From ca7e074b8846dab01ba5b63ecb6a402cbe6b4fa6 Mon Sep 17 00:00:00 2001 From: YoungSoo Shin Date: Tue, 29 Apr 2025 17:05:55 +0900 Subject: [PATCH] Release v2.14.0 --- assets/Codemirror--JcAba3g.js | 1 + assets/Heightmap-1ReT1M6e.js | 1 + assets/Heightmap-Cx_CgFq_.css | 1 + assets/Hlsstreamer-BpBN3Lzc.js | 1 + assets/Hlsstreamer-Dpcrs_uP.css | 1 + assets/Ipstreamer-B2DsK1lF.css | 1 + assets/Ipstreamer-BPf8FdFe.js | 1 + assets/JMuxerStream-COVqP7gw.css | 1 + assets/JMuxerStream-Cqmc9Hrb.js | 6 + assets/JanusStreamer-CQyYvBpk.js | 8 + assets/JanusStreamer-CtR5HFZ8.css | 1 + assets/Mjpegstreamer-BgvUrWpO.css | 1 + assets/Mjpegstreamer-vxbaTGlP.js | 1 + assets/MjpegstreamerAdaptive-BIOOAIPf.css | 1 + assets/MjpegstreamerAdaptive-Boi1-RyL.js | 1 + assets/Uv4lMjpeg-1VbXGWjy.js | 1 + assets/Uv4lMjpeg-DO1dNraK.css | 1 + assets/Viewer-DVCEMRp5.js | 2 + assets/Viewer-oTo4b16s.css | 1 + assets/WebcamNozzleCrosshair-OgFJAMdG.js | 1 + assets/WebcamNozzleCrosshair-nYNM-zbo.css | 1 + assets/WebrtcCameraStreamer-CRSlmQer.js | 1 + assets/WebrtcCameraStreamer-CeCrPMao.css | 1 + assets/WebrtcGo2rtc-DGvVGkMJ.js | 1 + assets/WebrtcGo2rtc-rSd4eisB.css | 1 + assets/WebrtcMediaMTX-9dkGjohV.js | 1 + assets/WebrtcMediaMTX-D-CyIvoY.css | 1 + assets/bakedVertexAnimation-jXsepPDt.js | 1 + assets/basisTextureLoader-C2AKop91.js | 1 + assets/bonesVertex-B72aYlMi.js | 1 + assets/clipPlaneFragment-ef4zNzcj.js | 1 + assets/clipPlaneVertex-L9tMAQxe.js | 1 + assets/codemirror-ZSHHXwGs.js | 1 + assets/color.fragment-BjUREcw_.js | 1 + assets/color.fragment-DNkpzaOC.js | 1 + assets/color.vertex-BL9BK6Le.js | 1 + assets/color.vertex-Ccg8Ge1R.js | 1 + .../cubemapToSphericalPolynomial-DI79UW0r.js | 1 + assets/cz-D8m9rjS3.js | 1 + assets/da-DYgaz82Z.js | 1 + assets/dds-C4nWUSlI.js | 1 + assets/ddsTextureLoader-7rBWB6fI.js | 1 + assets/de-P4W13_SZ.js | 1 + assets/default.fragment-BQ0cgw4g.js | 1 + assets/default.fragment-DzWBfowK.js | 1 + assets/default.vertex-B3P8Ow0L.js | 1 + assets/default.vertex-Caa9iT2n.js | 1 + assets/echarts-DzoUeqWp.js | 22 ++ assets/en-o7vnTKjO.js | 1 + assets/envTextureLoader-0a1UyQXk.js | 2 + assets/es-DJtSPj3U.js | 1 + assets/exrTextureLoader-CpwykM8r.js | 1 + assets/fogFragment-BYUe2MTZ.js | 1 + assets/fr-BgUf3CTX.js | 1 + assets/fxaa.fragment-CKBSH8ak.js | 1 + assets/fxaa.fragment-CQ-OctB5.js | 1 + assets/fxaa.vertex-D11BDiUg.js | 1 + assets/fxaa.vertex-pl3gzfER.js | 1 + .../glowBlurPostProcess.fragment-BmYiq-YF.js | 1 + .../glowBlurPostProcess.fragment-D0h3Yhq8.js | 1 + assets/glowMapGeneration.fragment-C2VnGqtj.js | 1 + assets/glowMapGeneration.fragment-CfLBq-Y2.js | 1 + assets/glowMapGeneration.vertex-BcKlBU7O.js | 1 + assets/glowMapGeneration.vertex-O7p-xSBA.js | 1 + assets/glowMapMerge.fragment-C9pBmOul.js | 1 + assets/glowMapMerge.fragment-z1wsxOL6.js | 1 + assets/glowMapMerge.vertex-BOpN3rPY.js | 1 + assets/glowMapMerge.vertex-CYvG5BDv.js | 1 + assets/hdrTextureLoader-CbSWrxkf.js | 1 + assets/helperFunctions-CmftqOHQ.js | 1 + assets/hu-B1cvWa_J.js | 1 + assets/index-Bku7SJna.js | 51 +++++ assets/index-DdkGOISd.css | 1 + assets/it-CPOq0Dki.js | 1 + assets/ja-CS5xLYiw.js | 1 + assets/kernelBlur.fragment-BJnJE4Wi.js | 1 + assets/kernelBlur.fragment-CAduVWsS.js | 1 + assets/kernelBlur.vertex-Dciph_cp.js | 1 + assets/kernelBlur.vertex-SB8k7aXt.js | 1 + .../kernelBlurVaryingDeclaration-DOqeMSlf.js | 1 + .../kernelBlurVaryingDeclaration-DuItmes5.js | 1 + assets/ko-D481bVT5.js | 1 + assets/ktxTextureLoader-DFWsW27H.js | 1 + assets/line.fragment-azBhzxfj.js | 1 + assets/line.fragment-thDij4Gq.js | 1 + assets/line.vertex-ChOZncX4.js | 1 + assets/line.vertex-DNyxgHBi.js | 1 + assets/logDepthDeclaration-QTuRqmDC.js | 1 + assets/logDepthFragment-CVSnEUp_.js | 1 + assets/logDepthVertex-SrVRb0bM.js | 1 + assets/mainUVVaryingDeclaration-Byysp88Q.js | 1 + assets/mainUVVaryingDeclaration-DltpozJN.js | 1 + assets/meshUboDeclaration-BEPmj8E0.js | 1 + assets/morphTargetsVertex-B2hbMuPn.js | 1 + assets/morphTargetsVertex-Dur5DJ01.js | 1 + assets/nl-B9Xo5zsI.js | 1 + assets/overlayscrollbars-BJn_P54_.css | 12 + assets/overlayscrollbars-CiKU261J.js | 12 + assets/pass.fragment-BkcfUm5b.js | 1 + assets/pass.fragment-CM2j9WLA.js | 1 + assets/pl-bBR_77jy.js | 1 + assets/postprocess.vertex-DvFhjUjz.js | 1 + assets/pt-D716Rj3y.js | 1 + assets/rgbdDecode.fragment-BKWiTJSM.js | 1 + assets/rgbdDecode.fragment-DQaMBCWE.js | 1 + assets/ru-BYzx4dUn.js | 1 + assets/se-Dt3G_241.js | 1 + assets/tgaTextureLoader-CGo25llH.js | 1 + assets/tr-cyYpyxgv.js | 1 + assets/uk-DIP7xo0c.js | 1 + assets/vertexColorMixing-CVYhb6uZ.js | 1 + assets/vertexColorMixing-D-DdWwxQ.js | 1 + assets/virtual_pwa-register-DiXdS4qF.js | 1 + assets/vuetify-BSwS9o2d.css | 5 + assets/vuetify-Ce4WN_Dg.js | 5 + assets/workbox-window.prod.es5-C7zTcMQ_.js | 1 + assets/zh-T9gotgQQ.js | 1 + assets/zh_TW-BFyG3P84.js | 1 + config.json | 10 + css/themes/vzbot.css | 3 + fonts/roboto-black.woff2 | Bin 0 -> 11012 bytes fonts/roboto-bold.woff2 | Bin 0 -> 11020 bytes fonts/roboto-light.woff2 | Bin 0 -> 11180 bytes fonts/roboto-medium.woff2 | Bin 0 -> 11056 bytes fonts/roboto-regular.woff2 | Bin 0 -> 11016 bytes fonts/roboto-thin.woff2 | Bin 0 -> 10984 bytes fonts/robotoMono-regular.woff | Bin 0 -> 15160 bytes img/icons/apple-touch-icon-180x180.png | Bin 0 -> 6452 bytes img/icons/favicon-16x16.png | Bin 0 -> 332 bytes img/icons/favicon-32x32.png | Bin 0 -> 618 bytes img/icons/icon-192-maskable.png | Bin 0 -> 7847 bytes img/icons/icon-512-maskable.png | Bin 0 -> 35611 bytes img/icons/mstile-150x150.png | Bin 0 -> 2377 bytes img/icons/safari-pinned-tab.svg | 1 + img/klipper.svg | 1 + img/logo.svg | 1 + img/sidebar-background-light.svg | 206 ++++++++++++++++++ img/sidebar-background.svg | 1 + img/themes/sidebarBackground-vzbot.png | Bin 0 -> 384096 bytes img/themes/sidebarLogo-btt.svg | 10 + img/themes/sidebarLogo-klipper.svg | 15 ++ img/themes/sidebarLogo-ldo.svg | 7 + img/themes/sidebarLogo-multec.svg | 1 + img/themes/sidebarLogo-prusa.svg | 5 + img/themes/sidebarLogo-voron.svg | 9 + img/themes/sidebarLogo-vzbot.svg | 8 + img/themes/sidebarLogo-yumi.svg | 1 + index.html | 38 ++++ manifest.webmanifest | 1 + release_info.json | 1 + sw.js | 1 + workbox-726ab1ca.js | 1 + 152 files changed, 554 insertions(+) create mode 100644 assets/Codemirror--JcAba3g.js create mode 100644 assets/Heightmap-1ReT1M6e.js create mode 100644 assets/Heightmap-Cx_CgFq_.css create mode 100644 assets/Hlsstreamer-BpBN3Lzc.js create mode 100644 assets/Hlsstreamer-Dpcrs_uP.css create mode 100644 assets/Ipstreamer-B2DsK1lF.css create mode 100644 assets/Ipstreamer-BPf8FdFe.js create mode 100644 assets/JMuxerStream-COVqP7gw.css create mode 100644 assets/JMuxerStream-Cqmc9Hrb.js create mode 100644 assets/JanusStreamer-CQyYvBpk.js create mode 100644 assets/JanusStreamer-CtR5HFZ8.css create mode 100644 assets/Mjpegstreamer-BgvUrWpO.css create mode 100644 assets/Mjpegstreamer-vxbaTGlP.js create mode 100644 assets/MjpegstreamerAdaptive-BIOOAIPf.css create mode 100644 assets/MjpegstreamerAdaptive-Boi1-RyL.js create mode 100644 assets/Uv4lMjpeg-1VbXGWjy.js create mode 100644 assets/Uv4lMjpeg-DO1dNraK.css create mode 100644 assets/Viewer-DVCEMRp5.js create mode 100644 assets/Viewer-oTo4b16s.css create mode 100644 assets/WebcamNozzleCrosshair-OgFJAMdG.js create mode 100644 assets/WebcamNozzleCrosshair-nYNM-zbo.css create mode 100644 assets/WebrtcCameraStreamer-CRSlmQer.js create mode 100644 assets/WebrtcCameraStreamer-CeCrPMao.css create mode 100644 assets/WebrtcGo2rtc-DGvVGkMJ.js create mode 100644 assets/WebrtcGo2rtc-rSd4eisB.css create mode 100644 assets/WebrtcMediaMTX-9dkGjohV.js create mode 100644 assets/WebrtcMediaMTX-D-CyIvoY.css create mode 100644 assets/bakedVertexAnimation-jXsepPDt.js create mode 100644 assets/basisTextureLoader-C2AKop91.js create mode 100644 assets/bonesVertex-B72aYlMi.js create mode 100644 assets/clipPlaneFragment-ef4zNzcj.js create mode 100644 assets/clipPlaneVertex-L9tMAQxe.js create mode 100644 assets/codemirror-ZSHHXwGs.js create mode 100644 assets/color.fragment-BjUREcw_.js create mode 100644 assets/color.fragment-DNkpzaOC.js create mode 100644 assets/color.vertex-BL9BK6Le.js create mode 100644 assets/color.vertex-Ccg8Ge1R.js create mode 100644 assets/cubemapToSphericalPolynomial-DI79UW0r.js create mode 100644 assets/cz-D8m9rjS3.js create mode 100644 assets/da-DYgaz82Z.js create mode 100644 assets/dds-C4nWUSlI.js create mode 100644 assets/ddsTextureLoader-7rBWB6fI.js create mode 100644 assets/de-P4W13_SZ.js create mode 100644 assets/default.fragment-BQ0cgw4g.js create mode 100644 assets/default.fragment-DzWBfowK.js create mode 100644 assets/default.vertex-B3P8Ow0L.js create mode 100644 assets/default.vertex-Caa9iT2n.js create mode 100644 assets/echarts-DzoUeqWp.js create mode 100644 assets/en-o7vnTKjO.js create mode 100644 assets/envTextureLoader-0a1UyQXk.js create mode 100644 assets/es-DJtSPj3U.js create mode 100644 assets/exrTextureLoader-CpwykM8r.js create mode 100644 assets/fogFragment-BYUe2MTZ.js create mode 100644 assets/fr-BgUf3CTX.js create mode 100644 assets/fxaa.fragment-CKBSH8ak.js create mode 100644 assets/fxaa.fragment-CQ-OctB5.js create mode 100644 assets/fxaa.vertex-D11BDiUg.js create mode 100644 assets/fxaa.vertex-pl3gzfER.js create mode 100644 assets/glowBlurPostProcess.fragment-BmYiq-YF.js create mode 100644 assets/glowBlurPostProcess.fragment-D0h3Yhq8.js create mode 100644 assets/glowMapGeneration.fragment-C2VnGqtj.js create mode 100644 assets/glowMapGeneration.fragment-CfLBq-Y2.js create mode 100644 assets/glowMapGeneration.vertex-BcKlBU7O.js create mode 100644 assets/glowMapGeneration.vertex-O7p-xSBA.js create mode 100644 assets/glowMapMerge.fragment-C9pBmOul.js create mode 100644 assets/glowMapMerge.fragment-z1wsxOL6.js create mode 100644 assets/glowMapMerge.vertex-BOpN3rPY.js create mode 100644 assets/glowMapMerge.vertex-CYvG5BDv.js create mode 100644 assets/hdrTextureLoader-CbSWrxkf.js create mode 100644 assets/helperFunctions-CmftqOHQ.js create mode 100644 assets/hu-B1cvWa_J.js create mode 100644 assets/index-Bku7SJna.js create mode 100644 assets/index-DdkGOISd.css create mode 100644 assets/it-CPOq0Dki.js create mode 100644 assets/ja-CS5xLYiw.js create mode 100644 assets/kernelBlur.fragment-BJnJE4Wi.js create mode 100644 assets/kernelBlur.fragment-CAduVWsS.js create mode 100644 assets/kernelBlur.vertex-Dciph_cp.js create mode 100644 assets/kernelBlur.vertex-SB8k7aXt.js create mode 100644 assets/kernelBlurVaryingDeclaration-DOqeMSlf.js create mode 100644 assets/kernelBlurVaryingDeclaration-DuItmes5.js create mode 100644 assets/ko-D481bVT5.js create mode 100644 assets/ktxTextureLoader-DFWsW27H.js create mode 100644 assets/line.fragment-azBhzxfj.js create mode 100644 assets/line.fragment-thDij4Gq.js create mode 100644 assets/line.vertex-ChOZncX4.js create mode 100644 assets/line.vertex-DNyxgHBi.js create mode 100644 assets/logDepthDeclaration-QTuRqmDC.js create mode 100644 assets/logDepthFragment-CVSnEUp_.js create mode 100644 assets/logDepthVertex-SrVRb0bM.js create mode 100644 assets/mainUVVaryingDeclaration-Byysp88Q.js create mode 100644 assets/mainUVVaryingDeclaration-DltpozJN.js create mode 100644 assets/meshUboDeclaration-BEPmj8E0.js create mode 100644 assets/morphTargetsVertex-B2hbMuPn.js create mode 100644 assets/morphTargetsVertex-Dur5DJ01.js create mode 100644 assets/nl-B9Xo5zsI.js create mode 100644 assets/overlayscrollbars-BJn_P54_.css create mode 100644 assets/overlayscrollbars-CiKU261J.js create mode 100644 assets/pass.fragment-BkcfUm5b.js create mode 100644 assets/pass.fragment-CM2j9WLA.js create mode 100644 assets/pl-bBR_77jy.js create mode 100644 assets/postprocess.vertex-DvFhjUjz.js create mode 100644 assets/pt-D716Rj3y.js create mode 100644 assets/rgbdDecode.fragment-BKWiTJSM.js create mode 100644 assets/rgbdDecode.fragment-DQaMBCWE.js create mode 100644 assets/ru-BYzx4dUn.js create mode 100644 assets/se-Dt3G_241.js create mode 100644 assets/tgaTextureLoader-CGo25llH.js create mode 100644 assets/tr-cyYpyxgv.js create mode 100644 assets/uk-DIP7xo0c.js create mode 100644 assets/vertexColorMixing-CVYhb6uZ.js create mode 100644 assets/vertexColorMixing-D-DdWwxQ.js create mode 100644 assets/virtual_pwa-register-DiXdS4qF.js create mode 100644 assets/vuetify-BSwS9o2d.css create mode 100644 assets/vuetify-Ce4WN_Dg.js create mode 100644 assets/workbox-window.prod.es5-C7zTcMQ_.js create mode 100644 assets/zh-T9gotgQQ.js create mode 100644 assets/zh_TW-BFyG3P84.js create mode 100644 config.json create mode 100644 css/themes/vzbot.css create mode 100644 fonts/roboto-black.woff2 create mode 100644 fonts/roboto-bold.woff2 create mode 100644 fonts/roboto-light.woff2 create mode 100644 fonts/roboto-medium.woff2 create mode 100644 fonts/roboto-regular.woff2 create mode 100644 fonts/roboto-thin.woff2 create mode 100644 fonts/robotoMono-regular.woff create mode 100644 img/icons/apple-touch-icon-180x180.png create mode 100644 img/icons/favicon-16x16.png create mode 100644 img/icons/favicon-32x32.png create mode 100644 img/icons/icon-192-maskable.png create mode 100644 img/icons/icon-512-maskable.png create mode 100644 img/icons/mstile-150x150.png create mode 100644 img/icons/safari-pinned-tab.svg create mode 100644 img/klipper.svg create mode 100644 img/logo.svg create mode 100644 img/sidebar-background-light.svg create mode 100644 img/sidebar-background.svg create mode 100644 img/themes/sidebarBackground-vzbot.png create mode 100644 img/themes/sidebarLogo-btt.svg create mode 100644 img/themes/sidebarLogo-klipper.svg create mode 100644 img/themes/sidebarLogo-ldo.svg create mode 100644 img/themes/sidebarLogo-multec.svg create mode 100644 img/themes/sidebarLogo-prusa.svg create mode 100644 img/themes/sidebarLogo-voron.svg create mode 100644 img/themes/sidebarLogo-vzbot.svg create mode 100644 img/themes/sidebarLogo-yumi.svg create mode 100644 index.html create mode 100644 manifest.webmanifest create mode 100644 release_info.json create mode 100644 sw.js create mode 100644 workbox-726ab1ca.js diff --git a/assets/Codemirror--JcAba3g.js b/assets/Codemirror--JcAba3g.js new file mode 100644 index 0000000..4acf963 --- /dev/null +++ b/assets/Codemirror--JcAba3g.js @@ -0,0 +1 @@ +import{m as w,B as _,R as E,P as h,W as H,C as B,n as F}from"./index-Bku7SJna.js";import{E as g,H as P,s as Z,t as r,a as O,b as D,i as T,k as $,c as A,S as J,j as L,d as q}from"./codemirror-ZSHHXwGs.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./echarts-DzoUeqWp.js";function k(){return k=Object.assign?Object.assign.bind():function(i){for(var e=1;e{var{theme:e,settings:n={},styles:t=[]}=i,o={".cm-gutters":{}},c={};n.background&&(c.backgroundColor=n.background),n.backgroundImage&&(c.backgroundImage=n.backgroundImage),n.foreground&&(c.color=n.foreground),(n.background||n.foreground)&&(o["&"]=c),n.fontFamily&&(o["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(o[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(o[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(o[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(o[".cm-content"]={caretColor:n.caret},o[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var l={};n.gutterActiveForeground&&(l.color=n.gutterActiveForeground),n.lineHighlight&&(o[".cm-activeLine"]={backgroundColor:n.lineHighlight},l.backgroundColor=n.lineHighlight),o[".cm-activeLineGutter"]=l,n.selection&&(o["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(o["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var f=g.theme(o,{dark:e==="dark"}),d=P.define(t),m=[f,Z(d)];return m},R={background:"#1e1e1e",foreground:"#9cdcfe",caret:"#c6c6c6",selection:"#6199ff2f",selectionMatch:"#72a1ff59",lineHighlight:"#ffffff0f",gutterBackground:"#1e1e1e",gutterForeground:"#838383",gutterActiveForeground:"#fff",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace'};function W(i){var{theme:e="dark",settings:n={},styles:t=[]}={};return I({theme:e,settings:k({},R,n),styles:[{tag:[r.keyword,r.operatorKeyword,r.modifier,r.color,r.constant(r.name),r.standard(r.name),r.standard(r.tagName),r.special(r.brace),r.atom,r.bool,r.special(r.variableName)],color:"#569cd6"},{tag:[r.controlKeyword,r.moduleKeyword],color:"#c586c0"},{tag:[r.name,r.deleted,r.character,r.macroName,r.propertyName,r.variableName,r.labelName,r.definition(r.name)],color:"#9cdcfe"},{tag:r.heading,fontWeight:"bold",color:"#9cdcfe"},{tag:[r.typeName,r.className,r.tagName,r.number,r.changed,r.annotation,r.self,r.namespace],color:"#4ec9b0"},{tag:[r.function(r.variableName),r.function(r.propertyName)],color:"#dcdcaa"},{tag:[r.number],color:"#b5cea8"},{tag:[r.operator,r.punctuation,r.separator,r.url,r.escape,r.regexp],color:"#d4d4d4"},{tag:[r.regexp],color:"#d16969"},{tag:[r.special(r.string),r.processingInstruction,r.string,r.inserted],color:"#ce9178"},{tag:[r.angleBracket],color:"#808080"},{tag:r.strong,fontWeight:"bold"},{tag:r.emphasis,fontStyle:"italic"},{tag:r.strikethrough,textDecoration:"line-through"},{tag:[r.meta,r.comment],color:"#6a9955"},{tag:r.link,color:"#6a9955",textDecoration:"underline"},{tag:r.invalid,color:"#ff0000"},...t]})}var V=W();const b={token:function(i,e,n=0){const t=i.peek();if(i.pos===n&&e.klipperMacro&&(e.klipperMacro=!1),i.pos>n&&e.klipperMacro){if(i.eatSpace(),i.match(/^{/))return"tag";if(i.match(/^"[^{]+"/)||i.match(/^'[^{]+'/))return"string";if(i.match(/^[-+]?[0-9]*\.?[0-9]+/))return"number";if(i.match(/^[A-Za-z\d_]+/))return"propertyName";if(n===0&&i.match(/^{[^%]+}/))return"variable"}if([";"].includes(t!=null?t:""))return i.skipToEnd(),"comment";const o=i.pos==n;return o&&i.match(/_?[GMgm][\d.]+/)?"namespace":i.string.substring(n).toLowerCase().startsWith("m117")?(i.skipToEnd(),"string"):i.pos>n&&i.match(/[EPXYZIJ]-?([\d]*\.[\d]+|[\d]+)?/i)?"className":i.pos>n&&i.match(/[Ff]-?([\d]*\.[\d]+|[\d]+)?/)?"string":i.pos>n&&i.match(/[TtSs]-?([\d]*\.[\d]+|[\d]+)?/)?"atom":n===0&&i.pos>n&&i.match(/^{[^%]+}/)?"propertyName":o&&i.match(/^\s*[A-Z_\d]+/)?(e.klipperMacro=!0,"name"):(i.next(),null)},startState:function(){return{klipperMacro:!1}},languageData:{commentTokens:{line:";"}}},K={token:function(i,e){var x,y;const n=["\\+","-","\\/\\/","\\/","%","\\*\\*","\\*","\\(","\\)","==","!=",">=",">","<=","<","=","\\|","~",","],t=new RegExp("^"+n.join("|")),o=["elif","else","endif","if","endfor","for","loop\\.index","loop\\.revindex","loop\\.first","loop\\.last","loop\\.length","loop\\.cycle","loop\\.depth","and","or","not","in","is","endmacro","macro","endcall","call","endfilter","filter","endset","set","extends","block","endblock","include","import","do"],c=["abs","attr","batch","capitalize","center","default","dictsort","escape","filesizeformat","first","float","forceescape","format","groupby","indent","int","join","last","length","list","lower","map","max","min","pprint","random","reject","rejectattr","replace","reverse","round","tojson","safe","select","selectattr","slice","sort","string","striptags","sum","title","trim","truncate","unique","upper","urlencode","urlize","wordcount","wordwrap","xmlattr"],l=["callable","defined","divisibleby","equalto","escaped","even","iterable","lower","mapping","none","number","odd","sameas","sequence","string","undefined","upper"],f=["range","lipsum","dict","cycler","joiner"],d=["\\.reset\\(\\)","\\.next\\(\\)"],m=new RegExp("^"+o.join("\\s+|")+"|"+d.join("|")+"\\s+"),N=new RegExp("^"+c.join("|")+"|"+l.join("|")+"|"+f.join("|")+"\\s+");function v(a){var S;const j=a.match(/^%}/),C=a.match(/^}/);function M(){return e.klipperMacroJinjaBraceStack.length===0&&e.klipperMacroJinjaPctStack.length===0}return j||C?(j?(e.klipperMacroJinjaPctStack.pop(),M()&&(e.klipperMacroJinja=!1)):(e.klipperMacroJinjaBraceStack.pop(),M()&&(e.klipperMacroJinja=!1)),a.eatSpace(),e.gcodeZeroPos=a.pos,"tag"):a.match(new RegExp("^((?{for(var o=t>1?void 0:t?U(e,n):e,c=i.length-1,l;c>=0;c--)(l=i[c])&&(o=(t?l(e,n,o):l(o))||o);return t&&o&&G(e,n,o),o};let u=class extends w(_){constructor(){super(...arguments),this.content="",this.codemirror=null,this.cminstance=null}valueChanged(e){var t,o;const n=(o=(t=this.cminstance)==null?void 0:t.state)==null?void 0:o.doc.toString();e!==n&&this.setCmValue(e)}mounted(){this.initialize()}beforeDestroy(){this.destroy()}destroy(){var e;(e=this.cminstance)==null||e.destroy()}initialize(){this.codemirror=new g({parent:this.editor}),this.cminstance=this.codemirror,this.$nextTick(()=>{this.setCmValue(this.code||this.value||this.content),this.$emit("ready",this.codemirror)})}setCmValue(e){var n;(n=this.cminstance)==null||n.setState(O.create({doc:e,extensions:this.cmExtensions}))}get cmExtensions(){const e=[g.theme({},{dark:!0}),D,V,T.of(" ".repeat(this.tabSize)),$.of([A]),g.updateListener.of(n=>{var t,o,c,l,f;if(n.selectionSet){const d=(l=(t=this.cminstance)==null?void 0:t.state)==null?void 0:l.doc.lineAt((c=(o=this.cminstance)==null?void 0:o.state)==null?void 0:c.selection.main.head).number;this.$emit("lineChange",d)}this.content=(f=n.state)==null?void 0:f.doc.toString(),this.$emit&&this.$emit("input",this.content)})];return["cfg","conf"].includes(this.fileExtension)?e.push(J.define(K)):["gcode"].includes(this.fileExtension)?e.push(J.define(b)):["json"].includes(this.fileExtension)?e.push(L()):["css","scss","sass"].includes(this.fileExtension)&&e.push(q()),e}visibilityChanged(e){var n;e&&((n=this.cminstance)==null||n.focus())}get tabSize(){return this.$store.state.gui.editor.tabSize||2}gotoLine(e){var t,o,c;const n=(o=(t=this.cminstance)==null?void 0:t.state)==null?void 0:o.doc.line(e);n&&((c=this.cminstance)==null||c.dispatch({selection:{head:n.from,anchor:n.to},scrollIntoView:!0}))}};p([E("editor")],u.prototype,"editor",2);p([h({required:!1,default:""})],u.prototype,"code",2);p([h({required:!1,default:""})],u.prototype,"value",2);p([h({required:!1,default:"codemirror"})],u.prototype,"name",2);p([h({required:!1,default:""})],u.prototype,"fileExtension",2);p([H("value")],u.prototype,"valueChanged",1);u=p([B],u);var z=function(){var e=this,n=e._self._c;return e._self._setupProxy,n("div",{staticClass:"vue-codemirror"},[n("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.visibilityChanged,expression:"visibilityChanged"}],ref:"editor"})])},X=[],Y=F(u,z,X,!1,null,null);const te=Y.exports;export{te as default}; diff --git a/assets/Heightmap-1ReT1M6e.js b/assets/Heightmap-1ReT1M6e.js new file mode 100644 index 0000000..06804da --- /dev/null +++ b/assets/Heightmap-1ReT1M6e.js @@ -0,0 +1 @@ +import{m as ct,B as ft,a as zi,b as jr,P as ze,W as ta,C as at,n as dt,_ as Dt,c as Qa,d as ra,e as Ja,f as es,g as ts,T as rs,R as is,h as ns,i as as,j as ss}from"./index-Bku7SJna.js";import{h as Gi,f as be,c as ut,i as et,o as ia,p as ki,d as Vi,m as Je,n as _e,x as os,j as Wt,V as ls,v as us,T as hs,q as Er,S as cs,t as fs}from"./vuetify-Ce4WN_Dg.js";import{m as an,j as ur,A as ds,L as vs,p as na,R as aa,k as ps,r as ms,l as hr,n as _s,o as gs,q as ys,s as xs,Z as Ts,C as sa,v as ht,w as xr,x as ws,y as Es,M as bs,z as Ei,B as bi,D as Ss,E as oa,F as la,G as ua,H as ha,I as As,J as Cs,K as Ms,N as Ps,O as Rs,P as Ls,Q as br,S as sn,T as Ns,U as Ds,V as Os,W as Is,X as Fs,Y as Bs,_ as Us,$ as Hs,a0 as Sr,a1 as zs,u as Gs,a2 as ks,a3 as Vs}from"./echarts-DzoUeqWp.js";import"./overlayscrollbars-CiKU261J.js";var Ws=Object.defineProperty,Xs=Object.getOwnPropertyDescriptor,qr=(e,t,r,i)=>{for(var n=i>1?void 0:i?Xs(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(n=(i?s(t,r,n):s(n))||n);return i&&n&&Ws(t,r,n),n};let qt=class extends ct(ft){constructor(){super(...arguments),this.mdiCloseThick=zi,this.mdiGrid=jr,this.isInvalidName=!1,this.newName="",this.rules=[t=>!!t||this.$t("Heightmap.InvalidNameEmpty"),t=>t!=="default"||this.$t("Heightmap.InvalidNameReserved"),t=>!this.profileNames.includes(t)||this.$t("Heightmap.InvalidNameAlreadyExists"),t=>t===t.replace(/[^\x00-\x7F]/g,"")||this.$t("Heightmap.InvalidNameAscii")]}get profileNames(){var t,r;return Object.keys((r=(t=this.$store.state.printer.bed_mesh)==null?void 0:t.profiles)!=null?r:{})}renameProfile(){const t='BED_MESH_PROFILE SAVE="'.concat(this.newName,'"\nBED_MESH_PROFILE REMOVE="').concat(this.name,'"');this.$store.dispatch("server/addEvent",{message:t,type:"command"}),this.$socket.emit("printer.gcode.script",{script:t},{loading:"bedMeshRename"}),this.closeDialog()}closeDialog(){this.$emit("close")}showChanged(){this.show&&(this.newName=this.name,this.$nextTick(()=>{setTimeout(()=>{var t;(t=this.$refs.input)==null||t.focus()},100)}))}};qr([ze({type:Boolean,required:!0})],qt.prototype,"show",2);qr([ze({type:String,required:!0})],qt.prototype,"name",2);qr([ta("show")],qt.prototype,"showChanged",1);qt=qr([at],qt);var js=function(){var t=this,r=t._self._c;return t._self._setupProxy,r(Gi,{attrs:{value:t.show,persistent:"","max-width":400},on:{keydown:function(i){return!i.type.indexOf("key")&&t._k(i.keyCode,"esc",27,i.key,["Esc","Escape"])?null:t.closeDialog.apply(null,arguments)}}},[r(Dt,{attrs:{title:t.$t("Heightmap.RenameBedMeshProfile"),icon:t.mdiGrid,"card-class":"heightmap-rename-dialog","margin-bottom":!1},scopedSlots:t._u([{key:"buttons",fn:function(){return[r(be,{attrs:{icon:"",tile:""},on:{click:t.closeDialog}},[r(ut,[t._v(t._s(t.mdiCloseThick))])],1)]},proxy:!0}])},[r(et,[r(ia,{ref:"input",attrs:{label:t.$t("Heightmap.Name"),required:"",rules:t.rules},on:{"update:error":i=>{t.isInvalidName=i},keyup:function(i){return!i.type.indexOf("key")&&t._k(i.keyCode,"enter",13,i.key,"Enter")?null:t.renameProfile.apply(null,arguments)}},model:{value:t.newName,callback:function(i){t.newName=i},expression:"newName"}})],1),r(ki,[r(Vi),r(be,{attrs:{text:""},on:{click:t.closeDialog}},[t._v(t._s(t.$t("Heightmap.Abort")))]),r(be,{attrs:{disabled:t.isInvalidName,color:"primary",text:""},on:{click:t.renameProfile}},[t._v(" "+t._s(t.$t("Heightmap.Rename"))+" ")])],1)],1)],1)},qs=[],Ys=dt(qt,js,qs,!1,null,null);const Wi=Ys.exports;var Zs=Object.defineProperty,$s=Object.getOwnPropertyDescriptor,Xi=(e,t,r,i)=>{for(var n=i>1?void 0:i?$s(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(n=(i?s(t,r,n):s(n))||n);return i&&n&&Zs(t,r,n),n};let cr=class extends ct(ft){constructor(){super(...arguments),this.mdiCloseThick=zi,this.mdiGrid=jr}removeProfile(){const e='BED_MESH_PROFILE REMOVE="'.concat(this.name,'"');this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"bedMeshRemove"}),this.closeDialog()}closeDialog(){this.$emit("close")}};Xi([ze({type:Boolean,required:!0})],cr.prototype,"show",2);Xi([ze({type:String,required:!0})],cr.prototype,"name",2);cr=Xi([at],cr);var Ks=function(){var t=this,r=t._self._c;return t._self._setupProxy,r(Gi,{attrs:{value:t.show,persistent:"","max-width":400},on:{keydown:function(i){return!i.type.indexOf("key")&&t._k(i.keyCode,"esc",27,i.key,["Esc","Escape"])?null:t.closeDialog.apply(null,arguments)}}},[r(Dt,{attrs:{title:t.$t("Heightmap.BedMeshRemove"),icon:t.mdiGrid,"card-class":"heightmap-remove-dialog","margin-bottom":!1},scopedSlots:t._u([{key:"buttons",fn:function(){return[r(be,{attrs:{icon:"",tile:""},on:{click:t.closeDialog}},[r(ut,[t._v(t._s(t.mdiCloseThick))])],1)]},proxy:!0}])},[r(et,[r("p",{staticClass:"mb-0"},[t._v(t._s(t.$t("Heightmap.DoYouReallyWantToDelete",{name:t.name})))])]),r(ki,[r(Vi),r(be,{attrs:{text:""},on:{click:t.closeDialog}},[t._v(t._s(t.$t("Heightmap.Abort")))]),r(be,{attrs:{color:"error",text:""},on:{click:t.removeProfile}},[t._v(t._s(t.$t("Heightmap.Remove")))])],1)],1)],1)},Qs=[],Js=dt(cr,Ks,Qs,!1,null,null);const ca=Js.exports;var eo=Object.defineProperty,to=Object.getOwnPropertyDescriptor,ji=(e,t,r,i)=>{for(var n=i>1?void 0:i?to(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(n=(i?s(t,r,n):s(n))||n);return i&&n&&eo(t,r,n),n};let fr=class extends ct(ft){constructor(){super(...arguments),this.mdiDelete=Qa,this.mdiPencil=ra,this.mdiProgressUpload=Ja,this.showRemove=!1,this.showRename=!1}get points(){const e=[];for(let t=0;t{for(var n=i>1?void 0:i?ao(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(n=s(n)||n);return n};let Si=class extends ct(ft){constructor(){super(...arguments),this.mdiStackOverflow=es}get profiles(){var e,t;return(t=(e=this.$store.state.printer.bed_mesh)==null?void 0:e.profiles)!=null?t:{}}};Si=so([at({components:{HeightmapProfilesPanelRow:fa}})],Si);var oo=function(){var t=this,r=t._self._c;return t._self._setupProxy,r(Dt,{staticClass:"mt-6 mt-md-0",attrs:{title:t.$t("Heightmap.Profiles"),"card-class":"heightmap-profiles-panel",icon:t.mdiStackOverflow,collapsible:!0}},[Object.keys(t.profiles).length?r(et,{staticClass:"px-0 py-3"},[t._l(t.profiles,function(i,n,a){return[a?r(Wt,{key:"deliver_".concat(n),staticClass:"my-3"}):t._e(),r(fa,{key:"profile_".concat(n),attrs:{profile:i,name:n}})]})],2):r(et,[r("p",{staticClass:"mb-0"},[t._v(t._s(t.$t("Heightmap.NoProfile")))])])],1)},lo=[],uo=dt(Si,oo,lo,!1,null,null);const ho=uo.exports;var co=Object.getOwnPropertyDescriptor,fo=(e,t,r,i)=>{for(var n=i>1?void 0:i?co(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(n=s(n)||n);return n};let dr=class extends ls{get bed_mesh(){var e;return(e=this.$store.state.printer.bed_mesh)!=null?e:{}}get profiles(){var e;return(e=this.bed_mesh.profiles)!=null?e:{}}get mesh_min(){var e;return(e=this.bed_mesh.mesh_min)!=null?e:[0,0]}get mesh_max(){var e;return(e=this.bed_mesh.mesh_max)!=null?e:[0,0]}get min(){return Math.min(...this.points)}get max(){return Math.max(...this.points)}get variance(){return Math.abs(this.min-this.max).toFixed(3)}get is_active(){return this.bed_mesh.profile_name!==""?!0:this.mesh_min[0]!==0||this.mesh_min[1]!==0||this.mesh_max[0]!==0||this.mesh_max[1]!==0}get name(){return this.bed_mesh.profile_name!==""?this.bed_mesh.profile_name:"Unknown"}get probed_matrix(){var e;return(e=this.bed_mesh.probed_matrix)!=null?e:[]}get points(){const e=[];for(let t=0;t{for(var n=i>1?void 0:i?vo(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(n=s(n)||n);return n};let Ai=class extends ct(ft,dr){constructor(){super(...arguments),this.mdiInformation=ts,this.mdiPencil=ra,this.showRename=!1}get x_count(){var e,t;return(t=(e=this.bed_mesh.probed_matrix[0])==null?void 0:e.length)!=null?t:0}get y_count(){var e,t;return(t=(e=this.bed_mesh.probed_matrix)==null?void 0:e.length)!=null?t:0}get x_step_size(){return this.x_count<1?0:(this.mesh_max[0]-this.mesh_min[0])/(this.x_count-1)}get y_step_size(){return this.y_count<1?0:(this.mesh_max[1]-this.mesh_min[1])/(this.y_count-1)}get index_max(){return this.points.indexOf(this.max)}get index_max_y(){return Math.trunc(this.index_max/this.x_count)}get index_max_x(){return this.index_max%this.y_count}get position_max_x(){return this.mesh_min[0]+this.index_max_x*this.x_step_size}get position_max_y(){return this.mesh_min[1]+this.index_max_y*this.y_step_size}get index_min(){return this.points.indexOf(this.min)}get index_min_y(){return Math.trunc(this.index_min/this.x_count)}get index_min_x(){return this.index_min%this.y_count}get position_min_x(){return this.mesh_min[0]+this.index_min_x*this.x_step_size}get position_min_y(){return this.mesh_min[1]+this.index_min_y*this.y_step_size}};Ai=po([at({components:{}})],Ai);var mo=function(){var t=this,r=t._self._c;return t._self._setupProxy,t.is_active?r(Dt,{staticClass:"mt-0",attrs:{title:t.$t("Heightmap.CurrentMesh.Headline"),"card-class":"heightmap-current-mesh-panel",icon:t.mdiInformation,collapsible:!0}},[r(et,{staticClass:"py-3 px-0"},[r(Je,{staticClass:"px-3"},[r(_e,[t._v(t._s(t.$t("Heightmap.CurrentMesh.Name")))]),r(_e,{staticClass:"text-right"},[t.name.startsWith("adaptive-")?r("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.name))]):r("span",{staticClass:"currentMeshName cursor-pointer font-weight-bold",on:{click:function(i){t.showRename=!0}}},[r(ut,{attrs:{left:"",small:"",color:"primary"}},[t._v(t._s(t.mdiPencil))]),t._v(" "+t._s(t.name)+" ")],1)])],1),r(Wt,{staticClass:"my-3"}),r(Je,{staticClass:"px-3"},[r(_e,[t._v(t._s(t.$t("Heightmap.CurrentMesh.Size")))]),r(_e,{staticClass:"text-right"},[t._v(t._s(t.x_count)+"x"+t._s(t.y_count))])],1),r(Wt,{staticClass:"my-3"}),t.index_max>-1?r(Je,{staticClass:"px-3"},[r(_e,[t._v(" "+t._s(t.$t("Heightmap.CurrentMesh.Max"))+" ["+t._s(t.position_max_x.toFixed(1))+", "+t._s(t.position_max_y.toFixed(1))+"] ")]),r(_e,{staticClass:"text-right"},[t._v(t._s(t.max.toFixed(3))+" mm")])],1):t._e(),r(Wt,{staticClass:"my-3"}),r(Je,{staticClass:"px-3"},[r(_e,[t._v(" "+t._s(t.$t("Heightmap.CurrentMesh.Min"))+" ["+t._s(t.position_min_x.toFixed(1))+", "+t._s(t.position_min_y.toFixed(1))+"] ")]),r(_e,{staticClass:"text-right"},[t._v(t._s(t.min.toFixed(3))+" mm")])],1),r(Wt,{staticClass:"my-3"}),r(Je,{staticClass:"px-3"},[r(_e,[t._v(t._s(t.$t("Heightmap.CurrentMesh.Range")))]),r(_e,{staticClass:"text-right"},[t._v(t._s(t.variance)+" mm")])],1)],1),r(Wi,{attrs:{show:t.showRename,name:t.name},on:{close:function(i){t.showRename=!1}}})],1):t._e()},_o=[],go=dt(Ai,mo,_o,!1,null,"1001f9ee");const yo=go.exports;var xo=Object.defineProperty,To=Object.getOwnPropertyDescriptor,qi=(e,t,r,i)=>{for(var n=i>1?void 0:i?To(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(n=(i?s(t,r,n):s(n))||n);return i&&n&&xo(t,r,n),n};let vr=class extends ct(ft){constructor(){super(...arguments),this.mdiCloseThick=zi,this.mdiGrid=jr,this.isInvalidName=!1,this.name="",this.rules=[e=>!!e||this.$t("Heightmap.InvalidNameEmpty"),e=>e===e.replace(/[^\x00-\x7F]/g,"")||this.$t("Heightmap.InvalidNameAscii")]}calibrateMesh(){const e='BED_MESH_CALIBRATE PROFILE="'.concat(this.name,'"');this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"bedMeshCalibrate"}),this.closeDialog()}closeDialog(){this.$emit("close")}showChanged(){this.show&&(this.name="default",this.$nextTick(()=>{setTimeout(()=>{var e;(e=this.$refs.input)==null||e.focus()},100)}))}};qi([ze({type:Boolean,required:!0})],vr.prototype,"show",2);qi([ta("show")],vr.prototype,"showChanged",1);vr=qi([at],vr);var wo=function(){var t=this,r=t._self._c;return t._self._setupProxy,r(Gi,{attrs:{value:t.show,persistent:"","max-width":400},on:{keydown:function(i){return!i.type.indexOf("key")&&t._k(i.keyCode,"esc",27,i.key,["Esc","Escape"])?null:t.closeDialog.apply(null,arguments)}}},[r(Dt,{attrs:{title:t.$t("Heightmap.BedMeshCalibrate"),icon:t.mdiGrid,"card-class":"heightmap-calibrate-dialog","margin-bottom":!1},scopedSlots:t._u([{key:"buttons",fn:function(){return[r(be,{attrs:{icon:"",tile:""},on:{click:t.closeDialog}},[r(ut,[t._v(t._s(t.mdiCloseThick))])],1)]},proxy:!0}])},[r(et,[r(ia,{ref:"input",attrs:{label:t.$t("Heightmap.Name"),required:"",rules:t.rules},on:{"update:error":i=>{t.isInvalidName=i},keyup:function(i){return!i.type.indexOf("key")&&t._k(i.keyCode,"enter",13,i.key,"Enter")?null:t.calibrateMesh.apply(null,arguments)}},model:{value:t.name,callback:function(i){t.name=i},expression:"name"}})],1),r(ki,[r(Vi),r(be,{attrs:{text:""},on:{click:t.closeDialog}},[t._v(t._s(t.$t("Heightmap.Abort")))]),r(be,{attrs:{disabled:t.isInvalidName,color:"primary",text:""},on:{click:t.calibrateMesh}},[t._v(" "+t._s(t.$t("Heightmap.Calibrate"))+" ")])],1)],1)],1)},Eo=[],bo=dt(vr,wo,Eo,!1,null,null);const da=bo.exports;function on(e,t,r){typeof t=="object"&&(r=t,t=null);var i=this,n;if(!(e instanceof Function)){n=[];for(var a in e)e.hasOwnProperty(a)&&n.push(a)}var s=function(l){if(i.apply(this,arguments),e instanceof Function?ln(this,e.call(this,l)):So(this,e,n),this.constructor===s)for(var u=s.__initializers__,h=0;h=400?e.onerror&&e.onerror():e.onload&&e.onload(t.response)},e.onerror&&(t.onerror=e.onerror),t.send(null)}const Do={get:No};var ti,J={};J.supportWebGL=function(){if(ti==null)try{var e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)throw new Error}catch{ti=!1}return ti};J.Int8Array=typeof Int8Array>"u"?Array:Int8Array;J.Uint8Array=typeof Uint8Array>"u"?Array:Uint8Array;J.Uint16Array=typeof Uint16Array>"u"?Array:Uint16Array;J.Uint32Array=typeof Uint32Array>"u"?Array:Uint32Array;J.Int16Array=typeof Int16Array>"u"?Array:Int16Array;J.Float32Array=typeof Float32Array>"u"?Array:Float32Array;J.Float64Array=typeof Float64Array>"u"?Array:Float64Array;var Pt={};typeof window<"u"?Pt=window:typeof global<"u"&&(Pt=global);J.requestAnimationFrame=Pt.requestAnimationFrame||Pt.msRequestAnimationFrame||Pt.mozRequestAnimationFrame||Pt.webkitRequestAnimationFrame||function(e){setTimeout(e,16)};J.createCanvas=function(){return document.createElement("canvas")};J.createImage=function(){return new Pt.Image};J.request={get:Do.get};J.addEventListener=function(e,t,r,i){e.addEventListener(t,r,i)};J.removeEventListener=function(e,t,r){e.removeEventListener(t,r)};var we=function(){this.head=null,this.tail=null,this._length=0};we.prototype.insert=function(e){var t=new we.Entry(e);return this.insertEntry(t),t};we.prototype.insertAt=function(e,t){if(!(e<0)){for(var r=this.head,i=0;r&&i!=e;)r=r.next,i++;if(r){var n=new we.Entry(t),a=r.prev;a?(a.next=n,n.prev=a):this.head=n,n.next=r,r.prev=n}else this.insert(t)}};we.prototype.insertBeforeEntry=function(e,t){var r=new we.Entry(e),i=t.prev;i?(i.next=r,r.prev=i):this.head=r,r.next=t,t.prev=r,this._length++};we.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,this.tail=e):this.head=this.tail=e,this._length++};we.prototype.remove=function(e){var t=e.prev,r=e.next;t?t.next=r:this.head=r,r?r.prev=t:this.tail=t,e.next=e.prev=null,this._length--};we.prototype.removeAt=function(e){if(!(e<0)){for(var t=this.head,r=0;t&&r!=e;)t=t.next,r++;if(t)return this.remove(t),t.value}};we.prototype.getHead=function(){if(this.head)return this.head.value};we.prototype.getTail=function(){if(this.tail)return this.tail.value};we.prototype.getAt=function(e){if(!(e<0)){for(var t=this.head,r=0;t&&r!=e;)t=t.next,r++;return t.value}};we.prototype.indexOf=function(e){for(var t=this.head,r=0;t;){if(t.value===e)return r;t=t.next,r++}};we.prototype.length=function(){return this._length};we.prototype.isEmpty=function(){return this._length===0};we.prototype.forEach=function(e,t){for(var r=this.head,i=0,n=typeof t<"u";r;)n?e.call(t,r.value,i):e(r.value,i),r=r.next,i++};we.prototype.clear=function(){this.tail=this.head=null,this._length=0};we.Entry=function(e){this.value=e,this.next=null,this.prev=null};var Ot=function(e){this._list=new we,this._map={},this._maxSize=e||10};Ot.prototype.setMaxSize=function(e){this._maxSize=e};Ot.prototype.put=function(e,t){if(!this._map.hasOwnProperty(e)){var r=this._list.length();if(r>=this._maxSize&&r>0){var i=this._list.head;this._list.remove(i),delete this._map[i.key]}var n=this._list.insert(t);n.key=e,this._map[e]=n}};Ot.prototype.get=function(e){var t=this._map[e];if(this._map.hasOwnProperty(e))return t!==this._list.tail&&(this._list.remove(t),this._list.insertEntry(t)),t.value};Ot.prototype.remove=function(e){var t=this._map[e];typeof t<"u"&&(delete this._map[e],this._list.remove(t))};Ot.prototype.clear=function(){this._list.clear(),this._map={}};var ce={},cn={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ye(e){return e=Math.round(e),e<0?0:e>255?255:e}function Oo(e){return e=Math.round(e),e<0?0:e>360?360:e}function pr(e){return e<0?0:e>1?1:e}function ri(e){return e.length&&e.charAt(e.length-1)==="%"?Ye(parseFloat(e)/100*255):Ye(parseInt(e,10))}function Yt(e){return e.length&&e.charAt(e.length-1)==="%"?pr(parseFloat(e)/100):pr(parseFloat(e))}function ii(e,t,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?e+(t-e)*r*6:r*2<1?t:r*3<2?e+(t-e)*(2/3-r)*6:e}function yt(e,t,r){return e+(t-e)*r}function qe(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function Ci(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var va=new Ot(20),Ar=null;function Ft(e,t){Ar&&Ci(Ar,t),Ar=va.put(e,Ar||t.slice())}ce.parse=function(e,t){if(e){t=t||[];var r=va.get(e);if(r)return Ci(t,r);e=e+"";var i=e.replace(/ /g,"").toLowerCase();if(i in cn)return Ci(t,cn[i]),Ft(e,t),t;if(i.charAt(0)==="#"){if(i.length===4){var n=parseInt(i.substr(1),16);if(!(n>=0&&n<=4095)){qe(t,0,0,0,1);return}return qe(t,(n&3840)>>4|(n&3840)>>8,n&240|(n&240)>>4,n&15|(n&15)<<4,1),Ft(e,t),t}else if(i.length===7){var n=parseInt(i.substr(1),16);if(!(n>=0&&n<=16777215)){qe(t,0,0,0,1);return}return qe(t,(n&16711680)>>16,(n&65280)>>8,n&255,1),Ft(e,t),t}return}var a=i.indexOf("("),s=i.indexOf(")");if(a!==-1&&s+1===i.length){var o=i.substr(0,a),l=i.substr(a+1,s-(a+1)).split(","),u=1;switch(o){case"rgba":if(l.length!==4){qe(t,0,0,0,1);return}u=Yt(l.pop());case"rgb":if(l.length!==3){qe(t,0,0,0,1);return}return qe(t,ri(l[0]),ri(l[1]),ri(l[2]),u),Ft(e,t),t;case"hsla":if(l.length!==4){qe(t,0,0,0,1);return}return l[3]=Yt(l[3]),Mi(l,t),Ft(e,t),t;case"hsl":if(l.length!==3){qe(t,0,0,0,1);return}return Mi(l,t),Ft(e,t),t;default:return}}qe(t,0,0,0,1)}};ce.parseToFloat=function(e,t){if(t=ce.parse(e,t),!!t)return t[0]/=255,t[1]/=255,t[2]/=255,t};function Mi(e,t){var r=(parseFloat(e[0])%360+360)%360/360,i=Yt(e[1]),n=Yt(e[2]),a=n<=.5?n*(i+1):n+i-n*i,s=n*2-a;return t=t||[],qe(t,Ye(ii(s,a,r+1/3)*255),Ye(ii(s,a,r)*255),Ye(ii(s,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function Io(e){if(e){var t=e[0]/255,r=e[1]/255,i=e[2]/255,n=Math.min(t,r,i),a=Math.max(t,r,i),s=a-n,o=(a+n)/2,l,u;if(s===0)l=0,u=0;else{o<.5?u=s/(a+n):u=s/(2-a-n);var h=((a-t)/6+s/2)/s,c=((a-r)/6+s/2)/s,d=((a-i)/6+s/2)/s;t===a?l=d-c:r===a?l=1/3+h-d:i===a&&(l=2/3+c-h),l<0&&(l+=1),l>1&&(l-=1)}var f=[l*360,u,o];return e[3]!=null&&f.push(e[3]),f}}ce.lift=function(e,t){var r=ce.parse(e);if(r){for(var i=0;i<3;i++)t<0?r[i]=r[i]*(1-t)|0:r[i]=(255-r[i])*t+r[i]|0;return ce.stringify(r,r.length===4?"rgba":"rgb")}};ce.toHex=function(e){var t=ce.parse(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)};ce.fastLerp=function(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){r=r||[];var i=e*(t.length-1),n=Math.floor(i),a=Math.ceil(i),s=t[n],o=t[a],l=i-n;return r[0]=Ye(yt(s[0],o[0],l)),r[1]=Ye(yt(s[1],o[1],l)),r[2]=Ye(yt(s[2],o[2],l)),r[3]=pr(yt(s[3],o[3],l)),r}};ce.fastMapToColor=ce.fastLerp;ce.lerp=function(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var i=e*(t.length-1),n=Math.floor(i),a=Math.ceil(i),s=ce.parse(t[n]),o=ce.parse(t[a]),l=i-n,u=ce.stringify([Ye(yt(s[0],o[0],l)),Ye(yt(s[1],o[1],l)),Ye(yt(s[2],o[2],l)),pr(yt(s[3],o[3],l))],"rgba");return r?{color:u,leftIndex:n,rightIndex:a,value:i}:u}};ce.mapToColor=ce.lerp;ce.modifyHSL=function(e,t,r,i){if(e=ce.parse(e),e)return e=Io(e),t!=null&&(e[0]=Oo(t)),r!=null&&(e[1]=Yt(r)),i!=null&&(e[2]=Yt(i)),ce.stringify(Mi(e),"rgba")};ce.modifyAlpha=function(e,t){if(e=ce.parse(e),e&&t!=null)return e[3]=pr(t),ce.stringify(e,"rgba")};ce.stringify=function(e,t){if(!(!e||!e.length)){var r=e[0]+","+e[1]+","+e[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(r+=","+e[3]),t+"("+r+")"}};var Fo=ce.parseToFloat,ni={};function fn(e){var t=Object.keys(e);t.sort();for(var r=[],i=0;i=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(e,t){if(typeof e=="object")for(var r in e){var i=e[r];this.setUniform(r,i)}else this.setUniform(e,t)},get:function(e){var t=this.uniforms[e];if(t)return t.value},attachShader:function(e,t){var r=this.uniforms;this.uniforms=e.createUniforms(),this.shader=e;var i=this.uniforms;this._enabledUniforms=Object.keys(i),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter(function(u){var h=this.uniforms[u].type;return h==="t"||h==="tv"},this);var n=this.vertexDefines,a=this.fragmentDefines;if(this.vertexDefines=me.clone(e.vertexDefines),this.fragmentDefines=me.clone(e.fragmentDefines),t){for(var s in r)i[s]&&(i[s].value=r[s].value);me.defaults(this.vertexDefines,n),me.defaults(this.fragmentDefines,a)}var o={};for(var l in e.textures)o[l]={shaderType:e.textures[l].shaderType,type:e.textures[l].type,enabled:t&&this._textureStatus[l]?this._textureStatus[l].enabled:!1};this._textureStatus=o,this._programKey=""},clone:function(){var e=new this.constructor({name:this.name,shader:this.shader});for(var t in this.uniforms)e.uniforms[t].value=this.uniforms[t].value;return e.depthTest=this.depthTest,e.depthMask=this.depthMask,e.transparent=this.transparent,e.blend=this.blend,e.vertexDefines=me.clone(this.vertexDefines),e.fragmentDefines=me.clone(this.fragmentDefines),e.enableTexture(this.getEnabledTextures()),e.precision=this.precision,e},define:function(e,t,r){var i=this.vertexDefines,n=this.fragmentDefines;e!=="vertex"&&e!=="fragment"&&e!=="both"&&arguments.length<3&&(r=t,t=e,e="both"),r=r!=null?r:null,(e==="vertex"||e==="both")&&i[t]!==r&&(i[t]=r,this._programKey=""),(e==="fragment"||e==="both")&&n[t]!==r&&(n[t]=r,e!=="both"&&(this._programKey=""))},undefine:function(e,t){e!=="vertex"&&e!=="fragment"&&e!=="both"&&arguments.length<2&&(t=e,e="both"),(e==="vertex"||e==="both")&&this.isDefined("vertex",t)&&(delete this.vertexDefines[t],this._programKey=""),(e==="fragment"||e==="both")&&this.isDefined("fragment",t)&&(delete this.fragmentDefines[t],e!=="both"&&(this._programKey=""))},isDefined:function(e,t){switch(e){case"vertex":return this.vertexDefines[t]!==void 0;case"fragment":return this.fragmentDefines[t]!==void 0}},getDefine:function(e,t){switch(e){case"vertex":return this.vertexDefines[t];case"fragment":return this.fragmentDefines[t]}},enableTexture:function(e){if(Array.isArray(e)){for(var t=0;t0&&(n=1/Math.sqrt(n),e[0]=t[0]*n,e[1]=t[1]*n),e};R.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]};R.cross=function(e,t,r){var i=t[0]*r[1]-t[1]*r[0];return e[0]=e[1]=0,e[2]=i,e};R.lerp=function(e,t,r,i){var n=t[0],a=t[1];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e};R.random=function(e,t){t=t||1;var r=GLMAT_RANDOM()*2*Math.PI;return e[0]=Math.cos(r)*t,e[1]=Math.sin(r)*t,e};R.transformMat2=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n,e[1]=r[1]*i+r[3]*n,e};R.transformMat2d=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[2]*n+r[4],e[1]=r[1]*i+r[3]*n+r[5],e};R.transformMat3=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[3]*n+r[6],e[1]=r[1]*i+r[4]*n+r[7],e};R.transformMat4=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e};R.forEach=function(){var e=R.create();return function(t,r,i,n,a,s){var o,l;for(r||(r=2),i||(i=0),n?l=Math.min(n*r+i,t.length):l=t.length,o=i;o0&&i.push("#define "+n.toUpperCase()+"_COUNT "+a)}if(r)for(var s=0;sl.getMaxJointNumber()&&(d.USE_SKIN_MATRICES_TEXTURE=null),c+="\n"+si(d)+"\n"}a&&(c+="\n#define INSTANCING\n");var f=c+si(t.vertexDefines,o,h),v=c+si(t.fragmentDefines,o,h),p=f+"\n"+t.shader.vertex,m=["OES_standard_derivatives","EXT_shader_texture_lod"].filter(function(S){return l.getGLExtension(S)!=null});m.indexOf("EXT_shader_texture_lod")>=0&&(v+="\n#define SUPPORT_TEXTURE_LOD"),m.indexOf("OES_standard_derivatives")>=0&&(v+="\n#define SUPPORT_STANDARD_DERIVATIVES");var g=Go(m)+"\n"+ko(t.precision)+"\n"+v+"\n"+t.shader.fragment,T=yn(p,t.vertexDefines,o),y=yn(g,t.fragmentDefines,o),x=new Ho;x.uniformSemantics=t.shader.uniformSemantics,x.attributes=t.shader.attributes;var E=x.buildProgram(u,t.shader,T,y);return x.__error=E,i[s]=x,x};var xn=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,Vo=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,Tn=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,Wo={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"};function ot(e){for(var t=[],r=0;r=0){if(d!==o&&d!==h){Bt();break}d=l,v=[];continue}else if(d===o){e==="bool"?f[p].value=g==="true":f[p].value=parseFloat(g),v=null;continue}else if(d===h){var T=g;Pi.indexOf(T)>=0||ma.indexOf(T)>=0||_a.indexOf(T)>=0?f[p].semantic=T:T==="ignore"||T==="unconfigurable"?f[p].ignore=!0:e==="bool"?f[p].value=T==="true":f[p].value=parseFloat(T);continue}m(g),d=s}}return f}function F(e,t){typeof e=="object"&&(t=e.fragment,e=e.vertex),e=En(e),t=En(t),this._shaderID=jo(e,t),this._vertexCode=F.parseImport(e),this._fragmentCode=F.parseImport(t),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}F.prototype={constructor:F,createUniforms:function(){var e={};for(var t in this.uniformTemplates){var r=this.uniformTemplates[t];e[t]={type:r.type,value:r.value()}}return e},_parseImport:function(){this._vertexCode=F.parseImport(this.vertex),this._fragmentCode=F.parseImport(this.fragment)},_addSemanticUniform:function(e,t,r){if(Pi.indexOf(r)>=0)this.attributeSemantics[r]={symbol:e,type:t};else if(_a.indexOf(r)>=0){var i=!1,n=r;r.match(/TRANSPOSE$/)&&(i=!0,n=r.slice(0,-9)),this.matrixSemantics[r]={symbol:e,type:t,isTranspose:i,semanticNoTranspose:n}}else ma.indexOf(r)>=0&&(this.uniformSemantics[r]={symbol:e,type:t})},_addMaterialUniform:function(e,t,r,i,n,a){a[e]={type:r,value:n?wn.array:i||wn[t],semantic:null}},_parseUniforms:function(){var e={},t=this,r="vertex";this._uniformList=[],this._vertexCode=this._vertexCode.replace(xn,n),r="fragment",this._fragmentCode=this._fragmentCode.replace(xn,n),t.matrixSemanticKeys=Object.keys(this.matrixSemantics);function i(a){return a!=null?function(){return a}:null}function n(a,s,o){var l=bn(s,o),u=[];for(var h in l){var c=l[h],d=c.semantic,f=h,v=Wo[s],p=i(l[h].value);l[h].isArray&&(f+="["+l[h].arraySize+"]",v+="v"),u.push(f),t._uniformList.push(h),c.ignore||((s==="sampler2D"||s==="samplerCube")&&(t.textures[h]={shaderType:r,type:s}),d?t._addSemanticUniform(h,v,d):t._addMaterialUniform(h,s,v,p,l[h].isArray,e))}return u.length>0?"uniform "+s+" "+u.join(",")+";\n":""}this.uniformTemplates=e},_parseAttributes:function(){var e={},t=this;this._vertexCode=this._vertexCode.replace(Vo,r);function r(i,n,a){var s=bn(n,a),o=Xo[n]||1,l=[];for(var u in s){var h=s[u].semantic;if(e[u]={type:"float",size:o,semantic:h||null},h){if(Pi.indexOf(h)<0)throw new Error('Unkown semantic "'+h+'"');t.attributeSemantics[h]={symbol:u,type:n}}l.push(u)}return"attribute "+n+" "+l.join(",")+";\n"}this.attributes=e},_parseDefines:function(){var e=this,t="vertex";this._vertexCode=this._vertexCode.replace(Tn,r),t="fragment",this._fragmentCode=this._fragmentCode.replace(Tn,r);function r(i,n,a){var s=t==="vertex"?e.vertexDefines:e.fragmentDefines;return s[n]||(a==="false"?s[n]=!1:a==="true"?s[n]=!0:s[n]=a?isNaN(parseFloat(a))?a.trim():parseFloat(a):null),""}},clone:function(){var e=ga[this._shaderID],t=new F(e.vertex,e.fragment);return t}};Object.defineProperty&&(Object.defineProperty(F.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(F.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(F.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(F.prototype,"uniforms",{get:function(){return this._uniformList}}));var qo=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;F.parseImport=function(e){return e=e.replace(qo,function(n,r,i){var n=F.source(i);return n?F.parseImport(n):(console.error('Shader chunk "'+i+'" not existed in library'),"")}),e};var Yo=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;F.import=function(e){e.replace(Yo,function(t,r,i,a){var a=a.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"");if(a){for(var s=i.split("."),o=F.codes,l=0,u;l0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e};_.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]};_.cross=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=r[0],o=r[1],l=r[2];return e[0]=n*l-a*o,e[1]=a*s-i*l,e[2]=i*o-n*s,e};_.lerp=function(e,t,r,i){var n=t[0],a=t[1],s=t[2];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=s+i*(r[2]-s),e};_.random=function(e,t){t=t||1;var r=Xt()*2*Math.PI,i=Xt()*2-1,n=Math.sqrt(1-i*i)*t;return e[0]=Math.cos(r)*n,e[1]=Math.sin(r)*n,e[2]=i*t,e};_.transformMat4=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=r[3]*i+r[7]*n+r[11]*a+r[15];return s=s||1,e[0]=(r[0]*i+r[4]*n+r[8]*a+r[12])/s,e[1]=(r[1]*i+r[5]*n+r[9]*a+r[13])/s,e[2]=(r[2]*i+r[6]*n+r[10]*a+r[14])/s,e};_.transformMat3=function(e,t,r){var i=t[0],n=t[1],a=t[2];return e[0]=i*r[0]+n*r[3]+a*r[6],e[1]=i*r[1]+n*r[4]+a*r[7],e[2]=i*r[2]+n*r[5]+a*r[8],e};_.transformQuat=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=r[0],o=r[1],l=r[2],u=r[3],h=u*i+o*a-l*n,c=u*n+l*i-s*a,d=u*a+s*n-o*i,f=-s*i-o*n-l*a;return e[0]=h*u+f*-s+c*-l-d*-o,e[1]=c*u+f*-o+d*-s-h*-l,e[2]=d*u+f*-l+h*-o-c*-s,e};_.rotateX=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0],a[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),a[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e};_.rotateY=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),a[1]=n[1],a[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e};_.rotateZ=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),a[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),a[2]=n[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e};_.forEach=function(){var e=_.create();return function(t,r,i,n,a,s){var o,l;for(r||(r=3),i||(i=0),n?l=Math.min(n*r+i,t.length):l=t.length,o=i;o1?0:Math.acos(n)};F.import(ya);var oe=C.create,Sn={};function An(e){return e.material}function Zo(e,t,r){return t.uniforms[r].value}function $o(e,t,r,i){return r!==i}function Ko(e){return!0}function Cn(){}var Mn={float:b.FLOAT,byte:b.BYTE,ubyte:b.UNSIGNED_BYTE,short:b.SHORT,ushort:b.UNSIGNED_SHORT};function Qo(e,t,r){this.availableAttributes=e,this.availableAttributeSymbols=t,this.indicesBuffer=r,this.vao=null}function Jo(e){var t,r;this.bind=function(i){t||(t=J.createCanvas(),t.width=t.height=1,t.getContext("2d"));var n=i.gl,a=!r;a&&(r=n.createTexture()),n.bindTexture(n.TEXTURE_2D,r),a&&n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t)},this.unbind=function(i){i.gl.bindTexture(i.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var We=Pe.extend(function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},maxJointNumber:20,__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}},function(){this.canvas||(this.canvas=J.createCanvas());var e=this.canvas;try{var t={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!this.gl)throw new Error;this._glinfo=new Lo(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(r){throw"Error creating WebGL Context "+r}this._programMgr=new pa(this),this._placeholderTexture=new Jo},{resize:function(e,t){var r=this.canvas,i=this.devicePixelRatio;e!=null?(r.style&&(r.style.width=e+"px",r.style.height=t+"px"),r.width=e*i,r.height=t*i,this._width=e,this._height=t):(this._width=r.width/i,this._height=r.height/i),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var e=this.viewport;return e.width/e.height},setDevicePixelRatio:function(e){this.devicePixelRatio=e,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(e){return this._glinfo.getExtension(e)},getGLParameter:function(e){return this._glinfo.getParameter(e)},setViewport:function(e,t,r,i,n){if(typeof e=="object"){var a=e;e=a.x,t=a.y,r=a.width,i=a.height,n=a.devicePixelRatio}n=n||this.devicePixelRatio,this.gl.viewport(e*n,t*n,r*n,i*n),this.viewport={x:e,y:t,width:r,height:i,devicePixelRatio:n}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var e=this._clearStack.pop();this.clearColor=e.clearColor,this.clearBit=e.clearBit}},bindSceneRendering:function(e){this._sceneRendering=e},render:function(e,t,r,i){var n=this.gl,a=this.clearColor;if(this.clearBit){n.colorMask(!0,!0,!0,!0),n.depthMask(!0);var s=this.viewport,o=!1,l=s.devicePixelRatio;(s.width!==this._width||s.height!==this._height||l&&l!==this.devicePixelRatio||s.x||s.y)&&(o=!0,n.enable(n.SCISSOR_TEST),n.scissor(s.x*l,s.y*l,s.width*l,s.height*l)),n.clearColor(a[0],a[1],a[2],a[3]),n.clear(this.clearBit),o&&n.disable(n.SCISSOR_TEST)}if(r||e.update(!1),e.updateLights(),t=t||e.getMainCamera(),!t){console.error("Can't find camera in the scene.");return}t.update();var u=e.updateRenderList(t,!0);this._sceneRendering=e;var h=u.opaque,c=u.transparent,d=e.material;e.trigger("beforerender",this,e,t,u),i?(this.renderPreZ(h,e,t),n.depthFunc(n.LEQUAL)):n.depthFunc(n.LESS);for(var f=oe(),v=_.create(),p=0;p0){var o=e[n-1],l=o.joints?o.joints.length:0,u=a.joints?a.joints.length:0;if(u===l&&a.material===o.material&&a.lightGroup===o.lightGroup){a.__program=o.__program;continue}}var h=this._programMgr.getProgram(a,s,t);this.validateProgram(h),a.__program=h}},renderPass:function(e,t,r){this.trigger("beforerenderpass",this,e,t,r),r=r||{},r.getMaterial=r.getMaterial||An,r.getUniform=r.getUniform||Zo,r.isMaterialChanged=r.isMaterialChanged||$o,r.beforeRender=r.beforeRender||Cn,r.afterRender=r.afterRender||Cn;var i=r.ifRender||Ko;this.updatePrograms(e,this._sceneRendering,r),r.sortCompare&&e.sort(r.sortCompare);var n=this.viewport,a=n.devicePixelRatio,s=[n.x*a,n.y*a,n.width*a,n.height*a],o=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*o,this._height*o],u=[s[2],s[3]],h=Date.now();t?(C.copy(se.VIEW,t.viewMatrix.array),C.copy(se.PROJECTION,t.projectionMatrix.array),C.copy(se.VIEWINVERSE,t.worldTransform.array)):(C.identity(se.VIEW),C.identity(se.PROJECTION),C.identity(se.VIEWINVERSE)),C.multiply(se.VIEWPROJECTION,se.PROJECTION,se.VIEW),C.invert(se.PROJECTIONINVERSE,se.PROJECTION),C.invert(se.VIEWPROJECTIONINVERSE,se.VIEWPROJECTION);for(var c=this.gl,d=this._sceneRendering,f,v,p,m,g,T,y,x,E,S,O,P,B=null,k=0;kthis.getMaxJointNumber()){var a=n.getSubSkinMatricesTexture(e.__uid__,e.joints);t.useTextureSlot(this,a,r),t.setUniform(i,"1i","skinMatricesTexture",r),t.setUniform(i,"1f","skinMatricesTextureSize",a.width)}else{var s=n.getSubSkinMatrices(e.__uid__,e.joints);t.setUniformOfSemantic(i,"SKIN_MATRIX",s)}},_renderObject:function(e,t,r){var i=this.gl,n=e.geometry,a=e.mode;a==null&&(a=4);var s=null,o=e.isInstancedMesh&&e.isInstancedMesh();if(o&&(s=this.getGLExtension("ANGLE_instanced_arrays"),!s)){console.warn("Device not support ANGLE_instanced_arrays extension");return}var l;if(o&&(l=this._bindInstancedAttributes(e,r,s)),t.indicesBuffer){var u=this.getGLExtension("OES_element_index_uint"),h=u&&n.indices instanceof Uint32Array,c=h?i.UNSIGNED_INT:i.UNSIGNED_SHORT;o?s.drawElementsInstancedANGLE(a,t.indicesBuffer.count,c,0,e.getInstanceCount()):i.drawElements(a,t.indicesBuffer.count,c,0)}else o?s.drawArraysInstancedANGLE(a,0,n.vertexCount,e.getInstanceCount()):i.drawArrays(a,0,n.vertexCount);if(o)for(var d=0;dr?r:e}var ie=Math.atan2,ke=Math.asin,Ut=Math.abs;w.eulerFromQuat=function(e,t,d){e._dirty=!0,t=t.array;var i=e.array,n=t[0],a=t[1],s=t[2],o=t[3],l=n*n,u=a*a,h=s*s,c=o*o,d=(d||"XYZ").toUpperCase();switch(d){case"XYZ":i[0]=ie(2*(n*o-a*s),c-l-u+h),i[1]=ke(Ge(2*(n*s+a*o),-1,1)),i[2]=ie(2*(s*o-n*a),c+l-u-h);break;case"YXZ":i[0]=ke(Ge(2*(n*o-a*s),-1,1)),i[1]=ie(2*(n*s+a*o),c-l-u+h),i[2]=ie(2*(n*a+s*o),c-l+u-h);break;case"ZXY":i[0]=ke(Ge(2*(n*o+a*s),-1,1)),i[1]=ie(2*(a*o-s*n),c-l-u+h),i[2]=ie(2*(s*o-n*a),c-l+u-h);break;case"ZYX":i[0]=ie(2*(n*o+s*a),c-l-u+h),i[1]=ke(Ge(2*(a*o-n*s),-1,1)),i[2]=ie(2*(n*a+s*o),c+l-u-h);break;case"YZX":i[0]=ie(2*(n*o-s*a),c-l+u-h),i[1]=ie(2*(a*o-n*s),c+l-u-h),i[2]=ke(Ge(2*(n*a+s*o),-1,1));break;case"XZY":i[0]=ie(2*(n*o+a*s),c-l+u-h),i[1]=ie(2*(n*s+a*o),c+l-u-h),i[2]=ke(Ge(2*(s*o-n*a),-1,1));break;default:console.warn("Unkown order: "+d)}return e};w.eulerFromMat3=function(e,t,v){var i=t.array,n=i[0],a=i[3],s=i[6],o=i[1],l=i[4],u=i[7],h=i[2],c=i[5],d=i[8],f=e.array,v=(v||"XYZ").toUpperCase();switch(v){case"XYZ":f[1]=ke(Ge(s,-1,1)),Ut(s)<.99999?(f[0]=ie(-u,d),f[2]=ie(-a,n)):(f[0]=ie(c,l),f[2]=0);break;case"YXZ":f[0]=ke(-Ge(u,-1,1)),Ut(u)<.99999?(f[1]=ie(s,d),f[2]=ie(o,l)):(f[1]=ie(-h,n),f[2]=0);break;case"ZXY":f[0]=ke(Ge(c,-1,1)),Ut(c)<.99999?(f[1]=ie(-h,d),f[2]=ie(-a,l)):(f[1]=0,f[2]=ie(o,n));break;case"ZYX":f[1]=ke(-Ge(h,-1,1)),Ut(h)<.99999?(f[0]=ie(c,d),f[2]=ie(o,n)):(f[0]=0,f[2]=ie(-a,l));break;case"YZX":f[2]=ke(Ge(o,-1,1)),Ut(o)<.99999?(f[0]=ie(-u,l),f[1]=ie(-h,n)):(f[0]=0,f[1]=ie(s,d));break;case"XZY":f[2]=ke(-Ge(a,-1,1)),Ut(a)<.99999?(f[0]=ie(c,l),f[1]=ie(s,n)):(f[0]=ie(-u,d),f[1]=0);break;default:console.warn("Unkown order: "+v)}return e._dirty=!0,e};Object.defineProperties(w,{POSITIVE_X:{get:function(){return new w(1,0,0)}},NEGATIVE_X:{get:function(){return new w(-1,0,0)}},POSITIVE_Y:{get:function(){return new w(0,1,0)}},NEGATIVE_Y:{get:function(){return new w(0,-1,0)}},POSITIVE_Z:{get:function(){return new w(0,0,1)}},NEGATIVE_Z:{get:function(){return new w(0,0,-1)}},UP:{get:function(){return new w(0,1,0)}},ZERO:{get:function(){return new w}}});var el=1e-5,Lt=function(e,t){this.origin=e||new w,this.direction=t||new w};Lt.prototype={constructor:Lt,intersectPlane:function(e,t){var r=e.normal.array,i=e.distance,n=this.origin.array,a=this.direction.array,s=_.dot(r,a);if(s===0)return null;t||(t=new w);var o=(_.dot(r,n)-i)/s;return _.scaleAndAdd(t.array,n,a,-o),t._dirty=!0,t},mirrorAgainstPlane:function(e){var t=_.dot(e.normal.array,this.direction.array);_.scaleAndAdd(this.direction.array,this.direction.array,e.normal.array,-t*2),this.direction._dirty=!0},distanceToPoint:function(){var e=_.create();return function(t){_.sub(e,t,this.origin.array);var r=_.dot(e,this.direction.array);if(r<0)return _.distance(this.origin.array,t);var i=_.lenSquared(e);return Math.sqrt(i-r*r)}}(),intersectSphere:function(){var e=_.create();return function(t,r,i){var n=this.origin.array,a=this.direction.array;t=t.array,_.sub(e,t,n);var s=_.dot(e,a),o=_.squaredLength(e),l=o-s*s,u=r*r;if(!(l>u)){var h=Math.sqrt(u-l),c=s-h,d=s+h;return i||(i=new w),c<0?d<0?null:(_.scaleAndAdd(i.array,n,a,d),i):(_.scaleAndAdd(i.array,n,a,c),i)}}}(),intersectBoundingBox:function(e,t){var r=this.direction.array,i=this.origin.array,n=e.min.array,a=e.max.array,s=1/r[0],o=1/r[1],l=1/r[2],u,h,c,d,f,v;if(s>=0?(u=(n[0]-i[0])*s,h=(a[0]-i[0])*s):(h=(n[0]-i[0])*s,u=(a[0]-i[0])*s),o>=0?(c=(n[1]-i[1])*o,d=(a[1]-i[1])*o):(d=(n[1]-i[1])*o,c=(a[1]-i[1])*o),u>d||c>h||((c>u||u!==u)&&(u=c),(d=0?(f=(n[2]-i[2])*l,v=(a[2]-i[2])*l):(v=(n[2]-i[2])*l,f=(a[2]-i[2])*l),u>v||f>h)||((f>u||u!==u)&&(u=f),(v=0?u:h;return t||(t=new w),_.scaleAndAdd(t.array,i,r,p),t},intersectTriangle:function(){var e=_.create(),t=_.create(),r=_.create(),i=_.create();return function(n,a,s,o,l,u){var h=this.direction.array,c=this.origin.array;n=n.array,a=a.array,s=s.array,_.sub(e,a,n),_.sub(t,s,n),_.cross(i,t,h);var d=_.dot(e,i);if(o){if(d>-1e-5)return null}else if(d>-1e-5&&d1)return null;_.cross(i,e,r);var v=_.dot(h,i)/d;if(v<0||v>1||f+v>1)return null;_.cross(i,e,t);var p=-_.dot(r,i)/d;return p<0?null:(l||(l=new w),u&&w.set(u,1-f-v,f,v),_.scaleAndAdd(l.array,c,h,p),l)}}(),applyTransform:function(e){w.add(this.direction,this.direction,this.origin),w.transformMat4(this.origin,this.origin,e),w.transformMat4(this.direction,this.direction,e),w.sub(this.direction,this.direction,this.origin),w.normalize(this.direction,this.direction)},copy:function(e){w.copy(this.origin,e.origin),w.copy(this.direction,e.direction)},clone:function(){var e=new Lt;return e.copy(this),e}};var A={};A.create=function(){var e=new Ae(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e};A.clone=function(e){var t=new Ae(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t};A.fromValues=function(e,t,r,i){var n=new Ae(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n};A.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e};A.set=function(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e};A.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e};A.subtract=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e};A.sub=A.subtract;A.multiply=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e};A.mul=A.multiply;A.divide=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e};A.div=A.divide;A.min=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e};A.max=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e};A.scale=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e};A.scaleAndAdd=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e};A.distance=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+i*i+n*n+a*a)};A.dist=A.distance;A.squaredDistance=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return r*r+i*i+n*n+a*a};A.sqrDist=A.squaredDistance;A.length=function(e){var t=e[0],r=e[1],i=e[2],n=e[3];return Math.sqrt(t*t+r*r+i*i+n*n)};A.len=A.length;A.squaredLength=function(e){var t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n};A.sqrLen=A.squaredLength;A.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e};A.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e};A.normalize=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=r*r+i*i+n*n+a*a;return s>0&&(s=1/Math.sqrt(s),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s),e};A.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]};A.lerp=function(e,t,r,i){var n=t[0],a=t[1],s=t[2],o=t[3];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=s+i*(r[2]-s),e[3]=o+i*(r[3]-o),e};A.random=function(e,t){return t=t||1,e[0]=Xt(),e[1]=Xt(),e[2]=Xt(),e[3]=Xt(),A.normalize(e,e),A.scale(e,e,t),e};A.transformMat4=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,e};A.transformQuat=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=r[0],o=r[1],l=r[2],u=r[3],h=u*i+o*a-l*n,c=u*n+l*i-s*a,d=u*a+s*n-o*i,f=-s*i-o*n-l*a;return e[0]=h*u+f*-s+c*-l-d*-o,e[1]=c*u+f*-o+d*-s-h*-l,e[2]=d*u+f*-l+h*-o-c*-s,e};A.forEach=function(){var e=A.create();return function(t,r,i,n,a,s){var o,l;for(r||(r=4),i||(i=0),n?l=Math.min(n*r+i,t.length):l=t.length,o=i;o.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(_.cross(e,n,a),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=1+s,D.normalize(i,i))}}();D.setAxes=function(){var e=W.create();return function(t,r,i,n){return e[0]=i[0],e[3]=i[1],e[6]=i[2],e[1]=n[0],e[4]=n[1],e[7]=n[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],D.normalize(t,D.fromMat3(t,e))}}();D.clone=A.clone;D.fromValues=A.fromValues;D.copy=A.copy;D.set=A.set;D.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e};D.setAxisAngle=function(e,t,r){r=r*.5;var i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e};D.add=A.add;D.multiply=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3],o=r[0],l=r[1],u=r[2],h=r[3];return e[0]=i*h+s*o+n*u-a*l,e[1]=n*h+s*l+a*o-i*u,e[2]=a*h+s*u+i*l-n*o,e[3]=s*h-i*o-n*l-a*u,e};D.mul=D.multiply;D.scale=A.scale;D.rotateX=function(e,t,r){r*=.5;var i=t[0],n=t[1],a=t[2],s=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=i*l+s*o,e[1]=n*l+a*o,e[2]=a*l-n*o,e[3]=s*l-i*o,e};D.rotateY=function(e,t,r){r*=.5;var i=t[0],n=t[1],a=t[2],s=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=i*l-a*o,e[1]=n*l+s*o,e[2]=a*l+i*o,e[3]=s*l-n*o,e};D.rotateZ=function(e,t,r){r*=.5;var i=t[0],n=t[1],a=t[2],s=t[3],o=Math.sin(r),l=Math.cos(r);return e[0]=i*l+n*o,e[1]=n*l-i*o,e[2]=a*l+s*o,e[3]=s*l-a*o,e};D.calculateW=function(e,t){var r=t[0],i=t[1],n=t[2];return e[0]=r,e[1]=i,e[2]=n,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),e};D.dot=A.dot;D.lerp=A.lerp;D.slerp=function(e,t,r,i){var n=t[0],a=t[1],s=t[2],o=t[3],l=r[0],u=r[1],h=r[2],c=r[3],d,f,v,p,m;return f=n*l+a*u+s*h+o*c,f<0&&(f=-f,l=-l,u=-u,h=-h,c=-c),1-f>1e-6?(d=Math.acos(f),v=Math.sin(d),p=Math.sin((1-i)*d)/v,m=Math.sin(i*d)/v):(p=1-i,m=i),e[0]=p*n+m*l,e[1]=p*a+m*u,e[2]=p*s+m*h,e[3]=p*o+m*c,e};D.invert=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=r*r+i*i+n*n+a*a,o=s?1/s:0;return e[0]=-r*o,e[1]=-i*o,e[2]=-n*o,e[3]=a*o,e};D.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e};D.length=A.length;D.len=D.length;D.squaredLength=A.squaredLength;D.sqrLen=D.squaredLength;D.normalize=A.normalize;D.fromMat3=function(e,t){var r=t[0]+t[4]+t[8],i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{var n=0;t[4]>t[0]&&(n=1),t[8]>t[n*3+n]&&(n=2);var a=(n+1)%3,s=(n+2)%3;i=Math.sqrt(t[n*3+n]-t[a*3+a]-t[s*3+s]+1),e[n]=.5*i,i=.5/i,e[3]=(t[a*3+s]-t[s*3+a])*i,e[a]=(t[a*3+n]+t[n*3+a])*i,e[s]=(t[s*3+n]+t[n*3+s])*i}return e};var I=function(){this._axisX=new w,this._axisY=new w,this._axisZ=new w,this.array=C.create(),this._dirty=!0};I.prototype={constructor:I,setArray:function(e){for(var t=0;t0){var t=this.min,r=this.max,i=t.array,n=r.array;Rr(i,e[0]),Rr(n,e[0]);for(var a=1;an[0]&&(n[0]=s[0]),s[1]>n[1]&&(n[1]=s[1]),s[2]>n[2]&&(n[2]=s[2])}t._dirty=!0,r._dirty=!0}},union:function(e){var t=this.min,r=this.max;return _.min(t.array,t.array,e.min.array),_.max(r.array,r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},intersection:function(e){var t=this.min,r=this.max;return _.max(t.array,t.array,e.min.array),_.min(r.array,r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},intersectBoundingBox:function(e){var t=this.min.array,r=this.max.array,i=e.min.array,n=e.max.array;return!(t[0]>n[0]||t[1]>n[1]||t[2]>n[2]||r[0]=n[0]&&r[1]>=n[1]&&r[2]>=n[2]},containPoint:function(e){var t=this.min.array,r=this.max.array,i=e.array;return t[0]<=i[0]&&t[1]<=i[1]&&t[2]<=i[2]&&r[0]>=i[0]&&r[1]>=i[1]&&r[2]>=i[2]},isFinite:function(){var e=this.min.array,t=this.max.array;return isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])&&isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])},applyTransform:function(e){this.transformFrom(this,e)},transformFrom:function(){var e=_.create(),t=_.create(),r=_.create(),i=_.create(),n=_.create(),a=_.create();return function(s,o){var l=s.min.array,u=s.max.array,h=o.array;return e[0]=h[0]*l[0],e[1]=h[1]*l[0],e[2]=h[2]*l[0],t[0]=h[0]*u[0],t[1]=h[1]*u[0],t[2]=h[2]*u[0],r[0]=h[4]*l[1],r[1]=h[5]*l[1],r[2]=h[6]*l[1],i[0]=h[4]*u[1],i[1]=h[5]*u[1],i[2]=h[6]*u[1],n[0]=h[8]*l[2],n[1]=h[9]*l[2],n[2]=h[10]*l[2],a[0]=h[8]*u[2],a[1]=h[9]*u[2],a[2]=h[10]*u[2],l=this.min.array,u=this.max.array,l[0]=Math.min(e[0],t[0])+Math.min(r[0],i[0])+Math.min(n[0],a[0])+h[12],l[1]=Math.min(e[1],t[1])+Math.min(r[1],i[1])+Math.min(n[1],a[1])+h[13],l[2]=Math.min(e[2],t[2])+Math.min(r[2],i[2])+Math.min(n[2],a[2])+h[14],u[0]=Math.max(e[0],t[0])+Math.max(r[0],i[0])+Math.max(n[0],a[0])+h[12],u[1]=Math.max(e[1],t[1])+Math.max(r[1],i[1])+Math.max(n[1],a[1])+h[13],u[2]=Math.max(e[2],t[2])+Math.max(r[2],i[2])+Math.max(n[2],a[2])+h[14],this.min._dirty=!0,this.max._dirty=!0,this}}(),applyProjection:function(e){var t=this.min.array,r=this.max.array,i=e.array,n=t[0],a=t[1],s=t[2],o=r[0],l=r[1],u=t[2],h=r[0],c=r[1],d=r[2];if(i[15]===1)t[0]=i[0]*n+i[12],t[1]=i[5]*a+i[13],r[2]=i[10]*s+i[14],r[0]=i[0]*h+i[12],r[1]=i[5]*c+i[13],t[2]=i[10]*d+i[14];else{var f=-1/s;t[0]=i[0]*n*f,t[1]=i[5]*a*f,r[2]=(i[10]*s+i[14])*f,f=-1/u,r[0]=i[0]*o*f,r[1]=i[5]*l*f,f=-1/d,t[2]=(i[10]*d+i[14])*f}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var e=this.vertices;if(!e){e=[];for(var t=0;t<8;t++)e[t]=_.fromValues(0,0,0);this.vertices=e}var r=this.min.array,i=this.max.array;return _t(e[0],r[0],r[1],r[2]),_t(e[1],r[0],i[1],r[2]),_t(e[2],i[0],r[1],r[2]),_t(e[3],i[0],i[1],r[2]),_t(e[4],r[0],r[1],i[2]),_t(e[5],r[0],i[1],i[2]),_t(e[6],i[0],r[1],i[2]),_t(e[7],i[0],i[1],i[2]),this},copy:function(e){var t=this.min,r=this.max;return Rr(t.array,e.min.array),Rr(r.array,e.max.array),t._dirty=!0,r._dirty=!0,this},clone:function(){var e=new Se;return e.copy(this),e}};var tl=0,tt=Pe.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},function(){this.name||(this.name=(this.type||"NODE")+"_"+tl++),this.position||(this.position=new w),this.rotation||(this.rotation=new te),this.scale||(this.scale=new w(1,1,1)),this.worldTransform=new I,this.localTransform=new I,this._children=[]},{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(e){var t=this._scene;if(t){var r=t._nodeRepository;delete r[this.name],r[e]=this}this.name=e},add:function(e){var t=e._parent;if(t!==this){t&&t.remove(e),e._parent=this,this._children.push(e);var r=this._scene;r&&r!==e.scene&&e.traverse(this._addSelfToScene,this),e._needsUpdateWorldTransform=!0}},remove:function(e){var t=this._children,r=t.indexOf(e);r<0||(t.splice(r,1),e._parent=null,this._scene&&e.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var e=this._children,t=0;t0},beforeRender:function(e){},afterRender:function(e,t){},getBoundingBox:function(e,t){return t=tt.prototype.getBoundingBox.call(this,e,t),this.geometry&&this.geometry.boundingBox&&t.union(this.geometry.boundingBox),t},clone:function(){var e=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"];return function(){var t=tt.prototype.clone.call(this);t.geometry=this.geometry,t.material=this.material;for(var r=0;r=0&&E[y]>1e-4&&(_.transformMat4(P,x,g[S[y]]),_.scaleAndAdd(O,O,P,E[y]));B.set(T,O)}}for(var T=0;T>t;return e+1},dispose:function(e){var t=this._cache;t.use(e.__uid__);var r=t.get("webgl_texture");r&&e.gl.deleteTexture(r),t.deleteContext(e.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(L.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e}});Object.defineProperty(L.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e}});L.BYTE=b.BYTE;L.UNSIGNED_BYTE=b.UNSIGNED_BYTE;L.SHORT=b.SHORT;L.UNSIGNED_SHORT=b.UNSIGNED_SHORT;L.INT=b.INT;L.UNSIGNED_INT=b.UNSIGNED_INT;L.FLOAT=b.FLOAT;L.HALF_FLOAT=36193;L.UNSIGNED_INT_24_8_WEBGL=34042;L.DEPTH_COMPONENT=b.DEPTH_COMPONENT;L.DEPTH_STENCIL=b.DEPTH_STENCIL;L.ALPHA=b.ALPHA;L.RGB=b.RGB;L.RGBA=b.RGBA;L.LUMINANCE=b.LUMINANCE;L.LUMINANCE_ALPHA=b.LUMINANCE_ALPHA;L.SRGB=35904;L.SRGB_ALPHA=35906;L.COMPRESSED_RGB_S3TC_DXT1_EXT=33776;L.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777;L.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778;L.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779;L.NEAREST=b.NEAREST;L.LINEAR=b.LINEAR;L.NEAREST_MIPMAP_NEAREST=b.NEAREST_MIPMAP_NEAREST;L.LINEAR_MIPMAP_NEAREST=b.LINEAR_MIPMAP_NEAREST;L.NEAREST_MIPMAP_LINEAR=b.NEAREST_MIPMAP_LINEAR;L.LINEAR_MIPMAP_LINEAR=b.LINEAR_MIPMAP_LINEAR;L.REPEAT=b.REPEAT;L.CLAMP_TO_EDGE=b.CLAMP_TO_EDGE;L.MIRRORED_REPEAT=b.MIRRORED_REPEAT;var Be=Ie.extend({skeleton:null,joints:null},function(){this.joints||(this.joints=[])},{offsetMatrix:null,isInstancedMesh:function(){return!1},isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var e=Ie.prototype.clone.call(this);return e.skeleton=this.skeleton,this.joints&&(e.joints=this.joints.slice()),e}});Be.POINTS=b.POINTS;Be.LINES=b.LINES;Be.LINE_LOOP=b.LINE_LOOP;Be.LINE_STRIP=b.LINE_STRIP;Be.TRIANGLES=b.TRIANGLES;Be.TRIANGLE_STRIP=b.TRIANGLE_STRIP;Be.TRIANGLE_FAN=b.TRIANGLE_FAN;Be.BACK=b.BACK;Be.FRONT=b.FRONT;Be.FRONT_AND_BACK=b.FRONT_AND_BACK;Be.CW=b.CW;Be.CCW=b.CCW;var Tr={};Tr.isPowerOfTwo=function(e){return(e&e-1)===0};Tr.nextPowerOfTwo=function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e};Tr.nearestPowerOfTwo=function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))};var Pn=Tr.isPowerOfTwo;function Rn(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))}function rl(e,t){var r=Rn(e.width),i=Rn(e.height);t=t||document.createElement("canvas"),t.width=r,t.height=i;var n=t.getContext("2d");return n.drawImage(e.image,0,0,r,i),t}var Q=L.extend(function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}},{textureType:"texture2D",update:function(e){var t=e.gl;t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(e);var r=this.format,i=this.type,n=!!(this.convertToPOT&&!this.mipmaps.length&&this.image&&(this.wrapS===L.REPEAT||this.wrapT===L.REPEAT)&&this.NPOT);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,n?this.wrapS:this.getAvailableWrapS()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,n?this.wrapT:this.getAvailableWrapT()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n?this.magFilter:this.getAvailableMagFilter()),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n?this.minFilter:this.getAvailableMinFilter());var a=e.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&t.texParameterf(t.TEXTURE_2D,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),i===36193){var s=e.getGLExtension("OES_texture_half_float");s||(i=b.FLOAT)}if(this.mipmaps.length)for(var o=this.width,l=this.height,u=0;u=L.COMPRESSED_RGB_S3TC_DXT1_EXT?e.compressedTexImage2D(e.TEXTURE_2D,r,a,i,n,0,t.pixels):e.texImage2D(e.TEXTURE_2D,r,a,i,n,0,a,s,t.pixels)},generateMipmap:function(e){var t=e.gl;this.useMipmap&&!this.NPOT&&(t.bindTexture(t.TEXTURE_2D,this._cache.get("webgl_texture")),t.generateMipmap(t.TEXTURE_2D))},isPowerOfTwo:function(){return Pn(this.width)&&Pn(this.height)},isRenderable:function(){return this.image?this.image.width>0&&this.image.height>0:!!(this.width&&this.height)},bind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,this.getWebGLTexture(e))},unbind:function(e){e.gl.bindTexture(e.gl.TEXTURE_2D,null)},load:function(e,t){var r=J.createImage();t&&(r.crossOrigin=t);var i=this;return r.onload=function(){i.dirty(),i.trigger("success",i)},r.onerror=function(){i.trigger("error",i)},r.src=e,this.image=r,this}});Object.defineProperty(Q.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(e){this.image?console.warn("Texture from image can't set width"):(this._width!==e&&this.dirty(),this._width=e)}});Object.defineProperty(Q.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(e){this.image?console.warn("Texture from image can't set height"):(this._height!==e&&this.dirty(),this._height=e)}});function xa(e){return{byte:J.Int8Array,ubyte:J.Uint8Array,short:J.Int16Array,ushort:J.Uint16Array}[e]||J.Float32Array}function hi(e){return"attr_"+e}function $t(e,t,r,i){switch(this.name=e,this.type=t,this.size=r,this.semantic=i||"",this.value=null,r){case 1:this.get=function(n){return this.value[n]},this.set=function(n,a){this.value[n]=a},this.copy=function(n,a){this.value[n]=this.value[n]};break;case 2:this.get=function(n,a){var s=this.value;return a[0]=s[n*2],a[1]=s[n*2+1],a},this.set=function(n,a){var s=this.value;s[n*2]=a[0],s[n*2+1]=a[1]},this.copy=function(n,a){var s=this.value;a*=2,n*=2,s[n]=s[a],s[n+1]=s[a+1]};break;case 3:this.get=function(n,a){var s=n*3,o=this.value;return a[0]=o[s],a[1]=o[s+1],a[2]=o[s+2],a},this.set=function(n,a){var s=n*3,o=this.value;o[s]=a[0],o[s+1]=a[1],o[s+2]=a[2]},this.copy=function(n,a){var s=this.value;a*=3,n*=3,s[n]=s[a],s[n+1]=s[a+1],s[n+2]=s[a+2]};break;case 4:this.get=function(n,a){var s=this.value,o=n*4;return a[0]=s[o],a[1]=s[o+1],a[2]=s[o+2],a[3]=s[o+3],a},this.set=function(n,a){var s=this.value,o=n*4;s[o]=a[0],s[o+1]=a[1],s[o+2]=a[2],s[o+3]=a[3]},this.copy=function(n,a){var s=this.value;a*=4,n*=4,s[n]=s[a],s[n+1]=s[a+1],s[n+2]=s[a+2],s[n+3]=s[a+3]}}}$t.prototype.init=function(e){if(!this.value||this.value.length!==e*this.size){var t=xa(this.type);this.value=new t(e*this.size)}};$t.prototype.fromArray=function(e){var t=xa(this.type),r;if(e[0]&&e[0].length){var i=0,n=this.size;r=new t(e.length*n);for(var a=0;a=0){t||(t=[]);var r=this.indices;return t[0]=r[e*3],t[1]=r[e*3+1],t[2]=r[e*3+2],t}},setTriangleIndices:function(e,t){var r=this.indices;r[e*3]=t[0],r[e*3+1]=t[1],r[e*3+2]=t[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(e){var t,r=this.vertexCount>65535?J.Uint32Array:J.Uint16Array;if(e[0]&&e[0].length){var i=0,n=3;t=new r(e.length*n);for(var a=0;a=0?(t.splice(r,1),delete this.attributes[e],!0):!1},getAttribute:function(e){return this.attributes[e]},getEnabledAttributes:function(){var e=this._enabledAttributes,t=this._attributeList;if(e)return e;for(var r=[],i=this.vertexCount,n=0;na[0]&&(a[0]=o),l>a[1]&&(a[1]=l),u>a[2]&&(a[2]=u)}r._dirty=!0,i._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var e=this.indices,t=this.attributes,r=t.position.value,i=t.normal.value;if(!i||i.length!==r.length)i=t.normal.value=new J.Float32Array(r.length);else for(var n=0;n65535&&(this.indices=new J.Uint32Array(this.indices));for(var e=this.attributes,t=this.indices,r=this.getEnabledAttributes(),i={},n=0;nthis.distance,n=1;n<8;n++)if(_.dot(t[n].array,r)>this.distance!=i)return!0},intersectLine:function(){var e=_.create();return function(t,r,i){var n=this.distanceToPoint(t),a=this.distanceToPoint(r);if(n>0&&a>0||n<0&&a<0)return null;var s=this.normal.array,o=this.distance,l=t.array;_.sub(e,r.array,t.array),_.normalize(e,e);var u=_.dot(s,e);if(u===0)return null;i||(i=new w);var h=(_.dot(s,l)-o)/u;return _.scaleAndAdd(i.array,l,e,-h),i._dirty=!0,i}}(),applyTransform:function(){var e=C.create(),t=A.create(),r=A.create();return r[3]=1,function(i){i=i.array,_.scale(r,this.normal.array,this.distance),A.transformMat4(r,r,i),this.distance=_.dot(r,this.normal.array),C.invert(e,i),C.transpose(e,e),t[3]=0,_.copy(t,this.normal.array),A.transformMat4(t,t,e),_.copy(this.normal.array,t)}}(),copy:function(e){_.copy(this.normal.array,e.normal.array),this.normal._dirty=!0,this.distance=e.distance},clone:function(){var e=new lr;return e.copy(this),e}};var pe=_.set,Ln=_.copy,Nn=_.transformMat4,ci=Math.min,fi=Math.max,Yr=function(){this.planes=[];for(var e=0;e<6;e++)this.planes.push(new lr);this.boundingBox=new Se,this.vertices=[];for(var e=0;e<8;e++)this.vertices[e]=_.fromValues(0,0,0)};Yr.prototype={setFromProjection:function(e){var t=this.planes,r=e.array,i=r[0],n=r[1],a=r[2],s=r[3],o=r[4],l=r[5],u=r[6],h=r[7],c=r[8],d=r[9],f=r[10],v=r[11],p=r[12],m=r[13],g=r[14],T=r[15];pe(t[0].normal.array,s-i,h-o,v-c),t[0].distance=-(T-p),t[0].normalize(),pe(t[1].normal.array,s+i,h+o,v+c),t[1].distance=-(T+p),t[1].normalize(),pe(t[2].normal.array,s+n,h+l,v+d),t[2].distance=-(T+m),t[2].normalize(),pe(t[3].normal.array,s-n,h-l,v-d),t[3].distance=-(T-m),t[3].normalize(),pe(t[4].normal.array,s-a,h-u,v-f),t[4].distance=-(T-g),t[4].normalize(),pe(t[5].normal.array,s+a,h+u,v+f),t[5].distance=-(T+g),t[5].normalize();var y=this.boundingBox,x=this.vertices;if(T===0){var E=l/i,S=-g/(f-1),O=-g/(f+1),P=-O/l,B=-S/l;y.min.set(-P*E,-P,O),y.max.set(P*E,P,S),pe(x[0],-P*E,-P,O),pe(x[1],-P*E,P,O),pe(x[2],P*E,-P,O),pe(x[3],P*E,P,O),pe(x[4],-B*E,-B,S),pe(x[5],-B*E,B,S),pe(x[6],B*E,-B,S),pe(x[7],B*E,B,S)}else{var k=(-1-p)/i,N=(1-p)/i,V=(1-m)/l,z=(-1-m)/l,U=(-1-g)/f,X=(1-g)/f;y.min.set(Math.min(k,N),Math.min(z,V),Math.min(X,U)),y.max.set(Math.max(N,k),Math.max(V,z),Math.max(U,X));var G=y.min.array,Y=y.max.array;pe(x[0],G[0],G[1],G[2]),pe(x[1],G[0],Y[1],G[2]),pe(x[2],Y[0],G[1],G[2]),pe(x[3],Y[0],Y[1],G[2]),pe(x[4],G[0],G[1],Y[2]),pe(x[5],G[0],Y[1],Y[2]),pe(x[6],Y[0],G[1],Y[2]),pe(x[7],Y[0],Y[1],Y[2])}},getTransformedBoundingBox:function(){var e=_.create();return function(t,r){var i=this.vertices,n=r.array,a=t.min,s=t.max,o=a.array,l=s.array,u=i[0];Nn(e,u,n),Ln(o,e),Ln(l,e);for(var h=1;h<8;h++)u=i[h],Nn(e,u,n),o[0]=ci(e[0],o[0]),o[1]=ci(e[1],o[1]),o[2]=ci(e[2],o[2]),l[0]=fi(e[0],l[0]),l[1]=fi(e[1],l[1]),l[2]=fi(e[2],l[2]);return a._dirty=!0,s._dirty=!0,t}}()};var Kt=tt.extend(function(){return{projectionMatrix:new I,invProjectionMatrix:new I,viewMatrix:new I,frustum:new Yr}},function(){this.update(!0)},{update:function(e){tt.prototype.update.call(this,e),I.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),I.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(e){I.copy(this.viewMatrix,e),I.invert(this.worldTransform,e),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(e){I.copy(this.projectionMatrix,e),I.invert(this.invProjectionMatrix,e),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:function(){var e=A.create();return function(t,r){var i=r!==void 0?r:new Lt,n=t.array[0],a=t.array[1];return A.set(e,n,a,-1,1),A.transformMat4(e,e,this.invProjectionMatrix.array),A.transformMat4(e,e,this.worldTransform.array),_.scale(i.origin.array,e,1/e[3]),A.set(e,n,a,1,1),A.transformMat4(e,e,this.invProjectionMatrix.array),A.transformMat4(e,e,this.worldTransform.array),_.scale(e,e,1/e[3]),_.sub(i.direction.array,e,i.origin.array),_.normalize(i.direction.array,i.direction.array),i.direction._dirty=!0,i.origin._dirty=!0,i}}()}),al=C.create(),Dn=C.create(),di={};function sl(e){var t=[],r=Object.keys(e);r.sort();for(var i=0;i0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(e)):e instanceof Ze&&this.lights.push(e),e.name&&(this._nodeRepository[e.name]=e)},removeFromScene:function(e){var t;e instanceof Kt?(t=this._cameraList.indexOf(e),t>=0&&this._cameraList.splice(t,1)):e instanceof Ze&&(t=this.lights.indexOf(e),t>=0&&this.lights.splice(t,1)),e.name&&delete this._nodeRepository[e.name]},getNode:function(e){return this._nodeRepository[e]},setMainCamera:function(e){var t=this._cameraList.indexOf(e);t>=0&&this._cameraList.splice(t,1),this._cameraList.unshift(e)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var e=this.lights;this._previousLightNumber=this._lightNumber;for(var t={},r=0;r0&&this._doUpdateRenderList(s,t,r,i,n)}},isFrustumCulled:function(){var e=new Se,t=new I;return function(r,i,n){var a=r.boundingBox;if(a||(r.skeleton&&r.skeleton.boundingBox?a=r.skeleton.boundingBox:a=r.geometry.boundingBox),!a)return!1;if(t.array=n,e.transformFrom(a,t),r.castShadow&&this.viewBoundingBoxLastFrame.union(e),r.frustumCulling){if(!e.intersectBoundingBox(i.frustum.boundingBox))return!0;t.array=i.projectionMatrix.array,e.max.array[2]>0&&e.min.array[2]<0&&(e.max.array[2]=-1e-20),e.applyProjection(t);var s=e.min.array,o=e.max.array;if(o[0]<-1||s[0]>1||o[1]<-1||s[1]>1||o[2]<-1||s[2]>1)return!0}return!1}}(),_updateLightUniforms:function(){var e=this.lights;e.sort(ol);var t=this._lightUniforms;for(var r in t)for(var i in t[r])t[r][i].value.length=0;for(var n=0;n1&&t.texParameterf(t.TEXTURE_CUBE_MAP,n.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),i===36193){var a=e.getGLExtension("OES_texture_half_float");a||(i=b.FLOAT)}if(this.mipmaps.length)for(var s=this.width,o=this.height,l=0;l0&&e.height>0}var Te=Kt.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var e=this.fov/180*Math.PI;this.projectionMatrix.perspective(e,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array,t=Math.atan(1/e[5])*2;this.fov=t/Math.PI*180,this.aspect=e[5]/e[0],this.near=e[14]/(e[10]-1),this.far=e[14]/(e[10]+1)},clone:function(){var e=Kt.prototype.clone.call(this);return e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e}}),Nr="framebuffer",lt="renderbuffer",On=lt+"_width",In=lt+"_height",vi=lt+"_attached",pi="depthtexture_attached",Et=b.FRAMEBUFFER,ir=b.RENDERBUFFER,sr=b.DEPTH_ATTACHMENT,Ea=b.COLOR_ATTACHMENT0,ye=Pe.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},function(){this._cache=new Zt,this._textures={}},{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(e){if(e.__currentFrameBuffer){if(e.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}e.__currentFrameBuffer=this;var t=e.gl;t.bindFramebuffer(Et,this._getFrameBufferGL(e)),this._boundRenderer=e;var r=this._cache;r.put("viewport",e.viewport);var i=!1,n,a;for(var s in this._textures){i=!0;var o=this._textures[s];o&&(n=o.texture.width,a=o.texture.height,this._doAttach(e,o.texture,s,o.target))}this._width=n,this._height=a,!i&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?e.setViewport(this.viewport):e.setViewport(0,0,n,a,1);var l=r.get("attached_textures");if(l){for(var s in l)if(!this._textures[s]){var u=l[s];this._doDetach(t,s,u)}}if(!r.get(pi)&&this.depthBuffer){r.miss(lt)&&r.put(lt,t.createRenderbuffer());var h=r.get(lt);(n!==r.get(On)||a!==r.get(In))&&(t.bindRenderbuffer(ir,h),t.renderbufferStorage(ir,t.DEPTH_COMPONENT16,n,a),r.put(On,n),r.put(In,a),t.bindRenderbuffer(ir,null)),r.get(vi)||(t.framebufferRenderbuffer(Et,sr,ir,h),r.put(vi,!0))}},unbind:function(e){e.__currentFrameBuffer=null;var t=e.gl;t.bindFramebuffer(Et,null),this._boundRenderer=null,this._cache.use(e.__uid__);var r=this._cache.get("viewport");r&&e.setViewport(r),this.updateMipmap(e)},updateMipmap:function(e){var t=e.gl;for(var r in this._textures){var i=this._textures[r];if(i){var n=i.texture;if(!n.NPOT&&n.useMipmap&&n.minFilter===L.LINEAR_MIPMAP_LINEAR){var a=n.textureType==="textureCube"?b.TEXTURE_CUBE_MAP:b.TEXTURE_2D;t.bindTexture(a,n.getWebGLTexture(e)),t.generateMipmap(a),t.bindTexture(a,null)}}}},checkStatus:function(e){return e.checkFramebufferStatus(Et)},_getFrameBufferGL:function(e){var t=this._cache;return t.use(e.__uid__),t.miss(Nr)&&t.put(Nr,e.gl.createFramebuffer()),t.get(Nr)},attach:function(e,t,r){if(!e.width)throw new Error("The texture attached to color buffer is not a valid.");t=t||Ea,r=r||b.TEXTURE_2D;var i=this._boundRenderer,n=i&&i.gl,a;if(n){var s=this._cache;s.use(i.__uid__),a=s.get("attached_textures")}var o=this._textures[t];if(!(o&&o.target===r&&o.texture===e&&a&&a[t]!=null)){var l=!0;i&&(l=this._doAttach(i,e,t,r),this.viewport||i.setViewport(0,0,e.width,e.height,1)),l&&(this._textures[t]=this._textures[t]||{},this._textures[t].texture=e,this._textures[t].target=r)}},_doAttach:function(e,t,r,i){var n=e.gl,a=t.getWebGLTexture(e),s=this._cache.get("attached_textures");if(s&&s[r]){var o=s[r];if(o.texture===t&&o.target===i)return}r=+r;var l=!0;if(r===sr||r===b.DEPTH_STENCIL_ATTACHMENT){var u=e.getGLExtension("WEBGL_depth_texture");if(u||(console.error("Depth texture is not supported by the browser"),l=!1),t.format!==b.DEPTH_COMPONENT&&t.format!==b.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),l=!1),l){var h=this._cache.get(lt);h&&(n.framebufferRenderbuffer(Et,sr,ir,null),n.deleteRenderbuffer(h),this._cache.put(lt,!1)),this._cache.put(vi,!1),this._cache.put(pi,!0)}}return n.framebufferTexture2D(Et,r,i,a,0),s||(s={},this._cache.put("attached_textures",s)),s[r]=s[r]||{},s[r].texture=t,s[r].target=i,l},_doDetach:function(e,t,r){e.framebufferTexture2D(Et,t,r,null,0);var i=this._cache.get("attached_textures");i&&i[t]&&(i[t]=null),(t===sr||t===b.DEPTH_STENCIL_ATTACHMENT)&&this._cache.put(pi,!1)},detach:function(e,t){if(this._textures[e]=null,this._boundRenderer){var r=this._cache;r.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,e,t)}},dispose:function(e){var t=e.gl,r=this._cache;r.use(e.__uid__);var i=r.get(lt);i&&t.deleteRenderbuffer(i);var n=r.get(Nr);n&&t.deleteFramebuffer(n),r.deleteContext(e.__uid__),this._textures={}}});ye.DEPTH_ATTACHMENT=sr;ye.COLOR_ATTACHMENT0=Ea;ye.STENCIL_ATTACHMENT=b.STENCIL_ATTACHMENT;ye.DEPTH_STENCIL_ATTACHMENT=b.DEPTH_STENCIL_ATTACHMENT;var ul=["px","nx","py","ny","pz","nz"],$i=Pe.extend(function(){var e={position:new w,far:1e3,near:.1,texture:null,shadowMapPass:null},t=e._cameras={px:new Te({fov:90}),nx:new Te({fov:90}),py:new Te({fov:90}),ny:new Te({fov:90}),pz:new Te({fov:90}),nz:new Te({fov:90})};return t.px.lookAt(w.POSITIVE_X,w.NEGATIVE_Y),t.nx.lookAt(w.NEGATIVE_X,w.NEGATIVE_Y),t.py.lookAt(w.POSITIVE_Y,w.POSITIVE_Z),t.ny.lookAt(w.NEGATIVE_Y,w.NEGATIVE_Z),t.pz.lookAt(w.POSITIVE_Z,w.NEGATIVE_Y),t.nz.lookAt(w.NEGATIVE_Z,w.NEGATIVE_Y),e._frameBuffer=new ye,e},{getCamera:function(e){return this._cameras[e]},render:function(e,t,r){var i=e.gl;r||t.update();for(var n=this.texture.width,a=2*Math.atan(n/(n-.5))/Math.PI*180,s=0;s<6;s++){var o=ul[s],l=this._cameras[o];if(w.copy(l.position,this.position),l.far=this.far,l.near=this.near,l.fov=a,this.shadowMapPass){l.update();var u=t.getBoundingBox();u.applyTransform(l.viewMatrix),t.viewBoundingBoxLastFrame.copy(u),this.shadowMapPass.render(e,t,l,!0)}this._frameBuffer.attach(this.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+s),this._frameBuffer.bind(e),e.render(t,l,!0),this._frameBuffer.unbind(e)}},dispose:function(e){this._frameBuffer.dispose(e)}}),Ki=ae.extend({dynamic:!1,widthSegments:1,heightSegments:1},function(){this.build()},{build:function(){for(var e=this.heightSegments,t=this.widthSegments,r=this.attributes,i=[],n=[],a=[],s=[],o=0;o<=e;o++)for(var l=o/e,u=0;u<=t;u++){var h=u/t;if(i.push([2*h-1,2*l-1,0]),n&&n.push([h,l]),a&&a.push([0,0,1]),u0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),e.renderPass([this],r)}}),cl=542327876,fl=131072,dl=512,vl=4;function Qi(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var pl=31,ml=Qi("DXT1"),_l=Qi("DXT3"),gl=Qi("DXT5"),yl=0,xl=1,Tl=2,wl=3,El=4,bl=7,Sl=20,Al=21,Cl=28,Ml={parse:function(e,t){var r=new Int32Array(e,0,pl);if(r[yl]!==cl||!r(Sl)&vl)return null;var i=r(Al),n=r[El],a=r[wl],s=r[Cl]&dl,o=r[Tl]&fl,l,u;switch(i){case ml:l=8,u=L.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case _l:l=16,u=L.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case gl:l=16,u=L.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var h=r[xl]+4,c=s?6:1,d=1;o&&(d=Math.max(1,r[bl]));for(var f=[],v=0;v0){var n=Math.pow(2,e[3]-128-8+i);t[r+0]=e[0]*n,t[r+1]=e[1]*n,t[r+2]=e[2]*n}else t[r+0]=0,t[r+1]=0,t[r+2]=0;return t[r+3]=1,t}function Nl(e,t,r){for(var i="",n=t;n0;)if(e[a][0]=t[r++],e[a][1]=t[r++],e[a][2]=t[r++],e[a][3]=t[r++],e[a][0]===1&&e[a][1]===1&&e[a][2]===1){for(var o=e[a][3]<>>0;o>0;o--)Dl(e[a-1],e[a]),a++,s--;n+=8}else a++,s--,n=0;return r}function Ol(e,t,r,i){if(iRl)return Fn(e,t,r,i);var n=t[r++];if(n!=2)return Fn(e,t,r-1,i);if(e[0][1]=t[r++],e[0][2]=t[r++],n=t[r++],(e[0][2]<<8>>>0|n)>>>0!==i)return null;for(var n=0;n<4;n++)for(var a=0;a128){s=(s&127)>>>0;for(var o=t[r++];s--;)e[a++][n]=o}else for(;s--;)e[a++][n]=t[r++]}return r}var Il={parseRGBE:function(e,t,r){r==null&&(r=0);var i=new Uint8Array(e),n=i.length;if(Nl(i,0,2)==="#?"){for(var a=2;a=n)){a+=2;for(var s="";a20)return console.warn("Given image is not a height map"),e}var f,v,p,m;l%(i*4)===0?(f=s.data[l],p=s.data[l+4]):l%(i*4)===(i-1)*4?(f=s.data[l-4],p=s.data[l]):(f=s.data[l-4],p=s.data[l+4]),li*(n-1)*4?(v=s.data[l-i*4],m=s.data[l]):(v=s.data[l-i*4],m=s.data[l+i*4]),o.data[l]=f-p+127,o.data[l+1]=v-m+127,o.data[l+2]=255,o.data[l+3]=255}return a.putImageData(o,0,0),r},isHeightImage:function(e,t,r){if(!e||!e.width||!e.height)return!1;var i=document.createElement("canvas"),n=i.getContext("2d"),a=t||32;r=r||20,i.width=i.height=a,n.drawImage(e,0,0,a,a);for(var s=n.getImageData(0,0,a,a),o=0;or)return!1}return!0},_fetchTexture:function(e,t,r){J.request.get({url:e,responseType:"arraybuffer",onload:t,onerror:r})},createChessboard:function(e,t,r,i){e=e||512,t=t||64,r=r||"black",i=i||"white";var n=Math.ceil(e/t),a=document.createElement("canvas");a.width=e,a.height=e;var s=a.getContext("2d");s.fillStyle=i,s.fillRect(0,0,e,e),s.fillStyle=r;for(var o=0;o=0||(Ri.forEach(function(t){e.on(t,this[Li(t)],this)},this),this._meshes.push(e))},detachFromMesh:function(e){var t=this._meshes.indexOf(e);t>=0&&this._meshes.splice(t,1),Ri.forEach(function(r){e.off(r,this[Li(r)])},this)},dispose:function(){this._meshes.forEach(function(e){this.detachFromMesh(e)},this)}};var _r=Kt.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var e=this.projectionMatrix.array;this.left=(-1-e[12])/e[0],this.right=(1-e[12])/e[0],this.top=(1-e[13])/e[5],this.bottom=(-1-e[13])/e[5],this.near=-(-1-e[14])/e[10],this.far=-(1-e[14])/e[10]},clone:function(){var e=Kt.prototype.clone.call(this);return e.left=this.left,e.right=this.right,e.near=this.near,e.far=this.far,e.top=this.top,e.bottom=this.bottom,e}});const Fl="\n@export clay.compositor.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n v_Texcoord = texcoord;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end";F.import(Fl);var Bl=new Ki,Bn=new Be({geometry:Bl,frustumCulling:!1}),Ul=new _r,De=Pe.extend(function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}},function(){var e=new F(F.source("clay.compositor.vertex"),this.fragment),t=new vt({shader:e});t.enableTexturesAll(),this.material=t},{setUniform:function(e,t){this.material.setUniform(e,t)},getUniform:function(e){var t=this.material.uniforms[e];if(t)return t.value},attachOutput:function(e,t){this.outputs||(this.outputs={}),t=t||b.COLOR_ATTACHMENT0,this.outputs[t]=e},detachOutput:function(e){for(var t in this.outputs)this.outputs[t]===e&&(this.outputs[t]=null)},bind:function(e,t){if(this.outputs)for(var r in this.outputs){var i=this.outputs[r];i&&t.attach(i,r)}t&&t.bind(e)},unbind:function(e,t){t.unbind(e)},render:function(e,t){var r=e.gl;if(t){this.bind(e,t);var i=e.getGLExtension("EXT_draw_buffers");if(i&&this.outputs){var n=[];for(var a in this.outputs)a=+a,a>=r.COLOR_ATTACHMENT0&&a<=r.COLOR_ATTACHMENT0+8&&n.push(a);i.drawBuffersEXT(n)}}this.trigger("beforerender",this,e);var s=this.clearDepth?r.DEPTH_BUFFER_BIT:0;if(r.depthMask(!0),this.clearColor){s=s|r.COLOR_BUFFER_BIT,r.colorMask(!0,!0,!0,!0);var o=this.clearColor;Array.isArray(o)&&r.clearColor(o[0],o[1],o[2],o[3])}r.clear(s),this.blendWithPrevious?(r.enable(r.BLEND),this.material.transparent=!0):(r.disable(r.BLEND),this.material.transparent=!1),this.renderQuad(e),this.trigger("afterrender",this,e),t&&this.unbind(e,t)},renderQuad:function(e){Bn.material=this.material,e.renderPass([Bn],Ul)},dispose:function(e){}});const Hl="#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform sampler2D normalDistribution;\nuniform vec2 viewportSize : [512, 256];\nconst vec3 N = vec3(0.0, 0.0, 1.0);\nconst float fSampleNumber = float(SAMPLE_NUMBER);\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nfloat G_Smith(float roughness, float NoV, float NoL) {\n float k = roughness * roughness / 2.0;\n float G1V = NoV / (NoV * (1.0 - k) + k);\n float G1L = NoL / (NoL * (1.0 - k) + k);\n return G1L * G1V;\n}\nvoid main() {\n vec2 uv = gl_FragCoord.xy / viewportSize;\n float NoV = uv.x;\n float roughness = uv.y;\n vec3 V;\n V.x = sqrt(1.0 - NoV * NoV);\n V.y = 0.0;\n V.z = NoV;\n float A = 0.0;\n float B = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(L.z, 0.0, 1.0);\n float NoH = clamp(H.z, 0.0, 1.0);\n float VoH = clamp(dot(V, H), 0.0, 1.0);\n if (NoL > 0.0) {\n float G = G_Smith(roughness, NoV, NoL);\n float G_Vis = G * VoH / (NoH * NoV);\n float Fc = pow(1.0 - VoH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);\n}\n",zl="#define SHADER_NAME prefilter\n#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform sampler2D normalDistribution;\nuniform float roughness : 0.5;\nvarying vec2 v_Texcoord;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n float fMaxSampleNumber = float(SAMPLE_NUMBER);\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(dot(N, L), 0.0, 1.0);\n if (NoL > 0.0) {\n prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;\n totalWeight += NoL;\n }\n }\n gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));\n}\n";var it={},mi=["px","nx","py","ny","pz","nz"];it.prefilterEnvironmentMap=function(e,t,r,i,n){(!n||!i)&&(i=it.generateNormalDistribution(),n=it.integrateBRDF(e,i)),r=r||{};var a=r.width||64,s=r.height||64,o=r.type||t.type,l=new Nt({width:a,height:s,type:o,flipY:!1,mipmaps:[]});l.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var u=Math.min(a,s),h=Math.log(u)/Math.log(2)+1,c=new vt({shader:new F({vertex:F.source("clay.skybox.vertex"),fragment:zl})});c.set("normalDistribution",i),r.encodeRGBM&&c.define("fragment","RGBM_ENCODE"),r.decodeRGBM&&c.define("fragment","RGBM_DECODE");var d=new xt,f;if(t.textureType==="texture2D"){var v=new Nt({width:a,height:s,type:o===L.FLOAT?L.HALF_FLOAT:o});rt.panoramaToCubeMap(e,t,v,{encodeRGBM:r.decodeRGBM}),t=v}f=new mr({scene:d,material:c}),f.material.set("environmentMap",t);var p=new $i({texture:l});r.encodeRGBM&&(o=l.type=L.UNSIGNED_BYTE);for(var m=new Q({width:a,height:s,type:o}),g=new ye({depthBuffer:!1}),T=J[o===L.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],y=0;y>>16)>>>0;c=((c&1431655765)<<1|(c&2863311530)>>>1)>>>0,c=((c&858993459)<<2|(c&3435973836)>>>2)>>>0,c=((c&252645135)<<4|(c&4042322160)>>>4)>>>0,c=(((c&16711935)<<8|(c&4278255360)>>>8)>>>0)/4294967296;var d=Math.sqrt((1-c)/(1+(u*u-1)*c));s[h]=d}for(var h=0;h65535?Uint32Array:Uint16Array,o=this.indices=new s(t*e*6),l,u,h,c,d,f,v,y=this.radius,p=this.phiStart,m=this.phiLength,g=this.thetaStart,T=this.thetaLength,y=this.radius,x=[],E=[],S=0,O=1/y;for(v=0;v<=e;v++)for(f=0;f<=t;f++)c=f/t,d=v/e,l=-y*Math.cos(p+c*m)*Math.sin(g+d*T),u=y*Math.cos(g+d*T),h=y*Math.sin(p+c*m)*Math.sin(g+d*T),x[0]=l,x[1]=u,x[2]=h,E[0]=c,E[1]=d,r.set(S,x),i.set(S,E),x[0]*=O,x[1]*=O,x[2]*=O,n.set(S,x),S++;var P,B,k,N,V=t+1,z=0;for(v=0;v=0&&l.splice(c,1)}),l.push(u),this.__zr&&this.__zr.animation.addAnimator(u),u},stopAnimation:function(e){this._animators=this._animators||[];for(var t=this._animators,r=t.length,i=0;i3?t[3]=e[3]:t[3]=1,t):(t=na(e||"#000",t)||[0,0,0,0],t[0]/=255,t[1]/=255,t[2]/=255,t)};M.directionFromAlphaBeta=function(e,t){var r=e/180*Math.PI+Math.PI/2,i=-t/180*Math.PI+Math.PI/2,n=[],a=Math.sin(r);return n[0]=a*Math.cos(i),n[1]=-Math.cos(r),n[2]=a*Math.sin(i),n};M.getShadowResolution=function(e){var t=1024;switch(e){case"low":t=512;break;case"medium":break;case"high":t=2048;break;case"ultra":t=4096;break}return t};M.COMMON_SHADERS=["lambert","color","realistic","hatching","shadow"];M.createShader=function(e){e==="ecgl.shadow"&&(e="ecgl.displayShadow");var t=F.source(e+".vertex"),r=F.source(e+".fragment");t||console.error("Vertex shader of '%s' not exits",e),r||console.error("Fragment shader of '%s' not exits",e);var i=new F(t,r);return i.name=e,i};M.createMaterial=function(e,t){t instanceof Array||(t=[t]);var r=M.createShader(e),i=new vt({shader:r});return t.forEach(function(n){typeof n=="string"&&i.define(n)}),i};M.setMaterialFromModel=function(e,t,r,i){t.autoUpdateTextureStatus=!1;var n=r.getModel(e+"Material"),a=n.get("detailTexture"),s=Ve.firstNotNull(n.get("textureTiling"),1),o=Ve.firstNotNull(n.get("textureOffset"),0);typeof s=="number"&&(s=[s,s]),typeof o=="number"&&(o=[o,o]);var l=s[0]>1||s[1]>1?M.Texture.REPEAT:M.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if(e==="realistic"){var h=n.get("roughness"),c=n.get("metalness");c!=null?isNaN(c)&&(t.setTextureImage("metalnessMap",c,i,u),c=Ve.firstNotNull(n.get("metalnessAdjust"),.5)):c=0,h!=null?isNaN(h)&&(t.setTextureImage("roughnessMap",h,i,u),h=Ve.firstNotNull(n.get("roughnessAdjust"),.5)):h=.5;var d=n.get("normalTexture");t.setTextureImage("detailMap",a,i,u),t.setTextureImage("normalMap",d,i,u),t.set({roughness:h,metalness:c,detailUvRepeat:s,detailUvOffset:o})}else if(e==="lambert")t.setTextureImage("detailMap",a,i,u),t.set({detailUvRepeat:s,detailUvOffset:o});else if(e==="color")t.setTextureImage("detailMap",a,i,u),t.set({detailUvRepeat:s,detailUvOffset:o});else if(e==="hatching"){var f=n.get("hatchingTextures")||[];f.length<6;for(var v=0;v<6;v++)t.setTextureImage("hatch"+(v+1),f[v],i,{anisotropic:8,wrapS:M.Texture.REPEAT,wrapT:M.Texture.REPEAT});t.set({detailUvRepeat:s,detailUvOffset:o})}};M.updateVertexAnimation=function(e,t,r,i){var n=i.get("animation"),a=i.get("animationDurationUpdate"),s=i.get("animationEasingUpdate"),o=r.shadowDepthMaterial;if(n&&t&&a>0&&t.geometry.vertexCount===r.geometry.vertexCount){r.material.define("vertex","VERTEX_ANIMATION"),r.ignorePreZ=!0,o&&o.define("vertex","VERTEX_ANIMATION");for(var l=0;l=0&&this._viewsToDispose.splice(t,1),this.views.push(e),e.layer=this;var r=this.zr;e.scene.traverse(function(i){i.__zr=r,i.addAnimatorsToZr&&i.addAnimatorsToZr(r)})}};function Ca(e){var t=e.__zr;e.__zr=null,t&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(t)}ne.prototype.removeView=function(e){if(e.layer===this){var t=this.views.indexOf(e);t>=0&&(this.views.splice(t,1),e.scene.traverse(Ca,this),e.layer=null,this._viewsToDispose.push(e))}};ne.prototype.removeViewsAll=function(){this.views.forEach(function(e){e.scene.traverse(Ca,this),e.layer=null,this._viewsToDispose.push(e)},this),this.views.length=0};ne.prototype.resize=function(e,t){var r=this.renderer;r.resize(e,t)};ne.prototype.clear=function(){var e=this.renderer.gl,t=this._backgroundColor||[0,0,0,0];e.clearColor(t[0],t[1],t[2],t[3]),e.depthMask(!0),e.colorMask(!0,!0,!0,!0),e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT)};ne.prototype.clearDepth=function(){var e=this.renderer.gl;e.clear(e.DEPTH_BUFFER_BIT)};ne.prototype.clearColor=function(){var e=this.renderer.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)};ne.prototype.needsRefresh=function(){this.zr.refresh()};ne.prototype.refresh=function(e){this._backgroundColor=e?M.parseColor(e):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var t=0;t20)){e=e.event;var i=this.pickObject(e.offsetX,e.offsetY);i&&(this._dispatchEvent(e.type,e,i),this._dispatchDataEvent(e.type,e,i));var n=this._clickToSetFocusPoint(e);if(n){var a=n.view.setDOFFocusOnPoint(n.distance);a&&this.zr.refresh()}}}};ne.prototype._clickToSetFocusPoint=function(e){for(var t=this.renderer,r=t.viewport,i=this.views.length-1;i>=0;i--){var n=this.views[i];if(n.hasDOF()&&n.containPoint(e.offsetX,e.offsetY)){this._picking.scene=n.scene,this._picking.camera=n.camera,t.viewport=n.viewport;var a=this._picking.pick(e.offsetX,e.offsetY,!0);if(a)return a.view=n,a}}t.viewport=r};ne.prototype.onglobalout=function(e){var t=this._hovered;t&&this._dispatchEvent("mouseout",e,{target:t.target})};ne.prototype.pickObject=function(e,t){for(var r=[],i=this.renderer,n=i.viewport,a=0;a=0&&(h.dataIndex=this._lastDataIndex,h.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",t)),o=!0):s!=null&&s!==this._lastEventData&&(this._lastEventData!=null&&(h.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",t)),o=!0),this._lastEventData=s,this._lastDataIndex=n,this._lastSeriesIndex=a),h.eventData=s,h.dataIndex=n,h.seriesIndex=a,(s!=null||parseInt(n,10)>=0&&parseInt(a,10)>=0)&&(this.zr.handler.dispatchToElement(u,e,t),o&&this.zr.handler.dispatchToElement(u,"mouseover",t))};ne.prototype._dispatchToView=function(e,t){for(var r=0;r=0&&(du(t),t.coordinateSystem==="mapbox"&&(t.coordinateSystem="mapbox3D",e.mapbox3D=e.mapbox))}),Fr(e.xAxis3D),Fr(e.yAxis3D),Fr(e.zAxis3D),Fr(e.grid3D),or(e.geo3D)}function Ma(e){this._layers={},this._zr=e}Ma.prototype.update=function(e,t){var r=this,i=t.getZr();if(!i.getWidth()||!i.getHeight()){console.warn("Dom has no width or height");return}function n(o){i.setSleepAfterStill(0);var l;o.coordinateSystem&&o.coordinateSystem.model,l=o.get("zlevel");var u=r._layers,h=u[l];if(!h){if(h=u[l]=new ne("gl-"+l,i),i.painter.isSingleCanvas()){h.virtual=!0;var c=new Ts({z:1e4,style:{image:h.renderer.canvas},silent:!0});h.__hostImage=c,i.add(c)}i.painter.insertLayer(l,h)}return h.__hostImage&&h.__hostImage.setStyle({width:h.renderer.getWidth(),height:h.renderer.getHeight()}),h}function a(o,l){o&&o.traverse(function(u){u.isRenderable&&u.isRenderable()&&(u.ignorePicking=u.$ignorePicking!=null?u.$ignorePicking:l)})}for(var s in this._layers)this._layers[s].removeViewsAll();e.eachComponent(function(o,l){if(o!=="series"){var u=t.getViewOfComponentModel(l),h=l.coordinateSystem;if(u.__ecgl__){var c;if(h){if(!h.viewGL){console.error("Can't find viewGL in coordinateSystem of component "+l.id);return}c=h.viewGL}else{if(!l.viewGL){console.error("Can't find viewGL of component "+l.id);return}c=h.viewGL}var c=h.viewGL,d=n(l);d.addView(c),u.afterRender&&u.afterRender(l,e,t,d),a(u.groupGL,l.get("silent"))}}}),e.eachSeries(function(o){var l=t.getViewOfSeriesModel(o),u=o.coordinateSystem;if(l.__ecgl__){if(u&&!u.viewGL&&!l.viewGL){console.error("Can't find viewGL of series "+l.id);return}var h=u&&u.viewGL||l.viewGL,c=n(o);c.addView(h),l.afterRender&&l.afterRender(o,e,t,c),a(l.groupGL,o.get("silent"))}})};gs(function(e){var t=e.getZr(),r=t.painter.dispose;t.painter.dispose=function(){typeof this.eachOtherLayer=="function"&&this.eachOtherLayer(function(i){i instanceof ne&&i.dispose()}),r.call(this)},t.painter.getRenderedCanvas=function(i){if(i=i||{},this._singleCanvas)return this._layers[0].dom;var n=document.createElement("canvas"),a=i.pixelRatio||this.dpr;n.width=this.getWidth()*a,n.height=this.getHeight()*a;var s=n.getContext("2d");s.dpr=a,s.clearRect(0,0,n.width,n.height),i.backgroundColor&&(s.fillStyle=i.backgroundColor,s.fillRect(0,0,n.width,n.height));var o=this.storage.getDisplayList(!0),l={},u,h=this;function c(p,m){var g=h._zlevelList;p==null&&(p=-1/0);for(var T,y=0;yp&&x0&&this._notFirst?this.animateTo({alpha:u,beta:h,center:c,distance:a,orthographicSize:s,easing:l.animationEasingUpdate,duration:l.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(u),this.setBeta(h),this.setCenter(c),this.setOrthographicSize(s)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){},animateTo:function(e){var t=this.zr,r=this,i={},n={};return e.distance!=null&&(i.distance=this.getDistance(),n.distance=e.distance),e.orthographicSize!=null&&(i.orthographicSize=this.getOrthographicSize(),n.orthographicSize=e.orthographicSize),e.alpha!=null&&(i.alpha=this.getAlpha(),n.alpha=e.alpha),e.beta!=null&&(i.beta=this.getBeta(),n.beta=e.beta),e.center!=null&&(i.center=this.getCenter(),n.center=e.center),this._addAnimator(t.animation.animate(i).when(e.duration||1e3,n).during(function(){i.alpha!=null&&r.setAlpha(i.alpha),i.beta!=null&&r.setBeta(i.beta),i.distance!=null&&r.setDistance(i.distance),i.center!=null&&r.setCenter(i.center),i.orthographicSize!=null&&r.setOrthographicSize(i.orthographicSize),r._needsUpdate=!0})).start(e.easing||"linear")},stopAllAnimation:function(){for(var e=0;e0},_update:function(e){if(this._rotating){var t=(this.autoRotateDirection==="cw"?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=t*e/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(e=Math.min(e,50),this._updateDistanceOrSize(e),this._updatePan(e),this._updateRotate(e),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(e){var t=this._rotateVelocity;this._phi=t.y*e/20+this._phi,this._theta=t.x*e/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(t,Math.pow(this.damping,e/16))},_updateDistanceOrSize:function(e){this._projection==="perspective"?this._setDistance(this._distance+this._zoomSpeed*e/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*e/20),this._zoomSpeed*=Math.pow(this.damping,e/16)},_setDistance:function(e){this._distance=Math.max(Math.min(e,this.maxDistance),this.minDistance)},_setOrthoSize:function(e){this._orthoSize=Math.max(Math.min(e,this.maxOrthographicSize),this.minOrthographicSize);var t=this.getCamera(),r=this._orthoSize,i=r/this.viewGL.viewport.height*this.viewGL.viewport.width;t.left=-i/2,t.right=i/2,t.top=r/2,t.bottom=-r/2},_updatePan:function(e){var t=this._panVelocity,r=this._distance,i=this.getCamera(),n=i.worldTransform.y,a=i.worldTransform.x;this._center.scaleAndAdd(a,-t.x*r/200).scaleAndAdd(n,-t.y*r/200),this._vectorDamping(t,0)},_updateTransform:function(){var e=this.getCamera(),t=new w,r=this._theta+Math.PI/2,i=this._phi+Math.PI/2,n=Math.sin(r);t.x=n*Math.cos(i),t.y=-Math.cos(r),t.z=n*Math.sin(i),e.position.copy(this._center).scaleAndAdd(t,this._distance),e.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var e=this.autoRotateAfterStill,t=this;!isNaN(e)&&e>0&&(this._stillTimeout=setTimeout(function(){t._rotating=!0},e*1e3))},_vectorDamping:function(e,t){var r=e.len();r=r*t,r<1e-4&&(r=0),e.normalize().scale(r)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var e=this.getCamera().worldTransform.z,t=Math.asin(e.y),r=Math.atan2(e.x,e.z);this._theta=t,this._phi=-r,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(e){if(!e.target&&!this._isAnimating()){var t=e.offsetX,r=e.offsetY;this.viewGL&&!this.viewGL.containPoint(t,r)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),e.event.targetTouches?e.event.targetTouches.length===1&&(this._mode="rotate"):e.event.button===zn[this.rotateMouseButton]?this._mode="rotate":e.event.button===zn[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=e.offsetX,this._mouseY=e.offsetY)}},_mouseMoveHandler:function(e){if(!(e.target&&e.target.__isGLToZRProxy)&&!this._isAnimating()){var t=Gn(this.panSensitivity),r=Gn(this.rotateSensitivity);this._mode==="rotate"?(this._rotateVelocity.y=(e.offsetX-this._mouseX)/this.zr.getHeight()*2*r[0],this._rotateVelocity.x=(e.offsetY-this._mouseY)/this.zr.getWidth()*2*r[1]):this._mode==="pan"&&(this._panVelocity.x=(e.offsetX-this._mouseX)/this.zr.getWidth()*t[0]*400,this._panVelocity.y=(-e.offsetY+this._mouseY)/this.zr.getHeight()*t[1]*400),this._mouseX=e.offsetX,this._mouseY=e.offsetY,e.event.preventDefault()}},_mouseWheelHandler:function(e){if(!this._isAnimating()){var t=e.event.wheelDelta||-e.event.detail;this._zoomHandler(e,t)}},_pinchHandler:function(e){this._isAnimating()||(this._zoomHandler(e,e.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(e,t){if(t!==0){var r=e.offsetX,i=e.offsetY;if(!(this.viewGL&&!this.viewGL.containPoint(r,i))){var n;this._projection==="perspective"?n=Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):n=Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(t>0?-1:1)*n*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&this._mode==="rotate"&&this._startCountingStill(),e.event.preventDefault()}}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return this.rotateMouseButton==="right"||this.panMouseButton==="right"},_contextMenuHandler:function(e){this._isRightMouseButtonUsed()&&e.preventDefault()},_addAnimator:function(e){var t=this._animators;return t.push(e),e.done(function(){var r=t.indexOf(e);r>=0&&t.splice(r,1)}),e}});Object.defineProperty(Pa.prototype,"autoRotate",{get:function(e){return this._autoRotate},set:function(e){this._autoRotate=e,this._rotating=e}});const Ji={convertToDynamicArray:function(e){e&&this.resetOffset();var t=this.attributes;for(var r in t)e||!t[r].value?t[r].value=[]:t[r].value=Array.prototype.slice.call(t[r].value);e||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var e=this.attributes;for(var t in e)e[t].value&&e[t].value.length>0?e[t].value=new Float32Array(e[t].value):e[t].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}},Kr={vec3:_};var _i=Kr.vec3,kn=[[0,0],[1,1]],Qr=ae.extend(function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new ae.Attribute("position","float",3,"POSITION"),positionPrev:new ae.Attribute("positionPrev","float",3),positionNext:new ae.Attribute("positionNext","float",3),prevPositionPrev:new ae.Attribute("prevPositionPrev","float",3),prevPosition:new ae.Attribute("prevPosition","float",3),prevPositionNext:new ae.Attribute("prevPositionNext","float",3),offset:new ae.Attribute("offset","float",1),color:new ae.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(e){var t=this.attributes;this.vertexCount!==e&&(t.position.init(e),t.color.init(e),this.useNativeLine||(t.positionPrev.init(e),t.positionNext.init(e),t.offset.init(e)),e>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(e){this.triangleCount!==e&&(e===0?this.indices=null:this.indices=this.vertexCount>65535?new Uint32Array(e*3):new Uint16Array(e*3))},_getCubicCurveApproxStep:function(e,t,r,i){var n=_i.dist(e,t)+_i.dist(r,t)+_i.dist(i,r),a=1/(n+1)*this.segmentScale;return a},getCubicCurveVertexCount:function(e,t,r,i){var n=this._getCubicCurveApproxStep(e,t,r,i),a=Math.ceil(1/n);return this.useNativeLine?a*2:a*2+2},getCubicCurveTriangleCount:function(e,t,r,i){var n=this._getCubicCurveApproxStep(e,t,r,i),a=Math.ceil(1/n);return this.useNativeLine?0:a*2},getLineVertexCount:function(){return this.getPolylineVertexCount(kn)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(kn)},getPolylineVertexCount:function(e){var t;if(typeof e=="number")t=e;else{var r=typeof e[0]!="number";t=r?e.length:e.length/3}return this.useNativeLine?(t-1)*2:(t-1)*2+2},getPolylineTriangleCount:function(e){var t;if(typeof e=="number")t=e;else{var r=typeof e[0]!="number";t=r?e.length:e.length/3}return this.useNativeLine?0:Math.max(t-1,0)*2},addCubicCurve:function(e,t,r,i,n,a){a==null&&(a=1);for(var s=e[0],o=e[1],l=e[2],u=t[0],h=t[1],c=t[2],d=r[0],f=r[1],v=r[2],p=i[0],m=i[1],g=i[2],T=this._getCubicCurveApproxStep(e,t,r,i),y=T*T,x=y*T,E=3*T,S=3*y,O=6*y,P=6*x,B=s-u*2+d,k=o-h*2+f,N=l-c*2+v,V=(u-d)*3-s+p,z=(h-f)*3-o+m,U=(c-v)*3-l+g,X=s,G=o,Y=l,H=(u-s)*E+B*S+V*x,le=(h-o)*E+k*S+z*x,j=(c-l)*E+N*S+U*x,ve=B*O+V*P,re=k*O+z*P,ue=N*O+U*P,he=V*P,Ce=z*P,Me=U*P,xe=0,Le=0,He=Math.ceil(1/T),Re=new Float32Array((He+1)*3),Re=[],Xe=0,Le=0;Le1&&(X=H>0?Math.min(X,p):Math.max(X,p),G=le>0?Math.min(G,m):Math.max(G,m),Y=j>0?Math.min(Y,g):Math.max(Y,g));return this.addPolyline(Re,n,a)},addLine:function(e,t,r,i){return this.addPolyline([e,t],r,i)},addPolyline:function(e,t,r,i,n){if(e.length){var a=typeof e[0]!="number";if(n==null&&(n=a?e.length:e.length/3),!(n<2)){i==null&&(i=0),r==null&&(r=1),this._itemVertexOffsets.push(this._vertexOffset);var a=typeof e[0]!="number",s=a?typeof t[0]!="number":t.length/4===n,o=this.attributes.position,l=this.attributes.positionPrev,u=this.attributes.positionNext,h=this.attributes.color,c=this.attributes.offset,d=this.indices,f=this._vertexOffset,v,p;r=Math.max(r,.01);for(var m=i;m1&&(o.copy(f,f-1),h.copy(f,f-1),f++):(m0&&(u.set(f-2,v),u.set(f-1,v)),o.set(f,v),o.set(f+1,v),h.set(f,p),h.set(f+1,p),c.set(f,r/2),c.set(f+1,-r/2),f+=2),this.useNativeLine)h.set(f,p),o.set(f,v),f++;else if(m>0){var y=this._triangleOffset*3,d=this.indices;d[y]=f-4,d[y+1]=f-3,d[y+2]=f-2,d[y+3]=f-3,d[y+4]=f-1,d[y+5]=f-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,E=this._vertexOffset+n*2;l.copy(x,x+2),l.copy(x+1,x+3),u.copy(E-1,E-3),u.copy(E-2,E-4)}return this._vertexOffset=f,this._vertexOffset}}},setItemColor:function(e,t){for(var r=this._itemVertexOffsets[e],i=es&&(n=this._x=0,a+=this._rowHeight+l,this._y=a,this._rowHeight=0),this._x+=t+l,this._rowHeight=Math.max(this._rowHeight,r),a+r+l>o)return null;e.x+=this.offsetX*this.dpr+n,e.y+=this.offsetY*this.dpr+a,this._zr.add(e);var u=[this.offsetX/this.width,this.offsetY/this.height],h=[[n/s+u[0],a/o+u[1]],[(n+t)/s+u[0],(a+r)/o+u[1]]];return h},_fitElement:function(e,t,r){var i=e.getBoundingRect(),n=t/i.width,a=r/i.height;e.x=-i.x*n,e.y=-i.y*a,e.scaleX=n,e.scaleY=a,e.update()}};function Di(e){e=e||{},e.width=e.width||512,e.height=e.height||512,e.devicePixelRatio=e.devicePixelRatio||1,e.gap=e.gap==null?2:e.gap;var t=document.createElement("canvas");t.width=e.width*e.devicePixelRatio,t.height=e.height*e.devicePixelRatio,this._canvas=t,this._texture=new Q({image:t,flipY:!1});var r=this;this._zr=ws(t);var i=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){i.call(this),r._texture.dirty(),r.onupdate&&r.onupdate()},this._dpr=e.devicePixelRatio,this._coords={},this.onupdate=e.onupdate,this._gap=e.gap,this._textureAtlasNodes=[new Gr(this._zr,0,0,e.width,e.height,this._gap,this._dpr)],this._nodeWidth=e.width,this._nodeHeight=e.height,this._currentNodeIdx=0}Di.prototype={clear:function(){for(var e=0;e=e)){var a=(i+this._nodeWidth)*this._dpr,s=(n+this._nodeHeight)*this._dpr;try{this._zr.resize({width:a,height:s})}catch{this._canvas.width=a,this._canvas.height=s}var o=new Gr(this._zr,i,n,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(o),o}},add:function(e,t,r){if(this._coords[e.id])return this._coords[e.id];var i=this._getCurrentNode().add(e,t,r);if(!i){var n=this._expand();if(!n)return;i=n.add(e,t,r)}return this._coords[e.id]=i,i},getCoordsScale:function(){var e=this._dpr;return[this._nodeWidth/this._canvas.width*e,this._nodeHeight/this._canvas.height*e]},getCoords:function(e){return this._coords[e]},dispose:function(){this._zr.dispose()}};function Oi(){}Oi.prototype={constructor:Oi,setScene:function(e){this._scene=e,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(e){this._lightRoot=e,this.mainLight=new M.DirectionalLight({shadowBias:.005}),this.ambientLight=new M.AmbientLight,e.add(this.mainLight),e.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(e){var t=this.mainLight,r=this.ambientLight,i=e.getModel("light"),n=i.getModel("main"),a=i.getModel("ambient");t.intensity=n.get("intensity"),r.intensity=a.get("intensity"),t.color=M.parseColor(n.get("color")).slice(0,3),r.color=M.parseColor(a.get("color")).slice(0,3);var s=n.get("alpha")||0,o=n.get("beta")||0;t.position.setArray(M.directionFromAlphaBeta(s,o)),t.lookAt(M.Vector3.ZERO),t.castShadow=n.get("shadow"),t.shadowResolution=M.getShadowResolution(n.get("shadowQuality"))},updateAmbientCubemap:function(e,t,r){var i=t.getModel("light.ambientCubemap"),n=i.get("texture");if(n){this._cubemapLightsCache=this._cubemapLightsCache||{};var a=this._cubemapLightsCache[n];if(!a){var s=this;a=this._cubemapLightsCache[n]=M.createAmbientCubemap(i.option,e,r,function(){s._isSkyboxFromAmbientCubemap&&s._skybox.setEnvironmentMap(a.specular.cubemap),r.getZr().refresh()})}this._lightRoot.add(a.diffuse),this._lightRoot.add(a.specular),this._currentCubemapLights=a}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(e,t,r){var i=t.get("environment"),n=this;function a(){return n._skybox=n._skybox||new mr,n._skybox}var s=a();if(i&&i!=="none")if(i==="auto")if(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights){var o=this._currentCubemapLights.specular.cubemap;s.setEnvironmentMap(o),this._scene&&s.attachScene(this._scene),s.material.set("lod",3)}else this._skybox&&this._skybox.detachScene();else if(typeof i=="object"&&i.colorStops||typeof i=="string"&&na(i)){this._isSkyboxFromAmbientCubemap=!1;var l=new M.Texture2D({anisotropic:8,flipY:!1});s.setEnvironmentMap(l);var u=l.image=document.createElement("canvas");u.width=u.height=16;var h=u.getContext("2d"),c=new aa({shape:{x:0,y:0,width:16,height:16},style:{fill:i}});Es(h,c),s.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;var l=M.loadTexture(i,r,{anisotropic:8,flipY:!1});s.setEnvironmentMap(l),s.attachScene(this._scene)}else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var d=t.coordinateSystem;if(this._skybox)if(d&&d.viewGL&&i!=="auto"&&!(i.match&&i.match(/.hdr$/))){var f=d.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[f]("fragment","SRGB_DECODE")}else this._skybox.material.undefine("fragment","SRGB_DECODE")}};var bt=Kr.vec3,Ra=ae.extend(function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new ae.Attribute("position","float",3,"POSITION"),normal:new ae.Attribute("normal","float",3,"NORMAL"),color:new ae.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(e){var t=this.attributes,r=this.getQuadVertexCount()*e,i=this.getQuadTriangleCount()*e;this.vertexCount!==r&&(t.position.init(r),t.normal.init(r),t.color.init(r)),this.triangleCount!==i&&(this.indices=r>65535?new Uint32Array(i*3):new Uint16Array(i*3))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:function(){var e=bt.create(),t=bt.create(),r=bt.create(),i=[0,3,1,3,2,1];return function(n,a){var s=this.attributes.position,o=this.attributes.normal,l=this.attributes.color;bt.sub(e,n[1],n[0]),bt.sub(t,n[2],n[1]),bt.cross(r,e,t),bt.normalize(r,r);for(var u=0;u<4;u++)s.set(this._vertexOffset+u,n[u]),l.set(this._vertexOffset+u,a),o.set(this._vertexOffset+u,r);for(var h=this._faceOffset*3,u=0;u<6;u++)this.indices[h+u]=i[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2}}()});xr(Ra.prototype,Ji);var Ii=Ve.firstNotNull,gu={x:0,y:2,z:1};function yu(e,t,r,i){var n=[0,0,0],a=i<0?r.getExtentMin():r.getExtentMax();n[gu[r.dim]]=a,e.position.setArray(n),e.rotation.identity(),t.distance=-Math.abs(a),t.normal.set(0,0,0),r.dim==="x"?(e.rotation.rotateY(i*Math.PI/2),t.normal.x=-i):r.dim==="z"?(e.rotation.rotateX(-i*Math.PI/2),t.normal.y=-i):(i>0&&e.rotation.rotateY(Math.PI),t.normal.z=-i)}function Jr(e,t,r){this.rootNode=new M.Node;var i=new M.Mesh({geometry:new Qr({useNativeLine:!1}),material:t,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),n=new M.Mesh({geometry:new Ra,material:r,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(n),this.rootNode.add(i),this.faceInfo=e,this.plane=new M.Plane,this.linesMesh=i,this.quadsMesh=n}Jr.prototype.update=function(e,t,r){var i=e.coordinateSystem,n=[i.getAxis(this.faceInfo[0]),i.getAxis(this.faceInfo[1])],a=this.linesMesh.geometry,s=this.quadsMesh.geometry;a.convertToDynamicArray(!0),s.convertToDynamicArray(!0),this._updateSplitLines(a,n,e,r),this._udpateSplitAreas(s,n,e,r),a.convertToTypedArray(),s.convertToTypedArray();var o=i.getAxis(this.faceInfo[2]);yu(this.rootNode,this.plane,o,this.faceInfo[3])};Jr.prototype._updateSplitLines=function(e,t,r,i){var n=i.getDevicePixelRatio();t.forEach(function(a,s){var o=a.model,l=t[1-s].getExtent();if(!a.scale.isBlank()){var u=o.getModel("splitLine",r.getModel("splitLine"));if(u.get("show")){var h=u.getModel("lineStyle"),c=h.get("color"),d=Ii(h.get("opacity"),1),f=Ii(h.get("width"),1);c=ur(c)?c:[c];for(var v=a.getTicksCoords({tickModel:u}),p=0,m=0;m65535?new Uint32Array(r*3):new Uint16Array(r*3))},setSpriteAlign:function(e,t,r,i,n){r==null&&(r="left"),i==null&&(i="top");var a,s,o,l;switch(n=n||0,r){case"left":a=n,o=t[0]+n;break;case"center":case"middle":a=-t[0]/2,o=t[0]/2;break;case"right":a=-t[0]-n,o=-n;break}switch(i){case"bottom":s=n,l=t[1]+n;break;case"middle":s=-t[1]/2,l=t[1]/2;break;case"top":s=-t[1]-n,l=-n;break}var u=e*4,h=this.attributes.offset;h.set(u,[a,l]),h.set(u+1,[o,l]),h.set(u+2,[o,s]),h.set(u+3,[a,s])},addSprite:function(e,t,r,i,n,a){var s=this._vertexOffset;this.setSprite(this._vertexOffset/4,e,t,r,i,n,a);for(var o=0;oi[1]?0:1,o=this._faces[r*2+s],l=this._faces[r*2+1-s];o.rootNode.invisible=!0,l.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var e=this._model.coordinateSystem,t=e.getAxis("x"),r=e.getAxis("y"),i=e.getAxis("z"),n=i.getExtentMax(),a=i.getExtentMin(),s=t.getExtentMin(),o=t.getExtentMax(),l=r.getExtentMax(),u=r.getExtentMin(),h=this._axes[0].rootNode,c=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,v=f[4].rootNode.invisible?u:l,p=f[2].rootNode.invisible?n:a,m=f[0].rootNode.invisible?s:o,g=f[2].rootNode.invisible?n:a,T=f[0].rootNode.invisible?o:s,y=f[4].rootNode.invisible?u:l;h.rotation.identity(),c.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,h.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,c.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),h.position.set(0,p,v),c.position.set(m,g,0),d.position.set(T,0,y),h.update(),c.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var e=this._control.getCamera(),t=[new M.Vector4,new M.Vector4],r=new M.Vector4;this.groupGL.getWorldPosition(r),r.w=1,r.transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix),r.x/=r.w,r.y/=r.w,this._axes.forEach(function(i){var n=i.axisLineCoords;i.labelsMesh.geometry;for(var a=0;ar.y?"bottom":"top"):(c="middle",h=l>r.x?"left":"right"),i.setSpriteAlign(h,c,this._api)},this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(e){var t=this._model.coordinateSystem,r=t.dataToPoint(e),i=this._axisPointerLineMesh,n=i.geometry,a=this._model.getModel("axisPointer"),s=this._api.getDevicePixelRatio();n.convertToDynamicArray(!0);function o(P){return Ve.firstNotNull(P.model.get("axisPointer.show"),a.get("show"))}function l(P){var B=P.model.getModel("axisPointer",a),k=B.getModel("lineStyle"),N=M.parseColor(k.get("color")),V=Wn(k.get("width"),1),z=Wn(k.get("opacity"),1);return N[3]*=z,{color:N,lineWidth:V}}for(var u=0;u4){console.warn("Support at most 4 cascade");continue}v.shadowCascade>1&&(d=v),this.renderDirectionalLightShadow(e,t,r,v,h,u,l)}else v.type==="SPOT_LIGHT"?this.renderSpotLightShadow(e,t,v,o,s):v.type==="POINT_LIGHT"&&this.renderPointLightShadow(e,t,v,c);this._shadowMapNumber[v.type]++}for(var p in this._shadowMapNumber)for(var m=this._shadowMapNumber[p],g=p+"_SHADOWMAP_COUNT",f=0;f0?y.define("fragment",g,m):y.isDefined("fragment",g)&&y.undefine("fragment",g))}for(var f=0;f0){var S=l.map(E);if(x.directionalLightShadowMaps={value:l,type:"tv"},x.directionalLightMatrices={value:u,type:"m4v"},x.directionalLightShadowMapSizes={value:S,type:"1fv"},d){var O=h.slice(),P=h.slice();O.pop(),P.shift(),O.reverse(),P.reverse(),u.reverse(),x.shadowCascadeClipsNear={value:O,type:"1fv"},x.shadowCascadeClipsFar={value:P,type:"1fv"}}}if(s.length>0){var B=s.map(E),x=t.shadowUniforms;x.spotLightShadowMaps={value:s,type:"tv"},x.spotLightMatrices={value:o,type:"m4v"},x.spotLightShadowMapSizes={value:B,type:"1fv"}}c.length>0&&(x.pointLightShadowMaps={value:c,type:"tv"})},renderDirectionalLightShadow:function(){var e=new Yr,t=new I,r=new Se,i=new I,n=new I,a=new I,s=new I;return function(o,l,u,h,c,d,f){var v=this._getDepthMaterial(h),p={getMaterial:function(ue){return ue.shadowDepthMaterial||v},isMaterialChanged:jn,getUniform:xi,ifRender:function(ue){return ue.castShadow},sortCompare:We.opaqueSortCompare};if(!l.viewBoundingBoxLastFrame.isFinite()){var m=l.getBoundingBox();l.viewBoundingBoxLastFrame.copy(m).applyTransform(u.viewMatrix)}var g=Math.min(-l.viewBoundingBoxLastFrame.min.z,u.far),T=Math.max(-l.viewBoundingBoxLastFrame.max.z,u.near),y=this._getDirectionalLightCamera(h,l,u),x=a.array;s.copy(y.projectionMatrix),C.invert(n.array,y.worldTransform.array),C.multiply(n.array,n.array,u.worldTransform.array),C.multiply(x,s.array,n.array);for(var E=[],S=u instanceof Te,O=(u.near+u.far)/(u.near-u.far),P=2*u.near*u.far/(u.near-u.far),B=0;B<=h.shadowCascade;B++){var k=T*Math.pow(g/T,B/h.shadowCascade),N=T+(g-T)*B/h.shadowCascade,V=k*h.cascadeSplitLogFactor+N*(1-h.cascadeSplitLogFactor);E.push(V),c.push(-(-V*O+P)/-V)}var z=this._getTexture(h,h.shadowCascade);f.push(z);var U=o.viewport,X=o.gl;this._frameBuffer.attach(z),this._frameBuffer.bind(o),X.clear(X.COLOR_BUFFER_BIT|X.DEPTH_BUFFER_BIT);for(var B=0;Bk?B>N?v[S>0?"px":"nx"]=!0:v[P>0?"pz":"nz"]=!0:k>N?v[O>0?"py":"ny"]=!0:v[P>0?"pz":"nz"]=!0}for(var x=0;x0){var t=this.outputs[e];t.keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e])}}}),qn=Pe.extend(function(){return{nodes:[]}},{dirty:function(){this._dirty=!0},addNode:function(e){this.nodes.indexOf(e)>=0||(this.nodes.push(e),this._dirty=!0)},removeNode:function(e){typeof e=="string"&&(e=this.getNodeByName(e));var t=this.nodes.indexOf(e);t>=0&&(this.nodes.splice(t,1),this._dirty=!0)},getNodeByName:function(e){for(var t=0;t=t.COLOR_ATTACHMENT0&&l<=t.COLOR_ATTACHMENT0+8&&h.push(l);u.drawBuffersEXT(h)}e.saveClear(),e.clearBit=b.DEPTH_BUFFER_BIT|b.COLOR_BUFFER_BIT,r=e.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),e.restoreClear(),i.unbind(e)}this.trigger("afterrender",r),this._rendering=!1,this._rendered=!0}}),Mu=yr.extend(function(){return{texture:null,outputs:{color:{}}}},function(){},{getOutput:function(e,t){return this.texture},beforeFrame:function(){},afterFrame:function(){}}),Pu=yr.extend(function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}},function(){var e=new De({fragment:this.shader});this.pass=e},{render:function(e,t){this.trigger("beforerender",e),this._rendering=!0;var r=e.gl;for(var i in this.inputLinks){var n=this.inputLinks[i],a=n.node.getOutput(e,n.pin);this.pass.setUniform(i,a)}if(!this.outputs)this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(e),this.pass.render(e,t);else{this.pass.outputs={};var s={};for(var o in this.outputs){var l=this.updateParameter(o,e);isNaN(l.width)&&this.updateParameter(o,e);var u=this.outputs[o],h=this._compositor.allocateTexture(l);this._outputTextures[o]=h;var c=u.attachment||r.COLOR_ATTACHMENT0;typeof c=="string"&&(c=r[c]),s[c]=h}this._compositor.getFrameBuffer().bind(e);for(var c in s)this._compositor.getFrameBuffer().attach(s[c],c);this.pass.render(e),this._compositor.getFrameBuffer().updateMipmap(e)}for(var i in this.inputLinks){var n=this.inputLinks[i];n.node.removeReference(n.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",e)},updateParameter:function(e,t){var r=this.outputs[e],i=r.parameters,n=r._parametersCopy;if(n||(n=r._parametersCopy={}),i)for(var a in i)a!=="width"&&a!=="height"&&(n[a]=i[a]);var s,o;return typeof i.width=="function"?s=i.width.call(this,t):s=i.width,typeof i.height=="function"?o=i.height.call(this,t):o=i.height,s=Math.ceil(s),o=Math.ceil(o),(n.width!==s||n.height!==o)&&this._outputTextures[e]&&this._outputTextures[e].dispose(t),n.width=s,n.height=o,n},setParameter:function(e,t){this.pass.setUniform(e,t)},getParameter:function(e){return this.pass.getUniform(e)},setParameters:function(e){for(var t in e)this.setParameter(t,e[t])},define:function(e,t){this.pass.material.define("fragment",e,t)},undefine:function(e){this.pass.material.undefine("fragment",e)},removeReference:function(e){if(this._outputReferences[e]--,this._outputReferences[e]===0){var t=this.outputs[e];t.keepLastFrame?(this._prevOutputTextures[e]&&this._compositor.releaseTexture(this._prevOutputTextures[e]),this._prevOutputTextures[e]=this._outputTextures[e]):this._compositor.releaseTexture(this._outputTextures[e])}},clear:function(){yr.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});const Ru="@export clay.compositor.coloradjust\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float exposure : 0.0;\nuniform float gamma : 1.0;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);\n color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n color = clamp( color * pow(2.0, exposure), 0.0, 1.0);\n color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);\n float luminance = dot( color, w );\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.brightness\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = tex.rgb + vec3(brightness);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.contrast\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float contrast : 1.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.exposure\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float exposure : 0.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb * pow(2.0, exposure);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.gamma\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float gamma : 1.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = pow(tex.rgb, vec3(gamma));\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.saturation\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb;\n float luminance = dot(color, w);\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end",Oa="@export clay.compositor.kernel.gaussian_9\nfloat gaussianKernel[9];\ngaussianKernel[0] = 0.07;\ngaussianKernel[1] = 0.09;\ngaussianKernel[2] = 0.12;\ngaussianKernel[3] = 0.14;\ngaussianKernel[4] = 0.16;\ngaussianKernel[5] = 0.14;\ngaussianKernel[6] = 0.12;\ngaussianKernel[7] = 0.09;\ngaussianKernel[8] = 0.07;\n@end\n@export clay.compositor.kernel.gaussian_13\nfloat gaussianKernel[13];\ngaussianKernel[0] = 0.02;\ngaussianKernel[1] = 0.03;\ngaussianKernel[2] = 0.06;\ngaussianKernel[3] = 0.08;\ngaussianKernel[4] = 0.11;\ngaussianKernel[5] = 0.13;\ngaussianKernel[6] = 0.14;\ngaussianKernel[7] = 0.13;\ngaussianKernel[8] = 0.11;\ngaussianKernel[9] = 0.08;\ngaussianKernel[10] = 0.06;\ngaussianKernel[11] = 0.03;\ngaussianKernel[12] = 0.02;\n@end\n@export clay.compositor.gaussian_blur\n#define SHADER_NAME gaussian_blur\nuniform sampler2D texture;varying vec2 v_Texcoord;\nuniform float blurSize : 2.0;\nuniform vec2 textureSize : [512.0, 512.0];\nuniform float blurDir : 0.0;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main (void)\n{\n @import clay.compositor.kernel.gaussian_9\n vec2 off = blurSize / textureSize;\n off *= vec2(1.0 - blurDir, blurDir);\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n for (int i = 0; i < 9; i++) {\n float w = gaussianKernel[i];\n vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));\n sum += texel * w;\n weightAll += w;\n }\n gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));\n}\n@end\n",Lu="@export clay.compositor.hdr.log_lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n float luminance = dot(tex.rgb, w);\n luminance = log(luminance + 0.001);\n gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));\n}\n@end\n@export clay.compositor.hdr.lum_adaption\nvarying vec2 v_Texcoord;\nuniform sampler2D adaptedLum;\nuniform sampler2D currentLum;\nuniform float frameTime : 0.02;\n@import clay.util.rgbm\nvoid main()\n{\n float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;\n float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);\n fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));\n gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));\n}\n@end\n@export clay.compositor.lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord );\n float luminance = dot(tex.rgb, w);\n gl_FragColor = vec4(vec3(luminance), 1.0);\n}\n@end",Ia="\n@export clay.compositor.lut\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform sampler2D lookup;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n float blueColor = tex.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec4 newColor1 = texture2D(lookup, texPos1);\n vec4 newColor2 = texture2D(lookup, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = vec4(newColor.rgb, tex.w);\n}\n@end",Nu="@export clay.compositor.vignette\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float darkness: 1;\nuniform float offset: 1;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = texel.rgb;\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);\n gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));\n}\n@end",Fa="@export clay.compositor.output\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = tex.rgb;\n#ifdef OUTPUT_ALPHA\n gl_FragColor.a = tex.a;\n#else\n gl_FragColor.a = 1.0;\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",Ba="@export clay.compositor.bright\nuniform sampler2D texture;\nuniform float threshold : 1;\nuniform float scale : 1.0;\nuniform vec2 textureSize: [512, 512];\nvarying vec2 v_Texcoord;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvec4 median(vec4 a, vec4 b, vec4 c)\n{\n return a + b + c - min(min(a, b), c) - max(max(a, b), c);\n}\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n#ifdef ANTI_FLICKER\n vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);\n vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));\n vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));\n vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));\n vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));\n texel = median(median(texel, s1, s2), s3, s4);\n#endif\n float lum = dot(texel.rgb , lumWeight);\n vec4 color;\n if (lum > threshold && texel.a > 0.0)\n {\n color = vec4(texel.rgb * scale, texel.a * scale);\n }\n else\n {\n color = vec4(0.0);\n }\n gl_FragColor = encodeHDR(color);\n}\n@end\n",Ua="@export clay.compositor.downsample\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nfloat brightness(vec3 c)\n{\n return max(max(c.r, c.g), c.b);\n}\n@import clay.util.clamp_sample\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n#ifdef ANTI_FLICKER\n vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;\n vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;\n vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;\n vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;\n float s1w = 1.0 / (brightness(s1) + 1.0);\n float s2w = 1.0 / (brightness(s2) + 1.0);\n float s3w = 1.0 / (brightness(s3) + 1.0);\n float s4w = 1.0 / (brightness(s4) + 1.0);\n float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);\n vec4 color = vec4(\n (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,\n 1.0\n );\n#else\n vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n color *= 0.25;\n#endif\n gl_FragColor = encodeHDR(color);\n}\n@end",Ha="\n@export clay.compositor.upsample\n#define HIGH_QUALITY\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n gl_FragColor = encodeHDR(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n gl_FragColor = encodeHDR(s / 4.0);\n#endif\n}\n@end",za="@export clay.compositor.hdr.composite\n#define TONEMAPPING\nuniform sampler2D texture;\n#ifdef BLOOM_ENABLED\nuniform sampler2D bloom;\n#endif\n#ifdef LENSFLARE_ENABLED\nuniform sampler2D lensflare;\nuniform sampler2D lensdirt;\n#endif\n#ifdef LUM_ENABLED\nuniform sampler2D lum;\n#endif\n#ifdef LUT_ENABLED\nuniform sampler2D lut;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float saturation : 1.0;\n#endif\n#ifdef VIGNETTE\nuniform float vignetteDarkness: 1.0;\nuniform float vignetteOffset: 1.0;\n#endif\nuniform float exposure : 1.0;\nuniform float bloomIntensity : 0.25;\nuniform float lensflareIntensity : 1;\nvarying vec2 v_Texcoord;\n@import clay.util.srgb\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nfloat eyeAdaption(float fLum)\n{\n return mix(0.2, fLum, 0.5);\n}\n#ifdef LUT_ENABLED\nvec3 lutTransform(vec3 color) {\n float blueColor = color.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec4 newColor1 = texture2D(lut, texPos1);\n vec4 newColor2 = texture2D(lut, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n return newColor.rgb;\n}\n#endif\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = vec4(0.0);\n vec4 originalTexel = vec4(0.0);\n#ifdef TEXTURE_ENABLED\n texel = decodeHDR(texture2D(texture, v_Texcoord));\n originalTexel = texel;\n#endif\n#ifdef BLOOM_ENABLED\n vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));\n texel.rgb += bloomTexel.rgb * bloomIntensity;\n texel.a += bloomTexel.a * bloomIntensity;\n#endif\n#ifdef LENSFLARE_ENABLED\n texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;\n#endif\n texel.a = min(texel.a, 1.0);\n#ifdef LUM_ENABLED\n float fLum = texture2D(lum, vec2(0.5, 0.5)).r;\n float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));\n float exposureBias = adaptedLumDest * exposure;\n#else\n float exposureBias = exposure;\n#endif\n#ifdef TONEMAPPING\n texel.rgb *= exposureBias;\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n texel = linearTosRGB(texel);\n#ifdef LUT_ENABLED\n texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));\n#endif\n#ifdef COLOR_CORRECTION\n texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);\n texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));\n texel.rgb = mix(vec3(lum), texel.rgb, saturation);\n#endif\n#ifdef VIGNETTE\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);\n texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\n#endif\n gl_FragColor = encodeHDR(texel);\n#ifdef DEBUG\n #if DEBUG == 1\n gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));\n #elif DEBUG == 2\n gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);\n #elif DEBUG == 3\n gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));\n #endif\n#endif\n if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {\n gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));\n }\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",Du="@export clay.compositor.lensflare\n#define SAMPLE_NUMBER 8\nuniform sampler2D texture;\nuniform sampler2D lenscolor;\nuniform vec2 textureSize : [512, 512];\nuniform float dispersal : 0.3;\nuniform float haloWidth : 0.4;\nuniform float distortion : 1.0;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvec4 textureDistorted(\n in vec2 texcoord,\n in vec2 direction,\n in vec3 distortion\n) {\n return vec4(\n decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,\n 1.0\n );\n}\nvoid main()\n{\n vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;\n vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;\n vec2 haloVec = normalize(ghostVec) * haloWidth;\n vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);\n vec4 result = vec4(0.0);\n for (int i = 0; i < SAMPLE_NUMBER; i++)\n {\n vec2 offset = fract(texcoord + ghostVec * float(i));\n float weight = length(vec2(0.5) - offset) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n }\n result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));\n float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n vec2 offset = fract(texcoord + haloVec);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n gl_FragColor = result;\n}\n@end",Ga="@export clay.compositor.blend\n#define SHADER_NAME blend\n#ifdef TEXTURE1_ENABLED\nuniform sampler2D texture1;\nuniform float weight1 : 1.0;\n#endif\n#ifdef TEXTURE2_ENABLED\nuniform sampler2D texture2;\nuniform float weight2 : 1.0;\n#endif\n#ifdef TEXTURE3_ENABLED\nuniform sampler2D texture3;\nuniform float weight3 : 1.0;\n#endif\n#ifdef TEXTURE4_ENABLED\nuniform sampler2D texture4;\nuniform float weight4 : 1.0;\n#endif\n#ifdef TEXTURE5_ENABLED\nuniform sampler2D texture5;\nuniform float weight5 : 1.0;\n#endif\n#ifdef TEXTURE6_ENABLED\nuniform sampler2D texture6;\nuniform float weight6 : 1.0;\n#endif\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = vec4(0.0);\n#ifdef TEXTURE1_ENABLED\n tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;\n#endif\n#ifdef TEXTURE2_ENABLED\n tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;\n#endif\n#ifdef TEXTURE3_ENABLED\n tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;\n#endif\n#ifdef TEXTURE4_ENABLED\n tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;\n#endif\n#ifdef TEXTURE5_ENABLED\n tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;\n#endif\n#ifdef TEXTURE6_ENABLED\n tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;\n#endif\n gl_FragColor = encodeHDR(tex);\n}\n@end",ka="@export clay.compositor.fxaa\nuniform sampler2D texture;\nuniform vec4 viewport : VIEWPORT;\nvarying vec2 v_Texcoord;\n#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\n@import clay.util.rgbm\nvoid main()\n{\n vec2 resolution = 1.0 / viewport.zw;\n vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;\n vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );\n vec3 rgbM = rgbaM.xyz;\n float opacity = rgbaM.w;\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float lumaNW = dot( rgbNW, luma );\n float lumaNE = dot( rgbNE, luma );\n float lumaSW = dot( rgbSW, luma );\n float lumaSE = dot( rgbSE, luma );\n float lumaM = dot( rgbM, luma );\n float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\n float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\n float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\n dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * resolution;\n vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA *= 0.5;\n vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;\n rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;\n rgbB *= 0.25;\n rgbB += rgbA * 0.5;\n float lumaB = dot( rgbB, luma );\n if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )\n {\n gl_FragColor = vec4( rgbA, opacity );\n }\n else {\n gl_FragColor = vec4( rgbB, opacity );\n }\n}\n@end";function Ou(e){e.import(Ru),e.import(Oa),e.import(Lu),e.import(Ia),e.import(Nu),e.import(Fa),e.import(Ba),e.import(Ua),e.import(Ha),e.import(za),e.import(Du),e.import(Ga),e.import(ka)}Ou(F);var Iu=/^#source\((.*?)\)/;function Fu(e,t){var r=new Au;t=t||{};var i={textures:{},parameters:{}},n=function(o,l){for(var u=0;u0;)r=r+i*(n%t),n=Math.floor(n/t),i=i/t;return r}const Vu="@export ecgl.ssao.estimate\n\nuniform sampler2D depthTex;\n\nuniform sampler2D normalTex;\n\nuniform sampler2D noiseTex;\n\nuniform vec2 depthTexSize;\n\nuniform vec2 noiseTexSize;\n\nuniform mat4 projection;\n\nuniform mat4 projectionInv;\n\nuniform mat4 viewInverseTranspose;\n\nuniform vec3 kernel[KERNEL_SIZE];\n\nuniform float radius : 1;\n\nuniform float power : 1;\n\nuniform float bias: 1e-2;\n\nuniform float intensity: 1.0;\n\nvarying vec2 v_Texcoord;\n\nfloat ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {\n float occlusion = 0.0;\n\n for (int i = 0; i < KERNEL_SIZE; i++) {\n vec3 samplePos = kernel[i];\n#ifdef NORMALTEX_ENABLED\n samplePos = kernelBasis * samplePos;\n#endif\n samplePos = samplePos * radius + originPos;\n\n vec4 texCoord = projection * vec4(samplePos, 1.0);\n texCoord.xy /= texCoord.w;\n\n vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);\n\n float sampleDepth = depthTexel.r * 2.0 - 1.0;\n if (projection[3][3] == 0.0) {\n sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);\n }\n else {\n sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];\n }\n \n float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));\n occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);\n }\n#ifdef NORMALTEX_ENABLED\n occlusion = 1.0 - occlusion / float(KERNEL_SIZE);\n#else\n occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);\n#endif\n return pow(occlusion, power);\n}\n\nvoid main()\n{\n\n vec4 depthTexel = texture2D(depthTex, v_Texcoord);\n\n#ifdef NORMALTEX_ENABLED\n vec4 tex = texture2D(normalTex, v_Texcoord);\n if (dot(tex.rgb, tex.rgb) == 0.0) {\n gl_FragColor = vec4(1.0);\n return;\n }\n vec3 N = tex.rgb * 2.0 - 1.0;\n N = (viewInverseTranspose * vec4(N, 0.0)).xyz;\n\n vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;\n vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;\n vec3 T = normalize(rvec - N * dot(rvec, N));\n vec3 BT = normalize(cross(N, T));\n mat3 kernelBasis = mat3(T, BT, N);\n#else\n if (depthTexel.r > 0.99999) {\n gl_FragColor = vec4(1.0);\n return;\n }\n mat3 kernelBasis;\n#endif\n\n float z = depthTexel.r * 2.0 - 1.0;\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * projectedPos;\n\n vec3 position = p4.xyz / p4.w;\n\n float ao = ssaoEstimator(position, kernelBasis);\n ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);\n gl_FragColor = vec4(vec3(ao), 1.0);\n}\n\n@end\n\n\n@export ecgl.ssao.blur\n#define SHADER_NAME SSAO_BLUR\n\nuniform sampler2D ssaoTexture;\n\n#ifdef NORMALTEX_ENABLED\nuniform sampler2D normalTex;\n#endif\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\nuniform int direction: 0.0;\n\n#ifdef DEPTHTEX_ENABLED\nuniform sampler2D depthTex;\nuniform mat4 projection;\nuniform float depthRange : 0.5;\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n#endif\n\nvoid main()\n{\n float kernel[5];\n kernel[0] = 0.122581;\n kernel[1] = 0.233062;\n kernel[2] = 0.288713;\n kernel[3] = 0.233062;\n kernel[4] = 0.122581;\n\n vec2 off = vec2(0.0);\n if (direction == 0) {\n off[0] = blurSize / textureSize.x;\n }\n else {\n off[1] = blurSize / textureSize.y;\n }\n\n vec2 coord = v_Texcoord;\n\n float sum = 0.0;\n float weightAll = 0.0;\n\n#ifdef NORMALTEX_ENABLED\n vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;\n#endif\n#if defined(DEPTHTEX_ENABLED)\n float centerDepth = getLinearDepth(v_Texcoord);\n#endif\n\n for (int i = 0; i < 5; i++) {\n vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));\n\n float w = kernel[i];\n#ifdef NORMALTEX_ENABLED\n vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;\n w *= clamp(dot(normal, centerNormal), 0.0, 1.0);\n#endif\n#ifdef DEPTHTEX_ENABLED\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));\n#endif\n\n weightAll += w;\n sum += texture2D(ssaoTexture, coord).r * w;\n }\n\n gl_FragColor = vec4(vec3(sum / weightAll), 1.0);\n}\n\n@end\n";F.import(Vu);function Wa(e){for(var t=new Uint8Array(e*e*4),r=0,i=new w,n=0;n=1?.95:0,weight2:i>=1?.05:1}),f.render(e)),u.attach(o),c.setUniform("texture",this._physicallyCorrect?this._currentTexture:s),c.render(e),u.attach(l),d.setUniform("texture",o),d.render(e),u.unbind(e),this._physicallyCorrect){var g=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=g}};mt.prototype.getTargetTexture=function(){return this._texture3};mt.prototype.setParameter=function(e,t){e==="maxIteration"?this._ssrPass.material.define("fragment","MAX_ITERATION",t):this._ssrPass.setUniform(e,t)};mt.prototype.setPhysicallyCorrect=function(e){e?(this._normalDistribution||(this._normalDistribution=it.generateNormalDistribution(64,this._totalSamples)),this._ssrPass.material.define("fragment","PHYSICALLY_CORRECT"),this._ssrPass.material.set("normalDistribution",this._normalDistribution),this._ssrPass.material.set("normalDistributionSize",[64,this._totalSamples])):this._ssrPass.material.undefine("fragment","PHYSICALLY_CORRECT"),this._physicallyCorrect=e};mt.prototype.setSSAOTexture=function(e){var t=this._blurPass2;e?(t.material.enableTexture("ssaoTex"),t.material.set("ssaoTex",e)):t.material.disableTexture("ssaoTex")};mt.prototype.isFinished=function(e){return this._physicallyCorrect?e>this._totalSamples/this._samplePerFrame:!0};mt.prototype.dispose=function(e){this._ssrTexture.dispose(e),this._texture2.dispose(e),this._texture3.dispose(e),this._prevTexture.dispose(e),this._currentTexture.dispose(e),this._frameBuffer.dispose(e)};const Zn=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925],ju="@export ecgl.normal.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\n@import ecgl.common.normalMap.vertexHeader\n\n@import ecgl.common.vertexAnimation.header\n\nvoid main()\n{\n\n @import ecgl.common.vertexAnimation.main\n\n @import ecgl.common.uv.main\n\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n @import ecgl.common.normalMap.vertexMain\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n}\n\n\n@end\n\n\n@export ecgl.normal.fragment\n\n#define ROUGHNESS_CHANEL 0\n\nuniform bool useBumpMap;\nuniform bool useRoughnessMap;\nuniform bool doubleSide;\nuniform float roughness;\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n@import ecgl.common.normalMap.fragmentHeader\n@import ecgl.common.bumpMap.header\n\nuniform sampler2D roughnessMap;\n\nvoid main()\n{\n vec3 N = v_Normal;\n \n bool flipNormal = false;\n if (doubleSide) {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n flipNormal = true;\n }\n }\n\n @import ecgl.common.normalMap.fragmentMain\n\n if (useBumpMap) {\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n }\n\n float g = 1.0 - roughness;\n\n if (useRoughnessMap) {\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n }\n\n if (flipNormal) {\n N = -N;\n }\n\n gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;\n gl_FragColor.a = g;\n}\n@end";F.import(ju);function Ti(e,t,r,i,n){var a=e.gl;t.setUniform(a,"1i",r,n),a.activeTexture(a.TEXTURE0+n),i.isRenderable()?i.bind(e):i.unbind(e)}function qu(e,t,r,i,n){var a,s,o,l,u=e.gl;return function(h,c,d){if(!(l&&l.material===h.material)){var f=h.material,v=h.__program,p=f.get("roughness");p==null&&(p=1);var m=f.get("normalMap")||t,g=f.get("roughnessMap"),T=f.get("bumpMap"),y=f.get("uvRepeat"),x=f.get("uvOffset"),E=f.get("detailUvRepeat"),S=f.get("detailUvOffset"),O=!!T&&f.isTextureEnabled("bumpMap"),P=!!g&&f.isTextureEnabled("roughnessMap"),B=f.isDefined("fragment","DOUBLE_SIDED");T=T||r,g=g||i,d!==c?(c.set("normalMap",m),c.set("bumpMap",T),c.set("roughnessMap",g),c.set("useBumpMap",O),c.set("useRoughnessMap",P),c.set("doubleSide",B),y!=null&&c.set("uvRepeat",y),x!=null&&c.set("uvOffset",x),E!=null&&c.set("detailUvRepeat",E),S!=null&&c.set("detailUvOffset",S),c.set("roughness",p)):(v.setUniform(u,"1f","roughness",p),a!==m&&Ti(e,v,"normalMap",m,0),s!==T&&T&&Ti(e,v,"bumpMap",T,1),o!==g&&g&&Ti(e,v,"roughnessMap",g,2),y!=null&&v.setUniform(u,"2f","uvRepeat",y),x!=null&&v.setUniform(u,"2f","uvOffset",x),E!=null&&v.setUniform(u,"2f","detailUvRepeat",E),S!=null&&v.setUniform(u,"2f","detailUvOffset",S),v.setUniform(u,"1i","useBumpMap",+O),v.setUniform(u,"1i","useRoughnessMap",+P),v.setUniform(u,"1i","doubleSide",+B)),a=m,s=T,o=g,l=h}}}function Jt(e){this._depthTex=new Q({format:L.DEPTH_COMPONENT,type:L.UNSIGNED_INT}),this._normalTex=new Q({type:L.HALF_FLOAT}),this._framebuffer=new ye,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,ye.DEPTH_ATTACHMENT),this._normalMaterial=new vt({shader:new F(F.source("ecgl.normal.vertex"),F.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=rt.createBlank("#000"),this._defaultBumpMap=rt.createBlank("#000"),this._defaultRoughessMap=rt.createBlank("#000"),this._debugPass=new De({fragment:F.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}Jt.prototype.getDepthTexture=function(){return this._depthTex};Jt.prototype.getNormalTexture=function(){return this._normalTex};Jt.prototype.update=function(e,t,r){var i=e.getWidth(),n=e.getHeight(),a=this._depthTex,s=this._normalTex,o=this._normalMaterial;a.width=i,a.height=n,s.width=i,s.height=n;var l=t.getRenderList(r).opaque;this._framebuffer.bind(e),e.gl.clearColor(0,0,0,0),e.gl.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.gl.disable(e.gl.BLEND),e.renderPass(l,r,{getMaterial:function(){return o},ifRender:function(u){return u.renderNormal},beforeRender:qu(e,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:e.opaqueSortCompare}),this._framebuffer.unbind(e)};Jt.prototype.renderDebug=function(e){this._debugPass.render(e)};Jt.prototype.dispose=function(e){this._depthTex.dispose(e),this._normalTex.dispose(e)};function wr(e){e=e||{},this._edgePass=new De({fragment:F.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",e.normalTexture),this._edgePass.setUniform("depthTexture",e.depthTexture),this._targetTexture=new Q({type:L.HALF_FLOAT}),this._frameBuffer=new ye,this._frameBuffer.attach(this._targetTexture)}wr.prototype.update=function(e,t,r,i){var n=e.getWidth(),a=e.getHeight(),s=this._targetTexture;s.width=n,s.height=a;var o=this._frameBuffer;o.bind(e),this._edgePass.setUniform("projectionInv",t.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[n,a]),this._edgePass.setUniform("texture",r),this._edgePass.render(e),o.unbind(e)};wr.prototype.getTargetTexture=function(){return this._targetTexture};wr.prototype.setParameter=function(e,t){this._edgePass.setUniform(e,t)};wr.prototype.dispose=function(e){this._targetTexture.dispose(e),this._frameBuffer.dispose(e)};const Yu={nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]},Zu="@export ecgl.dof.coc\n\nuniform sampler2D depth;\n\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\n\nuniform float focalDistance: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\n\nvarying vec2 v_Texcoord;\n\n@import clay.util.encode_float\n\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n\n float aperture = focalLength / fstop;\n\n float coc;\n\n float uppper = focalDistance + focalRange;\n float lower = focalDistance - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 2.0) / 2.00001;\n\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n\n gl_FragColor = encodeFloat(coc);\n}\n@end\n\n\n@export ecgl.dof.composite\n\n#define DEBUG 0\n\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n\n@import clay.util.rgbm\n@import clay.util.float\n\nvoid main()\n{\n vec4 blurredColor = texture2D(blurred, v_Texcoord);\n vec4 originalColor = texture2D(original, v_Texcoord);\n\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n\n fCoc = abs(fCoc * 2.0 - 1.0);\n\n float weight = smoothstep(0.0, 1.0, fCoc);\n \n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\n\n gl_FragColor = encodeHDR(\n mix(\n nearfieldColor, mix(originalColor, blurredColor, weight),\n pow(1.0 - fNearCoc, 4.0)\n )\n );\n#else\n gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));\n#endif\n\n}\n\n@end\n\n\n\n@export ecgl.dof.diskBlur\n\n#define POISSON_KERNEL_SIZE 16;\n\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n\nuniform float blurRadius : 10.0;\nuniform vec2 textureSize : [512.0, 512.0];\n\nuniform vec2 poissonKernel[POISSON_KERNEL_SIZE];\n\nuniform float percent;\n\nfloat nrand(const in vec2 n) {\n return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n@import clay.util.rgbm\n@import clay.util.float\n\n\nvoid main()\n{\n vec2 offset = blurRadius / textureSize;\n\n float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );\n float cosa = cos(rnd);\n float sina = sin(rnd);\n vec4 basis = vec4(cosa, -sina, sina, cosa);\n\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n\n\n float weightSum = 0.0;\n\n for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {\n vec2 ofs = poissonKernel[i];\n\n ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\n\n vec2 uv = v_Texcoord + ofs * offset;\n vec4 texel = texture2D(texture, uv);\n\n float w = 1.0;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texel) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n texel = texel;\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n texel.rgb *= texel.a;\n color += texel * w;\n#endif\n\n weightSum += w;\n }\n\n#ifdef BLUR_COC\n gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n color /= weightSum;\n color.rgb /= (color.a + 0.0001);\n gl_FragColor = color;\n#endif\n}\n\n@end",$u="@export ecgl.edge\n\nuniform sampler2D texture;\n\nuniform sampler2D normalTexture;\nuniform sampler2D depthTexture;\n\nuniform mat4 projectionInv;\n\nuniform vec2 textureSize;\n\nuniform vec4 edgeColor: [0,0,0,0.8];\n\nvarying vec2 v_Texcoord;\n\nvec3 packColor(vec2 coord) {\n float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;\n vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * p;\n\n return vec3(\n texture2D(normalTexture, coord).rg,\n -p4.z / p4.w / 5.0\n );\n}\n\nvoid main() {\n vec2 cc = v_Texcoord;\n vec3 center = packColor(cc);\n\n float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;\n float dx = size / textureSize.x;\n float dy = size / textureSize.y;\n\n vec2 coord;\n vec3 topLeft = packColor(cc+vec2(-dx, -dy));\n vec3 top = packColor(cc+vec2(0.0, -dy));\n vec3 topRight = packColor(cc+vec2(dx, -dy));\n vec3 left = packColor(cc+vec2(-dx, 0.0));\n vec3 right = packColor(cc+vec2(dx, 0.0));\n vec3 bottomLeft = packColor(cc+vec2(-dx, dy));\n vec3 bottom = packColor(cc+vec2(0.0, dy));\n vec3 bottomRight = packColor(cc+vec2(dx, dy));\n\n vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;\n vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;\n\n float edge = sqrt(dot(h, h) + dot(v, v));\n\n edge = smoothstep(0.8, 1.0, edge);\n\n gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);\n}\n@end";F.import(Oa);F.import(Ia);F.import(Fa);F.import(Ba);F.import(Ua);F.import(Ha);F.import(za);F.import(Ga);F.import(ka);F.import(Zu);F.import($u);function Xa(e,t){return{color:{parameters:{width:e,height:t}}}}var rn=["composite","FXAA"];function Z(){this._width,this._height,this._dpr,this._sourceTexture=new Q({type:L.HALF_FLOAT}),this._depthTexture=new Q({format:L.DEPTH_COMPONENT,type:L.UNSIGNED_INT}),this._framebuffer=new ye,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,ye.DEPTH_ATTACHMENT),this._normalPass=new Jt,this._compositor=Fu(Yu);var e=this._compositor.getNodeByName("source");e.texture=this._sourceTexture;var t=this._compositor.getNodeByName("coc");this._sourceNode=e,this._cocNode=t,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map(function(i){return this._compositor.getNodeByName(i)},this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=rn.map(function(i){return this._compositor.getNodeByName(i)},this);var r={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new pt(r),this._ssrPass=new mt(r),this._edgePass=new wr(r)}Z.prototype.resize=function(i,n,r){r=r||1;var i=i*r,n=n*r,a=this._sourceTexture,s=this._depthTexture;a.width=i,a.height=n,s.width=i,s.height=n;var o={getWidth:function(){return i},getHeight:function(){return n},getDevicePixelRatio:function(){return r}};function l(u,h){if(typeof u[h]=="function"){var c=u[h].__original||u[h];u[h]=function(d){return c.call(this,o)},u[h].__original=c}}this._compositor.nodes.forEach(function(u){for(var h in u.outputs){var c=u.outputs[h].parameters;c&&(l(c,"width"),l(c,"height"))}for(var d in u.parameters)l(u.parameters,d)}),this._width=i,this._height=n,this._dpr=r};Z.prototype.getWidth=function(){return this._width};Z.prototype.getHeight=function(){return this._height};Z.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR};Z.prototype._getPrevNode=function(e){for(var t=rn.indexOf(e.name)-1,r=this._finalNodesChain[t];r&&!this._compositor.getNodeByName(r.name);)t-=1,r=this._finalNodesChain[t];return r};Z.prototype._getNextNode=function(e){for(var t=rn.indexOf(e.name)+1,r=this._finalNodesChain[t];r&&!this._compositor.getNodeByName(r.name);)t+=1,r=this._finalNodesChain[t];return r};Z.prototype._addChainNode=function(e){var t=this._getPrevNode(e),r=this._getNextNode(e);t&&(e.inputs.texture=t.name,r?(e.outputs=Xa(this.getWidth.bind(this),this.getHeight.bind(this)),r.inputs.texture=e.name):e.outputs=null,this._compositor.addNode(e))};Z.prototype._removeChainNode=function(e){var t=this._getPrevNode(e),r=this._getNextNode(e);t&&(r?(t.outputs=Xa(this.getWidth.bind(this),this.getHeight.bind(this)),r.inputs.texture=t.name):t.outputs=null,this._compositor.removeNode(e))};Z.prototype.updateNormal=function(e,t,r,i){this._ifRenderNormalPass()&&this._normalPass.update(e,t,r)};Z.prototype.updateSSAO=function(e,t,r,i){this._ssaoPass.update(e,r,i)};Z.prototype.enableSSAO=function(){this._enableSSAO=!0};Z.prototype.disableSSAO=function(){this._enableSSAO=!1};Z.prototype.enableSSR=function(){this._enableSSR=!0};Z.prototype.disableSSR=function(){this._enableSSR=!1};Z.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()};Z.prototype.getSourceFrameBuffer=function(){return this._framebuffer};Z.prototype.getSourceTexture=function(){return this._sourceTexture};Z.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)};Z.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)};Z.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()};Z.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()};Z.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()};Z.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()};Z.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0};Z.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1};Z.prototype.enableEdge=function(){this._enableEdge=!0};Z.prototype.disableEdge=function(){this._enableEdge=!1};Z.prototype.setBloomIntensity=function(e){this._compositeNode.setParameter("bloomIntensity",e)};Z.prototype.setSSAOParameter=function(e,t){switch(e){case"quality":var r={low:6,medium:12,high:32,ultra:62}[t]||12;this._ssaoPass.setParameter("kernelSize",r);break;case"radius":this._ssaoPass.setParameter(e,t),this._ssaoPass.setParameter("bias",t/200);break;case"intensity":this._ssaoPass.setParameter(e,t);break}};Z.prototype.setDOFParameter=function(e,t){switch(e){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(e,t);break;case"blurRadius":for(var r=0;r=this._haltonSequence.length},render:function(e,t,r){var i=this._blendPass;this._frame===0?(i.setUniform("weight1",0),i.setUniform("weight2",1)):(i.setUniform("weight1",.9),i.setUniform("weight2",.1)),i.setUniform("texture1",this._prevFrameTex),i.setUniform("texture2",t||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(e),i.render(e),this._blendFb.unbind(e),r||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(e));var n=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=n,this._frame++},dispose:function(e){this._sourceFb.dispose(e),this._blendFb.dispose(e),this._prevFrameTex.dispose(e),this._outputTex.dispose(e),this._sourceTex.dispose(e),this._outputPass.dispose(e),this._blendPass.dispose(e)}};function fe(e){e=e||"perspective",this.layer=null,this.scene=new xt,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(e),this._compositor=new Z,this._temporalSS=new Fi,this._shadowMapPass=new Qe;for(var t=[],r=0,i=0;i<30;i++){for(var n=[],a=0;a<6;a++)n.push(Qt(r,2)*4-2),n.push(Qt(r,3)*4-2),r++;t.push(n)}this._pcfKernels=t,this.scene.on("beforerender",function(s,o,l){this.needsTemporalSS()&&this._temporalSS.jitterProjection(s,l)},this)}fe.prototype.setProjection=function(e){var t=this.camera;t&&t.update(),e==="perspective"?this.camera instanceof Te||(this.camera=new Te,t&&this.camera.setLocalTransform(t.localTransform)):this.camera instanceof _r||(this.camera=new _r,t&&this.camera.setLocalTransform(t.localTransform)),this.camera.near=.1,this.camera.far=2e3};fe.prototype.setViewport=function(e,t,r,i,n){this.camera instanceof Te&&(this.camera.aspect=r/i),n=n||1,this.viewport.x=e,this.viewport.y=t,this.viewport.width=r,this.viewport.height=i,this.viewport.devicePixelRatio=n,this._compositor.resize(r*n,i*n),this._temporalSS.resize(r*n,i*n)};fe.prototype.containPoint=function(e,t){var r=this.viewport,i=this.layer.renderer.getHeight();return t=i-t,e>=r.x&&t>=r.y&&e<=r.x+r.width&&t<=r.y+r.height};var $n=new q;fe.prototype.castRay=function(e,t,r){var i=this.layer.renderer,n=i.viewport;return i.viewport=this.viewport,i.screenToNDC(e,t,$n),this.camera.castRay($n,r),i.viewport=n,r};fe.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var e=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var t=0;t30};fe.prototype._doRender=function(e,t,r){var i=this.scene,n=this.camera;r=r||0,this._updateTransparent(e,i,n,r),t||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(e,i,n,!0)),this._updateShadowPCFKernel(r);var a=e.clearColor;if(e.gl.clearColor(a[0],a[1],a[2],a[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(e,n),this._compositor.updateNormal(e,i,n,this._temporalSS.getFrame())),this._updateSSAO(e,i,n,this._temporalSS.getFrame()),this._enablePostEffect){var s=this._compositor.getSourceFrameBuffer();s.bind(e),e.gl.clear(e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT),e.render(i,n,!0,!0),s.unbind(e),this.needsTemporalSS()&&t?(this._compositor.composite(e,i,n,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),e.setViewport(this.viewport),this._temporalSS.render(e)):(e.setViewport(this.viewport),this._compositor.composite(e,i,n,null,0))}else if(this.needsTemporalSS()&&t){var s=this._temporalSS.getSourceFrameBuffer();s.bind(e),e.saveClear(),e.clearBit=e.gl.DEPTH_BUFFER_BIT|e.gl.COLOR_BUFFER_BIT,e.render(i,n,!0,!0),e.restoreClear(),s.unbind(e),e.setViewport(this.viewport),this._temporalSS.render(e)}else e.setViewport(this.viewport),e.render(i,n,!0,!0)};fe.prototype._updateTransparent=function(e,t,r,i){for(var n=new w,a=new I,s=r.getWorldPosition(),o=t.getRenderList(r).transparent,l=0;lthis.camera.far||el&&o.push({pivot:Math.floor((u+l)/2),left:l,right:u});var l=a[s].pivot+1,u=a[s].right;u>l&&o.push({pivot:Math.floor((u+l)/2),left:l,right:u})}a=this._parts=o}else for(var s=0;s=2e4},doSortTriangles:function(e,t){var r=this.indices;if(t===0){var i=this.attributes.position,e=e.array;(!this._triangleZList||this._triangleZList.length!==this.triangleCount)&&(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new r.constructor(r.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var n=0,a,s=0;s"+d.join("
")}var n=e.getData(),a=e.getRawValue(t),s=ur(a)?i(a):br(sn(a)),o=n.getName(t),l=Bi(n,t);Ns(l)&&l.colorStops&&(l=(l.colorStops[0]||{}).color),l=l||"transparent";var u=Ds(l),h=e.name;return h==="\0-"&&(h=""),h=h?br(h)+"
":"",h+u+(o?br(o)+": "+s:s)}function ch(e,t,r){r=r||e.getSource();var i=t||Is(e.get("coordinateSystem"))||["x","y","z"],n=Fs(r,{dimensionsDefine:r.dimensionsDefine||e.get("dimensions"),encodeDefine:r.encodeDefine||e.get("encode"),coordDimensions:i.map(function(o){var l=e.getReferringComponents(o+"Axis3D").models[0];return{type:l&&l.get("type")==="category"?"ordinal":"float",name:o}})});e.get("coordinateSystem")==="cartesian3D"&&n.forEach(function(o){if(i.indexOf(o.coordDim)>=0){var l=e.getReferringComponents(o.coordDim+"Axis3D").models[0];l&&l.get("type")==="category"&&(o.ordinalMeta=l.getOrdinalMeta())}});var a=Bs.enableDataStack(e,n,{byIndex:!0,stackedCoordDimension:"z"}),s=new Us(n,e);return s.setCalculationInfo(a),s.initData(r),s}var $a=Hs.extend({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",formatTooltip:function(e){return hh(this,e)},getInitialData:function(e,t){var r=e.data;function i(Y){return!(isNaN(Y.min)||isNaN(Y.max)||isNaN(Y.step))}function n(Y){var H=oa;return Math.max(H(Y.min),H(Y.max),H(Y.step))+1}if(!r)if(e.parametric){var x=e.parametricEquation||{},E=x.u||{},S=x.v||{};["u","v"].forEach(function(H){i(x[H])}),["x","y","z"].forEach(function(H){x[H]});var O=Math.floor((E.max+E.step-E.min)/E.step),P=Math.floor((S.max+S.step-S.min)/S.step);r=new Float32Array(O*P*5);for(var B=n(E),k=n(S),d=0,f=0;f0;this._updateSurfaceMesh(this._surfaceMesh,e,h,f);var v=this._surfaceMesh.material;f?(v.define("WIREFRAME_QUAD"),v.set("wireframeLineWidth",d),v.set("wireframeLineColor",M.parseColor(c.get("lineStyle.color")))):v.undefine("WIREFRAME_QUAD"),this._initHandler(e,r),this._updateAnimation(e)},_updateAnimation:function(e){M.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,e)},_createSurfaceMesh:function(){var e=new M.Mesh({geometry:new M.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new M.Material({shader:new M.Shader(M.Shader.source("ecgl.sm.depth.vertex"),M.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return e.geometry.createAttribute("barycentric","float",4),e.geometry.createAttribute("prevPosition","float",3),e.geometry.createAttribute("prevNormal","float",3),Object.assign(e.geometry,lh),e},_initHandler:function(e,t){var r=e.getData(),i=this._surfaceMesh,n=e.coordinateSystem;function a(o,l){for(var u=1/0,h=-1,c=[],d=0;d=0){var u=[];i.geometry.attributes.position.get(l,u);for(var h=n.pointToData(u),c=1/0,d=-1,f=[],v=0;v65535?Uint32Array:Uint16Array)((v-1)*(p-1)*6),S=function($e,It,st){st[1]=$e*p+It,st[0]=$e*p+It+1,st[3]=($e+1)*p+It+1,st[2]=($e+1)*p+It},O=!1;if(l){var P=[],B=[],k=0;g?h.init(n.vertexCount):h.value=null;for(var N=[[],[],[]],V=[],z=[],U=Mt.create(),X=function($e,It,st){var ei=It*3;return st[0]=$e[ei],st[1]=$e[ei+1],st[2]=$e[ei+2],st},G=new Float32Array(s.length),Y=new Float32Array(s.length/3*4),H=0;H0;){if(Math.floor(o/h)===o/h)return[h,o/h];h--}return h=Math.floor(Math.sqrt(o)),[h,h]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});function vh(e){e.registerChartView(dh),e.registerSeriesModel($a),e.registerLayout(function(t,r){t.eachSeriesByType("surface",function(i){var n=i.coordinateSystem;!n||n.type;var a=i.getData(),s=new Float32Array(3*a.count()),o=[NaN,NaN,NaN];if(n&&n.type==="cartesian3D"){var l=n.dimensions,u=l.map(function(h){return i.coordDimToDataDim(h)[0]});a.each(u,function(h,c,d,f){var v;a.hasValue(f)?v=n.dataToPoint([h,c,d]):v=o,s[f*3]=v[0],s[f*3+1]=v[1],s[f*3+2]=v[2]})}a.setLayout("points",s)})})}var ph=Object.defineProperty,mh=Object.getOwnPropertyDescriptor,Tt=(e,t,r,i)=>{for(var n=i>1?void 0:i?mh(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(n=(i?s(t,r,n):s(n))||n);return i&&n&&ph(t,r,n),n};Gs([ks,Vs,sh,vh]);let nt=class extends ct(ft,dr,rs){get chart(){var e,t;return(t=(e=this.heightmap)==null?void 0:e.chart)!=null?t:null}get chartOptions(){return{tooltip:{backgroundColor:this.bgColor(.9),borderWidth:0,textStyle:{color:this.fgColor(1),fontSize:"14px"},padding:15,formatter:this.tooltipFormatter},darkMode:this.$vuetify.theme.dark,animation:!1,legend:{show:!1,selected:this.selected},visualMap:{show:!0,min:this.visualMapRange[0],max:this.visualMapRange[1],calculable:!0,dimension:2,inRange:{color:this.colorMap},seriesIndex:this.visualMapSeriesIndex,left:this.isMobile?10:30,top:20,bottom:0,itemWidth:this.isMobile?10:30,itemHeight:550,precision:3,textStyle:{color:this.fgColorHi,fontSize:14}},xAxis3D:{type:"value",nameTextStyle:{color:this.fgColorMid},min:this.rangeX[0],max:this.rangeX[1],minInterval:1},yAxis3D:{type:"value",nameTextStyle:{color:this.fgColorMid},min:this.rangeY[0],max:this.rangeY[1]},zAxis3D:{type:"value",min:this.scaleZMax*-1,max:this.scaleZMax,nameTextStyle:{color:this.fgColorMid},axisPointer:{label:{formatter:function(e){return e=parseFloat(e),e.toFixed(2)}}}},grid3D:{axisLabel:{textStyle:{color:this.fgColorMid}},axisLine:{lineStyle:{color:this.fgColorLow}},axisTick:{lineStyle:{color:this.fgColorLow}},splitLine:{lineStyle:{color:this.fgColorLow}},axisPointer:{lineStyle:{color:this.fgColorHi},label:{textStyle:{color:this.fgColorHi}}},boxWidth:100*this.scaleX,boxDepth:100*this.scaleY,viewControl:{distance:200,...this.defaultOrientation}},series:this.series}}get selected(){return{probed:this.showProbed,mesh:this.showMesh,flat:this.showFlat}}get series(){const e=[];return this.bed_mesh&&(e.push(this.seriesProbed),e.push(this.seriesMesh),e.push(this.seriesFlat)),e}get seriesProbed(){const e={type:"surface",name:"probed",data:[],itemStyle:{opacity:1},wireframe:{show:this.wireframe}};if(this.bed_mesh){const t=this.bed_mesh.probed_matrix[0].length,r=this.bed_mesh.probed_matrix.length,i=this.bed_mesh.mesh_min[0],n=this.bed_mesh.mesh_max[0],a=this.bed_mesh.mesh_min[1],s=this.bed_mesh.mesh_max[1],o=(n-i)/(t-1),l=(s-a)/(r-1),u=[];let h=0;this.bed_mesh.probed_matrix.forEach(c=>{let d=0;c.forEach(f=>{u.push([i+o*d,a+l*h,f]),d++}),h++}),e.data=u,e.dataShape=[r,t]}return e}get seriesMesh(){const e={type:"surface",name:"mesh",data:[],itemStyle:{opacity:1},wireframe:{show:this.wireframe}};if(this.bed_mesh){const t=this.bed_mesh.mesh_matrix[0].length,r=this.bed_mesh.mesh_matrix.length,i=this.bed_mesh.mesh_min[0],n=this.bed_mesh.mesh_max[0],a=this.bed_mesh.mesh_min[1],s=this.bed_mesh.mesh_max[1],o=(n-i)/(t-1),l=(s-a)/(r-1),u=[];let h=0;this.bed_mesh.mesh_matrix.forEach(c=>{let d=0;c.forEach(f=>{u.push([i+o*d,a+l*h,f]),d++}),h++}),e.data=u,e.dataShape=[r,t]}return e}get seriesFlat(){var r,i,n,a;const e={type:"surface",name:"flat",data:[],itemStyle:{color:[1,1,1,1],opacity:.5},wireframe:{show:this.wireframe}},t=(i=(r=this.$store.state.printer.configfile)==null?void 0:r.settings)==null?void 0:i.bed_mesh;if(t){let s=[1,1];t.probe_count&&typeof t.probe_count=="string"?s=t.probe_count.split(","):t.probe_count?s=t.probe_count.length<2?[t.probe_count,t.probe_count]:t.probe_count:t.round_probe_count&&(s=[t.round_probe_count,t.round_probe_count]);let o=(n=t.mesh_min)!=null?n:[0,0],l=(a=t.mesh_max)!=null?a:[200,200];"mesh_radius"in t&&(o=[t.mesh_radius*-1,t.mesh_radius*-1],l=[t.mesh_radius,t.mesh_radius]);const u=s[0],h=s[1],c=parseFloat(o[0]),d=parseFloat(l[0]),f=parseFloat(o[1]),v=parseFloat(l[1]),p=(d-c)/(u-1),m=(v-f)/(h-1),g=[];for(let T=0;T".concat(e.seriesName,"")),Object.keys(e.encode).sort().forEach(r=>{const i=e.data[e.encode[r][0]].toFixed(r==="z"?3:1);t.push("".concat(r.toUpperCase(),": ").concat(i," mm"))}),t.join("
")}beforeDestroy(){typeof window>"u"||this.chart&&this.chart.dispose()}};Tt([ze({type:Boolean,default:!1})],nt.prototype,"showProbed",2);Tt([ze({type:Boolean,default:!1})],nt.prototype,"showMesh",2);Tt([ze({type:Boolean,default:!1})],nt.prototype,"showFlat",2);Tt([ze({type:Boolean,default:!1})],nt.prototype,"wireframe",2);Tt([ze({type:Boolean,default:!1})],nt.prototype,"scaleGradient",2);Tt([ze({type:Number,default:1})],nt.prototype,"scaleZMax",2);Tt([is("heightmap")],nt.prototype,"heightmap",2);nt=Tt([at],nt);var _h=function(){var t=this,r=t._self._c;return t._self._setupProxy,r("e-chart",{ref:"heightmap",staticStyle:{height:"600px",width:"100%",overflow:"hidden"},attrs:{option:t.chartOptions,"init-options":{renderer:"canvas"}}})},gh=[],yh=dt(nt,_h,gh,!1,null,null);const xh=yh.exports;var Th=Object.getOwnPropertyDescriptor,wh=(e,t,r,i)=>{for(var n=i>1?void 0:i?Th(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(n=s(n)||n);return n};let Ui=class extends ct(ft,ns,dr){constructor(){super(...arguments),this.mdiGrid=jr,this.mdiHome=as,this.calibrateDialog=!1}get showProbed(){var e;return(e=this.$store.state.gui.view.heightmap.probed)!=null?e:!0}set showProbed(e){this.$store.dispatch("gui/saveSetting",{name:"view.heightmap.probed",value:e})}get showMesh(){var e;return(e=this.$store.state.gui.view.heightmap.mesh)!=null?e:!0}set showMesh(e){this.$store.dispatch("gui/saveSetting",{name:"view.heightmap.mesh",value:e})}get showFlat(){var e;return(e=this.$store.state.gui.view.heightmap.flat)!=null?e:!0}set showFlat(e){this.$store.dispatch("gui/saveSetting",{name:"view.heightmap.flat",value:e})}get wireframe(){var e;return(e=this.$store.state.gui.view.heightmap.wireframe)!=null?e:!0}set wireframe(e){this.$store.dispatch("gui/saveSetting",{name:"view.heightmap.wireframe",value:e})}get scaleGradient(){var e;return(e=this.$store.state.gui.view.heightmap.scaleGradient)!=null?e:!1}set scaleGradient(e){this.$store.dispatch("gui/saveSetting",{name:"view.heightmap.scaleGradient",value:e})}get scaleZMax(){var e;return(e=this.$store.state.gui.view.heightmap.scaleZMax)!=null?e:.5}set scaleZMax(e){this.$store.dispatch("gui/saveSetting",{name:"view.heightmap.scaleZMax",value:e})}get heightmapRangeLimit(){const e=Math.round(Math.max(Math.abs(this.min),Math.abs(this.max))*10)/10,t=Math.max(e,1);return[e,t]}homePrinter(){const e="G28";this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"homeAll"})}clearBedMesh(){const e="BED_MESH_CLEAR";this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"bedMeshClear"})}};Ui=wh([at({components:{HeightmapCalibrateMeshDialog:da}})],Ui);var Eh=function(){var t=this,r=t._self._c;return t._self._setupProxy,r(Dt,{attrs:{"card-class":"heightmap-map-panel",title:t.$t("Heightmap.Heightmap"),icon:t.mdiGrid},scopedSlots:t._u([{key:"buttons",fn:function(){return[r(be,{staticClass:"d-none d-sm-flex",attrs:{icon:"",tile:"",disabled:t.printerIsPrinting,color:t.homedAxes.includes("xyz")?"primary":"warning",loading:t.loadings.includes("homeAll"),title:t.$t("Heightmap.TitleHomeAll"),ripple:!0},on:{click:t.homePrinter}},[r(ut,[t._v(t._s(t.mdiHome))])],1),t.is_active?r(be,{staticClass:"d-none d-sm-flex",attrs:{text:"",tile:"",loading:t.loadings.includes("bedMeshClear"),title:t.$t("Heightmap.TitleClear")},on:{click:t.clearBedMesh}},[t._v(" "+t._s(t.$t("Heightmap.Clear"))+" ")]):t._e(),r(be,{staticClass:"d-none d-sm-flex",attrs:{text:"",tile:"",loading:t.loadings.includes("bedMeshCalibrate"),disabled:t.printerIsPrinting,title:t.$t("Heightmap.TitleCalibrate")},on:{click:function(i){t.calibrateDialog=!0}}},[t._v(" "+t._s(t.$t("Heightmap.Calibrate"))+" ")])]},proxy:!0}])},[r(et,{staticClass:"d-sm-none text-center pb-0"},[r(us,{staticClass:"v-btn-toggle",attrs:{tile:"",name:"controllers"}},[r(be,{staticClass:"px-2 minwidth-0",attrs:{text:"",small:"",disabled:t.printerIsPrinting,color:t.homedAxes.includes("xyz")?"primary":"warning",loading:t.loadings.includes("homeAll"),title:t.$t("Heightmap.TitleHomeAll")},on:{click:t.homePrinter}},[r(ut,{attrs:{color:t.homedAxes.includes("xyz")?"primary":"warning",small:""}},[t._v(" "+t._s(t.mdiHome)+" ")])],1),t.bed_mesh?r(be,{staticClass:"px-2 minwidth-0",attrs:{text:"",small:"",color:"primary",loading:t.loadings.includes("bedMeshClear"),title:t.$t("Heightmap.TitleClear")},on:{click:t.clearBedMesh}},[t._v(" "+t._s(t.$t("Heightmap.Clear"))+" ")]):t._e(),r(be,{staticClass:"px-2 minwidth-0",attrs:{text:"",small:"",color:"primary",loading:t.loadings.includes("bedMeshCalibrate"),disabled:t.printerIsPrinting,title:t.$t("Heightmap.TitleCalibrate")},on:{click:function(i){t.calibrateDialog=!0}}},[t._v(" "+t._s(t.$t("Heightmap.Calibrate"))+" ")])],1)],1),t.is_active?[r(et,{staticClass:"py-0 px-0"},[r(Je,[r(_e,{},[r(xh,{attrs:{"show-probed":t.showProbed,"show-mesh":t.showMesh,"show-flat":t.showFlat,wireframe:t.wireframe,"scale-gradient":t.scaleGradient,"scale-z-max":t.scaleZMax}})],1)],1),r(Je,[r(_e,{staticClass:"col-12 col-sm-auto pt-0 pb-0 pl-lg-6 d-flex justify-center justify-sm-start"},[r(hs,{staticClass:"mt-0 ml-5",attrs:{label:t.$t("Heightmap.ScaleGradient")},model:{value:t.scaleGradient,callback:function(i){t.scaleGradient=i},expression:"scaleGradient"}})],1),r(_e,{staticClass:"d-flex justify-center pt-0 pb-6 pb-lg-3"},[r(Er,{staticClass:"mx-3 mt-0",attrs:{label:t.$t("Heightmap.Probed"),"hide-details":""},model:{value:t.showProbed,callback:function(i){t.showProbed=i},expression:"showProbed"}}),r(Er,{staticClass:"mx-3 mt-0",attrs:{label:t.$t("Heightmap.Mesh"),"hide-details":""},model:{value:t.showMesh,callback:function(i){t.showMesh=i},expression:"showMesh"}}),r(Er,{staticClass:"mx-3 mt-0",attrs:{label:t.$t("Heightmap.Flat"),"hide-details":""},model:{value:t.showFlat,callback:function(i){t.showFlat=i},expression:"showFlat"}}),r(Er,{staticClass:"mx-3 mt-0",attrs:{label:t.$t("Heightmap.Wireframe"),"hide-details":""},model:{value:t.wireframe,callback:function(i){t.wireframe=i},expression:"wireframe"}})],1)],1)],1),r(Wt),r(et,{staticClass:"pt-0 pb-3"},[r(Je,[r(_e,[r(cs,{staticClass:"mt-4",attrs:{label:t.$t("Heightmap.ScaleZMax"),min:t.heightmapRangeLimit[0],max:t.heightmapRangeLimit[1],step:.1,ticks:"always","hide-details":""},model:{value:t.scaleZMax,callback:function(i){t.scaleZMax=i},expression:"scaleZMax"}})],1)],1)],1)]:[r(et,{staticClass:"text-center py-3 font-italic"},[t._v(" "+t._s(t.$t("Heightmap.NoBedMeshHasBeenLoadedYet"))+" ")])],r(da,{attrs:{show:t.calibrateDialog},on:{close:function(i){t.calibrateDialog=!1}}})],2)},bh=[],Sh=dt(Ui,Eh,bh,!1,null,null);const Ah=Sh.exports;var Ch=Object.getOwnPropertyDescriptor,Mh=(e,t,r,i)=>{for(var n=i>1?void 0:i?Ch(t,r):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(n=s(n)||n);return n};let Hi=class extends ct(ft){constructor(){super(...arguments),this.mdiLockOutline=ss}};Hi=Mh([at({components:{Panel:Dt}})],Hi);var Ph=function(){var t=this,r=t._self._c;return t._self._setupProxy,r("div",[r(Je,[t.klipperReadyForGui?[r(_e,{staticClass:"col-12 col-md-8 pb-0"},[r(Ah)],1),r(_e,{staticClass:"col-12 col-md-4"},[r(yo),r(ho)],1)]:[r(_e,[r(fs,{staticClass:"mx-auto mt-6",attrs:{dense:"",text:"",type:"warning",elevation:"2","max-width":"500",icon:t.mdiLockOutline}},[t._v(" "+t._s(t.$t("Heightmap.ErrorKlipperNotReady"))+" ")])],1)]],2)],1)},Rh=[],Lh=dt(Hi,Ph,Rh,!1,null,null);const Bh=Lh.exports;export{Bh as default}; diff --git a/assets/Heightmap-Cx_CgFq_.css b/assets/Heightmap-Cx_CgFq_.css new file mode 100644 index 0000000..bcd4375 --- /dev/null +++ b/assets/Heightmap-Cx_CgFq_.css @@ -0,0 +1 @@ +.currentMeshName[data-v-b0715bd0],.currentMeshName[data-v-1001f9ee]{color:var(--v-primary-base)}.currentMeshName .v-icon[data-v-1001f9ee]{opacity:0}.currentMeshName:hover .v-icon[data-v-1001f9ee]{opacity:1} diff --git a/assets/Hlsstreamer-BpBN3Lzc.js b/assets/Hlsstreamer-BpBN3Lzc.js new file mode 100644 index 0000000..1dd0664 --- /dev/null +++ b/assets/Hlsstreamer-BpBN3Lzc.js @@ -0,0 +1 @@ +import{m as rr,B as nr,H as ar,P as ni,C as or,n as lr}from"./index-Bku7SJna.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./echarts-DzoUeqWp.js";function cr(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var ai={exports:{}};(function(a,t){(function(e){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,c,h){if(h=h||{},l=l.trim(),c=c.trim(),!c){if(!h.alwaysNormalize)return l;var u=o.parseURL(l);if(!u)throw new Error("Error trying to parse base URL.");return u.path=o.normalizePath(u.path),o.buildURLFromParts(u)}var d=o.parseURL(c);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return h.alwaysNormalize?(d.path=o.normalizePath(d.path),o.buildURLFromParts(d)):c;var f=o.parseURL(l);if(!f)throw new Error("Error trying to parse base URL.");if(!f.netLoc&&f.path&&f.path[0]!=="/"){var g=i.exec(f.path);f.netLoc=g[1],f.path=g[2]}f.netLoc&&!f.path&&(f.path="/");var p={scheme:f.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(p.netLoc=f.netLoc,d.path[0]!=="/"))if(!d.path)p.path=f.path,d.params||(p.params=f.params,d.query||(p.query=f.query));else{var T=f.path,y=T.substring(0,T.lastIndexOf("/")+1)+d.path;p.path=o.normalizePath(y)}return p.path===null&&(p.path=h.alwaysNormalize?o.normalizePath(d.path):d.path),o.buildURLFromParts(p)},parseURL:function(l){var c=s.exec(l);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(r,"");l.length!==(l=l.replace(n,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};a.exports=o})()})(ai);var je=ai.exports;function us(a,t){var e=Object.keys(a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(a);t&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),e.push.apply(e,s)}return e}function ct(a){for(var t=1;t")):_t}function gr(a,...t){t.forEach(function(e){Kt[e]=a[e]?a[e].bind(a):fr(e)})}function mr(a,t){if(self.console&&a===!0||typeof a=="object"){gr(a,"debug","log","info","warn","error");try{Kt.log('Debug logs enabled for "'.concat(t,'" in hls.js version 1.4.12'))}catch{Kt=Ue}}else Kt=Ue}const x=Kt,pr=/^(\d+)x(\d+)$/,ds=/(.+?)=(".*?"|.*?)(?:,|$)/g;class z{constructor(t){typeof t=="string"&&(t=z.parseAttrList(t));for(const e in t)t.hasOwnProperty(e)&&(e.substring(0,2)==="X-"&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(e)),this[e]=t[e])}decimalInteger(t){const e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e}hexadecimalInteger(t){if(this[t]){let e=(this[t]||"0x").slice(2);e=(e.length&1?"0":"")+e;const s=new Uint8Array(e.length/2);for(let i=0;iNumber.MAX_SAFE_INTEGER?1/0:e}decimalFloatingPoint(t){return parseFloat(this[t])}optionalFloat(t,e){const s=this[t];return s?parseFloat(s):e}enumeratedString(t){return this[t]}bool(t){return this[t]==="YES"}decimalResolution(t){const e=pr.exec(this[t]);if(e!==null)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}}static parseAttrList(t){let e;const s={},i='"';for(ds.lastIndex=0;(e=ds.exec(t))!==null;){let r=e[2];r.indexOf(i)===0&&r.lastIndexOf(i)===r.length-1&&(r=r.slice(1,-1));const n=e[1].trim();s[n]=r}return s}}function Tr(a){return a!=="ID"&&a!=="CLASS"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function yr(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"}class oi{constructor(t,e){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,e){const s=e.attr;for(const i in s)if(Object.prototype.hasOwnProperty.call(t,i)&&t[i]!==s[i]){x.warn('DATERANGE tag attribute: "'.concat(i,'" does not match for tags with ID: "').concat(t.ID,'"')),this._badValueForSameId=i;break}t=tt(new z({}),s,t)}if(this.attr=t,this._startDate=new Date(t["START-DATE"]),"END-DATE"in this.attr){const s=new Date(this.attr["END-DATE"]);F(s.getTime())&&(this._endDate=s)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const t=this.duration;return t!==null?new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const t=this.attr.decimalFloatingPoint("DURATION");if(F(t))return t}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&F(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class ue{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var H={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class li{constructor(t){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[H.AUDIO]:null,[H.VIDEO]:null,[H.AUDIOVIDEO]:null},this.baseurl=t}setByteRange(t,e){const s=t.split("@",2),i=[];s.length===1?i[0]=e?e.byteRangeEndOffset:0:i[0]=parseInt(s[1]),i[1]=parseInt(s[0])+i[0],this._byteRange=i}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=je.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(t){this._url=t}}class me extends li{constructor(t,e){super(e),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new ue,this.urlId=0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.type=t}get decryptdata(){const{levelkeys:t}=this;if(!t&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{const s=Object.keys(this.levelkeys);if(s.length===1)return this._decryptdata=this.levelkeys[s[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null||!F(this.programDateTime))return null;const t=F(this.duration)?this.duration:0;return this.programDateTime+t*1e3}get encrypted(){var t;if((t=this._decryptdata)!=null&&t.encrypted)return!0;if(this.levelkeys){const e=Object.keys(this.levelkeys),s=e.length;if(s>1||s===1&&this.levelkeys[e[0]].encrypted)return!0}return!1}setKeyFormat(t){if(this.levelkeys){const e=this.levelkeys[t];e&&!this._decryptdata&&(this._decryptdata=e.getDecryptData(this.sn))}}abortRequests(){var t,e;(t=this.loader)==null||t.abort(),(e=this.keyLoader)==null||e.abort()}setElementaryStreamInfo(t,e,s,i,r,n=!1){const{elementaryStreams:o}=this,l=o[t];if(!l){o[t]={startPTS:e,endPTS:s,startDTS:i,endDTS:r,partial:n};return}l.startPTS=Math.min(l.startPTS,e),l.endPTS=Math.max(l.endPTS,s),l.startDTS=Math.min(l.startDTS,i),l.endDTS=Math.max(l.endDTS,r)}clearElementaryStreamInfo(){const{elementaryStreams:t}=this;t[H.AUDIO]=null,t[H.VIDEO]=null,t[H.AUDIOVIDEO]=null}}class xr extends li{constructor(t,e,s,i,r){super(s),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new ue,this.duration=t.decimalFloatingPoint("DURATION"),this.gap=t.bool("GAP"),this.independent=t.bool("INDEPENDENT"),this.relurl=t.enumeratedString("URI"),this.fragment=e,this.index=i;const n=t.enumeratedString("BYTERANGE");n&&this.setByteRange(n,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:t}=this;return!!(t.audio||t.video||t.audiovideo)}}const Er=10;class Sr{constructor(t){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=t}reloaded(t){if(!t){this.advanced=!0,this.updated=!0;return}const e=this.lastPartSn-t.lastPartSn,s=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!s||!!e||!this.live,this.advanced=this.endSN>t.endSN||e>0||e===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(t.misses*.6):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay}get hasProgramDateTime(){return this.fragments.length?F(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Er}get drift(){const t=this.driftEndTime-this.driftStartTime;return t>0?(this.driftEnd-this.driftStart)*1e3/t:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var t;return(t=this.fragments)!=null&&t.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function Xe(a){return Uint8Array.from(atob(a),t=>t.charCodeAt(0))}function vr(a){const t=ci(a).subarray(0,16),e=new Uint8Array(16);return e.set(t,16-t.length),e}function Ar(a){const t=function(s,i,r){const n=s[i];s[i]=s[r],s[r]=n};t(a,0,3),t(a,1,2),t(a,4,5),t(a,6,7)}function Lr(a){const t=a.split(":");let e=null;if(t[0]==="data"&&t.length===2){const s=t[1].split(";"),i=s[s.length-1].split(",");if(i.length===2){const r=i[0]==="base64",n=i[1];r?(s.splice(-1,1),e=Xe(n)):e=vr(n)}}return e}function ci(a){return Uint8Array.from(unescape(encodeURIComponent(a)),t=>t.charCodeAt(0))}var Q={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},lt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function fs(a){switch(a){case lt.FAIRPLAY:return Q.FAIRPLAY;case lt.PLAYREADY:return Q.PLAYREADY;case lt.WIDEVINE:return Q.WIDEVINE;case lt.CLEARKEY:return Q.CLEARKEY}}var hi={WIDEVINE:"edef8ba979d64acea3c827dcd51d21ed"};function Rr(a){if(a===hi.WIDEVINE)return Q.WIDEVINE}function gs(a){switch(a){case Q.FAIRPLAY:return lt.FAIRPLAY;case Q.PLAYREADY:return lt.PLAYREADY;case Q.WIDEVINE:return lt.WIDEVINE;case Q.CLEARKEY:return lt.CLEARKEY}}function pe(a){const{drmSystems:t,widevineLicenseUrl:e}=a,s=t?[Q.FAIRPLAY,Q.WIDEVINE,Q.PLAYREADY,Q.CLEARKEY].filter(i=>!!t[i]):[];return!s[Q.WIDEVINE]&&e&&s.push(Q.WIDEVINE),s}const ui=function(){return typeof self<"u"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function Ir(a,t,e,s){let i;switch(a){case Q.FAIRPLAY:i=["cenc","sinf"];break;case Q.WIDEVINE:case Q.PLAYREADY:i=["cenc"];break;case Q.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error("Unknown key-system: ".concat(a))}return br(i,t,e,s)}function br(a,t,e,s){return[{initDataTypes:a,persistentState:s.persistentState||"not-allowed",distinctiveIdentifier:s.distinctiveIdentifier||"not-allowed",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:t.map(r=>({contentType:'audio/mp4; codecs="'.concat(r,'"'),robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:e.map(r=>({contentType:'video/mp4; codecs="'.concat(r,'"'),robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}function wt(a,t,e){return Uint8Array.prototype.slice?a.slice(t,e):new Uint8Array(Array.prototype.slice.call(a,t,e))}const ze=(a,t)=>t+10<=a.length&&a[t]===73&&a[t+1]===68&&a[t+2]===51&&a[t+3]<255&&a[t+4]<255&&a[t+6]<128&&a[t+7]<128&&a[t+8]<128&&a[t+9]<128,di=(a,t)=>t+10<=a.length&&a[t]===51&&a[t+1]===68&&a[t+2]===73&&a[t+3]<255&&a[t+4]<255&&a[t+6]<128&&a[t+7]<128&&a[t+8]<128&&a[t+9]<128,ne=(a,t)=>{const e=t;let s=0;for(;ze(a,t);){s+=10;const i=de(a,t+6);s+=i,di(a,t+10)&&(s+=10),t+=s}if(s>0)return a.subarray(e,e+s)},de=(a,t)=>{let e=0;return e=(a[t]&127)<<21,e|=(a[t+1]&127)<<14,e|=(a[t+2]&127)<<7,e|=a[t+3]&127,e},Dr=(a,t)=>ze(a,t)&&de(a,t+6)+10<=a.length-t,Cr=a=>{const t=gi(a);for(let e=0;ea&&a.key==="PRIV"&&a.info==="com.apple.streaming.transportStreamTimestamp",kr=a=>{const t=String.fromCharCode(a[0],a[1],a[2],a[3]),e=de(a,4),s=10;return{type:t,size:e,data:a.subarray(s,s+e)}},gi=a=>{let t=0;const e=[];for(;ze(a,t);){const s=de(a,t+6);t+=10;const i=t+s;for(;t+8a.type==="PRIV"?wr(a):a.type[0]==="W"?Fr(a):Pr(a),wr=a=>{if(a.size<2)return;const t=St(a.data,!0),e=new Uint8Array(a.data.subarray(t.length+1));return{key:a.type,info:t,data:e.buffer}},Pr=a=>{if(a.size<2)return;if(a.type==="TXXX"){let e=1;const s=St(a.data.subarray(e),!0);e+=s.length+1;const i=St(a.data.subarray(e));return{key:a.type,info:s,data:i}}const t=St(a.data.subarray(1));return{key:a.type,data:t}},Fr=a=>{if(a.type==="WXXX"){if(a.size<2)return;let e=1;const s=St(a.data.subarray(e),!0);e+=s.length+1;const i=St(a.data.subarray(e));return{key:a.type,info:s,data:i}}const t=St(a.data);return{key:a.type,data:t}},Or=a=>{if(a.data.byteLength===8){const t=new Uint8Array(a.data),e=t[3]&1;let s=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return s/=45,e&&(s+=4772185884e-2),Math.round(s)}},St=(a,t=!1)=>{const e=Mr();if(e){const c=e.decode(a);if(t){const h=c.indexOf("\0");return h!==-1?c.substring(0,h):c}return c.replace(/\0/g,"")}const s=a.length;let i,r,n,o="",l=0;for(;l>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:r=a[l++],o+=String.fromCharCode((i&31)<<6|r&63);break;case 14:r=a[l++],n=a[l++],o+=String.fromCharCode((i&15)<<12|(r&63)<<6|(n&63)<<0);break}}return o};let Te;function Mr(){return!Te&&typeof self.TextDecoder<"u"&&(Te=new self.TextDecoder("utf-8")),Te}const xt={hexDump:function(a){let t="";for(let e=0;e>24,a[t+1]=e>>16&255,a[t+2]=e>>8&255,a[t+3]=e&255}function $(a,t){const e=[];if(!t.length)return e;const s=a.byteLength;for(let i=0;i1?i+r:s;if(n===t[0])if(t.length===1)e.push(a.subarray(i+8,o));else{const l=$(a.subarray(i+8,o),t.slice(1));l.length&&Nr.apply(e,l)}i=o}return e}function Ur(a){const t=[],e=a[0];let s=8;const i=B(a,s);s+=4;const r=0,n=0;e===0?s+=8:s+=16,s+=2;let o=a.length+n;const l=pi(a,s);s+=2;for(let c=0;c>>31===1)return x.warn("SIDX has hierarchical references (not supported)"),null;const g=B(a,h);h+=4,t.push({referenceSize:d,subsegmentDuration:g,info:{duration:g/i,start:o,end:o+d-1}}),o+=d,h+=4,s=h}return{earliestPresentationTime:r,timescale:i,version:e,referencesCount:l,references:t}}function yi(a){const t=[],e=$(a,["moov","trak"]);for(let i=0;i{const r=B(i,4),n=t[r];n&&(n.default={duration:B(i,12),flags:B(i,20)})}),t}function Br(a,t){if(!a||!t)return a;const e=t.keyId;return e&&t.isCommonEncryption&&$(a,["moov","trak"]).forEach(i=>{const n=$(i,["mdia","minf","stbl","stsd"])[0].subarray(8);let o=$(n,["enca"]);const l=o.length>0;l||(o=$(n,["encv"])),o.forEach(c=>{const h=l?c.subarray(28):c.subarray(78);$(h,["sinf"]).forEach(d=>{const f=xi(d);if(f){const g=f.subarray(8,24);g.some(p=>p!==0)||(x.log("[eme] Patching keyId in 'enc".concat(l?"a":"v",">sinf>>tenc' box: ").concat(xt.hexDump(g)," -> ").concat(xt.hexDump(e))),f.set(e,8))}})})}),a}function xi(a){const t=$(a,["schm"])[0];if(t){const e=st(t.subarray(4,8));if(e==="cbcs"||e==="cenc")return $(a,["schi","tenc"])[0]}return x.error("[eme] missing 'schm' box"),null}function $r(a,t){return $(t,["moof","traf"]).reduce((e,s)=>{const i=$(s,["tfdt"])[0],r=i[0],n=$(s,["tfhd"]).reduce((o,l)=>{const c=B(l,4),h=a[c];if(h){let u=B(i,4);if(r===1){if(u===ae)return x.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),o;u*=ae+1,u+=B(i,8)}const d=h.timescale||9e4,f=u/d;if(isFinite(f)&&(o===null||fh+u.info.duration||0,0))}return n}return s||i}function Kr(a){const t=B(a,0);let e=8;t&1&&(e+=4),t&4&&(e+=4);let s=0;const i=B(a,4);for(let r=0;r{$(s,["tfhd"]).forEach(i=>{const r=B(i,4),n=a[r];if(!n)return;const o=n.timescale||9e4;$(s,["tfdt"]).forEach(l=>{const c=l[0];let h=B(l,4);if(c===0)h-=e*o,h=Math.max(h,0),ye(l,4,h);else{h*=Math.pow(2,32),h+=B(l,8),h-=e*o,h=Math.max(h,0);const u=Math.floor(h/(ae+1)),d=Math.floor(h%(ae+1));ye(l,4,u),ye(l,8,d)}})})})}function Vr(a){const t={valid:null,remainder:null},e=$(a,["moof"]);if(e){if(e.length<2)return t.remainder=a,t}else return t;const s=e[e.length-1];return t.valid=wt(a,0,s.byteOffset-8),t.remainder=wt(a,s.byteOffset-8),t}function Pt(a,t){const e=new Uint8Array(a.length+t.length);return e.set(a),e.set(t,a.length),e}function ms(a,t){const e=[],s=t.samples,i=t.timescale,r=t.id;let n=!1;return $(s,["moof"]).map(l=>{const c=l.byteOffset-8;$(l,["traf"]).map(u=>{const d=$(u,["tfdt"]).map(f=>{const g=f[0];let p=B(f,4);return g===1&&(p*=Math.pow(2,32),p+=B(f,8)),p/i})[0];return d!==void 0&&(a=d),$(u,["tfhd"]).map(f=>{const g=B(f,4),p=B(f,0)&16777215,T=(p&1)!==0,y=(p&2)!==0,S=(p&8)!==0;let E=0;const R=(p&16)!==0;let A=0;const k=(p&32)!==0;let D=8;g===r&&(T&&(D+=8),y&&(D+=4),S&&(E=B(f,D),D+=4),R&&(A=B(f,D),D+=4),k&&(D+=4),t.type==="video"&&(n=Wr(t.codec)),$(u,["trun"]).map(C=>{const _=C[0],I=B(C,0)&16777215,O=(I&1)!==0;let w=0;const V=(I&4)!==0,nt=(I&256)!==0;let X=0;const J=(I&512)!==0;let j=0;const P=(I&1024)!==0,M=(I&2048)!==0;let W=0;const Y=B(C,4);let K=8;O&&(w=B(C,K),K+=4),V&&(K+=4);let Z=w+c;for(let ht=0;ht>1&63;return e===39||e===40}else return(t&31)===6}function Ei(a,t,e,s){const i=Si(a);let r=0;r+=t;let n=0,o=0,l=!1,c=0;for(;r=i.length)break;c=i[r++],n+=c}while(c===255);o=0;do{if(r>=i.length)break;c=i[r++],o+=c}while(c===255);const h=i.length-r;if(!l&&n===4&&r16){const u=[];for(let g=0;g<16;g++){const p=i[r++].toString(16);u.push(p.length==1?"0"+p:p),(g===3||g===5||g===7||g===9)&&u.push("-")}const d=o-16,f=new Uint8Array(d);for(let g=0;gh)break}}function Si(a){const t=a.byteLength,e=[];let s=1;for(;s>24&255,r[1]=s>>16&255,r[2]=s>>8&255,r[3]=s&255,r.set(a,4),i=0,s=8;i0?(r=new Uint8Array(4),t.length>0&&new DataView(r.buffer).setUint32(0,t.length,!1)):r=new Uint8Array;const n=new Uint8Array(4);return e&&e.byteLength>0&&new DataView(n.buffer).setUint32(0,e.byteLength,!1),jr([112,115,115,104],new Uint8Array([s,0,0,0]),a,r,i,n,e||new Uint8Array)}function zr(a){if(!(a instanceof ArrayBuffer)||a.byteLength<32)return null;const t={version:0,systemId:"",kids:null,data:null},e=new DataView(a),s=e.getUint32(0);if(a.byteLength!==s&&s>44||e.getUint32(4)!==1886614376||(t.version=e.getUint32(8)>>>24,t.version>1))return null;t.systemId=xt.hexDump(new Uint8Array(a,12,16));const r=e.getUint32(28);if(t.version===0){if(s-32=22&&(this.keyId=e.subarray(e.length-22,e.length-6));break;case lt.PLAYREADY:{const s=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Xr(s,null,e);const i=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),r=String.fromCharCode.apply(null,Array.from(i)),n=r.substring(r.indexOf("<"),r.length),c=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(c){const h=c.childNodes[0]?c.childNodes[0].nodeValue:c.getAttribute("VALUE");if(h){const u=Xe(h).subarray(0,16);Ar(u),this.keyId=u}}break}default:{let s=e.subarray(0,16);if(s.length!==16){const i=new Uint8Array(16);i.set(s,16-s.length),s=i}this.keyId=s;break}}if(!this.keyId||this.keyId.byteLength!==16){let s=jt[this.uri];if(!s){const i=Object.keys(jt).length%Number.MAX_SAFE_INTEGER;s=new Uint8Array(16),new DataView(s.buffer,12,4).setUint32(0,i),jt[this.uri]=s}this.keyId=s}return this}}function Qr(a){const t=new Uint8Array(16);for(let e=12;e<16;e++)t[e]=a>>8*(15-e)&255;return t}const vi=/\{\$([a-zA-Z0-9-_]+)\}/g;function ps(a){return vi.test(a)}function ot(a,t,e){if(a.variableList!==null||a.hasVariableRefs)for(let s=e.length;s--;){const i=e[s],r=t[i];r&&(t[i]=Be(a,r))}}function Be(a,t){if(a.variableList!==null||a.hasVariableRefs){const e=a.variableList;return t.replace(vi,s=>{const i=s.substring(2,s.length-1),r=e==null?void 0:e[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error('Missing preceding EXT-X-DEFINE tag for Variable Reference: "'.concat(i,'"'))),s):r})}return t}function Ts(a,t,e){let s=a.variableList;s||(a.variableList=s={});let i,r;if("QUERYPARAM"in t){i=t.QUERYPARAM;try{const n=new self.URL(e).searchParams;if(n.has(i))r=n.get(i);else throw new Error('"'.concat(i,'" does not match any query parameter in URI: "').concat(e,'"'))}catch(n){a.playlistParsingError||(a.playlistParsingError=new Error("EXT-X-DEFINE QUERYPARAM: ".concat(n.message)))}}else i=t.NAME,r=t.VALUE;i in s?a.playlistParsingError||(a.playlistParsingError=new Error('EXT-X-DEFINE duplicate Variable Name declarations: "'.concat(i,'"'))):s[i]=r||""}function Jr(a,t,e){const s=t.IMPORT;if(e&&s in e){let i=a.variableList;i||(a.variableList=i={}),i[s]=e[s]}else a.playlistParsingError||(a.playlistParsingError=new Error('EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "'.concat(s,'"')))}function fe(){if(!(typeof self>"u"))return self.MediaSource||self.WebKitMediaSource}const Zr={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}},ys=fe();function tn(a,t){const e=Zr[t];return!!e&&e[a.slice(0,4)]===!0}function xe(a,t){var e;return(e=ys==null?void 0:ys.isTypeSupported("".concat(t||"video",'/mp4;codecs="').concat(a,'"')))!=null?e:!1}const xs=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Es=/#EXT-X-MEDIA:(.*)/g,en=/^#EXT(?:INF|-X-TARGETDURATION):/m,Ss=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),sn=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class yt{static findGroup(t,e){for(let s=0;s2){let s=e.shift()+".";return s+=parseInt(e.shift()).toString(16),s+=("000"+parseInt(e.shift()).toString(16)).slice(-4),s}return t}static resolve(t,e){return je.buildAbsoluteURL(e,t,{alwaysNormalize:!0})}static isMediaPlaylist(t){return en.test(t)}static parseMasterPlaylist(t,e){const s=ps(t),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:s},r=[];xs.lastIndex=0;let n;for(;(n=xs.exec(t))!=null;)if(n[1]){var o;const c=new z(n[1]);ot(i,c,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const h=Be(i,n[2]),u={attrs:c,bitrate:c.decimalInteger("AVERAGE-BANDWIDTH")||c.decimalInteger("BANDWIDTH"),name:c.NAME,url:yt.resolve(h,e)},d=c.decimalResolution("RESOLUTION");d&&(u.width=d.width,u.height=d.height),rn((c.CODECS||"").split(/[ ,]+/).filter(f=>f),u),u.videoCodec&&u.videoCodec.indexOf("avc1")!==-1&&(u.videoCodec=yt.convertAVC1ToAVCOTI(u.videoCodec)),(o=u.unknownCodecs)!=null&&o.length||r.push(u),i.levels.push(u)}else if(n[3]){const c=n[3],h=n[4];switch(c){case"SESSION-DATA":{const u=new z(h);ot(i,u,["DATA-ID","LANGUAGE","VALUE","URI"]);const d=u["DATA-ID"];d&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[d]=u);break}case"SESSION-KEY":{const u=vs(h,e,i);u.encrypted&&u.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(u)):x.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'.concat(h,'"'));break}case"DEFINE":{{const u=new z(h);ot(i,u,["NAME","VALUE","QUERYPARAM"]),Ts(i,u,e)}break}case"CONTENT-STEERING":{const u=new z(h);ot(i,u,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:yt.resolve(u["SERVER-URI"],e),pathwayId:u["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=As(h);break}}}const l=r.length>0&&r.length({id:c.attrs.AUDIO,audioCodec:c.audioCodec})),SUBTITLES:n.map(c=>({id:c.attrs.SUBTITLES,textCodec:c.textCodec})),"CLOSED-CAPTIONS":[]};let l=0;for(Es.lastIndex=0;(i=Es.exec(t))!==null;){const c=new z(i[1]),h=c.TYPE;if(h){const u=o[h],d=r[h]||[];r[h]=d,ot(s,c,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const f={attrs:c,bitrate:0,id:l++,groupId:c["GROUP-ID"]||"",instreamId:c["INSTREAM-ID"],name:c.NAME||c.LANGUAGE||"",type:h,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:c.LANGUAGE,url:c.URI?yt.resolve(c.URI,e):""};if(u!=null&&u.length){const g=yt.findGroup(u,f.groupId)||u[0];Ls(f,g,"audioCodec"),Ls(f,g,"textCodec")}d.push(f)}}return r}static parseLevelPlaylist(t,e,s,i,r,n){const o=new Sr(e),l=o.fragments;let c=null,h=0,u=0,d=0,f=0,g=null,p=new me(i,e),T,y,S,E=-1,R=!1;for(Ss.lastIndex=0,o.m3u8=t,o.hasVariableRefs=ps(t);(T=Ss.exec(t))!==null;){R&&(R=!1,p=new me(i,e),p.start=d,p.sn=h,p.cc=f,p.level=s,c&&(p.initSegment=c,p.rawProgramDateTime=c.rawProgramDateTime,c.rawProgramDateTime=null));const C=T[1];if(C){p.duration=parseFloat(C);const _=(" "+T[2]).slice(1);p.title=_||null,p.tagList.push(_?["INF",C,_]:["INF",C])}else if(T[3]){if(F(p.duration)){p.start=d,S&&bs(p,S,o),p.sn=h,p.level=s,p.cc=f,p.urlId=r,l.push(p);const _=(" "+T[3]).slice(1);p.relurl=Be(o,_),Rs(p,g),g=p,d+=p.duration,h++,u=0,R=!0}}else if(T[4]){const _=(" "+T[4]).slice(1);g?p.setByteRange(_,g):p.setByteRange(_)}else if(T[5])p.rawProgramDateTime=(" "+T[5]).slice(1),p.tagList.push(["PROGRAM-DATE-TIME",p.rawProgramDateTime]),E===-1&&(E=l.length);else{if(T=T[0].match(sn),!T){x.warn("No matches on slow regex match for level playlist!");continue}for(y=1;y0&&w.bool("CAN-SKIP-DATERANGES"),o.partHoldBack=w.optionalFloat("PART-HOLD-BACK",0),o.holdBack=w.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const w=new z(I);o.partTarget=w.decimalFloatingPoint("PART-TARGET");break}case"PART":{let w=o.partList;w||(w=o.partList=[]);const V=u>0?w[w.length-1]:void 0,nt=u++,X=new z(I);ot(o,X,["BYTERANGE","URI"]);const J=new xr(X,p,e,nt,V);w.push(J),p.duration+=J.duration;break}case"PRELOAD-HINT":{const w=new z(I);ot(o,w,["URI"]),o.preloadHint=w;break}case"RENDITION-REPORT":{const w=new z(I);ot(o,w,["URI"]),o.renditionReports=o.renditionReports||[],o.renditionReports.push(w);break}default:x.warn("line parsed but not handled: ".concat(T));break}}}g&&!g.relurl?(l.pop(),d-=g.duration,o.partList&&(o.fragmentHint=g)):o.partList&&(Rs(p,g),p.cc=f,o.fragmentHint=p,S&&bs(p,S,o));const A=l.length,k=l[0],D=l[A-1];if(d+=o.skippedSegments*o.targetduration,d>0&&A&&D){o.averagetargetduration=d/A;const C=D.sn;o.endSN=C!=="initSegment"?C:0,o.live||(D.endList=!0),k&&(o.startCC=k.cc)}else o.endSN=0,o.startCC=0;return o.fragmentHint&&(d+=o.fragmentHint.duration),o.totalduration=d,o.endCC=f,E>0&&nn(l,E),o}}function vs(a,t,e){var s,i;const r=new z(a);ot(e,r,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const n=(s=r.METHOD)!=null?s:"",o=r.URI,l=r.hexadecimalInteger("IV"),c=r.KEYFORMATVERSIONS,h=(i=r.KEYFORMAT)!=null?i:"identity";o&&r.IV&&!l&&x.error("Invalid IV: ".concat(r.IV));const u=o?yt.resolve(o,t):"",d=(c||"1").split("/").map(Number).filter(Number.isFinite);return new Vt(n,u,h,d,l)}function As(a){const e=new z(a).decimalFloatingPoint("TIME-OFFSET");return F(e)?e:null}function rn(a,t){["video","audio","text"].forEach(e=>{const s=a.filter(i=>tn(i,e));if(s.length){const i=s.filter(r=>r.lastIndexOf("avc1",0)===0||r.lastIndexOf("mp4a",0)===0);t["".concat(e,"Codec")]=i.length>0?i[0]:s[0],a=a.filter(r=>s.indexOf(r)===-1)}}),t.unknownCodecs=a}function Ls(a,t,e){const s=t[e];s&&(a[e]=s)}function nn(a,t){let e=a[t];for(let s=t;s--;){const i=a[s];if(!i)return;i.programDateTime=e.programDateTime-i.duration*1e3,e=i}}function Rs(a,t){a.rawProgramDateTime?a.programDateTime=Date.parse(a.rawProgramDateTime):t!=null&&t.programDateTime&&(a.programDateTime=t.endProgramDateTime),F(a.programDateTime)||(a.programDateTime=null,a.rawProgramDateTime=null)}function Is(a,t,e,s){a.relurl=t.URI,t.BYTERANGE&&a.setByteRange(t.BYTERANGE),a.level=e,a.sn="initSegment",s&&(a.levelkeys=s),a.initSegment=null}function bs(a,t,e){a.levelkeys=t;const{encryptedFragments:s}=e;(!s.length||s[s.length-1].levelkeys!==t)&&Object.keys(t).some(i=>t[i].isCommonEncryption)&&s.push(a)}var G={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},U={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};function Ds(a){const{type:t}=a;switch(t){case G.AUDIO_TRACK:return U.AUDIO;case G.SUBTITLE_TRACK:return U.SUBTITLE;default:return U.MAIN}}function Ee(a,t){let e=a.url;return(e===void 0||e.indexOf("data:")===0)&&(e=t.url),e}class an{constructor(t){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=t,this.registerListeners()}startLoad(t){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:t}=this;t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.LEVEL_LOADING,this.onLevelLoading,this),t.on(m.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(m.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:t}=this;t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.LEVEL_LOADING,this.onLevelLoading,this),t.off(m.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(m.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(t){const e=this.hls.config,s=e.pLoader,i=e.loader,r=s||i,n=new r(e);return this.loaders[t.type]=n,n}getInternalLoader(t){return this.loaders[t.type]}resetInternalLoader(t){this.loaders[t]&&delete this.loaders[t]}destroyInternalLoaders(){for(const t in this.loaders){const e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(t,e){const{url:s}=e;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:G.MANIFEST,url:s,deliveryDirectives:null})}onLevelLoading(t,e){const{id:s,level:i,url:r,deliveryDirectives:n}=e;this.load({id:s,level:i,responseType:"text",type:G.LEVEL,url:r,deliveryDirectives:n})}onAudioTrackLoading(t,e){const{id:s,groupId:i,url:r,deliveryDirectives:n}=e;this.load({id:s,groupId:i,level:null,responseType:"text",type:G.AUDIO_TRACK,url:r,deliveryDirectives:n})}onSubtitleTrackLoading(t,e){const{id:s,groupId:i,url:r,deliveryDirectives:n}=e;this.load({id:s,groupId:i,level:null,responseType:"text",type:G.SUBTITLE_TRACK,url:r,deliveryDirectives:n})}load(t){var e;const s=this.hls.config;let i=this.getInternalLoader(t);if(i){const c=i.context;if(c&&c.url===t.url){x.trace("[playlist-loader]: playlist request ongoing");return}x.log("[playlist-loader]: aborting previous loader for type: ".concat(t.type)),i.abort()}let r;if(t.type===G.MANIFEST?r=s.manifestLoadPolicy.default:r=tt({},s.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(t),(e=t.deliveryDirectives)!=null&&e.part){let c;if(t.type===G.LEVEL&&t.level!==null?c=this.hls.levels[t.level].details:t.type===G.AUDIO_TRACK&&t.id!==null?c=this.hls.audioTracks[t.id].details:t.type===G.SUBTITLE_TRACK&&t.id!==null&&(c=this.hls.subtitleTracks[t.id].details),c){const h=c.partTarget,u=c.targetduration;if(h&&u){const d=Math.max(h*3,u*.8)*1e3;r=tt({},r,{maxTimeToFirstByteMs:Math.min(d,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(d,r.maxTimeToFirstByteMs)})}}}const n=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:n.maxNumRetry||0,retryDelay:n.retryDelayMs||0,maxRetryDelay:n.maxRetryDelayMs||0},l={onSuccess:(c,h,u,d)=>{const f=this.getInternalLoader(u);this.resetInternalLoader(u.type);const g=c.data;if(g.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(c,u,new Error("no EXTM3U delimiter"),d||null,h);return}h.parsing.start=performance.now(),yt.isMediaPlaylist(g)?this.handleTrackOrLevelPlaylist(c,h,u,d||null,f):this.handleMasterPlaylist(c,h,u,d)},onError:(c,h,u,d)=>{this.handleNetworkError(h,u,!1,c,d)},onTimeout:(c,h,u)=>{this.handleNetworkError(h,u,!0,void 0,c)}};i.load(t,o,l)}handleMasterPlaylist(t,e,s,i){const r=this.hls,n=t.data,o=Ee(t,s),l=yt.parseMasterPlaylist(n,o);if(l.playlistParsingError){this.handleManifestParsingError(t,s,l.playlistParsingError,i,e);return}const{contentSteering:c,levels:h,sessionData:u,sessionKeys:d,startTimeOffset:f,variableList:g}=l;this.variableList=g;const{AUDIO:p=[],SUBTITLES:T,"CLOSED-CAPTIONS":y}=yt.parseMasterPlaylistMedia(n,o,l);p.length&&!p.some(E=>!E.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(x.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),p.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new z({}),bitrate:0,url:""})),r.trigger(m.MANIFEST_LOADED,{levels:h,audioTracks:p,subtitles:T,captions:y,contentSteering:c,url:o,stats:e,networkDetails:i,sessionData:u,sessionKeys:d,startTimeOffset:f,variableList:g})}handleTrackOrLevelPlaylist(t,e,s,i,r){const n=this.hls,{id:o,level:l,type:c}=s,h=Ee(t,s),u=F(o)?o:0,d=F(l)?l:u,f=Ds(s),g=yt.parseLevelPlaylist(t.data,h,d,f,u,this.variableList);if(c===G.MANIFEST){const p={attrs:new z({}),bitrate:0,details:g,name:"",url:h};n.trigger(m.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:h,stats:e,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}e.parsing.end=performance.now(),s.levelDetails=g,this.handlePlaylistLoaded(g,t,e,s,i,r)}handleManifestParsingError(t,e,s,i,r){this.hls.trigger(m.ERROR,{type:N.NETWORK_ERROR,details:L.MANIFEST_PARSING_ERROR,fatal:e.type===G.MANIFEST,url:t.url,err:s,error:s,reason:s.message,response:t,context:e,networkDetails:i,stats:r})}handleNetworkError(t,e,s=!1,i,r){let n="A network ".concat(s?"timeout":"error"+(i?" (status "+i.code+")":"")," occurred while loading ").concat(t.type);t.type===G.LEVEL?n+=": ".concat(t.level," id: ").concat(t.id):(t.type===G.AUDIO_TRACK||t.type===G.SUBTITLE_TRACK)&&(n+=" id: ".concat(t.id,' group-id: "').concat(t.groupId,'"'));const o=new Error(n);x.warn("[playlist-loader]: ".concat(n));let l=L.UNKNOWN,c=!1;const h=this.getInternalLoader(t);switch(t.type){case G.MANIFEST:l=s?L.MANIFEST_LOAD_TIMEOUT:L.MANIFEST_LOAD_ERROR,c=!0;break;case G.LEVEL:l=s?L.LEVEL_LOAD_TIMEOUT:L.LEVEL_LOAD_ERROR,c=!1;break;case G.AUDIO_TRACK:l=s?L.AUDIO_TRACK_LOAD_TIMEOUT:L.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case G.SUBTITLE_TRACK:l=s?L.SUBTITLE_TRACK_LOAD_TIMEOUT:L.SUBTITLE_LOAD_ERROR,c=!1;break}h&&this.resetInternalLoader(t.type);const u={type:N.NETWORK_ERROR,details:l,fatal:c,url:t.url,loader:h,context:t,error:o,networkDetails:e,stats:r};if(i){const d=(e==null?void 0:e.url)||t.url;u.response=ct({url:d,data:void 0},i)}this.hls.trigger(m.ERROR,u)}handlePlaylistLoaded(t,e,s,i,r,n){const o=this.hls,{type:l,level:c,id:h,groupId:u,deliveryDirectives:d}=i,f=Ee(e,i),g=Ds(i),p=typeof i.level=="number"&&g===U.MAIN?c:void 0;if(!t.fragments.length){const y=new Error("No Segments found in Playlist");o.trigger(m.ERROR,{type:N.NETWORK_ERROR,details:L.LEVEL_EMPTY_ERROR,fatal:!1,url:f,error:y,reason:y.message,response:e,context:i,level:p,parent:g,networkDetails:r,stats:s});return}t.targetduration||(t.playlistParsingError=new Error("Missing Target Duration"));const T=t.playlistParsingError;if(T){o.trigger(m.ERROR,{type:N.NETWORK_ERROR,details:L.LEVEL_PARSING_ERROR,fatal:!1,url:f,error:T,reason:T.message,response:e,context:i,level:p,parent:g,networkDetails:r,stats:s});return}switch(t.live&&n&&(n.getCacheAge&&(t.ageHeader=n.getCacheAge()||0),(!n.getCacheAge||isNaN(t.ageHeader))&&(t.ageHeader=0)),l){case G.MANIFEST:case G.LEVEL:o.trigger(m.LEVEL_LOADED,{details:t,level:p||0,id:h||0,stats:s,networkDetails:r,deliveryDirectives:d});break;case G.AUDIO_TRACK:o.trigger(m.AUDIO_TRACK_LOADED,{details:t,id:h||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:d});break;case G.SUBTITLE_TRACK:o.trigger(m.SUBTITLE_TRACK_LOADED,{details:t,id:h||0,groupId:u||"",stats:s,networkDetails:r,deliveryDirectives:d});break}}}function Ai(a,t){let e;try{e=new Event("addtrack")}catch{e=document.createEvent("Event"),e.initEvent("addtrack",!1,!1)}e.track=a,t.dispatchEvent(e)}function Li(a,t){const e=a.mode;if(e==="disabled"&&(a.mode="hidden"),a.cues&&!a.cues.getCueById(t.id))try{if(a.addCue(t),!a.cues.getCueById(t.id))throw new Error("addCue is failed for: ".concat(t))}catch(s){x.debug("[texttrack-utils]: ".concat(s));try{const i=new self.TextTrackCue(t.startTime,t.endTime,t.text);i.id=t.id,a.addCue(i)}catch(i){x.debug("[texttrack-utils]: Legacy TextTrackCue fallback failed: ".concat(i))}}e==="disabled"&&(a.mode=e)}function Ut(a){const t=a.mode;if(t==="disabled"&&(a.mode="hidden"),a.cues)for(let e=a.cues.length;e--;)a.removeCue(a.cues[e]);t==="disabled"&&(a.mode=t)}function $e(a,t,e,s){const i=a.mode;if(i==="disabled"&&(a.mode="hidden"),a.cues&&a.cues.length>0){const r=ln(a.cues,t,e);for(let n=0;na[e].endTime)return-1;let s=0,i=e;for(;s<=i;){const r=Math.floor((i+s)/2);if(ta[r].startTime&&s-1)for(let r=i,n=a.length;r=t&&o.endTime<=e)s.push(o);else if(o.startTime>e)return s}return s}var Tt={audioId3:"org.id3",dateRange:"com.apple.quicktime.HLS",emsg:"https://aomedia.org/emsg/ID3"};const cn=.25;function Ge(){if(!(typeof self>"u"))return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}const Xt=(()=>{const a=Ge();try{new a(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Se(a,t){return a.getTime()/1e3-t}function hn(a){return Uint8Array.from(a.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class un{constructor(t){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=t,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:t}=this;t.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(m.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:t}=this;t.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(m.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(t,e){this.media=e.media}onMediaDetaching(){this.id3Track&&(Ut(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(t){const e=this.getID3Track(t.textTracks);return e.mode="hidden",e}getID3Track(t){if(this.media){for(let e=0;eXt&&(u=Xt),u-h<=0&&(u=h+cn);for(let f=0;fh.type===Tt.audioId3&&l:i==="video"?c=h=>h.type===Tt.emsg&&o:c=h=>h.type===Tt.audioId3&&l||h.type===Tt.emsg&&o,$e(r,e,s,c)}}onLevelUpdated(t,{details:e}){if(!this.media||!e.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:s,id3Track:i}=this,{dateRanges:r}=e,n=Object.keys(r);if(i){const h=Object.keys(s).filter(u=>!n.includes(u));for(let u=h.length;u--;){const d=h[u];Object.keys(s[d].cues).forEach(f=>{i.removeCue(s[d].cues[f])}),delete s[d]}}const o=e.fragments[e.fragments.length-1];if(n.length===0||!F(o==null?void 0:o.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const l=o.programDateTime/1e3-o.start,c=Ge();for(let h=0;h{const D=r[k];return D.class===d.class&&D.id!==k&&D.startDate>d.startDate&&A.push(D),A},[]).sort((A,k)=>A.startDate.getTime()-k.startDate.getTime())[0];R&&(y=Se(R.startDate,l),p=!0)}const E=Object.keys(d.attr);for(let R=0;Rthis.timeupdate(),this.hls=t,this.config=t.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:t,levelDetails:e}=this;return t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}get targetLatency(){const{levelDetails:t}=this;if(t===null)return null;const{holdBack:e,partHoldBack:s,targetduration:i}=t,{liveSyncDuration:r,liveSyncDurationCount:n,lowLatencyMode:o}=this.config,l=this.hls.userConfig;let c=o&&s||e;(l.liveSyncDuration||l.liveSyncDurationCount||c===0)&&(c=r!==void 0?r:n*i);const h=i;return c+Math.min(this.stallCount*1,h)}get liveSyncPosition(){const t=this.estimateLiveEdge(),e=this.targetLatency,s=this.levelDetails;if(t===null||e===null||s===null)return null;const i=s.edge,r=t-e-this.edgeStalled,n=i-s.totalduration,o=i-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(n,r),o)}get drift(){const{levelDetails:t}=this;return t===null?1:t.drift}get edgeStalled(){const{levelDetails:t}=this;if(t===null)return 0;const e=(this.config.lowLatencyMode&&t.partTarget||t.targetduration)*3;return Math.max(t.age-e,0)}get forwardBufferLength(){const{media:t,levelDetails:e}=this;if(!t||!e)return 0;const s=t.buffered.length;return(s?t.buffered.end(s-1):e.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(m.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(m.ERROR,this.onError,this)}onMediaAttached(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(t,{details:e}){this.levelDetails=e,e.advanced&&this.timeupdate(),!e.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(t,e){var s;e.details===L.BUFFER_STALLED_ERROR&&(this.stallCount++,(s=this.levelDetails)!=null&&s.live&&x.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:t,levelDetails:e}=this;if(!t||!e)return;this.currentTime=t.currentTime;const s=this.computeLatency();if(s===null)return;this._latency=s;const{lowLatencyMode:i,maxLiveSyncPlaybackRate:r}=this.config;if(!i||r===1)return;const n=this.targetLatency;if(n===null)return;const o=s-n,l=Math.min(this.maxLatency,n+e.targetduration),c=o.05&&this.forwardBufferLength>1){const h=Math.min(2,Math.max(1,r)),u=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;t.playbackRate=Math.min(h,Math.max(1,u))}else t.playbackRate!==1&&t.playbackRate!==0&&(t.playbackRate=1)}estimateLiveEdge(){const{levelDetails:t}=this;return t===null?null:t.edge+t.age}computeLatency(){const t=this.estimateLiveEdge();return t===null?null:t-this.currentTime}}const Ke=["NONE","TYPE-0","TYPE-1",null];var Ht={No:"",Yes:"YES",v2:"v2"};function fn(a,t){const{canSkipUntil:e,canSkipDateRanges:s,endSN:i}=a,r=t!==void 0?t-i:0;return e&&re).join(",").replace(/\.[^.,]+/g,"")}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get attrs(){return this._attrs[this._urlId]}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get uri(){return this.url[this._urlId]||""}get urlId(){return this._urlId}set urlId(t){const e=t%this.url.length;this._urlId!==e&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=e)}get audioGroupId(){var t;return(t=this.audioGroupIds)==null?void 0:t[this.urlId]}get textGroupId(){var t;return(t=this.textGroupIds)==null?void 0:t[this.urlId]}addFallback(t){this.url.push(t.url),this._attrs.push(t.attrs)}}function ve(a,t){const e=t.startPTS;if(F(e)){let s=0,i;t.sn>a.sn?(s=e-a.start,i=a):(s=a.start-e,i=t),i.duration!==s&&(i.duration=s)}else t.sn>a.sn?a.cc===t.cc&&a.minEndPTS?t.start=a.start+(a.minEndPTS-a.start):t.start=a.start+a.duration:t.start=Math.max(a.start-t.duration,0)}function Ri(a,t,e,s,i,r){s-e<=0&&(x.warn("Fragment should have a positive duration",t),s=e+t.duration,r=i+t.duration);let o=e,l=s;const c=t.startPTS,h=t.endPTS;if(F(c)){const T=Math.abs(c-e);F(t.deltaPTS)?t.deltaPTS=Math.max(T,t.deltaPTS):t.deltaPTS=T,o=Math.max(e,c),e=Math.min(e,c),i=Math.min(i,t.startDTS),l=Math.min(s,h),s=Math.max(s,h),r=Math.max(r,t.endDTS)}const u=e-t.start;t.start!==0&&(t.start=e),t.duration=s-t.start,t.startPTS=e,t.maxStartPTS=o,t.startDTS=i,t.endPTS=s,t.minEndPTS=l,t.endDTS=r;const d=t.sn;if(!a||da.endSN)return 0;let f;const g=d-a.startSN,p=a.fragments;for(p[g]=t,f=g;f>0;f--)ve(p[f],p[f-1]);for(f=g;f=0;l--){const c=s[l].initSegment;if(c){e=c;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let i=0,r;if(Tn(a,t,(l,c)=>{l.relurl&&(i=l.cc-c.cc),F(l.startPTS)&&F(l.endPTS)&&(c.start=c.startPTS=l.startPTS,c.startDTS=l.startDTS,c.maxStartPTS=l.maxStartPTS,c.endPTS=l.endPTS,c.endDTS=l.endDTS,c.minEndPTS=l.minEndPTS,c.duration=l.endPTS-l.startPTS,c.duration&&(r=c),t.PTSKnown=t.alignedSliding=!0),c.elementaryStreams=l.elementaryStreams,c.loader=l.loader,c.stats=l.stats,c.urlId=l.urlId,l.initSegment&&(c.initSegment=l.initSegment,e=l.initSegment)}),e&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach(c=>{var h;(!c.initSegment||c.initSegment.relurl===((h=e)==null?void 0:h.relurl))&&(c.initSegment=e)}),t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some(l=>!l),t.deltaUpdateFailed){x.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=t.skippedSegments;l--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=mn(a.dateRanges,t.dateRanges,t.recentlyRemovedDateranges));const n=t.fragments;if(i){x.warn("discontinuity sliding from playlist, take drift into account");for(let l=0;l{c.elementaryStreams=l.elementaryStreams,c.stats=l.stats}),r?Ri(t,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):Ii(a,t),n.length&&(t.totalduration=t.edge-n[0].start),t.driftStartTime=a.driftStartTime,t.driftStart=a.driftStart;const o=t.advancedDateTime;if(t.advanced&&o){const l=t.edge;t.driftStart||(t.driftStartTime=o,t.driftStart=l),t.driftEndTime=o,t.driftEnd=l}else t.driftEndTime=a.driftEndTime,t.driftEnd=a.driftEnd,t.advancedDateTime=a.advancedDateTime}function mn(a,t,e){const s=tt({},a);return e&&e.forEach(i=>{delete s[i]}),Object.keys(t).forEach(i=>{const r=new oi(t[i].attr,s[i]);r.isValid?s[i]=r:x.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'.concat(JSON.stringify(t[i].attr),'"'))}),s}function pn(a,t,e){if(a&&t){let s=0;for(let i=0,r=a.length;i<=r;i++){const n=a[i],o=t[i+s];n&&o&&n.index===o.index&&n.fragment.sn===o.fragment.sn?e(n,o):s--}}}function Tn(a,t,e){const s=t.skippedSegments,i=Math.max(a.startSN,t.startSN)-t.startSN,r=(a.fragmentHint?1:0)+(s?t.endSN:Math.min(a.endSN,t.endSN))-t.startSN,n=t.startSN-a.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let c=i;c<=r;c++){const h=l[n+c];let u=o[c];s&&!u&&c=s.length||He(t,s[e].start)}function He(a,t){if(t){const e=a.fragments;for(let s=a.skippedSegments;st){const r=s[s.length-1].duration*1e3;r499)}const Di={search:function(a,t){let e=0,s=a.length-1,i=null,r=null;for(;e<=s;){i=(e+s)/2|0,r=a[i];const n=t(r);if(n>0)e=i+1;else if(n<0)s=i-1;else return r}return null}};function Sn(a,t,e){if(t===null||!Array.isArray(a)||!a.length||!F(t))return null;const s=a[0].programDateTime;if(t<(s||0))return null;const i=a[a.length-1].endProgramDateTime;if(t>=(i||0))return null;e=e||0;for(let r=0;ra)return 0;const s=Math.min(t,e.duration+(e.deltaPTS?e.deltaPTS:0));return e.start+e.duration-s<=a?1:e.start-s>a&&e.start?-1:0}function vn(a,t,e){const s=Math.min(t,e.duration+(e.deltaPTS?e.deltaPTS:0))*1e3;return(e.endProgramDateTime||0)-s>a}function An(a,t){return Di.search(a,e=>e.cct?-1:0)}const Ln=3e5;var rt={DoNothing:0,SendAlternateToPenaltyBox:2,RetryRequest:5},ft={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2};class Rn{constructor(t){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=t,this.log=x.log.bind(x,"[info]:"),this.warn=x.warn.bind(x,"[warning]:"),this.error=x.error.bind(x,"[error]:"),this.registerListeners()}registerListeners(){const t=this.hls;t.on(m.ERROR,this.onError,this),t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const t=this.hls;t&&(t.off(m.ERROR,this.onError,this),t.off(m.ERROR,this.onErrorOut,this),t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(t){this.playlistError=0}stopLoad(){}getVariantLevelIndex(t){return(t==null?void 0:t.type)===U.MAIN?t.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(t,e){var s,i;if(e.fatal)return;const r=this.hls,n=e.context;switch(e.details){case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:e.errorAction=this.getFragRetryOrSwitchAction(e);return;case L.FRAG_PARSING_ERROR:if((s=e.frag)!=null&&s.gap){e.errorAction={action:rt.DoNothing,flags:ft.None};return}case L.FRAG_GAP:case L.FRAG_DECRYPT_ERROR:{e.errorAction=this.getFragRetryOrSwitchAction(e),e.errorAction.action=rt.SendAlternateToPenaltyBox;return}case L.LEVEL_EMPTY_ERROR:case L.LEVEL_PARSING_ERROR:{var o,l;const c=e.parent===U.MAIN?e.level:r.loadLevel;e.details===L.LEVEL_EMPTY_ERROR&&((o=e.context)!=null&&(l=o.levelDetails)!=null&&l.live)?e.errorAction=this.getPlaylistRetryOrSwitchAction(e,c):(e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,c))}return;case L.LEVEL_LOAD_ERROR:case L.LEVEL_LOAD_TIMEOUT:typeof(n==null?void 0:n.level)=="number"&&(e.errorAction=this.getPlaylistRetryOrSwitchAction(e,n.level));return;case L.AUDIO_TRACK_LOAD_ERROR:case L.AUDIO_TRACK_LOAD_TIMEOUT:case L.SUBTITLE_LOAD_ERROR:case L.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){const c=r.levels[r.loadLevel];if(c&&(n.type===G.AUDIO_TRACK&&n.groupId===c.audioGroupId||n.type===G.SUBTITLE_TRACK&&n.groupId===c.textGroupId)){e.errorAction=this.getPlaylistRetryOrSwitchAction(e,r.loadLevel),e.errorAction.action=rt.SendAlternateToPenaltyBox,e.errorAction.flags=ft.MoveAllAlternatesMatchingHost;return}}return;case L.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const c=r.levels[r.loadLevel],h=c==null?void 0:c.attrs["HDCP-LEVEL"];h&&(e.errorAction={action:rt.SendAlternateToPenaltyBox,flags:ft.MoveAllAlternatesMatchingHDCP,hdcpLevel:h})}return;case L.BUFFER_ADD_CODEC_ERROR:case L.REMUX_ALLOC_ERROR:e.errorAction=this.getLevelSwitchAction(e,(i=e.level)!=null?i:r.loadLevel);return;case L.INTERNAL_EXCEPTION:case L.BUFFER_APPENDING_ERROR:case L.BUFFER_APPEND_ERROR:case L.BUFFER_FULL_ERROR:case L.LEVEL_SWITCH_ERROR:case L.BUFFER_STALLED_ERROR:case L.BUFFER_SEEK_OVER_HOLE:case L.BUFFER_NUDGE_ON_STALL:e.errorAction={action:rt.DoNothing,flags:ft.None};return}if(e.type===N.KEY_SYSTEM_ERROR){const c=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,c);return}}getPlaylistRetryOrSwitchAction(t,e){var s;const i=this.hls,r=_s(i.config.playlistLoadPolicy,t),n=this.playlistError++,o=(s=t.response)==null?void 0:s.code;if(le(r,n,oe(t),o))return{action:rt.RetryRequest,flags:ft.None,retryConfig:r,retryCount:n};const c=this.getLevelSwitchAction(t,e);return r&&(c.retryConfig=r,c.retryCount=n),c}getFragRetryOrSwitchAction(t){const e=this.hls,s=this.getVariantLevelIndex(t.frag),i=e.levels[s],{fragLoadPolicy:r,keyLoadPolicy:n}=e.config,o=_s(t.details.startsWith("key")?n:r,t),l=e.levels.reduce((u,d)=>u+d.fragmentError,0);if(i){var c;t.details!==L.FRAG_GAP&&i.fragmentError++;const u=(c=t.response)==null?void 0:c.code;if(le(o,l,oe(t),u))return{action:rt.RetryRequest,flags:ft.None,retryConfig:o,retryCount:l}}const h=this.getLevelSwitchAction(t,s);return o&&(h.retryConfig=o,h.retryCount=l),h}getLevelSwitchAction(t,e){const s=this.hls;e==null&&(e=s.loadLevel);const i=this.hls.levels[e];if(i&&(i.loadError++,s.autoLevelEnabled)){var r,n;let o=-1;const{levels:l,loadLevel:c,minAutoLevel:h,maxAutoLevel:u}=s,d=(r=t.frag)==null?void 0:r.type,{type:f,groupId:g}=(n=t.context)!=null?n:{};for(let p=l.length;p--;){const T=(p+c)%l.length;if(T!==c&&T>=h&&T<=u&&l[T].loadError===0){const y=l[T];if(t.details===L.FRAG_GAP&&t.frag){const S=l[T].details;if(S){const E=Yt(t.frag,S.fragments,t.frag.start);if(E!=null&&E.gap)continue}}else{if(f===G.AUDIO_TRACK&&g===y.audioGroupId||f===G.SUBTITLE_TRACK&&g===y.textGroupId)continue;if(d===U.AUDIO&&i.audioGroupId===y.audioGroupId||d===U.SUBTITLE&&i.textGroupId===y.textGroupId)continue}o=T;break}}if(o>-1&&s.loadLevel!==o)return t.levelRetry=!0,this.playlistError=0,{action:rt.SendAlternateToPenaltyBox,flags:ft.None,nextAutoLevel:o}}return{action:rt.SendAlternateToPenaltyBox,flags:ft.MoveAllAlternatesMatchingHost}}onErrorOut(t,e){var s;switch((s=e.errorAction)==null?void 0:s.action){case rt.DoNothing:break;case rt.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(e),!e.errorAction.resolved&&e.details!==L.FRAG_GAP&&(e.fatal=!0);break}if(e.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(t){const e=this.hls,s=t.errorAction;if(!s)return;const{flags:i,hdcpLevel:r,nextAutoLevel:n}=s;switch(i){case ft.None:this.switchLevel(t,n);break;case ft.MoveAllAlternatesMatchingHost:s.resolved||(s.resolved=this.redundantFailover(t));break;case ft.MoveAllAlternatesMatchingHDCP:r&&(e.maxHdcpLevel=Ke[Ke.indexOf(r)-1],s.resolved=!0),this.warn('Restricting playback to HDCP-LEVEL of "'.concat(e.maxHdcpLevel,'" or lower'));break}s.resolved||this.switchLevel(t,n)}switchLevel(t,e){e!==void 0&&t.errorAction&&(this.warn("switching to level ".concat(e," after ").concat(t.details)),this.hls.nextAutoLevel=e,t.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}redundantFailover(t){const{hls:e,penalizedRenditions:s}=this,i=t.parent===U.MAIN?t.level:e.loadLevel,r=e.levels[i],n=r.url.length,o=t.frag?t.frag.urlId:r.urlId;r.urlId===o&&(!t.frag||r.details)&&this.penalizeRendition(r,t);for(let l=1;l{u.urlId=c}),e.nextLoadLevel=i,!0}return!1}penalizeRendition(t,e){const{penalizedRenditions:s}=this,i=s[t.urlId]||{lastErrorPerfMs:0,errors:[],details:void 0};i.lastErrorPerfMs=performance.now(),i.errors.push(e),i.details=t.details,s[t.urlId]=i}}function In(a,t,e){if(performance.now()-a.lastErrorPerfMs>Ln)return!0;const s=a.details;if(t.details===L.FRAG_GAP&&s&&t.frag){const i=t.frag.start,r=Yt(null,s.fragments,i);if(r&&!r.gap)return!0}if(e&&a.errors.lengths.targetduration*3)return!0}return!1}class Je{constructor(t,e){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=x.log.bind(x,"".concat(e,":")),this.warn=x.warn.bind(x,"".concat(e,":")),this.hls=t}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){clearTimeout(this.timer),this.timer=-1}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(t,e){const s=e==null?void 0:e.renditionReports;if(s){let i=-1;for(let r=0;r=0&&l>e.partTarget&&(o+=1)}return new Cs(n,o>=0?o:void 0,Ht.No)}}}loadPlaylist(t){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(t){return this.canLoad&&!!t&&!!t.url&&(!t.details||t.details.live)}shouldReloadPlaylist(t){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(t)}playlistLoaded(t,e,s){const{details:i,stats:r}=e,n=self.performance.now(),o=r.loading.first?Math.max(0,n-r.loading.first):0;if(i.advancedDateTime=Date.now()-o,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log("live playlist ".concat(t," ").concat(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED")),s&&i.fragments.length>0&&gn(s,i),!this.canLoad||!i.live)return;let l,c,h;if(i.canBlockReload&&i.endSN&&i.advanced){const T=this.hls.config.lowLatencyMode,y=i.lastPartSn,S=i.endSN,E=i.lastPartIndex,R=E!==-1,A=y===S,k=T?0:E;R?(c=A?S+1:y,h=A?k:E+1):c=S+1;const D=i.age,C=D+i.ageHeader;let _=Math.min(C-i.partTarget,i.targetduration*1.5);if(_>0){if(s&&_>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: ".concat(s.tuneInGoal," to: ").concat(_," with playlist age: ").concat(i.age)),_=0;else{const I=Math.floor(_/i.targetduration);if(c+=I,h!==void 0){const O=Math.round(_%i.targetduration/i.partTarget);h+=O}this.log("CDN Tune-in age: ".concat(i.ageHeader,"s last advanced ").concat(D.toFixed(2),"s goal: ").concat(_," skip sn ").concat(I," to part ").concat(h))}i.tuneInGoal=_}if(l=this.getDeliveryDirectives(i,e.deliveryDirectives,c,h),T||!A){this.loadPlaylist(l);return}}else(i.canBlockReload||i.canSkipUntil)&&(l=this.getDeliveryDirectives(i,e.deliveryDirectives,c,h));const u=this.hls.mainForwardBufferInfo,d=u?u.end-u.len:0,f=(i.edge-d)*1e3,g=yn(i,f);i.updated&&n>this.requestScheduled+g&&(this.requestScheduled=r.loading.start),c!==void 0&&i.canBlockReload?this.requestScheduled=r.loading.first+g-(i.partTarget*1e3||1e3):this.requestScheduled===-1||this.requestScheduled+gthis.loadPlaylist(l),p)}else this.clearTimer()}getDeliveryDirectives(t,e,s,i){let r=fn(t,s);return e!=null&&e.skip&&t.deltaUpdateFailed&&(s=e.msn,i=e.part,r=Ht.No),new Cs(s,i,r)}checkRetry(t){const e=t.details,s=oe(t),i=t.errorAction,{action:r,retryCount:n=0,retryConfig:o}=i||{},l=!!i&&!!o&&(r===rt.RetryRequest||!i.resolved&&r===rt.SendAlternateToPenaltyBox);if(l){var c;if(this.requestScheduled=-1,n>=o.maxNumRetry)return!1;if(s&&(c=t.context)!=null&&c.deliveryDirectives)this.warn("Retrying playlist loading ".concat(n+1,"/").concat(o.maxNumRetry,' after "').concat(e,'" without delivery-directives')),this.loadPlaylist();else{const h=Qe(o,n);this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn("Retrying playlist loading ".concat(n+1,"/").concat(o.maxNumRetry,' after "').concat(e,'" in ').concat(h,"ms"))}t.levelRetry=!0,i.resolved=!0}return l}}let Ae;class bn extends Je{constructor(t,e){super(t,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=e,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(m.LEVEL_LOADED,this.onLevelLoaded,this),t.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(m.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(m.FRAG_LOADED,this.onFragLoaded,this),t.on(m.ERROR,this.onError,this)}_unregisterListeners(){const{hls:t}=this;t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(m.LEVEL_LOADED,this.onLevelLoaded,this),t.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(m.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(m.FRAG_LOADED,this.onFragLoaded,this),t.off(m.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}startLoad(){this._levels.forEach(e=>{e.loadError=0,e.fragmentError=0}),super.startLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]}onManifestLoading(t,e){this.resetLevels()}onManifestLoaded(t,e){const s=[],i={};let r;e.levels.forEach(n=>{var o;const l=n.attrs;((o=n.audioCodec)==null?void 0:o.indexOf("mp4a.40.34"))!==-1&&(Ae||(Ae=/chrome|firefox/i.test(navigator.userAgent)),Ae&&(n.audioCodec=void 0));const{AUDIO:c,CODECS:h,"FRAME-RATE":u,"PATHWAY-ID":d,RESOLUTION:f,SUBTITLES:g}=l,p="".concat(d||".","-"),T="".concat(p).concat(n.bitrate,"-").concat(f,"-").concat(u,"-").concat(h);r=i[T],r?r.addFallback(n):(r=new Wt(n),i[T]=r,s.push(r)),ce(r,"audio",c),ce(r,"text",g)}),this.filterAndSortMediaOptions(s,e)}filterAndSortMediaOptions(t,e){let s=[],i=[],r=!1,n=!1,o=!1,l=t.filter(({audioCodec:f,videoCodec:g,width:p,height:T,unknownCodecs:y})=>(r||(r=!!(p&&T)),n||(n=!!g),o||(o=!!f),!(y!=null&&y.length)&&(!f||xe(f,"audio"))&&(!g||xe(g,"video"))));if((r||n)&&o&&(l=l.filter(({videoCodec:f,width:g,height:p})=>!!f||!!(g&&p))),l.length===0){Promise.resolve().then(()=>{if(this.hls){const f=new Error("no level with compatible codecs found in manifest");this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,error:f,reason:f.message})}});return}e.audioTracks&&(s=e.audioTracks.filter(f=>!f.audioCodec||xe(f.audioCodec,"audio")),Ps(s)),e.subtitles&&(i=e.subtitles,Ps(i));const c=l.slice(0);l.sort((f,g)=>f.attrs["HDCP-LEVEL"]!==g.attrs["HDCP-LEVEL"]?(f.attrs["HDCP-LEVEL"]||"")>(g.attrs["HDCP-LEVEL"]||"")?1:-1:f.bitrate!==g.bitrate?f.bitrate-g.bitrate:f.attrs["FRAME-RATE"]!==g.attrs["FRAME-RATE"]?f.attrs.decimalFloatingPoint("FRAME-RATE")-g.attrs.decimalFloatingPoint("FRAME-RATE"):f.attrs.SCORE!==g.attrs.SCORE?f.attrs.decimalFloatingPoint("SCORE")-g.attrs.decimalFloatingPoint("SCORE"):r&&f.height!==g.height?f.height-g.height:0);let h=c[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==c.length)){for(let f=0;f!!f.url)};this.hls.trigger(m.MANIFEST_PARSED,d),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return this._levels.length===0?null:this._levels}get level(){return this.currentLevelIndex}set level(t){const e=this._levels;if(e.length===0)return;if(t<0||t>=e.length){const h=new Error("invalid level idx"),u=t<0;if(this.hls.trigger(m.ERROR,{type:N.OTHER_ERROR,details:L.LEVEL_SWITCH_ERROR,level:t,fatal:u,error:h,reason:h.message}),u)return;t=Math.min(t,e.length-1)}const s=this.currentLevelIndex,i=this.currentLevel,r=i?i.attrs["PATHWAY-ID"]:void 0,n=e[t],o=n.attrs["PATHWAY-ID"];if(this.currentLevelIndex=t,this.currentLevel=n,s===t&&n.details&&i&&r===o)return;this.log("Switching to level ".concat(t).concat(o?" with Pathway "+o:""," from level ").concat(s).concat(r?" with Pathway "+r:""));const l=tt({},n,{level:t,maxBitrate:n.maxBitrate,attrs:n.attrs,uri:n.uri,urlId:n.urlId});delete l._attrs,delete l._urlId,this.hls.trigger(m.LEVEL_SWITCHING,l);const c=n.details;if(!c||c.live){const h=this.switchParams(n.uri,i==null?void 0:i.details);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(t){this.manualLevelIndex=t,this._startLevel===void 0&&(this._startLevel=t),t!==-1&&(this.level=t)}get firstLevel(){return this._firstLevel}set firstLevel(t){this._firstLevel=t}get startLevel(){if(this._startLevel===void 0){const t=this.hls.config.startLevel;return t!==void 0?t:this._firstLevel}else return this._startLevel}set startLevel(t){this._startLevel=t}onError(t,e){e.fatal||!e.context||e.context.type===G.LEVEL&&e.context.level===this.level&&this.checkRetry(e)}onFragLoaded(t,{frag:e}){if(e!==void 0&&e.type===U.MAIN){const s=this._levels[e.level];s!==void 0&&(s.loadError=0)}}onLevelLoaded(t,e){var s;const{level:i,details:r}=e,n=this._levels[i];if(!n){var o;this.warn("Invalid level index ".concat(i)),(o=e.deliveryDirectives)!=null&&o.skip&&(r.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(n.fragmentError===0&&(n.loadError=0),this.playlistLoaded(i,e,n.details)):(s=e.deliveryDirectives)!=null&&s.skip&&(r.deltaUpdateFailed=!0)}onAudioTrackSwitched(t,e){const s=this.currentLevel;if(!s)return;const i=this.hls.audioTracks[e.id].groupId;if(s.audioGroupIds&&s.audioGroupId!==i){let r=-1;for(let n=0;nn!==e,i=this._levels.filter((r,n)=>n!==t?!0:r.url.length>1&&e!==void 0?(r.url=r.url.filter(s),r.audioGroupIds&&(r.audioGroupIds=r.audioGroupIds.filter(s)),r.textGroupIds&&(r.textGroupIds=r.textGroupIds.filter(s)),r.urlId=0,!0):(this.steering&&this.steering.removeLevel(r),!1));this.hls.trigger(m.LEVELS_UPDATED,{levels:i})}onLevelsUpdated(t,{levels:e}){e.forEach((s,i)=>{const{details:r}=s;r!=null&&r.fragments&&r.fragments.forEach(n=>{n.level=i})}),this._levels=e}}function ce(a,t,e){e&&(t==="audio"?(a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds[a.url.length-1]=e):t==="text"&&(a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds[a.url.length-1]=e))}function Ps(a){const t={};a.forEach(e=>{const s=e.groupId||"";e.id=t[s]=t[s]||0,t[s]++})}var et={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class Dn{constructor(t){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=t,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(m.BUFFER_APPENDED,this.onBufferAppended,this),t.on(m.FRAG_BUFFERED,this.onFragBuffered,this),t.on(m.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:t}=this;t.off(m.BUFFER_APPENDED,this.onBufferAppended,this),t.off(m.FRAG_BUFFERED,this.onFragBuffered,this),t.off(m.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(t,e){const s=this.activePartLists[e];if(s)for(let i=s.length;i--;){const r=s[i];if(!r)break;const n=r.end;if(r.start<=t&&n!==null&&t<=n)return r}return this.getBufferedFrag(t,e)}getBufferedFrag(t,e){const{fragments:s}=this,i=Object.keys(s);for(let r=i.length;r--;){const n=s[i[r]];if((n==null?void 0:n.body.type)===e&&n.buffered){const o=n.body;if(o.start<=t&&t<=o.end)return o}}return null}detectEvictedFragments(t,e,s,i){this.timeRanges&&(this.timeRanges[t]=e);const r=(i==null?void 0:i.fragment.sn)||-1;Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o||r>=o.body.sn)return;if(!o.buffered&&!o.loaded){o.body.type===s&&this.removeFragment(o.body);return}const l=o.range[t];l&&l.time.some(c=>{const h=!this.isTimeBuffered(c.startPTS,c.endPTS,e);return h&&this.removeFragment(o.body),h})})}detectPartialFragments(t){const e=this.timeRanges,{frag:s,part:i}=t;if(!e||s.sn==="initSegment")return;const r=Ft(s),n=this.fragments[r];if(!n||n.buffered&&s.gap)return;const o=!s.relurl;Object.keys(e).forEach(l=>{const c=s.elementaryStreams[l];if(!c)return;const h=e[l],u=o||c.partial===!0;n.range[l]=this.getBufferedTimes(s,i,u,h)}),n.loaded=null,Object.keys(n.range).length?(n.buffered=!0,(n.body.endList=s.endList||n.body.endList)&&(this.endListFragments[n.body.type]=n),zt(n)||this.removeParts(s.sn-1,s.type)):this.removeFragment(n.body)}removeParts(t,e){const s=this.activePartLists[e];s&&(this.activePartLists[e]=s.filter(i=>i.fragment.sn>=t))}fragBuffered(t,e){const s=Ft(t);let i=this.fragments[s];!i&&e&&(i=this.fragments[s]={body:t,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},t.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,i.buffered=!0)}getBufferedTimes(t,e,s,i){const r={time:[],partial:s},n=t.start,o=t.end,l=t.minEndPTS||o,c=t.maxStartPTS||n;for(let h=0;h=u&&l<=d){r.time.push({startPTS:Math.max(n,i.start(h)),endPTS:Math.min(o,i.end(h))});break}else if(nu)r.partial=!0,r.time.push({startPTS:Math.max(n,i.start(h)),endPTS:Math.min(o,i.end(h))});else if(o<=u)break}return r}getPartialFragment(t){let e=null,s,i,r,n=0;const{bufferPadding:o,fragments:l}=this;return Object.keys(l).forEach(c=>{const h=l[c];h&&zt(h)&&(i=h.body.start-o,r=h.body.end+o,t>=i&&t<=r&&(s=Math.min(t-i,r-t),n<=s&&(e=h.body,n=s)))}),e}isEndListAppended(t){const e=this.endListFragments[t];return e!==void 0&&(e.buffered||zt(e))}getState(t){const e=Ft(t),s=this.fragments[e];return s?s.buffered?zt(s)?et.PARTIAL:et.OK:et.APPENDING:et.NOT_LOADED}isTimeBuffered(t,e,s){let i,r;for(let n=0;n=i&&e<=r)return!0;if(e<=i)return!1}return!1}onFragLoaded(t,e){const{frag:s,part:i}=e;if(s.sn==="initSegment"||s.bitrateTest)return;const r=i?null:e,n=Ft(s);this.fragments[n]={body:s,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(t,e){const{frag:s,part:i,timeRanges:r}=e;if(s.sn==="initSegment")return;const n=s.type;if(i){let o=this.activePartLists[n];o||(this.activePartLists[n]=o=[]),o.push(i)}this.timeRanges=r,Object.keys(r).forEach(o=>{const l=r[o];this.detectEvictedFragments(o,l,n,i)})}onFragBuffered(t,e){this.detectPartialFragments(e)}hasFragment(t){const e=Ft(t);return!!this.fragments[e]}hasParts(t){var e;return!!((e=this.activePartLists[t])!=null&&e.length)}removeFragmentsInRange(t,e,s,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o)return;const l=o.body;l.type!==s||i&&!l.gap||l.startt&&(o.buffered||r)&&this.removeFragment(l)})}removeFragment(t){const e=Ft(t);t.stats.loaded=0,t.clearElementaryStreamInfo();const s=this.activePartLists[t.type];if(s){const i=t.sn;this.activePartLists[t.type]=s.filter(r=>r.fragment.sn!==i)}delete this.fragments[e],t.endList&&delete this.endListFragments[t.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function zt(a){var t,e,s;return a.buffered&&(a.body.gap||((t=a.range.video)==null?void 0:t.partial)||((e=a.range.audio)==null?void 0:e.partial)||((s=a.range.audiovideo)==null?void 0:s.partial))}function Ft(a){return"".concat(a.type,"_").concat(a.level,"_").concat(a.urlId,"_").concat(a.sn)}const Fs=Math.pow(2,17);class Cn{constructor(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(t,e){const s=t.url;if(!s)return Promise.reject(new At({type:N.NETWORK_ERROR,details:L.FRAG_LOAD_ERROR,fatal:!1,frag:t,error:new Error("Fragment does not have a ".concat(s?"part list":"url")),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,n=i.loader;return new Promise((o,l)=>{if(this.loader&&this.loader.destroy(),t.gap)if(t.tagList.some(f=>f[0]==="GAP")){l(Ms(t));return}else t.gap=!1;const c=this.loader=t.loader=r?new r(i):new n(i),h=Os(t),u=ws(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:t.sn==="initSegment"?1/0:Fs};t.stats=c.stats,c.load(h,d,{onSuccess:(f,g,p,T)=>{this.resetLoader(t,c);let y=f.data;p.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(y.slice(0,16)),y=y.slice(16)),o({frag:t,part:null,payload:y,networkDetails:T})},onError:(f,g,p,T)=>{this.resetLoader(t,c),l(new At({type:N.NETWORK_ERROR,details:L.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:ct({url:s,data:void 0},f),error:new Error("HTTP Error ".concat(f.code," ").concat(f.text)),networkDetails:p,stats:T}))},onAbort:(f,g,p)=>{this.resetLoader(t,c),l(new At({type:N.NETWORK_ERROR,details:L.INTERNAL_ABORTED,fatal:!1,frag:t,error:new Error("Aborted"),networkDetails:p,stats:f}))},onTimeout:(f,g,p)=>{this.resetLoader(t,c),l(new At({type:N.NETWORK_ERROR,details:L.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,error:new Error("Timeout after ".concat(d.timeout,"ms")),networkDetails:p,stats:f}))},onProgress:(f,g,p,T)=>{e&&e({frag:t,part:null,payload:p,networkDetails:T})}})})}loadPart(t,e,s){this.abort();const i=this.config,r=i.fLoader,n=i.loader;return new Promise((o,l)=>{if(this.loader&&this.loader.destroy(),t.gap||e.gap){l(Ms(t,e));return}const c=this.loader=t.loader=r?new r(i):new n(i),h=Os(t,e),u=ws(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Fs};e.stats=c.stats,c.load(h,d,{onSuccess:(f,g,p,T)=>{this.resetLoader(t,c),this.updateStatsFromPart(t,e);const y={frag:t,part:e,payload:f.data,networkDetails:T};s(y),o(y)},onError:(f,g,p,T)=>{this.resetLoader(t,c),l(new At({type:N.NETWORK_ERROR,details:L.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:ct({url:h.url,data:void 0},f),error:new Error("HTTP Error ".concat(f.code," ").concat(f.text)),networkDetails:p,stats:T}))},onAbort:(f,g,p)=>{t.stats.aborted=e.stats.aborted,this.resetLoader(t,c),l(new At({type:N.NETWORK_ERROR,details:L.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,error:new Error("Aborted"),networkDetails:p,stats:f}))},onTimeout:(f,g,p)=>{this.resetLoader(t,c),l(new At({type:N.NETWORK_ERROR,details:L.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,error:new Error("Timeout after ".concat(d.timeout,"ms")),networkDetails:p,stats:f}))}})})}updateStatsFromPart(t,e){const s=t.stats,i=e.stats,r=i.total;if(s.loaded+=i.loaded,r){const l=Math.round(t.duration/e.duration),c=Math.min(Math.round(s.loaded/r),l),u=(l-c)*Math.round(s.loaded/c);s.total=s.loaded+u}else s.total=Math.max(s.loaded,s.total);const n=s.loading,o=i.loading;n.start?n.first+=o.first-o.start:(n.start=o.start,n.first=o.first),n.end=o.end}resetLoader(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()}}function Os(a,t=null){const e=t||a,s={frag:a,part:t,responseType:"arraybuffer",url:e.url,headers:{},rangeStart:0,rangeEnd:0},i=e.byteRangeStartOffset,r=e.byteRangeEndOffset;if(F(i)&&F(r)){var n;let o=i,l=r;if(a.sn==="initSegment"&&((n=a.decryptdata)==null?void 0:n.method)==="AES-128"){const c=r-i;c%16&&(l=r+(16-c%16)),i!==0&&(s.resetIV=!0,o=i-16)}s.rangeStart=o,s.rangeEnd=l}return s}function Ms(a,t){const e=new Error("GAP ".concat(a.gap?"tag":"attribute"," found")),s={type:N.MEDIA_ERROR,details:L.FRAG_GAP,fatal:!1,frag:a,error:e,networkDetails:null};return t&&(s.part=t),(t||a).stats.aborted=!0,new At(s)}class At extends Error{constructor(t){super(t.error.message),this.data=void 0,this.data=t}}class kn{constructor(t){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=t}abort(t){for(const e in this.keyUriToKeyInfo){const s=this.keyUriToKeyInfo[e].loader;if(s){if(t&&t!==s.context.frag.type)return;s.abort()}}}detach(){for(const t in this.keyUriToKeyInfo){const e=this.keyUriToKeyInfo[t];(e.mediaKeySessionContext||e.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[t]}}destroy(){this.detach();for(const t in this.keyUriToKeyInfo){const e=this.keyUriToKeyInfo[t].loader;e&&e.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(t,e=L.KEY_LOAD_ERROR,s,i,r){return new At({type:N.NETWORK_ERROR,details:e,fatal:!1,frag:t,response:r,error:s,networkDetails:i})}loadClear(t,e){if(this.emeController&&this.config.emeEnabled){const{sn:s,cc:i}=t;for(let r=0;r{n.setKeyFormat(o)});break}}}}load(t){return!t.decryptdata&&t.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(t).then(e=>this.loadInternal(t,e)):this.loadInternal(t)}loadInternal(t,e){var s,i;e&&t.setKeyFormat(e);const r=t.decryptdata;if(!r){const c=new Error(e?"Expected frag.decryptdata to be defined after setting format ".concat(e):"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(t,L.KEY_LOAD_ERROR,c))}const n=r.uri;if(!n)return Promise.reject(this.createKeyLoadError(t,L.KEY_LOAD_ERROR,new Error('Invalid key URI: "'.concat(n,'"'))));let o=this.keyUriToKeyInfo[n];if((s=o)!=null&&s.decryptdata.key)return r.key=o.decryptdata.key,Promise.resolve({frag:t,keyInfo:o});if((i=o)!=null&&i.keyLoadPromise){var l;switch((l=o.mediaKeySessionContext)==null?void 0:l.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return o.keyLoadPromise.then(c=>(r.key=c.keyInfo.decryptdata.key,{frag:t,keyInfo:o}))}}switch(o=this.keyUriToKeyInfo[n]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(o,t):this.loadKeyEME(o,t);case"AES-128":return this.loadKeyHTTP(o,t);default:return Promise.reject(this.createKeyLoadError(t,L.KEY_LOAD_ERROR,new Error('Key supplied with unsupported METHOD: "'.concat(r.method,'"'))))}}loadKeyEME(t,e){const s={frag:e,keyInfo:t};if(this.emeController&&this.config.emeEnabled){const i=this.emeController.loadKey(s);if(i)return(t.keyLoadPromise=i.then(r=>(t.mediaKeySessionContext=r,s))).catch(r=>{throw t.keyLoadPromise=null,r})}return Promise.resolve(s)}loadKeyHTTP(t,e){const s=this.config,i=s.loader,r=new i(s);return e.keyLoader=t.loader=r,t.keyLoadPromise=new Promise((n,o)=>{const l={keyInfo:t,frag:e,responseType:"arraybuffer",url:t.decryptdata.uri},c=s.keyLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(d,f,g,p)=>{const{frag:T,keyInfo:y,url:S}=g;if(!T.decryptdata||y!==this.keyUriToKeyInfo[S])return o(this.createKeyLoadError(T,L.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),p));y.decryptdata.key=T.decryptdata.key=new Uint8Array(d.data),T.keyLoader=null,y.loader=null,n({frag:T,keyInfo:y})},onError:(d,f,g,p)=>{this.resetLoader(f),o(this.createKeyLoadError(e,L.KEY_LOAD_ERROR,new Error("HTTP Error ".concat(d.code," loading key ").concat(d.text)),g,ct({url:l.url,data:void 0},d)))},onTimeout:(d,f,g)=>{this.resetLoader(f),o(this.createKeyLoadError(e,L.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),g))},onAbort:(d,f,g)=>{this.resetLoader(f),o(this.createKeyLoadError(e,L.INTERNAL_ABORTED,new Error("key loading aborted"),g))}};r.load(l,h,u)})}resetLoader(t){const{frag:e,keyInfo:s,url:i}=t,r=s.loader;e.keyLoader===r&&(e.keyLoader=null,s.loader=null),delete this.keyUriToKeyInfo[i],r&&r.destroy()}}class _n{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(t){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,t),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}const wn={length:0,start:()=>0,end:()=>0};class q{static isBuffered(t,e){try{if(t){const s=q.getBuffered(t);for(let i=0;i=s.start(i)&&e<=s.end(i))return!0}}catch{}return!1}static bufferInfo(t,e,s){try{if(t){const i=q.getBuffered(t),r=[];let n;for(n=0;nu&&(i[h-1].end=t[c].end):i.push(t[c])}else i.push(t[c])}else i=t;let r=0,n,o=e,l=e;for(let c=0;c=h&&ee.startCC||a&&a.cc>>8^y&255^99,t[g]=y,e[y]=g;const S=f[g],E=f[S],R=f[E];let A=f[y]*257^y*16843008;i[g]=A<<24|A>>>8,r[g]=A<<16|A>>>16,n[g]=A<<8|A>>>24,o[g]=A,A=R*16843009^E*65537^S*257^g*16843008,c[y]=A<<24|A>>>8,h[y]=A<<16|A>>>16,u[y]=A<<8|A>>>24,d[y]=A,g?(g=S^f[f[f[R^S]]],p^=f[f[p]]):g=p=1}}expandKey(t){const e=this.uint8ArrayToUint32Array_(t);let s=!0,i=0;for(;ii?(this.logOnce("WebCrypto AES decrypt"),new Un(i,new Uint8Array(s)).decrypt(t.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(x.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, ".concat(r.name,": ").concat(r.message)),this.onWebCryptoError(t,e,s)))}onWebCryptoError(t,e,s){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(t,e,s);const i=this.flush();if(i)return i.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(t){let e=t;const s=t.length-t.length%Kn;return s!==t.length&&(e=wt(t,0,s),this.remainderData=wt(t,s)),e}logOnce(t){this.logEnabled&&(x.log("[decrypter]: ".concat(t)),this.logEnabled=!1)}}const Hn={toString:function(a){let t="";const e=a.length;for(let s=0;so.end){const u=n>h;(n{if(this.fragContextChanged(t)){this.warn("Fragment ".concat(t.sn).concat(r.part?" p: "+r.part.index:""," of level ").concat(t.level," was dropped during download.")),this.fragmentTracker.removeFragment(t);return}t.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(t,e,s,i).then(r=>{if(!r)return;const n=this.state;if(this.fragContextChanged(t)){(n===b.FRAG_LOADING||!this.fragCurrent&&n===b.PARSING)&&(this.fragmentTracker.removeFragment(t),this.state=b.IDLE);return}"payload"in r&&(this.log("Loaded fragment ".concat(t.sn," of level ").concat(t.level)),this.hls.trigger(m.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===b.STOPPED||this.state===b.ERROR||(this.warn(r),this.resetFragmentLoading(t))})}clearTrackerIfNeeded(t){var e;const{fragmentTracker:s}=this;if(s.getState(t)===et.APPENDING){const r=t.type,n=this.getFwdBufferInfo(this.mediaBuffer,r),o=Math.max(t.duration,n?n.len:this.config.maxBufferLength);this.reduceMaxBufferLength(o)&&s.removeFragment(t)}else((e=this.mediaBuffer)==null?void 0:e.buffered.length)===0?s.removeAllFragments():s.hasParts(t.type)&&(s.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type}),s.getState(t)===et.PARTIAL&&s.removeFragment(t))}checkLiveUpdate(t){if(t.updated&&!t.live){const e=t.fragments[t.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type})}t.fragments[0]||(t.deltaUpdateFailed=!0)}flushMainBuffer(t,e,s=null){if(!(t-e))return;const i={startOffset:t,endOffset:e,type:s};this.hls.trigger(m.BUFFER_FLUSHING,i)}_loadInitSegment(t,e){this._doFragLoad(t,e).then(s=>{if(!s||this.fragContextChanged(t)||!this.levels)throw new Error("init load aborted");return s}).then(s=>{const{hls:i}=this,{payload:r}=s,n=t.decryptdata;if(r&&r.byteLength>0&&n&&n.key&&n.iv&&n.method==="AES-128"){const o=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer).catch(l=>{throw i.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:t}),l}).then(l=>{const c=self.performance.now();return i.trigger(m.FRAG_DECRYPTED,{frag:t,payload:l,stats:{tstart:o,tdecrypt:c}}),s.payload=l,s})}return s}).then(s=>{const{fragCurrent:i,hls:r,levels:n}=this;if(!n)throw new Error("init load aborted, missing levels");const o=t.stats;this.state=b.IDLE,e.fragmentError=0,t.data=new Uint8Array(s.payload),o.parsing.start=o.buffering.start=self.performance.now(),o.parsing.end=o.buffering.end=self.performance.now(),s.frag===i&&r.trigger(m.FRAG_BUFFERED,{stats:o,frag:i,part:null,id:t.type}),this.tick()}).catch(s=>{this.state===b.STOPPED||this.state===b.ERROR||(this.warn(s),this.resetFragmentLoading(t))})}fragContextChanged(t){const{fragCurrent:e}=this;return!t||!e||t.level!==e.level||t.sn!==e.sn||t.urlId!==e.urlId}fragBufferedComplete(t,e){var s,i,r,n;const o=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered ".concat(t.type," sn: ").concat(t.sn).concat(e?" part: "+e.index:""," of ").concat(this.playlistType===U.MAIN?"level":"track"," ").concat(t.level," (frag:[").concat(((s=t.startPTS)!=null?s:NaN).toFixed(3),"-").concat(((i=t.endPTS)!=null?i:NaN).toFixed(3),"] > buffer:").concat(o?Hn.toString(q.getBuffered(o)):"(detached)",")")),this.state=b.IDLE,o&&(!this.loadedmetadata&&t.type==U.MAIN&&o.buffered.length&&((r=this.fragCurrent)==null?void 0:r.sn)===((n=this.fragPrevious)==null?void 0:n.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(t){const{transmuxer:e}=this;if(!e)return;const{frag:s,part:i,partsLoaded:r}=t,n=!r||r.length===0||r.some(l=>!l),o=new Ze(s.level,s.sn,s.stats.chunkCount+1,0,i?i.index:-1,!n);e.flush(o)}_handleFragmentLoadProgress(t){}_doFragLoad(t,e,s=null,i){var r;const n=e==null?void 0:e.details;if(!this.levels||!n)throw new Error("frag load aborted, missing level".concat(n?"":" detail","s"));let o=null;if(t.encrypted&&!((r=t.decryptdata)!=null&&r.key)?(this.log("Loading key for ".concat(t.sn," of [").concat(n.startSN,"-").concat(n.endSN,"], ").concat(this.logPrefix==="[stream-controller]"?"level":"track"," ").concat(t.level)),this.state=b.KEY_LOADING,this.fragCurrent=t,o=this.keyLoader.load(t).then(h=>{if(!this.fragContextChanged(h.frag))return this.hls.trigger(m.KEY_LOADED,h),this.state===b.KEY_LOADING&&(this.state=b.IDLE),h}),this.hls.trigger(m.KEY_LOADING,{frag:t}),this.fragCurrent===null&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):!t.encrypted&&n.encryptedFragments.length&&this.keyLoader.loadClear(t,n.encryptedFragments),s=Math.max(t.start,s||0),this.config.lowLatencyMode&&t.sn!=="initSegment"){const h=n.partList;if(h&&i){s>t.end&&n.fragmentHint&&(t=n.fragmentHint);const u=this.getNextPart(h,t,s);if(u>-1){const d=h[u];this.log("Loading part sn: ".concat(t.sn," p: ").concat(d.index," cc: ").concat(t.cc," of playlist [").concat(n.startSN,"-").concat(n.endSN,"] parts [0-").concat(u,"-").concat(h.length-1,"] ").concat(this.logPrefix==="[stream-controller]"?"level":"track",": ").concat(t.level,", target: ").concat(parseFloat(s.toFixed(3)))),this.nextLoadPosition=d.start+d.duration,this.state=b.FRAG_LOADING;let f;return o?f=o.then(g=>!g||this.fragContextChanged(g.frag)?null:this.doFragPartsLoad(t,d,e,i)).catch(g=>this.handleFragLoadError(g)):f=this.doFragPartsLoad(t,d,e,i).catch(g=>this.handleFragLoadError(g)),this.hls.trigger(m.FRAG_LOADING,{frag:t,part:d,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):f}else if(!t.url||this.loadedEndOfParts(h,s))return Promise.resolve(null)}}this.log("Loading fragment ".concat(t.sn," cc: ").concat(t.cc," ").concat(n?"of ["+n.startSN+"-"+n.endSN+"] ":"").concat(this.logPrefix==="[stream-controller]"?"level":"track",": ").concat(t.level,", target: ").concat(parseFloat(s.toFixed(3)))),F(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=b.FRAG_LOADING;const l=this.config.progressive;let c;return l&&o?c=o.then(h=>!h||this.fragContextChanged(h==null?void 0:h.frag)?null:this.fragmentLoader.load(t,i)).catch(h=>this.handleFragLoadError(h)):c=Promise.all([this.fragmentLoader.load(t,l?i:void 0),o]).then(([h])=>(!l&&h&&i&&i(h),h)).catch(h=>this.handleFragLoadError(h)),this.hls.trigger(m.FRAG_LOADING,{frag:t,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):c}doFragPartsLoad(t,e,s,i){return new Promise((r,n)=>{var o;const l=[],c=(o=s.details)==null?void 0:o.partList,h=u=>{this.fragmentLoader.loadPart(t,u,i).then(d=>{l[u.index]=d;const f=d.part;this.hls.trigger(m.FRAG_LOADED,d);const g=ks(s,t.sn,u.index+1)||bi(c,t.sn,u.index+1);if(g)h(g);else return r({frag:t,part:f,partsLoaded:l})}).catch(n)};h(e)})}handleFragLoadError(t){if("data"in t){const e=t.data;t.data&&e.details===L.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(m.ERROR,e)}else this.hls.trigger(m.ERROR,{type:N.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,err:t,error:t,fatal:!0});return null}_handleTransmuxerFlush(t){const e=this.getCurrentContext(t);if(!e||this.state!==b.PARSING){!this.fragCurrent&&this.state!==b.STOPPED&&this.state!==b.ERROR&&(this.state=b.IDLE);return}const{frag:s,part:i,level:r}=e,n=self.performance.now();s.stats.parsing.end=n,i&&(i.stats.parsing.end=n),this.updateLevelTiming(s,i,r,t.partial)}getCurrentContext(t){const{levels:e,fragCurrent:s}=this,{level:i,sn:r,part:n}=t;if(!(e!=null&&e[i]))return this.warn("Levels object was unset while buffering fragment ".concat(r," of level ").concat(i,". The current chunk will not be buffered.")),null;const o=e[i],l=n>-1?ks(o,r,n):null,c=l?l.fragment:xn(o,r,s);return c?(s&&s!==c&&(c.stats=s.stats),{frag:c,part:l,level:o}):null}bufferFragmentData(t,e,s,i,r){var n;if(!t||this.state!==b.PARSING)return;const{data1:o,data2:l}=t;let c=o;if(o&&l&&(c=Pt(o,l)),!((n=c)!=null&&n.length))return;const h={type:t.type,frag:e,part:s,chunkMeta:i,parent:e.type,data:c};if(this.hls.trigger(m.BUFFER_APPENDING,h),t.dropped&&t.independent&&!s){if(r)return;this.flushBufferGap(e)}}flushBufferGap(t){const e=this.media;if(!e)return;if(!q.isBuffered(e,e.currentTime)){this.flushMainBuffer(0,t.start);return}const s=e.currentTime,i=q.bufferInfo(e,s,0),r=t.duration,n=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),o=Math.max(Math.min(t.start-n,i.end-n),s+n);t.start-o>n&&this.flushMainBuffer(o,t.start)}getFwdBufferInfo(t,e){const s=this.getLoadPosition();return F(s)?this.getFwdBufferInfoAtPos(t,s,e):null}getFwdBufferInfoAtPos(t,e,s){const{config:{maxBufferHole:i}}=this,r=q.bufferInfo(t,e,i);if(r.len===0&&r.nextStart!==void 0){const n=this.fragmentTracker.getBufferedFrag(e,s);if(n&&r.nextStart=s?(e.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to ".concat(e.maxMaxBufferLength,"s")),!0):!1}getAppendedFrag(t,e=U.MAIN){const s=this.fragmentTracker.getAppendedFrag(t,U.MAIN);return s&&"fragment"in s?s.fragment:s}getNextFragment(t,e){const s=e.fragments,i=s.length;if(!i)return null;const{config:r}=this,n=s[0].start;let o;if(e.live){const l=r.initialLiveManifestSize;if(ie}getNextFragmentLoopLoading(t,e,s,i,r){const n=t.gap,o=this.getNextFragment(this.nextLoadPosition,e);if(o===null)return o;if(t=o,n&&t&&!t.gap&&s.nextStart){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,s.nextStart,i);if(l!==null&&s.len+l.len>=r)return this.log('buffer full after gaps in "'.concat(i,'" playlist starting at sn: ').concat(t.sn)),null}return t}mapToInitFragWhenRequired(t){return t!=null&&t.initSegment&&!(t!=null&&t.initSegment.data)&&!this.bitrateTest?t.initSegment:t}getNextPart(t,e,s){let i=-1,r=!1,n=!0;for(let o=0,l=t.length;o-1&&ss.start&&s.loaded}getInitialLiveFragment(t,e){const s=this.fragPrevious;let i=null;if(s){if(t.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: ".concat(s.programDateTime)),i=Sn(e,s.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=s.sn+1;if(r>=t.startSN&&r<=t.endSN){const n=e[r-t.startSN];s.cc===n.cc&&(i=n,this.log("Live playlist, switching playlist, load frag with next SN: ".concat(i.sn)))}i||(i=An(e,s.cc),i&&this.log("Live playlist, switching playlist, load frag with same CC: ".concat(i.sn)))}}else{const r=this.hls.liveSyncPosition;r!==null&&(i=this.getFragmentAtPosition(r,this.bitrateTest?t.fragmentEnd:t.edge,t))}return i}getFragmentAtPosition(t,e,s){const{config:i}=this;let{fragPrevious:r}=this,{fragments:n,endSN:o}=s;const{fragmentHint:l}=s,c=i.maxFragLookUpTolerance,h=s.partList,u=!!(i.lowLatencyMode&&h!=null&&h.length&&l);u&&l&&!this.bitrateTest&&(n=n.concat(l),o=l.sn);let d;if(te-c?0:c;d=Yt(r,n,t,f)}else d=n[n.length-1];if(d){const f=d.sn-s.startSN,g=this.fragmentTracker.getState(d);if((g===et.OK||g===et.PARTIAL&&d.gap)&&(r=d),r&&d.sn===r.sn&&(!u||h[0].fragment.sn>d.sn)&&r&&d.level===r.level){const T=n[f+1];d.sn=n-e.maxFragLookUpTolerance&&r<=o;if(i!==null&&s.duration>i&&(r").concat(t.startSN," prev-sn: ").concat(r?r.sn:"na"," fragments: ").concat(o)),u}return l}waitForCdnTuneIn(t){return t.live&&t.canBlockReload&&t.partTarget&&t.tuneInGoal>Math.max(t.partHoldBack,t.partTarget*3)}setStartPosition(t,e){let s=this.startPosition;if(s ").concat((i=this.fragCurrent)==null?void 0:i.url));return}const r=e.details===L.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(s,!0);const n=e.errorAction,{action:o,retryCount:l=0,retryConfig:c}=n||{};if(n&&o===rt.RetryRequest&&c){var h;this.resetStartWhenNotLoaded((h=this.levelLastLoaded)!=null?h:s.level);const u=Qe(c,l);this.warn("Fragment ".concat(s.sn," of ").concat(t," ").concat(s.level," errored with ").concat(e.details,", retrying loading ").concat(l+1,"/").concat(c.maxNumRetry," in ").concat(u,"ms")),n.resolved=!0,this.retryDate=self.performance.now()+u,this.state=b.FRAG_LOADING_WAITING_RETRY}else c&&n?(this.resetFragmentErrors(t),l.5;i&&this.reduceMaxBufferLength(s.len);const r=!i;return r&&this.warn("Buffer full error while media.currentTime is not buffered, flush ".concat(e," buffer")),t.frag&&(this.fragmentTracker.removeFragment(t.frag),this.nextLoadPosition=t.frag.start),this.resetLoadingState(),r}return!1}resetFragmentErrors(t){t===U.AUDIO&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==b.STOPPED&&(this.state=b.IDLE)}afterBufferFlushed(t,e,s){if(!t)return;const i=q.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,i,s),this.state===b.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=b.IDLE}resetStartWhenNotLoaded(t){if(!this.loadedmetadata){this.startFragRequested=!1;const e=this.levels?this.levels[t].details:null;e!=null&&e.live?(this.startPosition=-1,this.setStartPosition(e,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(t){var e;this.warn("The loading context changed while buffering fragment ".concat(t.sn," of level ").concat(t.level,". This chunk will not be buffered.")),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded((e=this.levelLastLoaded)!=null?e:t.level),this.resetLoadingState()}removeUnbufferedFrags(t=0){this.fragmentTracker.removeFragmentsInRange(t,1/0,this.playlistType,!1,!0)}updateLevelTiming(t,e,s,i){var r;const n=s.details;if(!n){this.warn("level.details undefined");return}if(Object.keys(t.elementaryStreams).reduce((l,c)=>{const h=t.elementaryStreams[c];if(h){const u=h.endPTS-h.startPTS;if(u<=0)return this.warn("Could not parse fragment ".concat(t.sn," ").concat(c," duration reliably (").concat(u,")")),l||!1;const d=i?0:Ri(n,t,h.startPTS,h.endPTS,h.startDTS,h.endDTS);return this.hls.trigger(m.LEVEL_PTS_UPDATED,{details:n,level:s,drift:d,type:c,frag:t,start:h.startPTS,end:h.endPTS}),!0}return l},!1))s.fragmentError=0;else if(((r=this.transmuxer)==null?void 0:r.error)===null){const l=new Error("Found no media in fragment ".concat(t.sn," of level ").concat(t.level," resetting transmuxer to fallback to playlist timing"));if(s.fragmentError===0&&(s.fragmentError++,t.gap=!0,this.fragmentTracker.removeFragment(t),this.fragmentTracker.fragBuffered(t,!0)),this.warn(l.message),this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,error:l,frag:t,reason:"Found no media in msn ".concat(t.sn,' of level "').concat(s.url,'"')}),!this.hls)return;this.resetTransmuxer()}this.state=b.PARSED,this.hls.trigger(m.FRAG_PARSED,{frag:t,part:e})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(t){if(t.event==="demuxerWorker"){var e,s,i;this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded((e=(s=this.levelLastLoaded)!=null?s:(i=this.fragCurrent)==null?void 0:i.level)!=null?e:0),this.resetLoadingState()}}set state(t){const e=this._state;e!==t&&(this._state=t,this.log("".concat(e,"->").concat(t)))}get state(){return this._state}}function _i(){return self.SourceBuffer||self.WebKitSourceBuffer}function Vn(){const a=fe();if(!a)return!1;const t=_i(),e=a&&typeof a.isTypeSupported=="function"&&a.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),s=!t||t.prototype&&typeof t.prototype.appendBuffer=="function"&&typeof t.prototype.remove=="function";return!!e&&!!s}function Wn(){var a;const t=_i();return typeof(t==null||(a=t.prototype)==null?void 0:a.changeType)=="function"}function Yn(){return typeof __HLS_WORKER_BUNDLE__=="function"}function qn(){const a=new self.Blob(["var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(".concat(__HLS_WORKER_BUNDLE__.toString(),")(true);")],{type:"text/javascript"}),t=self.URL.createObjectURL(a);return{worker:new self.Worker(t),objectURL:t}}function jn(a){const t=new self.URL(a,self.location.href).href;return{worker:new self.Worker(t),scriptURL:t}}function Et(a="",t=9e4){return{type:a,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class wi{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(t,e,s,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(t){this.initPTS=t,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(t,e){return!1}appendFrame(t,e,s){}demux(t,e){this.cachedData&&(t=Pt(this.cachedData,t),this.cachedData=null);let s=ne(t,0),i=s?s.length:0,r;const n=this._audioTrack,o=this._id3Track,l=s?Cr(s):void 0,c=t.length;for((this.basePTS===null||this.frameIndex===0&&F(l))&&(this.basePTS=Xn(l,e,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),s&&s.length>0&&o.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:Tt.audioId3,duration:Number.POSITIVE_INFINITY});i{if(F(a))return a*90;const s=e?e.baseTime*9e4/e.timescale:0;return t*9e4+s};function zn(a,t,e,s){let i,r,n,o;const l=navigator.userAgent.toLowerCase(),c=s,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=((t[e+2]&192)>>>6)+1;const u=(t[e+2]&60)>>>2;if(u>h.length-1){a.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:".concat(u)});return}return n=(t[e+2]&1)<<2,n|=(t[e+3]&192)>>>6,x.log("manifest codec:".concat(s,", ADTS type:").concat(i,", samplingIndex:").concat(u)),/firefox/i.test(l)?u>=6?(i=5,o=new Array(4),r=u-3):(i=2,o=new Array(2),r=u):l.indexOf("android")!==-1?(i=2,o=new Array(2),r=u):(i=5,o=new Array(4),s&&(s.indexOf("mp4a.40.29")!==-1||s.indexOf("mp4a.40.5")!==-1)||!s&&u>=6?r=u-3:((s&&s.indexOf("mp4a.40.2")!==-1&&(u>=6&&n===1||/vivaldi/i.test(l))||!s&&n===1)&&(i=2,o=new Array(2)),r=u)),o[0]=i<<3,o[0]|=(u&14)>>1,o[1]|=(u&1)<<7,o[1]|=n<<3,i===5&&(o[1]|=(r&14)>>1,o[2]=(r&1)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:h[u],channelCount:n,codec:"mp4a.40."+i,manifestCodec:c}}function Pi(a,t){return a[t]===255&&(a[t+1]&246)===240}function Fi(a,t){return a[t+1]&1?7:9}function is(a,t){return(a[t+3]&3)<<11|a[t+4]<<3|(a[t+5]&224)>>>5}function Qn(a,t){return t+5=a.length)return!1;const s=is(a,t);if(s<=e)return!1;const i=t+s;return i===a.length||he(a,i)}return!1}function Oi(a,t,e,s,i){if(!a.samplerate){const r=zn(t,e,s,i);if(!r)return;a.config=r.config,a.samplerate=r.samplerate,a.channelCount=r.channelCount,a.codec=r.codec,a.manifestCodec=r.manifestCodec,x.log("parsed codec:".concat(a.codec,", rate:").concat(r.samplerate,", channels:").concat(r.channelCount))}}function Mi(a){return 1024*9e4/a}function ta(a,t){const e=Fi(a,t);if(t+e<=a.length){const s=is(a,t)-e;if(s>0)return{headerLength:e,frameLength:s}}}function Ni(a,t,e,s,i){const r=Mi(a.samplerate),n=s+i*r,o=ta(t,e);let l;if(o){const{frameLength:u,headerLength:d}=o,f=d+u,g=Math.max(0,e+f-t.length);g?(l=new Uint8Array(f-d),l.set(t.subarray(e+d,t.length),0)):l=t.subarray(e+d,e+f);const p={unit:l,pts:n};return g||a.samples.push(p),{sample:p,length:f,missing:g}}const c=t.length-e;return l=new Uint8Array(c),l.set(t.subarray(e,t.length),0),{sample:{unit:l,pts:n},length:c,missing:-1}}class ea extends wi{constructor(t,e){super(),this.observer=void 0,this.config=void 0,this.observer=t,this.config=e}resetInitSegment(t,e,s,i){super.resetInitSegment(t,e,s,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:e,duration:i,inputTimeScale:9e4,dropped:0}}static probe(t){if(!t)return!1;let s=(ne(t,0)||[]).length;for(let i=t.length;s16384?t.subarray(0,16384):t,$(t,["moof"]).length>0}demux(t,e){this.timeOffset=e;let s=t;const i=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(s=Pt(this.remainderData,t));const o=Vr(s);this.remainderData=o.remainder,i.samples=o.valid||new Uint8Array}else i.samples=s;const n=this.extractID3Track(i,e);return r.samples=ms(e,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:n,textTrack:this.txtTrack}}flush(){const t=this.timeOffset,e=this.videoTrack,s=this.txtTrack;e.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(e,this.timeOffset);return s.samples=ms(t,e),{videoTrack:e,audioTrack:Et(),id3Track:i,textTrack:Et()}}extractID3Track(t,e){const s=this.id3Track;if(t.samples.length){const i=$(t.samples,["emsg"]);i&&i.forEach(r=>{const n=qr(r);if(sa.test(n.schemeIdUri)){const o=F(n.presentationTime)?n.presentationTime/n.timeScale:e+n.presentationTimeDelta/n.timeScale;let l=n.eventDuration===4294967295?Number.POSITIVE_INFINITY:n.eventDuration/n.timeScale;l<=.001&&(l=Number.POSITIVE_INFINITY);const c=n.payload;s.samples.push({data:c,len:c.byteLength,dts:o,pts:o,type:Tt.emsg,duration:l})}})}return s}demuxSampleAes(t,e,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}}let Jt=null;const ra=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],na=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],aa=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],oa=[0,1,1,4];function Ui(a,t,e,s,i){if(e+24>t.length)return;const r=Bi(t,e);if(r&&e+r.frameLength<=t.length){const n=r.samplesPerFrame*9e4/r.sampleRate,o=s+i*n,l={unit:t.subarray(e,e+r.frameLength),pts:o,dts:o};return a.config=[],a.channelCount=r.channelCount,a.samplerate=r.sampleRate,a.samples.push(l),{sample:l,length:r.frameLength,missing:0}}}function Bi(a,t){const e=a[t+1]>>3&3,s=a[t+1]>>1&3,i=a[t+2]>>4&15,r=a[t+2]>>2&3;if(e!==1&&i!==0&&i!==15&&r!==3){const n=a[t+2]>>1&1,o=a[t+3]>>6,l=e===3?3-s:s===3?3:4,c=ra[l*14+i-1]*1e3,u=na[(e===3?0:e===2?1:2)*3+r],d=o===3?1:2,f=aa[e][s],g=oa[s],p=f*8*g,T=Math.floor(f*c/u+n)*g;if(Jt===null){const E=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Jt=E?parseInt(E[1]):0}return!!Jt&&Jt<=87&&s===2&&c>=224e3&&o===0&&(a[t+3]=a[t+3]|128),{sampleRate:u,channelCount:d,frameLength:T,samplesPerFrame:p}}}function rs(a,t){return a[t]===255&&(a[t+1]&224)===224&&(a[t+1]&6)!==0}function $i(a,t){return t+1t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,e=t>>3,t-=e<<3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)}readBits(t){let e=Math.min(this.bitsAvailable,t);const s=this.word>>>32-e;if(t>32&&x.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0)this.word<<=e;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return e=t-e,e>0&&this.bitsAvailable?s<>>t)return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const t=this.skipLZ();return this.readBits(t+1)-1}readEG(){const t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(t){let e=8,s=8,i;for(let r=0;r{const l=new Uint8Array(o);i.set(l,16),this.decrypter.isSync()||this.decryptAacSamples(t,e+1,s)})}decryptAacSamples(t,e,s){for(;;e++){if(e>=t.length){s();return}if(!(t[e].unit.length<32)&&(this.decryptAacSample(t,e,s),!this.decrypter.isSync()))return}}getAvcEncryptedData(t){const e=Math.floor((t.length-48)/160)*16+16,s=new Int8Array(e);let i=0;for(let r=32;r{r.data=this.getAvcDecryptedUnit(n,l),this.decrypter.isSync()||this.decryptAvcSamples(t,e,s+1,i)})}decryptAvcSamples(t,e,s,i){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,s=0){if(e>=t.length){i();return}const r=t[e].units;for(;!(s>=r.length);s++){const n=r[s];if(!(n.data.length<=48||n.type!==1&&n.type!==5)&&(this.decryptAvcSample(t,e,s,i,n),!this.decrypter.isSync()))return}}}}const it=188;class bt{constructor(t,e,s){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=t,this.config=e,this.typeSupported=s}static probe(t){const e=bt.syncOffset(t);return e>0&&x.warn("MPEG2-TS detected but first sync word found @ offset ".concat(e)),e!==-1}static syncOffset(t){const e=t.length;let s=Math.min(it*5,t.length-it)+1,i=0;for(;i1&&(n===0&&o>2||l+it>s))return n}else{if(o)return-1;break}i++}return-1}static createTrack(t,e){return{container:t==="video"||t==="audio"?"video/mp2t":void 0,type:t,id:mi[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:t==="audio"?e:void 0}}resetInitSegment(t,e,s,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=bt.createTrack("video"),this._audioTrack=bt.createTrack("audio",i),this._id3Track=bt.createTrack("id3"),this._txtTrack=bt.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=e,this.videoCodec=s,this._duration=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:t,_avcTrack:e,_id3Track:s}=this;t&&(t.pesData=null),e&&(e.pesData=null),s&&(s.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null}demux(t,e,s=!1,i=!1){s||(this.sampleAes=null);let r;const n=this._avcTrack,o=this._audioTrack,l=this._id3Track,c=this._txtTrack;let h=n.pid,u=n.pesData,d=o.pid,f=l.pid,g=o.pesData,p=l.pesData,T=null,y=this.pmtParsed,S=this._pmtId,E=t.length;if(this.remainderData&&(t=Pt(this.remainderData,t),E=t.length,this.remainderData=null),E>4;let O;if(I>1){if(O=D+5+t[D+4],O===D+it)continue}else O=D+4;switch(_){case h:C&&(u&&(r=Ot(u))&&this.parseAVCPES(n,c,r,!1),u={data:[],size:0}),u&&(u.data.push(t.subarray(O,D+it)),u.size+=D+it-O);break;case d:if(C){if(g&&(r=Ot(g)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r);break}g={data:[],size:0}}g&&(g.data.push(t.subarray(O,D+it)),g.size+=D+it-O);break;case f:C&&(p&&(r=Ot(p))&&this.parseID3PES(l,r),p={data:[],size:0}),p&&(p.data.push(t.subarray(O,D+it)),p.size+=D+it-O);break;case 0:C&&(O+=t[O]+1),S=this._pmtId=ua(t,O);break;case S:{C&&(O+=t[O]+1);const w=da(t,O,this.typeSupported,s);h=w.avc,h>0&&(n.pid=h),d=w.audio,d>0&&(o.pid=d,o.segmentCodec=w.segmentCodec),f=w.id3,f>0&&(l.pid=f),T!==null&&!y&&(x.warn("MPEG-TS PMT found at ".concat(D," after unknown PID '").concat(T,"'. Backtracking to sync byte @").concat(R," to parse all TS packets.")),T=null,D=R-188),y=this.pmtParsed=!0;break}case 17:case 8191:break;default:T=_;break}}else A++;if(A>0){const D=new Error("Found ".concat(A," TS packet/s that do not start with 0x47"));this.observer.emit(m.ERROR,m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,error:D,reason:D.message})}n.pesData=u,o.pesData=g,l.pesData=p;const k={audioTrack:o,videoTrack:n,id3Track:l,textTrack:c};return i&&this.extractRemainingSamples(k),k}flush(){const{remainderData:t}=this;this.remainderData=null;let e;return t?e=this.demux(t,-1,!1,!0):e={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e}extractRemainingSamples(t){const{audioTrack:e,videoTrack:s,id3Track:i,textTrack:r}=t,n=s.pesData,o=e.pesData,l=i.pesData;let c;if(n&&(c=Ot(n))?(this.parseAVCPES(s,r,c,!0),s.pesData=null):s.pesData=n,o&&(c=Ot(o))){switch(e.segmentCodec){case"aac":this.parseAACPES(e,c);break;case"mp3":this.parseMPEGPES(e,c);break}e.pesData=null}else o!=null&&o.size&&x.log("last AAC PES packet truncated,might overlap between fragments"),e.pesData=o;l&&(c=Ot(l))?(this.parseID3PES(i,c),i.pesData=null):i.pesData=l}demuxSampleAes(t,e,s){const i=this.demux(t,s,!0,!this.config.progressive),r=this.sampleAes=new ha(this.observer,this.config,e);return this.decrypt(i,r)}decrypt(t,e){return new Promise(s=>{const{audioTrack:i,videoTrack:r}=t;i.samples&&i.segmentCodec==="aac"?e.decryptAacSamples(i.samples,0,()=>{r.samples?e.decryptAvcSamples(r.samples,0,0,()=>{s(t)}):s(t)}):r.samples&&e.decryptAvcSamples(r.samples,0,0,()=>{s(t)})})}destroy(){this._duration=0}parseAVCPES(t,e,s,i){const r=this.parseAVCNALu(t,s.data);let n=this.avcSample,o,l=!1;s.data=null,n&&r.length&&!t.audFound&&($t(n,t),n=this.avcSample=Zt(!1,s.pts,s.dts,"")),r.forEach(c=>{var h;switch(c.type){case 1:{let d=!1;o=!0;const f=c.data;if(l&&f.length>4){const g=new Us(f).readSliceType();(g===2||g===4||g===7||g===9)&&(d=!0)}if(d){var u;(u=n)!=null&&u.frame&&!n.key&&($t(n,t),n=this.avcSample=null)}n||(n=this.avcSample=Zt(!0,s.pts,s.dts,"")),n.frame=!0,n.key=d;break}case 5:o=!0,(h=n)!=null&&h.frame&&!n.key&&($t(n,t),n=this.avcSample=null),n||(n=this.avcSample=Zt(!0,s.pts,s.dts,"")),n.key=!0,n.frame=!0;break;case 6:{o=!0,Ei(c.data,1,s.pts,e.samples);break}case 7:if(o=!0,l=!0,!t.sps){const d=c.data,g=new Us(d).readSPS();t.width=g.width,t.height=g.height,t.pixelRatio=g.pixelRatio,t.sps=[d],t.duration=this._duration;const p=d.subarray(1,4);let T="avc1.";for(let y=0;y<3;y++){let S=p[y].toString(16);S.length<2&&(S="0"+S),T+=S}t.codec=T}break;case 8:o=!0,t.pps||(t.pps=[c.data]);break;case 9:o=!1,t.audFound=!0,n&&$t(n,t),n=this.avcSample=Zt(!1,s.pts,s.dts,"");break;case 12:o=!0;break;default:o=!1,n&&(n.debug+="unknown NAL "+c.type+" ");break}n&&o&&n.units.push(c)}),i&&n&&($t(n,t),this.avcSample=null)}getLastNalUnit(t){var e;let s=this.avcSample,i;if((!s||s.units.length===0)&&(s=t[t.length-1]),(e=s)!=null&&e.units){const r=s.units;i=r[r.length-1]}return i}parseAVCNALu(t,e){const s=e.byteLength;let i=t.naluState||0;const r=i,n=[];let o=0,l,c,h,u=-1,d=0;for(i===-1&&(u=0,d=e[0]&31,i=0,o=1);o=0){const f={data:e.subarray(u,o-i-1),type:d};n.push(f)}else{const f=this.getLastNalUnit(t.samples);if(f&&(r&&o<=4-r&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-r)),c=o-i-1,c>0)){const g=new Uint8Array(f.data.byteLength+c);g.set(f.data,0),g.set(e.subarray(0,c),f.data.byteLength),f.data=g,f.state=0}}o=0&&i>=0){const f={data:e.subarray(u,s),type:d,state:i};n.push(f)}if(n.length===0){const f=this.getLastNalUnit(t.samples);if(f){const g=new Uint8Array(f.data.byteLength+e.byteLength);g.set(f.data,0),g.set(e,f.data.byteLength),f.data=g}}return t.naluState=i,n}parseAACPES(t,e){let s=0;const i=this.aacOverFlow;let r=e.data;if(i){this.aacOverFlow=null;const u=i.missing,d=i.sample.unit.byteLength;if(u===-1){const f=new Uint8Array(d+r.byteLength);f.set(i.sample.unit,0),f.set(r,d),r=f}else{const f=d-u;i.sample.unit.set(r.subarray(0,u),f),t.samples.push(i.sample),s=i.missing}}let n,o;for(n=s,o=r.length;n1;){const c=new Uint8Array(o[0].length+o[1].length);c.set(o[0]),c.set(o[1],o[0].length),o[0]=c,o.splice(1,1)}if(e=o[0],(e[0]<<16)+(e[1]<<8)+e[2]===1){if(s=(e[4]<<8)+e[5],s&&s>a.size-6)return null;const c=e[7];c&192&&(r=(e[9]&14)*536870912+(e[10]&255)*4194304+(e[11]&254)*16384+(e[12]&255)*128+(e[13]&254)/2,c&64?(n=(e[14]&14)*536870912+(e[15]&255)*4194304+(e[16]&254)*16384+(e[17]&255)*128+(e[18]&254)/2,r-n>60*9e4&&(x.warn("".concat(Math.round((r-n)/9e4),"s delta between PTS and DTS, align them")),r=n)):n=r),i=e[8];let h=i+9;if(a.size<=h)return null;a.size-=h;const u=new Uint8Array(a.size);for(let d=0,f=o.length;dg){h-=g;continue}else e=e.subarray(h),g-=h,h=0;u.set(e,t),t+=g}return s&&(s-=i+3),{data:u,pts:r,dts:n,len:s}}return null}function $t(a,t){if(a.units.length&&a.frame){if(a.pts===void 0){const e=t.samples,s=e.length;if(s){const i=e[s-1];a.pts=i.pts,a.dts=i.dts}else{t.dropped++;return}}t.samples.push(a)}a.debug.length&&x.log(a.pts+"/"+a.dts+":"+a.debug)}class fa extends wi{resetInitSegment(t,e,s,i){super.resetInitSegment(t,e,s,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:e,duration:i,inputTimeScale:9e4,dropped:0}}static probe(t){if(!t)return!1;let s=(ne(t,0)||[]).length;for(let i=t.length;s>24&255,n[1]=s>>16&255,n[2]=s>>8&255,n[3]=s&255,n.set(t,4),i=0,s=8;i>24&255,t>>16&255,t>>8&255,t&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(t){return v.box(v.types.mdia,v.mdhd(t.timescale,t.duration),v.hdlr(t.type),v.minf(t))}static mfhd(t){return v.box(v.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255]))}static minf(t){return t.type==="audio"?v.box(v.types.minf,v.box(v.types.smhd,v.SMHD),v.DINF,v.stbl(t)):v.box(v.types.minf,v.box(v.types.vmhd,v.VMHD),v.DINF,v.stbl(t))}static moof(t,e,s){return v.box(v.types.moof,v.mfhd(t),v.traf(s,e))}static moov(t){let e=t.length;const s=[];for(;e--;)s[e]=v.trak(t[e]);return v.box.apply(null,[v.types.moov,v.mvhd(t[0].timescale,t[0].duration)].concat(s).concat(v.mvex(t)))}static mvex(t){let e=t.length;const s=[];for(;e--;)s[e]=v.trex(t[e]);return v.box.apply(null,[v.types.mvex,...s])}static mvhd(t,e){e*=t;const s=Math.floor(e/(It+1)),i=Math.floor(e%(It+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return v.box(v.types.mvhd,r)}static sdtp(t){const e=t.samples||[],s=new Uint8Array(4+e.length);let i,r;for(i=0;i>>8&255),e.push(n&255),e=e.concat(Array.prototype.slice.call(r));for(i=0;i>>8&255),s.push(n&255),s=s.concat(Array.prototype.slice.call(r));const o=v.box(v.types.avcC,new Uint8Array([1,e[3],e[4],e[5],255,224|t.sps.length].concat(e).concat([t.pps.length]).concat(s))),l=t.width,c=t.height,h=t.pixelRatio[0],u=t.pixelRatio[1];return v.box(v.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,c>>8&255,c&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,v.box(v.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),v.box(v.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,u>>24,u>>16&255,u>>8&255,u&255])))}static esds(t){const e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))}static mp4a(t){const e=t.samplerate;return v.box(v.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),v.box(v.types.esds,v.esds(t)))}static mp3(t){const e=t.samplerate;return v.box(v.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))}static stsd(t){return t.type==="audio"?t.segmentCodec==="mp3"&&t.codec==="mp3"?v.box(v.types.stsd,v.STSD,v.mp3(t)):v.box(v.types.stsd,v.STSD,v.mp4a(t)):v.box(v.types.stsd,v.STSD,v.avc1(t))}static tkhd(t){const e=t.id,s=t.duration*t.timescale,i=t.width,r=t.height,n=Math.floor(s/(It+1)),o=Math.floor(s%(It+1));return v.box(v.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,o>>24,o>>16&255,o>>8&255,o&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,r>>8&255,r&255,0,0]))}static traf(t,e){const s=v.sdtp(t),i=t.id,r=Math.floor(e/(It+1)),n=Math.floor(e%(It+1));return v.box(v.types.traf,v.box(v.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),v.box(v.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,n>>24,n>>16&255,n>>8&255,n&255])),v.trun(t,s.length+16+20+8+16+8+8),s)}static trak(t){return t.duration=t.duration||4294967295,v.box(v.types.trak,v.tkhd(t),v.mdia(t))}static trex(t){const e=t.id;return v.box(v.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(t,e){const s=t.samples||[],i=s.length,r=12+16*i,n=new Uint8Array(r);let o,l,c,h,u,d;for(e+=8+r,n.set([t.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),o=0;o>>24&255,c>>>16&255,c>>>8&255,c&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&61440,u.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*o);return v.box(v.types.trun,n)}static initSegment(t){v.types||v.init();const e=v.moov(t),s=new Uint8Array(v.FTYP.byteLength+e.byteLength);return s.set(v.FTYP),s.set(e,v.FTYP.byteLength),s}}v.types=void 0;v.HDLR_TYPES=void 0;v.STTS=void 0;v.STSC=void 0;v.STCO=void 0;v.STSZ=void 0;v.VMHD=void 0;v.SMHD=void 0;v.STSD=void 0;v.FTYP=void 0;v.DINF=void 0;const Gi=9e4;function ns(a,t,e=1,s=!1){const i=a*t*e;return s?Math.round(i):i}function ga(a,t,e=1,s=!1){return ns(a,t,1/e,s)}function Gt(a,t=!1){return ns(a,1e3,1/Gi,t)}function ma(a,t=1){return ns(a,Gi,1/t)}const pa=10*1e3,$s=1024,Ta=1152;let te=null,Le=null;class Re{constructor(t,e,s,i=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=t,this.config=e,this.typeSupported=s,this.ISGenerated=!1,te===null){const n=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);te=n?parseInt(n[1]):0}if(Le===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);Le=r?parseInt(r[1]):0}}destroy(){}resetTimeStamp(t){x.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=t}resetNextTimestamp(){x.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){x.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1}getVideoStartPts(t){let e=!1;const s=t.reduce((i,r)=>{const n=r.pts-i;return n<-4294967296?(e=!0,gt(i,r.pts)):n>0?i:r.pts},t[0].pts);return e&&x.debug("PTS rollover detected"),s}remux(t,e,s,i,r,n,o,l){let c,h,u,d,f,g,p=r,T=r;const y=t.pid>-1,S=e.pid>-1,E=e.samples.length,R=t.samples.length>0,A=o&&E>0||E>1;if((!y||R)&&(!S||A)||this.ISGenerated||o){this.ISGenerated||(u=this.generateIS(t,e,r,n));const D=this.isVideoContiguous;let C=-1,_;if(A&&(C=ya(e.samples),!D&&this.config.forceKeyFrameOnDiscontinuity))if(g=!0,C>0){x.warn("[mp4-remuxer]: Dropped ".concat(C," out of ").concat(E," video samples due to a missing keyframe"));const I=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(C),e.dropped+=C,T+=(e.samples[0].pts-I)/e.inputTimeScale,_=T}else C===-1&&(x.warn("[mp4-remuxer]: No keyframe found out of ".concat(E," video samples")),g=!1);if(this.ISGenerated){if(R&&A){const I=this.getVideoStartPts(e.samples),w=(gt(t.samples[0].pts,I)-I)/e.inputTimeScale;p+=Math.max(0,w),T+=Math.max(0,-w)}if(R){if(t.samplerate||(x.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(t,e,r,n)),h=this.remuxAudio(t,p,this.isAudioContiguous,n,S||A||l===U.AUDIO?T:void 0),A){const I=h?h.endPTS-h.startPTS:0;e.inputTimeScale||(x.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(t,e,r,n)),c=this.remuxVideo(e,T,D,I)}}else A&&(c=this.remuxVideo(e,T,D,0));c&&(c.firstKeyFrame=C,c.independent=C!==-1,c.firstKeyFramePTS=_)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(s.samples.length&&(f=Ki(s,r,this._initPTS,this._initDTS)),i.samples.length&&(d=Hi(i,r,this._initPTS))),{audio:h,video:c,initSegment:u,independent:g,text:d,id3:f}}generateIS(t,e,s,i){const r=t.samples,n=e.samples,o=this.typeSupported,l={},c=this._initPTS;let h=!c||i,u="audio/mp4",d,f,g;if(h&&(d=f=1/0),t.config&&r.length){switch(t.timescale=t.samplerate,t.segmentCodec){case"mp3":o.mpeg?(u="audio/mpeg",t.codec=""):o.mp3&&(t.codec="mp3");break}l.audio={id:"audio",container:u,codec:t.codec,initSegment:t.segmentCodec==="mp3"&&o.mpeg?new Uint8Array(0):v.initSegment([t]),metadata:{channelCount:t.channelCount}},h&&(g=t.inputTimeScale,!c||g!==c.timescale?d=f=r[0].pts-Math.round(g*s):h=!1)}if(e.sps&&e.pps&&n.length&&(e.timescale=e.inputTimeScale,l.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:v.initSegment([e]),metadata:{width:e.width,height:e.height}},h))if(g=e.inputTimeScale,!c||g!==c.timescale){const p=this.getVideoStartPts(n),T=Math.round(g*s);f=Math.min(f,gt(n[0].dts,p)-T),d=Math.min(d,p-T)}else h=!1;if(Object.keys(l).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:d,timescale:g},this._initDTS={baseTime:f,timescale:g}):d=g=void 0,{tracks:l,initPTS:d,timescale:g}}remuxVideo(t,e,s,i){const r=t.inputTimeScale,n=t.samples,o=[],l=n.length,c=this._initPTS;let h=this.nextAvcDts,u=8,d=this.videoSampleDuration,f,g,p=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,y=!1;if(!s||h===null){const P=e*r,M=n[0].pts-gt(n[0].dts,n[0].pts);h=P-M}const S=c.baseTime*r/c.timescale;for(let P=0;P0?P-1:P].dts&&(y=!0)}y&&n.sort(function(P,M){const W=P.dts-M.dts,Y=P.pts-M.pts;return W||Y}),f=n[0].dts,g=n[n.length-1].dts;const E=g-f,R=E?Math.round(E/(l-1)):d||t.inputTimeScale/30;if(s){const P=f-h,M=P>R,W=P<-1;if((M||W)&&(M?x.warn("AVC: ".concat(Gt(P,!0)," ms (").concat(P,"dts) hole between fragments detected, filling it")):x.warn("AVC: ".concat(Gt(-P,!0)," ms (").concat(P,"dts) overlapping between fragments detected")),!W||h>=n[0].pts)){f=h;const Y=n[0].pts-P;n[0].dts=f,n[0].pts=Y,x.log("Video: First PTS/DTS adjusted: ".concat(Gt(Y,!0),"/").concat(Gt(f,!0),", delta: ").concat(Gt(P,!0)," ms"))}}f=Math.max(0,f);let A=0,k=0;for(let P=0;P0?M.dts-n[P-1].dts:R;if(K=P>0?M.pts-n[P-1].pts:R,ht.stretchShortVideoTrack&&this.nextAudioPts!==null){const ut=Math.floor(ht.maxBufferHole*r),Ct=(i?p+i*r:this.nextAudioPts)-M.pts;Ct>ut?(d=Ct-mt,d<0?d=mt:I=!0,x.log("[mp4-remuxer]: It is approximately ".concat(Ct/90," ms to the next segment; using duration ").concat(d/90," ms for the last video frame."))):d=mt}else d=mt}const Z=Math.round(M.pts-M.dts);O=Math.min(O,d),V=Math.max(V,d),w=Math.min(w,K),nt=Math.max(nt,K),o.push(new Gs(M.key,d,Y,Z))}if(o.length){if(te){if(te<70){const P=o[0].flags;P.dependsOn=2,P.isNonSync=0}}else if(Le&&nt-w0&&(i&&Math.abs(S-y)<9e3||Math.abs(gt(p[0].pts-E,S)-y)<20*h),p.forEach(function(J){J.pts=gt(J.pts-E,S)}),!s||y<0){if(p=p.filter(J=>J.pts>=0),!p.length)return;r===0?y=0:i&&!g?y=Math.max(0,S):y=p[0].pts}if(t.segmentCodec==="aac"){const J=this.config.maxAudioFramesDrift;for(let j=0,P=y;j=J*h&&K0){D+=T;try{k=new Uint8Array(D)}catch(K){this.observer.emit(m.ERROR,m.ERROR,{type:N.MUX_ERROR,details:L.REMUX_ALLOC_ERROR,fatal:!1,error:K,bytes:D,reason:"fail allocating audio mdat ".concat(D)});return}d||(new DataView(k.buffer).setUint32(0,D),k.set(v.types.mdat,4))}else return;k.set(M,T);const Y=M.byteLength;T+=Y,f.push(new Gs(!0,c,Y,0)),A=W}const _=f.length;if(!_)return;const I=f[f.length-1];this.nextAudioPts=y=A+l*I.duration;const O=d?new Uint8Array(0):v.moof(t.sequenceNumber++,R/l,tt({},t,{samples:f}));t.samples=[];const w=R/n,V=y/n,X={data1:O,data2:k,startPTS:w,endPTS:V,startDTS:w,endDTS:V,type:"audio",hasAudio:!0,hasVideo:!1,nb:_};return this.isAudioContiguous=!0,X}remuxEmptyAudio(t,e,s,i){const r=t.inputTimeScale,n=t.samplerate?t.samplerate:r,o=r/n,l=this.nextAudioPts,c=this._initDTS,h=c.baseTime*9e4/c.timescale,u=(l!==null?l:i.startDTS*r)+h,d=i.endDTS*r+h,f=o*$s,g=Math.ceil((d-u)/f),p=Bs.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(x.warn("[mp4-remuxer]: remux empty Audio"),!p){x.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}const T=[];for(let y=0;y4294967296;)a+=e;return a}function ya(a){for(let t=0;tn.pts-o.pts);const r=a.samples;return a.samples=[],{samples:r}}class Gs{constructor(t,e,s,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=e,this.size=s,this.cts=i,this.flags=new xa(t)}}class xa{constructor(t){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=t?2:1,this.isNonSync=t?0:1}}class Ea{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(t){this.initPTS=t,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(t,e,s,i){this.audioCodec=e,this.videoCodec=s,this.generateInitSegment(Br(t,i)),this.emitInitSegment=!0}generateInitSegment(t){let{audioCodec:e,videoCodec:s}=this;if(!(t!=null&&t.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const i=this.initData=yi(t);e||(e=Ks(i.audio,H.AUDIO)),s||(s=Ks(i.video,H.VIDEO));const r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:e+","+s,initSegment:t,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:i.video?r.video={container:"video/mp4",codec:s,initSegment:t,id:"main"}:x.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(t,e,s,i,r,n){var o,l;let{initPTS:c,lastEndTime:h}=this;const u={audio:void 0,video:void 0,text:i,id3:s,initSegment:void 0};F(h)||(h=this.lastEndTime=r||0);const d=e.samples;if(!(d!=null&&d.length))return u;const f={initPTS:void 0,timescale:1};let g=this.initData;if((o=g)!=null&&o.length||(this.generateInitSegment(d),g=this.initData),!((l=g)!=null&&l.length))return x.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1);const p=Gr(d,g),T=$r(g,d),y=T===null?r:T;(Sa(c,y,r,p)||f.timescale!==c.timescale&&n)&&(f.initPTS=y-r,c&&c.timescale===1&&x.warn("Adjusting initPTS by ".concat(f.initPTS-c.baseTime)),this.initPTS=c={baseTime:f.initPTS,timescale:1});const S=t?y-c.baseTime/c.timescale:h,E=S+p;Hr(g,d,c.baseTime/c.timescale),p>0?this.lastEndTime=E:(x.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const R=!!g.audio,A=!!g.video;let k="";R&&(k+="audio"),A&&(k+="video");const D={data1:d,startPTS:S,startDTS:S,endPTS:E,endDTS:E,type:k,hasAudio:R,hasVideo:A,nb:1,dropped:0};return u.audio=D.type==="audio"?D:void 0,u.video=D.type!=="audio"?D:void 0,u.initSegment=f,u.id3=Ki(s,r,c,c),i.samples.length&&(u.text=Hi(i,r,c)),u}}function Sa(a,t,e,s){if(a===null)return!0;const i=Math.max(s,1),r=t-a.baseTime/a.timescale;return Math.abs(r-e)>i}function Ks(a,t){const e=a==null?void 0:a.codec;return e&&e.length>4?e:e==="hvc1"||e==="hev1"?"hvc1.1.6.L120.90":e==="av01"?"av01.0.04M.08":e==="avc1"||t===H.VIDEO?"avc1.42e01e":"mp4a.40.5"}let Lt;try{Lt=self.performance.now.bind(self.performance)}catch{x.debug("Unable to use Performance API on this environment"),Lt=typeof self<"u"&&self.Date.now}const Ie=[{demux:ia,remux:Ea},{demux:bt,remux:Re},{demux:ea,remux:Re},{demux:fa,remux:Re}];class Hs{constructor(t,e,s,i,r){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=t,this.typeSupported=e,this.config=s,this.vendor=i,this.id=r}configure(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()}push(t,e,s,i){const r=s.transmuxing;r.executeStart=Lt();let n=new Uint8Array(t);const{currentTransmuxState:o,transmuxConfig:l}=this;i&&(this.currentTransmuxState=i);const{contiguous:c,discontinuity:h,trackSwitch:u,accurateTimeOffset:d,timeOffset:f,initSegmentChange:g}=i||o,{audioCodec:p,videoCodec:T,defaultInitPts:y,duration:S,initSegmentData:E}=l,R=va(n,e);if(R&&R.method==="AES-128"){const C=this.getDecrypter();if(C.isSync()){let _=C.softwareDecrypt(n,R.key.buffer,R.iv.buffer);if(s.part>-1&&(_=C.flush()),!_)return r.executeEnd=Lt(),be(s);n=new Uint8Array(_)}else return this.decryptionPromise=C.webCryptoDecrypt(n,R.key.buffer,R.iv.buffer).then(_=>{const I=this.push(_,null,s);return this.decryptionPromise=null,I}),this.decryptionPromise}const A=this.needsProbing(h,u);if(A){const C=this.configureTransmuxer(n);if(C)return x.warn("[transmuxer] ".concat(C.message)),this.observer.emit(m.ERROR,m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,fatal:!1,error:C,reason:C.message}),r.executeEnd=Lt(),be(s)}(h||u||g||A)&&this.resetInitSegment(E,p,T,S,e),(h||g||A)&&this.resetInitialTimestamp(y),c||this.resetContiguity();const k=this.transmux(n,R,f,d,s),D=this.currentTransmuxState;return D.contiguous=!0,D.discontinuity=!1,D.trackSwitch=!1,r.executeEnd=Lt(),k}flush(t){const e=t.transmuxing;e.executeStart=Lt();const{decrypter:s,currentTransmuxState:i,decryptionPromise:r}=this;if(r)return r.then(()=>this.flush(t));const n=[],{timeOffset:o}=i;if(s){const u=s.flush();u&&n.push(this.push(u,null,t))}const{demuxer:l,remuxer:c}=this;if(!l||!c)return e.executeEnd=Lt(),[be(t)];const h=l.flush(o);return re(h)?h.then(u=>(this.flushRemux(n,u,t),n)):(this.flushRemux(n,h,t),n)}flushRemux(t,e,s){const{audioTrack:i,videoTrack:r,id3Track:n,textTrack:o}=e,{accurateTimeOffset:l,timeOffset:c}=this.currentTransmuxState;x.log("[transmuxer.ts]: Flushed fragment ".concat(s.sn).concat(s.part>-1?" p: "+s.part:""," of level ").concat(s.level));const h=this.remuxer.remux(i,r,n,o,c,l,!0,this.id);t.push({remuxResult:h,chunkMeta:s}),s.transmuxing.executeEnd=Lt()}resetInitialTimestamp(t){const{demuxer:e,remuxer:s}=this;!e||!s||(e.resetTimeStamp(t),s.resetTimeStamp(t))}resetContiguity(){const{demuxer:t,remuxer:e}=this;!t||!e||(t.resetContiguity(),e.resetNextTimestamp())}resetInitSegment(t,e,s,i,r){const{demuxer:n,remuxer:o}=this;!n||!o||(n.resetInitSegment(t,e,s,i),o.resetInitSegment(t,e,s,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(t,e,s,i,r){let n;return e&&e.method==="SAMPLE-AES"?n=this.transmuxSampleAes(t,e,s,i,r):n=this.transmuxUnencrypted(t,s,i,r),n}transmuxUnencrypted(t,e,s,i){const{audioTrack:r,videoTrack:n,id3Track:o,textTrack:l}=this.demuxer.demux(t,e,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,n,o,l,e,s,!1,this.id),chunkMeta:i}}transmuxSampleAes(t,e,s,i,r){return this.demuxer.demuxSampleAes(t,e,s).then(n=>({remuxResult:this.remuxer.remux(n.audioTrack,n.videoTrack,n.id3Track,n.textTrack,s,i,!1,this.id),chunkMeta:r}))}configureTransmuxer(t){const{config:e,observer:s,typeSupported:i,vendor:r}=this;let n;for(let u=0,d=Ie.length;u0&&t!=null&&t.key!=null&&t.iv!==null&&t.method!=null&&(e=t),e}const be=a=>({remuxResult:{},chunkMeta:a});function re(a){return"then"in a&&a.then instanceof Function}class Aa{constructor(t,e,s,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=s,this.duration=i,this.defaultInitPts=r||null}}class La{constructor(t,e,s,i,r,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=t,this.contiguous=e,this.accurateTimeOffset=s,this.trackSwitch=i,this.timeOffset=r,this.initSegmentChange=n}}var Vi={exports:{}};(function(a){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function i(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function r(l,c,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new i(h,u||l,d),g=e?e+c:c;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],f]:l._events[g].push(f):(l._events[g]=f,l._eventsCount++),l}function n(l,c){--l._eventsCount===0?l._events=new s:delete l._events[c]}function o(){this._events=new s,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],h,u;if(this._eventsCount===0)return c;for(u in h=this._events)t.call(h,u)&&c.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},o.prototype.listeners=function(c){var h=e?e+c:c,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,g=new Array(f);d!1};class Wi{constructor(t,e,s,i){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const r=t.config;this.hls=t,this.id=e,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=s,this.onFlush=i;const n=(c,h)=>{h=h||{},h.frag=this.frag,h.id=this.id,c===m.ERROR&&(this.error=h.error),this.hls.trigger(c,h)};this.observer=new as,this.observer.on(m.FRAG_DECRYPTED,n),this.observer.on(m.ERROR,n);const o={mp4:De.isTypeSupported("video/mp4"),mpeg:De.isTypeSupported("audio/mpeg"),mp3:De.isTypeSupported('audio/mp4; codecs="mp3"')},l=navigator.vendor;if(this.useWorker&&typeof Worker<"u"&&(r.workerPath||Yn())){try{r.workerPath?(x.log("loading Web Worker ".concat(r.workerPath,' for "').concat(e,'"')),this.workerContext=jn(r.workerPath)):(x.log('injecting Web Worker for "'.concat(e,'"')),this.workerContext=qn()),this.onwmsg=u=>this.onWorkerMessage(u);const{worker:h}=this.workerContext;h.addEventListener("message",this.onwmsg),h.onerror=u=>{const d=new Error("".concat(u.message," (").concat(u.filename,":").concat(u.lineno,")"));r.enableWorker=!1,x.warn('Error in "'.concat(e,'" Web Worker, fallback to inline')),this.hls.trigger(m.ERROR,{type:N.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:d})},h.postMessage({cmd:"init",typeSupported:o,vendor:l,id:e,config:JSON.stringify(r)})}catch(h){x.warn('Error setting up "'.concat(e,'" Web Worker, fallback to inline'),h),this.resetWorker(),this.error=null,this.transmuxer=new Hs(this.observer,o,r,l,e)}return}this.transmuxer=new Hs(this.observer,o,r,l,e)}resetWorker(){if(this.workerContext){const{worker:t,objectURL:e}=this.workerContext;e&&self.URL.revokeObjectURL(e),t.removeEventListener("message",this.onwmsg),t.onerror=null,t.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const t=this.observer;t&&t.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(t,e,s,i,r,n,o,l,c,h){var u,d;c.transmuxing.start=self.performance.now();const{transmuxer:f}=this,g=n?n.start:r.start,p=r.decryptdata,T=this.frag,y=!(T&&r.cc===T.cc),S=!(T&&c.level===T.level),E=T?c.sn-T.sn:-1,R=this.part?c.part-this.part.index:-1,A=E===0&&c.id>1&&c.id===(T==null?void 0:T.stats.chunkCount),k=!S&&(E===1||E===0&&(R===1||A&&R<=0)),D=self.performance.now();(S||E||r.stats.parsing.start===0)&&(r.stats.parsing.start=D),n&&(R||!k)&&(n.stats.parsing.start=D);const C=!(T&&((u=r.initSegment)==null?void 0:u.url)===((d=T.initSegment)==null?void 0:d.url)),_=new La(y,k,l,S,g,C);if(!k||y||C){x.log("[transmuxer-interface, ".concat(r.type,"]: Starting new transmux session for sn: ").concat(c.sn," p: ").concat(c.part," level: ").concat(c.level," id: ").concat(c.id,"\n discontinuity: ").concat(y,"\n trackSwitch: ").concat(S,"\n contiguous: ").concat(k,"\n accurateTimeOffset: ").concat(l,"\n timeOffset: ").concat(g,"\n initSegmentChange: ").concat(C));const I=new Aa(s,i,e,o,h);this.configureTransmuxer(I)}if(this.frag=r,this.part=n,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:t,decryptdata:p,chunkMeta:c,state:_},t instanceof ArrayBuffer?[t]:[]);else if(f){const I=f.push(t,p,c,_);re(I)?(f.async=!0,I.then(O=>{this.handleTransmuxComplete(O)}).catch(O=>{this.transmuxerError(O,c,"transmuxer-interface push error")})):(f.async=!1,this.handleTransmuxComplete(I))}}flush(t){t.transmuxing.start=self.performance.now();const{transmuxer:e}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:t});else if(e){let s=e.flush(t);re(s)||e.async?(re(s)||(s=Promise.resolve(s)),s.then(r=>{this.handleFlushResult(r,t)}).catch(r=>{this.transmuxerError(r,t,"transmuxer-interface flush error")})):this.handleFlushResult(s,t)}}transmuxerError(t,e,s){this.hls&&(this.error=t,this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_PARSING_ERROR,chunkMeta:e,fatal:!1,error:t,err:t,reason:s}))}handleFlushResult(t,e){t.forEach(s=>{this.handleTransmuxComplete(s)}),this.onFlush(e)}onWorkerMessage(t){const e=t.data,s=this.hls;switch(e.event){case"init":{var i;const r=(i=this.workerContext)==null?void 0:i.objectURL;r&&self.URL.revokeObjectURL(r);break}case"transmuxComplete":{this.handleTransmuxComplete(e.data);break}case"flush":{this.onFlush(e.data);break}case"workerLog":x[e.data.logType]&&x[e.data.logType](e.data.message);break;default:{e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,s.trigger(e.event,e.data);break}}}configureTransmuxer(t){const{transmuxer:e}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:t}):e&&e.configure(t)}handleTransmuxComplete(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)}}const Ia=250,Ce=2,ba=.1,Da=.05;class Ca{constructor(t,e,s,i){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=e,this.fragmentTracker=s,this.hls=i}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(t,e){const{config:s,media:i,stalled:r}=this;if(i===null)return;const{currentTime:n,seeking:o}=i,l=this.seeking&&!o,c=!this.seeking&&o;if(this.seeking=o,n!==t){if(this.moved=!0,r!==null){if(this.stallReported){const y=self.performance.now()-r;x.warn("playback not stuck anymore @".concat(n,", after ").concat(Math.round(y),"ms")),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if(c||l){this.stalled=null;return}if(i.paused&&!o||i.ended||i.playbackRate===0||!q.getBuffered(i).length)return;const h=q.bufferInfo(i,n,0),u=h.len>0,d=h.nextStart||0;if(!u&&!d)return;if(o){const y=h.len>Ce,S=!d||e&&e.start<=n||d-n>Ce&&!this.fragmentTracker.getPartialFragment(n);if(y||S)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var f;const y=Math.max(d,h.start||0)-n,S=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,R=(S==null||(f=S.details)==null?void 0:f.live)?S.details.targetduration*2:Ce,A=this.fragmentTracker.getPartialFragment(n);if(y>0&&(y<=R||A)){this._trySkipBufferHole(A);return}}const g=self.performance.now();if(r===null){this.stalled=g;return}const p=g-r;if(!o&&p>=Ia&&(this._reportStall(h),!this.media))return;const T=q.bufferInfo(i,n,s.maxBufferHole);this._tryFixBufferStall(T,p)}_tryFixBufferStall(t,e){const{config:s,fragmentTracker:i,media:r}=this;if(r===null)return;const n=r.currentTime,o=i.getPartialFragment(n);o&&(this._trySkipBufferHole(o)||!this.media)||(t.len>s.maxBufferHole||t.nextStart&&t.nextStart-ns.highBufferWatchdogPeriod*1e3&&(x.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(t){const{hls:e,media:s,stallReported:i}=this;if(!i&&s){this.stallReported=!0;const r=new Error("Playback stalling at @".concat(s.currentTime," due to low buffer (").concat(JSON.stringify(t),")"));x.warn(r.message),e.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:t.len})}}_trySkipBufferHole(t){const{config:e,hls:s,media:i}=this;if(i===null)return 0;const r=i.currentTime,n=q.bufferInfo(i,r,0),o=r0&&n.len<1&&i.readyState<3,h=o-r;if(h>0&&(l||c)){if(h>e.maxBufferHole){const{fragmentTracker:d}=this;let f=!1;if(r===0){const g=d.getAppendedFrag(0,U.MAIN);g&&o1?(i=0,this.bitrateTest=!0):i=s.nextAutoLevel),this.level=s.nextLoadLevel=i,this.loadedmetadata=!1}e>0&&t===-1&&(this.log("Override startPosition with lastCurrentTime @".concat(e.toFixed(3))),t=e),this.state=b.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=b.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case b.WAITING_LEVEL:{var t;const{levels:s,level:i}=this,r=s==null||(t=s[i])==null?void 0:t.details;if(r&&(!r.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(r))break;this.state=b.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=b.IDLE;break}break}case b.FRAG_LOADING_WAITING_RETRY:{var e;const s=self.performance.now(),i=this.retryDate;(!i||s>=i||(e=this.media)!=null&&e.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=b.IDLE)}break}this.state===b.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:t,levelLastLoaded:e,levels:s,media:i}=this,{config:r,nextLoadLevel:n}=t;if(e===null||!i&&(this.startFragRequested||!r.startFragPrefetch)||this.altAudio&&this.audioOnly||!(s!=null&&s[n]))return;const o=s[n],l=this.getMainFwdBufferInfo();if(l===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(l,c)){const T={};this.altAudio&&(T.type="video"),this.hls.trigger(m.BUFFER_EOS,T),this.state=b.ENDED;return}t.loadLevel!==n&&t.manualLevel===-1&&this.log("Adapting to level ".concat(n," from level ").concat(this.level)),this.level=t.nextLoadLevel=n;const h=o.details;if(!h||this.state===b.WAITING_LEVEL||h.live&&this.levelLastLoaded!==n){this.level=n,this.state=b.WAITING_LEVEL;return}const u=l.len,d=this.getMaxBufferLength(o.maxBitrate);if(u>=d)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const f=this.backtrackFragment?this.backtrackFragment.start:l.end;let g=this.getNextFragment(f,h);if(this.couldBacktrack&&!this.fragPrevious&&g&&g.sn!=="initSegment"&&this.fragmentTracker.getState(g)!==et.OK){var p;const y=((p=this.backtrackFragment)!=null?p:g).sn-h.startSN,S=h.fragments[y-1];S&&g.cc===S.cc&&(g=S,this.fragmentTracker.removeFragment(S))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(g&&this.isLoopLoading(g,f)){if(!g.gap){const y=this.audioOnly&&!this.altAudio?H.AUDIO:H.VIDEO,S=(y===H.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;S&&this.afterBufferFlushed(S,y,U.MAIN)}g=this.getNextFragmentLoopLoading(g,h,l,U.MAIN,d)}g&&(g.initSegment&&!g.initSegment.data&&!this.bitrateTest&&(g=g.initSegment),this.loadFragment(g,o,f))}loadFragment(t,e,s){const i=this.fragmentTracker.getState(t);this.fragCurrent=t,i===et.NOT_LOADED||i===et.PARTIAL?t.sn==="initSegment"?this._loadInitSegment(t,e):this.bitrateTest?(this.log("Fragment ".concat(t.sn," of level ").concat(t.level," is being downloaded to test bitrate and will not be buffered")),this._loadBitrateTestFrag(t,e)):(this.startFragRequested=!0,super.loadFragment(t,e,s)):this.clearTrackerIfNeeded(t)}getBufferedFrag(t){return this.fragmentTracker.getBufferedFrag(t,U.MAIN)}followingBufferedFrag(t){return t?this.getBufferedFrag(t.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:t,media:e}=this;if(e!=null&&e.readyState){let s;const i=this.getAppendedFrag(e.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const o=this.getMainFwdBufferInfo();if(!o||o.len{r=n.audioCodec,r&&(r.indexOf("mp4a.40.2")!==-1&&(s=!0),r.indexOf("mp4a.40.5")!==-1&&(i=!0))}),this.audioCodecSwitch=s&&i&&!Wn(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1}onLevelLoading(t,e){const{levels:s}=this;if(!s||this.state!==b.IDLE)return;const i=s[e.level];(!i.details||i.details.live&&this.levelLastLoaded!==e.level||this.waitForCdnTuneIn(i.details))&&(this.state=b.WAITING_LEVEL)}onLevelLoaded(t,e){var s;const{levels:i}=this,r=e.level,n=e.details,o=n.totalduration;if(!i){this.warn("Levels were reset while loading level ".concat(r));return}this.log("Level ".concat(r," loaded [").concat(n.startSN,",").concat(n.endSN,"]").concat(n.lastPartSn?"[part-".concat(n.lastPartSn,"-").concat(n.lastPartIndex,"]"):"",", cc [").concat(n.startCC,", ").concat(n.endCC,"] duration:").concat(o));const l=i[r],c=this.fragCurrent;c&&(this.state===b.FRAG_LOADING||this.state===b.FRAG_LOADING_WAITING_RETRY)&&(c.level!==e.level||c.urlId!==l.urlId)&&c.loader&&this.abortCurrentFrag();let h=0;if(n.live||(s=l.details)!=null&&s.live){if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;h=this.alignPlaylists(n,l.details)}if(l.details=n,this.levelLastLoaded=r,this.hls.trigger(m.LEVEL_UPDATED,{details:n,level:r}),this.state===b.WAITING_LEVEL){if(this.waitForCdnTuneIn(n))return;this.state=b.IDLE}this.startFragRequested?n.live&&this.synchronizeToLiveEdge(n):this.setStartPosition(n,h),this.tick()}_handleFragmentLoadProgress(t){var e;const{frag:s,part:i,payload:r}=t,{levels:n}=this;if(!n){this.warn("Levels were reset while fragment load was in progress. Fragment ".concat(s.sn," of level ").concat(s.level," will not be buffered"));return}const o=n[s.level],l=o.details;if(!l){this.warn("Dropping fragment ".concat(s.sn," of level ").concat(s.level," after level details were reset")),this.fragmentTracker.removeFragment(s);return}const c=o.videoCodec,h=l.PTSKnown||!l.live,u=(e=s.initSegment)==null?void 0:e.data,d=this._getAudioCodec(o),f=this.transmuxer=this.transmuxer||new Wi(this.hls,U.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),g=i?i.index:-1,p=g!==-1,T=new Ze(s.level,s.sn,s.stats.chunkCount,r.byteLength,g,p),y=this.initPTS[s.cc];f.push(r,u,d,c,s,i,l.totalduration,h,T,y)}onAudioTrackSwitching(t,e){const s=this.altAudio;if(!!!e.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const n=this.fragCurrent;n&&(this.log("Switching to main audio track, cancel main fragment load"),n.abortRequests(),this.fragmentTracker.removeFragment(n)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const r=this.hls;s&&(r.trigger(m.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),r.trigger(m.AUDIO_TRACK_SWITCHED,e)}}onAudioTrackSwitched(t,e){const s=e.id,i=!!this.hls.audioTracks[s].url;if(i){const r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=i,this.tick()}onBufferCreated(t,e){const s=e.tracks;let i,r,n=!1;for(const o in s){const l=s[o];if(l.id==="main"){if(r=o,i=l,o==="video"){const c=s[o];c&&(this.videoBuffer=c.buffer)}}else n=!0}n&&i?(this.log("Alternate track found, use ".concat(r,".buffered to schedule main fragment loading")),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(t,e){const{frag:s,part:i}=e;if(s&&s.type!==U.MAIN)return;if(this.fragContextChanged(s)){this.warn("Fragment ".concat(s.sn).concat(i?" p: "+i.index:""," of level ").concat(s.level," finished buffering, but was aborted. state: ").concat(this.state)),this.state===b.PARSED&&(this.state=b.IDLE);return}const r=i?i.stats:s.stats;this.fragLastKbps=Math.round(8*r.total/(r.buffering.end-r.loading.first)),s.sn!=="initSegment"&&(this.fragPrevious=s),this.fragBufferedComplete(s,i)}onError(t,e){var s;if(e.fatal){this.state=b.ERROR;return}switch(e.details){case L.FRAG_GAP:case L.FRAG_PARSING_ERROR:case L.FRAG_DECRYPT_ERROR:case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(U.MAIN,e);break;case L.LEVEL_LOAD_ERROR:case L.LEVEL_LOAD_TIMEOUT:case L.LEVEL_PARSING_ERROR:!e.levelRetry&&this.state===b.WAITING_LEVEL&&((s=e.context)==null?void 0:s.type)===G.LEVEL&&(this.state=b.IDLE);break;case L.BUFFER_FULL_ERROR:if(!e.parent||e.parent!=="main")return;this.reduceLengthAndFlushBuffer(e)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case L.INTERNAL_EXCEPTION:this.recoverWorkerError(e);break}}checkBuffer(){const{media:t,gapController:e}=this;if(!(!t||!e||!t.readyState)){if(this.loadedmetadata||!q.getBuffered(t).length){const s=this.state!==b.IDLE?this.fragCurrent:null;e.poll(this.lastCurrentTime,s)}this.lastCurrentTime=t.currentTime}}onFragLoadEmergencyAborted(){this.state=b.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(t,{type:e}){if(e!==H.AUDIO||this.audioOnly&&!this.altAudio){const s=(e===H.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(s,e,U.MAIN)}}onLevelsUpdated(t,e){this.levels=e.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:t}=this;if(!t)return;const e=t.currentTime;let s=this.startPosition;if(s>=0&&e0&&(n{const{hls:i}=this;if(!s||this.fragContextChanged(t))return;e.fragmentError=0,this.state=b.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const r=t.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),i.trigger(m.FRAG_LOADED,s),t.bitrateTest=!1})}_handleTransmuxComplete(t){var e;const s="main",{hls:i}=this,{remuxResult:r,chunkMeta:n}=t,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:l,part:c,level:h}=o,{video:u,text:d,id3:f,initSegment:g}=r,{details:p}=h,T=this.altAudio?void 0:r.audio;if(this.fragContextChanged(l)){this.fragmentTracker.removeFragment(l);return}if(this.state=b.PARSING,g){if(g!=null&&g.tracks){const E=l.initSegment||l;this._bufferInitSegment(h,g.tracks,E,n),i.trigger(m.FRAG_PARSING_INIT_SEGMENT,{frag:E,id:s,tracks:g.tracks})}const y=g.initPTS,S=g.timescale;F(y)&&(this.initPTS[l.cc]={baseTime:y,timescale:S},i.trigger(m.INIT_PTS_FOUND,{frag:l,id:s,initPTS:y,timescale:S}))}if(u&&p&&l.sn!=="initSegment"){const y=p.fragments[l.sn-1-p.startSN],S=l.sn===p.startSN,E=!y||l.cc>y.cc;if(r.independent!==!1){const{startPTS:R,endPTS:A,startDTS:k,endDTS:D}=u;if(c)c.elementaryStreams[u.type]={startPTS:R,endPTS:A,startDTS:k,endDTS:D};else if(u.firstKeyFrame&&u.independent&&n.id===1&&!E&&(this.couldBacktrack=!0),u.dropped&&u.independent){const C=this.getMainFwdBufferInfo(),_=(C?C.end:this.getLoadPosition())+this.config.maxBufferHole,I=u.firstKeyFramePTS?u.firstKeyFramePTS:R;if(!S&&_{const h=e[l].initSegment;h!=null&&h.byteLength&&this.hls.trigger(m.BUFFER_APPENDING,{type:l,data:h,frag:s,part:null,chunkMeta:i,parent:s.type})}),this.tick()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,U.MAIN)}backtrack(t){this.couldBacktrack=!0,this.backtrackFragment=t,this.resetTransmuxer(),this.flushBufferGap(t),this.fragmentTracker.removeFragment(t),this.fragPrevious=null,this.nextLoadPosition=t.start,this.state=b.IDLE}checkFragmentChanged(){const t=this.media;let e=null;if(t&&t.readyState>1&&t.seeking===!1){const s=t.currentTime;if(q.isBuffered(t,s)?e=this.getAppendedFrag(s):q.isBuffered(t,s+.1)&&(e=this.getAppendedFrag(s+.1)),e){this.backtrackFragment=null;const i=this.fragPlaying,r=e.level;(!i||e.sn!==i.sn||i.level!==r||e.urlId!==i.urlId)&&(this.fragPlaying=e,this.hls.trigger(m.FRAG_CHANGED,{frag:e}),(!i||i.level!==r)&&this.hls.trigger(m.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const t=this.nextBufferedFrag;return t?t.level:-1}get currentFrag(){const t=this.media;return t?this.fragPlaying||this.getAppendedFrag(t.currentTime):null}get currentProgramDateTime(){const t=this.media;if(t){const e=t.currentTime,s=this.currentFrag;if(s&&F(e)&&F(s.programDateTime)){const i=s.programDateTime+(e-s.start)*1e3;return new Date(i)}}return null}get currentLevel(){const t=this.currentFrag;return t?t.level:-1}get nextBufferedFrag(){const t=this.currentFrag;return t?this.followingBufferedFrag(t):null}get forceStartLoad(){return this._forceStartLoad}}class Mt{constructor(t,e=0,s=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=s}sample(t,e){const s=Math.pow(this.alpha_,t);this.estimate_=e*(1-s)+s*this.estimate_,this.totalWeight_+=t}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_}}class wa{constructor(t,e,s,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=s,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Mt(t),this.fast_=new Mt(e),this.defaultTTFB_=i,this.ttfb_=new Mt(t)}update(t,e){const{slow_:s,fast_:i,ttfb_:r}=this;s.halfLife!==t&&(this.slow_=new Mt(t,s.getEstimate(),s.getTotalWeight())),i.halfLife!==e&&(this.fast_=new Mt(e,i.getEstimate(),i.getTotalWeight())),r.halfLife!==t&&(this.ttfb_=new Mt(t,r.getEstimate(),r.getTotalWeight()))}sample(t,e){t=Math.max(t,this.minDelayMs_);const s=8*e,i=t/1e3,r=s/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(t){const e=t/1e3,s=Math.sqrt(2)*Math.exp(-Math.pow(e,2)/2);this.ttfb_.sample(s,Math.max(t,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}class Pa{constructor(t){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=t;const e=t.config;this.bwEstimator=new wa(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate),this.registerListeners()}registerListeners(){const{hls:t}=this;t.on(m.FRAG_LOADING,this.onFragLoading,this),t.on(m.FRAG_LOADED,this.onFragLoaded,this),t.on(m.FRAG_BUFFERED,this.onFragBuffered,this),t.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(m.LEVEL_LOADED,this.onLevelLoaded,this)}unregisterListeners(){const{hls:t}=this;t.off(m.FRAG_LOADING,this.onFragLoading,this),t.off(m.FRAG_LOADED,this.onFragLoaded,this),t.off(m.FRAG_BUFFERED,this.onFragBuffered,this),t.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(m.LEVEL_LOADED,this.onLevelLoaded,this)}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null}onFragLoading(t,e){var s;const i=e.frag;this.ignoreFragment(i)||(this.fragCurrent=i,this.partCurrent=(s=e.part)!=null?s:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))}onLevelSwitching(t,e){this.clearTimer()}getTimeToLoadFrag(t,e,s,i){const r=t+s/e,n=i?this.lastLevelLoadSec:0;return r+n}onLevelLoaded(t,e){const s=this.hls.config,{total:i,bwEstimate:r}=e.stats;F(i)&&F(r)&&(this.lastLevelLoadSec=8*i/r),e.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)}_abandonRulesCheck(){const{fragCurrent:t,partCurrent:e,hls:s}=this,{autoLevelEnabled:i,media:r}=s;if(!t||!r)return;const n=performance.now(),o=e?e.stats:t.stats,l=e?e.duration:t.duration,c=n-o.loading.start;if(o.aborted||o.loaded&&o.loaded===o.total||t.level===0){this.clearTimer(),this._nextAutoLevel=-1;return}if(!i||r.paused||!r.playbackRate||!r.readyState)return;const h=s.mainForwardBufferInfo;if(h===null)return;const u=this.bwEstimator.getEstimateTTFB(),d=Math.abs(r.playbackRate);if(c<=Math.max(u,1e3*(l/(d*2))))return;const f=h.len/d;if(f>=2*l/d)return;const g=o.loading.first?o.loading.first-o.loading.start:-1,p=o.loaded&&g>-1,T=this.bwEstimator.getEstimate(),{levels:y,minAutoLevel:S}=s,E=y[t.level],R=o.total||Math.max(o.loaded,Math.round(l*E.maxBitrate/8));let A=c-g;A<1&&p&&(A=Math.min(c,o.loaded*8/T));const k=p?o.loaded*1e3/A:0,D=k?(R-o.loaded)/k:R*8/T+u/1e3;if(D<=f)return;const C=k?k*8:T;let _=Number.POSITIVE_INFINITY,I;for(I=t.level-1;I>S;I--){const O=y[I].maxBitrate;if(_=this.getTimeToLoadFrag(u/1e3,C,l*O,!y[I].details),_=D||_>l*10||(s.nextLoadLevel=I,p?this.bwEstimator.sample(c-Math.min(u,g),o.loaded):this.bwEstimator.sampleTTFB(c),this.clearTimer(),x.warn("[abr] Fragment ".concat(t.sn).concat(e?" part "+e.index:""," of level ").concat(t.level," is loading too slowly;\n Time to underbuffer: ").concat(f.toFixed(3)," s\n Estimated load time for current fragment: ").concat(D.toFixed(3)," s\n Estimated load time for down switch fragment: ").concat(_.toFixed(3)," s\n TTFB estimate: ").concat(g,"\n Current BW estimate: ").concat(F(T)?(T/1024).toFixed(3):"Unknown"," Kb/s\n New BW estimate: ").concat((this.bwEstimator.getEstimate()/1024).toFixed(3)," Kb/s\n Aborting and switching to level ").concat(I)),t.loader&&(this.fragCurrent=this.partCurrent=null,t.abortRequests()),s.trigger(m.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:e,stats:o}))}onFragLoaded(t,{frag:e,part:s}){const i=s?s.stats:e.stats;if(e.type===U.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(e)){if(this.clearTimer(),this.lastLoadedFragLevel=e.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){const r=s?s.duration:e.duration,n=this.hls.levels[e.level],o=(n.loaded?n.loaded.bytes:0)+i.loaded,l=(n.loaded?n.loaded.duration:0)+r;n.loaded={bytes:o,duration:l},n.realBitrate=Math.round(8*o/l)}if(e.bitrateTest){const r={stats:i,frag:e,part:s,id:e.type};this.onFragBuffered(m.FRAG_BUFFERED,r),e.bitrateTest=!1}}}onFragBuffered(t,e){const{frag:s,part:i}=e,r=i!=null&&i.stats.loaded?i.stats:s.stats;if(r.aborted||this.ignoreFragment(s))return;const n=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(n,r.loaded),r.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}ignoreFragment(t){return t.type!==U.MAIN||t.sn==="initSegment"}clearTimer(){self.clearInterval(this.timer)}get nextAutoLevel(){const t=this._nextAutoLevel,e=this.bwEstimator;if(t!==-1&&!e.canEstimate())return t;let s=this.getNextABRAutoLevel();if(t!==-1){const i=this.hls.levels;if(i.length>Math.max(t,s)&&i[t].loadError<=i[s].loadError)return t}return t!==-1&&(s=Math.min(t,s)),s}getNextABRAutoLevel(){const{fragCurrent:t,partCurrent:e,hls:s}=this,{maxAutoLevel:i,config:r,minAutoLevel:n,media:o}=s,l=e?e.duration:t?t.duration:0,c=o&&o.playbackRate!==0?Math.abs(o.playbackRate):1,h=this.bwEstimator?this.bwEstimator.getEstimate():r.abrEwmaDefaultEstimate,u=s.mainForwardBufferInfo,d=(u?u.len:0)/c;let f=this.findBestLevel(h,n,i,d,r.abrBandWidthFactor,r.abrBandWidthUpFactor);if(f>=0)return f;x.trace("[abr] ".concat(d?"rebuffering expected":"buffer is empty",", finding optimal quality level"));let g=l?Math.min(l,r.maxStarvationDelay):r.maxStarvationDelay,p=r.abrBandWidthFactor,T=r.abrBandWidthUpFactor;if(!d){const y=this.bitrateTestDelay;y&&(g=(l?Math.min(l,r.maxLoadingDelay):r.maxLoadingDelay)-y,x.trace("[abr] bitrate test took ".concat(Math.round(1e3*y),"ms, set first fragment max fetchDuration to ").concat(Math.round(1e3*g)," ms")),p=T=1)}return f=this.findBestLevel(h,n,i,d+g,p,T),Math.max(f,0)}findBestLevel(t,e,s,i,r,n){var o;const{fragCurrent:l,partCurrent:c,lastLoadedFragLevel:h}=this,{levels:u}=this.hls,d=u[h],f=!!(d!=null&&(o=d.details)!=null&&o.live),g=d==null?void 0:d.codecSet,p=c?c.duration:l?l.duration:0,T=this.bwEstimator.getEstimateTTFB()/1e3;let y=e,S=-1;for(let E=s;E>=e;E--){const R=u[E];if(!R||g&&R.codecSet!==g){R&&(y=Math.min(E,y),S=Math.max(E,S));continue}S!==-1&&x.trace("[abr] Skipped level(s) ".concat(y,"-").concat(S,' with CODECS:"').concat(u[S].attrs.CODECS,'"; not compatible with "').concat(d.attrs.CODECS,'"'));const A=R.details,k=(c?A==null?void 0:A.partTarget:A==null?void 0:A.averagetargetduration)||p;let D;E<=h?D=r*t:D=n*t;const C=u[E].maxBitrate,_=this.getTimeToLoadFrag(T,D,C*k,A===void 0);if(x.trace("[abr] level:".concat(E," adjustedbw-bitrate:").concat(Math.round(D-C)," avgDuration:").concat(k.toFixed(1)," maxFetchDuration:").concat(i.toFixed(1)," fetchDuration:").concat(_.toFixed(1))),D>C&&(_===0||!F(_)||f&&!this.bitrateTestDelay||_0&&t===-1?(this.log("Override startPosition with lastCurrentTime @".concat(e.toFixed(3))),t=e,this.state=b.IDLE):(this.loadedmetadata=!1,this.state=b.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}doTick(){switch(this.state){case b.IDLE:this.doTickIdle();break;case b.WAITING_TRACK:{var t;const{levels:s,trackId:i}=this,r=s==null||(t=s[i])==null?void 0:t.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=b.WAITING_INIT_PTS}break}case b.FRAG_LOADING_WAITING_RETRY:{var e;const s=performance.now(),i=this.retryDate;(!i||s>=i||(e=this.media)!=null&&e.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=b.IDLE);break}case b.WAITING_INIT_PTS:{const s=this.waitingData;if(s){const{frag:i,part:r,cache:n,complete:o}=s;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=b.FRAG_LOADING;const l=n.flush(),c={frag:i,part:r,payload:l,networkDetails:null};this._handleFragmentLoadProgress(c),o&&super._handleFragmentLoadComplete(c)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc (".concat(i.cc,") cancelled because video is at cc ").concat(this.videoTrackCC)),this.clearWaitingFragment();else{const l=this.getLoadPosition(),c=q.bufferInfo(this.mediaBuffer,l,this.config.maxBufferHole);Ve(c.end,this.config.maxFragLookUpTolerance,i)<0&&(this.log("Waiting fragment cc (".concat(i.cc,") @ ").concat(i.start," cancelled because another fragment at ").concat(c.end," is needed")),this.clearWaitingFragment())}}else this.state=b.IDLE}}this.onTickEnd()}clearWaitingFragment(){const t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=b.IDLE)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:t}=this;t!=null&&t.readyState&&(this.lastCurrentTime=t.currentTime)}doTickIdle(){const{hls:t,levels:e,media:s,trackId:i}=this,r=t.config;if(!(e!=null&&e[i])||!s&&(this.startFragRequested||!r.startFragPrefetch))return;const n=e[i],o=n.details;if(!o||o.live&&this.levelLastLoaded!==i||this.waitForCdnTuneIn(o)){this.state=b.WAITING_TRACK;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,H.AUDIO,U.AUDIO));const c=this.getFwdBufferInfo(l,U.AUDIO);if(c===null)return;const{bufferedTrack:h,switchingTrack:u}=this;if(!u&&this._streamEnded(c,o)){t.trigger(m.BUFFER_EOS,{type:"audio"}),this.state=b.ENDED;return}const d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,U.MAIN),f=c.len,g=this.getMaxBufferLength(d==null?void 0:d.len);if(f>=g&&!u)return;const T=o.fragments[0].start;let y=c.end;if(u&&s){const A=this.getLoadPosition();h&&u.attrs!==h.attrs&&(y=A),o.PTSKnown&&AT||c.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=T+.05)}let S=this.getNextFragment(y,o),E=!1;if(S&&this.isLoopLoading(S,y)&&(E=!!S.gap,S=this.getNextFragmentLoopLoading(S,o,c,U.MAIN,g)),!S){this.bufferFlushed=!0;return}const R=d&&S.start>d.end+o.targetduration;if(R||!(d!=null&&d.len)&&c.len){const A=this.getAppendedFrag(S.start,U.MAIN);if(A===null||(E||(E=!!A.gap||!!R&&d.len===0),R&&!E||E&&c.nextStart&&c.nextStartnew Wt(s))}onAudioTrackSwitching(t,e){const s=!!e.url;this.trackId=e.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),s?this.setInterval(Vs):this.resetTransmuxer(),s?(this.switchingTrack=e,this.state=b.IDLE):(this.switchingTrack=null,this.bufferedTrack=e,this.state=b.STOPPED),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(t,e){this.mainDetails=e.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(m.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(t,e){var s;if(this.mainDetails==null){this.cachedTrackLoadedData=e;return}const{levels:i}=this,{details:r,id:n}=e;if(!i){this.warn("Audio tracks were reset while loading level ".concat(n));return}this.log("Track ".concat(n," loaded [").concat(r.startSN,",").concat(r.endSN,"]").concat(r.lastPartSn?"[part-".concat(r.lastPartSn,"-").concat(r.lastPartIndex,"]"):"",",duration:").concat(r.totalduration));const o=i[n];let l=0;if(r.live||(s=o.details)!=null&&s.live){this.checkLiveUpdate(r);const c=this.mainDetails;if(r.deltaUpdateFailed||!c)return;!o.details&&r.hasProgramDateTime&&c.hasProgramDateTime?(ki(r,c),l=r.fragments[0].start):l=this.alignPlaylists(r,o.details)}o.details=r,this.levelLastLoaded=n,!this.startFragRequested&&(this.mainDetails||!r.live)&&this.setStartPosition(o.details,l),this.state===b.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=b.IDLE),this.tick()}_handleFragmentLoadProgress(t){var e;const{frag:s,part:i,payload:r}=t,{config:n,trackId:o,levels:l}=this;if(!l){this.warn("Audio tracks were reset while fragment load was in progress. Fragment ".concat(s.sn," of level ").concat(s.level," will not be buffered"));return}const c=l[o];if(!c){this.warn("Audio track is undefined on fragment load progress");return}const h=c.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(s.start);return}const u=n.defaultAudioCodec||c.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new Wi(this.hls,U.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const f=this.initPTS[s.cc],g=(e=s.initSegment)==null?void 0:e.data;if(f!==void 0){const T=i?i.index:-1,y=T!==-1,S=new Ze(s.level,s.sn,s.stats.chunkCount,r.byteLength,T,y);d.push(r,g,u,"",s,i,h.totalduration,!1,S,f)}else{this.log("Unknown video PTS for cc ".concat(s.cc,", waiting for video PTS before demuxing audio frag ").concat(s.sn," of [").concat(h.startSN," ,").concat(h.endSN,"],track ").concat(o));const{cache:p}=this.waitingData=this.waitingData||{frag:s,part:i,cache:new Yi,complete:!1};p.push(new Uint8Array(r)),this.waitingVideoCC=this.videoTrackCC,this.state=b.WAITING_INIT_PTS}}_handleFragmentLoadComplete(t){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(t)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(t,e){const s=e.tracks.audio;s&&(this.mediaBuffer=s.buffer||null),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer||null)}onFragBuffered(t,e){const{frag:s,part:i}=e;if(s.type!==U.AUDIO){if(!this.loadedmetadata&&s.type===U.MAIN){const r=this.videoBuffer||this.media;r&&q.getBuffered(r).length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(s)){this.warn("Fragment ".concat(s.sn).concat(i?" p: "+i.index:""," of level ").concat(s.level," finished buffering, but was aborted. state: ").concat(this.state,", audioSwitch: ").concat(this.switchingTrack?this.switchingTrack.name:"false"));return}if(s.sn!=="initSegment"){this.fragPrevious=s;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(m.AUDIO_TRACK_SWITCHED,ct({},r)))}this.fragBufferedComplete(s,i)}onError(t,e){var s;if(e.fatal){this.state=b.ERROR;return}switch(e.details){case L.FRAG_GAP:case L.FRAG_PARSING_ERROR:case L.FRAG_DECRYPT_ERROR:case L.FRAG_LOAD_ERROR:case L.FRAG_LOAD_TIMEOUT:case L.KEY_LOAD_ERROR:case L.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(U.AUDIO,e);break;case L.AUDIO_TRACK_LOAD_ERROR:case L.AUDIO_TRACK_LOAD_TIMEOUT:case L.LEVEL_PARSING_ERROR:!e.levelRetry&&this.state===b.WAITING_TRACK&&((s=e.context)==null?void 0:s.type)===G.AUDIO_TRACK&&(this.state=b.IDLE);break;case L.BUFFER_FULL_ERROR:if(!e.parent||e.parent!=="audio")return;this.reduceLengthAndFlushBuffer(e)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case L.INTERNAL_EXCEPTION:this.recoverWorkerError(e);break}}onBufferFlushed(t,{type:e}){e===H.AUDIO&&(this.bufferFlushed=!0,this.state===b.ENDED&&(this.state=b.IDLE))}_handleTransmuxComplete(t){var e;const s="audio",{hls:i}=this,{remuxResult:r,chunkMeta:n}=t,o=this.getCurrentContext(n);if(!o){this.resetWhenMissingContext(n);return}const{frag:l,part:c,level:h}=o,{details:u}=h,{audio:d,text:f,id3:g,initSegment:p}=r;if(this.fragContextChanged(l)||!u){this.fragmentTracker.removeFragment(l);return}if(this.state=b.PARSING,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),p!=null&&p.tracks){const T=l.initSegment||l;this._bufferInitSegment(p.tracks,T,n),i.trigger(m.FRAG_PARSING_INIT_SEGMENT,{frag:T,id:s,tracks:p.tracks})}if(d){const{startPTS:T,endPTS:y,startDTS:S,endDTS:E}=d;c&&(c.elementaryStreams[H.AUDIO]={startPTS:T,endPTS:y,startDTS:S,endDTS:E}),l.setElementaryStreamInfo(H.AUDIO,T,y,S,E),this.bufferFragmentData(d,l,c,n)}if(g!=null&&(e=g.samples)!=null&&e.length){const T=tt({id:s,frag:l,details:u},g);i.trigger(m.FRAG_PARSING_METADATA,T)}if(f){const T=tt({id:s,frag:l,details:u},f);i.trigger(m.FRAG_PARSING_USERDATA,T)}}_bufferInitSegment(t,e,s){if(this.state!==b.PARSING)return;t.video&&delete t.video;const i=t.audio;if(!i)return;i.levelCodec=i.codec,i.id="audio",this.log("Init audio buffer, container:".concat(i.container,", codecs[parsed]=[").concat(i.codec,"]")),this.hls.trigger(m.BUFFER_CODECS,t);const r=i.initSegment;if(r!=null&&r.byteLength){const n={type:"audio",frag:e,part:null,chunkMeta:s,parent:e.type,data:r};this.hls.trigger(m.BUFFER_APPENDING,n)}this.tick()}loadFragment(t,e,s){const i=this.fragmentTracker.getState(t);if(this.fragCurrent=t,this.switchingTrack||i===et.NOT_LOADED||i===et.PARTIAL){var r;t.sn==="initSegment"?this._loadInitSegment(t,e):(r=e.details)!=null&&r.live&&!this.initPTS[t.cc]?(this.log("Waiting for video PTS in continuity counter ".concat(t.cc," of live stream before loading audio fragment ").concat(t.sn," of level ").concat(this.trackId)),this.state=b.WAITING_INIT_PTS):(this.startFragRequested=!0,super.loadFragment(t,e,s))}else this.clearTrackerIfNeeded(t)}completeAudioSwitch(t){const{hls:e,media:s,bufferedTrack:i}=this,r=i==null?void 0:i.attrs,n=t.attrs;s&&r&&(r.CHANNELS!==n.CHANNELS||r.NAME!==n.NAME||r.LANGUAGE!==n.LANGUAGE)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")),this.bufferedTrack=t,this.switchingTrack=null,e.trigger(m.AUDIO_TRACK_SWITCHED,ct({},t))}}class Ma extends Je{constructor(t){super(t,"[audio-track-controller]"),this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:t}=this;t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.MANIFEST_PARSED,this.onManifestParsed,this),t.on(m.LEVEL_LOADING,this.onLevelLoading,this),t.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.MANIFEST_PARSED,this.onManifestParsed,this),t.off(m.LEVEL_LOADING,this.onLevelLoading,this),t.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(m.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(m.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(t,e){this.tracks=e.audioTracks||[]}onAudioTrackLoaded(t,e){const{id:s,groupId:i,details:r}=e,n=this.tracksInGroup[s];if(!n||n.groupId!==i){this.warn("Track with id:".concat(s," and group:").concat(i," not found in active group ").concat(n.groupId));return}const o=n.details;n.details=e.details,this.log("audio-track ".concat(s,' "').concat(n.name,'" lang:').concat(n.lang," group:").concat(i," loaded [").concat(r.startSN,"-").concat(r.endSN,"]")),s===this.trackId&&this.playlistLoaded(s,e,o)}onLevelLoading(t,e){this.switchLevel(e.level)}onLevelSwitching(t,e){this.switchLevel(e.level)}switchLevel(t){const e=this.hls.levels[t];if(!(e!=null&&e.audioGroupIds))return;const s=e.audioGroupIds[e.urlId];if(this.groupId!==s){this.groupId=s||null;const i=this.tracks.filter(n=>!s||n.groupId===s);this.selectDefaultTrack&&!i.some(n=>n.default)&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;const r={audioTracks:i};this.log("Updating audio tracks, ".concat(i.length," track(s) found in group:").concat(s)),this.hls.trigger(m.AUDIO_TRACKS_UPDATED,r),this.selectInitialTrack()}else this.shouldReloadPlaylist(this.currentTrack)&&this.setAudioTrack(this.trackId)}onError(t,e){e.fatal||!e.context||e.context.type===G.AUDIO_TRACK&&e.context.id===this.trackId&&e.context.groupId===this.groupId&&(this.requestScheduled=-1,this.checkRetry(e))}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}setAudioTrack(t){const e=this.tracksInGroup;if(t<0||t>=e.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();const s=this.currentTrack;e[this.trackId];const i=e[t],{groupId:r,name:n}=i;if(this.log("Switching to audio-track ".concat(t,' "').concat(n,'" lang:').concat(i.lang," group:").concat(r)),this.trackId=t,this.currentTrack=i,this.selectDefaultTrack=!1,this.hls.trigger(m.AUDIO_TRACK_SWITCHING,ct({},i)),i.details&&!i.details.live)return;const o=this.switchParams(i.url,s==null?void 0:s.details);this.loadPlaylist(o)}selectInitialTrack(){const t=this.tracksInGroup,e=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(e!==-1)this.setAudioTrack(e);else{const s=new Error("No track found for running audio group-ID: ".concat(this.groupId," track count: ").concat(t.length));this.warn(s.message),this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:s})}}findTrackId(t){const e=this.tracksInGroup;for(let s=0;sa[s]!==t[s])}const Ws=500;class Ua extends ss{constructor(t,e,s){super(t,e,s,"[subtitle-stream-controller]",U.SUBTITLE),this.levels=[],this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null}_registerListeners(){const{hls:t}=this;t.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.LEVEL_LOADED,this.onLevelLoaded,this),t.on(m.ERROR,this.onError,this),t.on(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(m.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(m.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:t}=this;t.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.LEVEL_LOADED,this.onLevelLoaded,this),t.off(m.ERROR,this.onError,this),t.off(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(m.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(m.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(m.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(t){this.stopLoad(),this.state=b.IDLE,this.setInterval(Ws),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(t,e){this.mainDetails=e.details}onSubtitleFragProcessed(t,e){const{frag:s,success:i}=e;if(this.fragPrevious=s,this.state=b.IDLE,!i)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let n;const o=s.start;for(let c=0;c=r[c].start&&o<=r[c].end){n=r[c];break}const l=s.start+s.duration;n?n.end=l:(n={start:o,end:l},r.push(n)),this.fragmentTracker.fragBuffered(s)}onBufferFlushing(t,e){const{startOffset:s,endOffset:i}=e;if(s===0&&i!==Number.POSITIVE_INFINITY){const r=i-1;if(r<=0)return;e.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(n=>{for(let o=0;onew Wt(s));return}this.tracksBuffered=[],this.levels=e.map(s=>{const i=new Wt(s);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,U.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(t,e){if(this.currentTrackId=e.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}const s=this.levels[this.currentTrackId];s!=null&&s.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,s&&this.setInterval(Ws)}onSubtitleTrackLoaded(t,e){var s;const{details:i,id:r}=e,{currentTrackId:n,levels:o}=this;if(!o.length)return;const l=o[n];if(r>=o.length||r!==n||!l)return;this.mediaBuffer=this.mediaBufferTimeRanges;let c=0;if(i.live||(s=l.details)!=null&&s.live){const h=this.mainDetails;if(i.deltaUpdateFailed||!h)return;const u=h.fragments[0];l.details?(c=this.alignPlaylists(i,l.details),c===0&&u&&(c=u.start,He(i,c))):i.hasProgramDateTime&&h.hasProgramDateTime?(ki(i,h),c=i.fragments[0].start):u&&(c=u.start,He(i,c))}l.details=i,this.levelLastLoaded=r,!this.startFragRequested&&(this.mainDetails||!i.live)&&this.setStartPosition(l.details,c),this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===b.IDLE&&(Yt(null,i.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),l.details=void 0))}_handleFragmentLoadComplete(t){const{frag:e,payload:s}=t,i=e.decryptdata,r=this.hls;if(!this.fragContextChanged(e)&&s&&s.byteLength>0&&i&&i.key&&i.iv&&i.method==="AES-128"){const n=performance.now();this.decrypter.decrypt(new Uint8Array(s),i.key.buffer,i.iv.buffer).catch(o=>{throw r.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.FRAG_DECRYPT_ERROR,fatal:!1,error:o,reason:o.message,frag:e}),o}).then(o=>{const l=performance.now();r.trigger(m.FRAG_DECRYPTED,{frag:e,payload:o,stats:{tstart:n,tdecrypt:l}})}).catch(o=>{this.warn("".concat(o.name,": ").concat(o.message)),this.state=b.IDLE})}}doTick(){if(!this.media){this.state=b.IDLE;return}if(this.state===b.IDLE){const{currentTrackId:t,levels:e}=this,s=e[t];if(!e.length||!s||!s.details)return;const{config:i}=this,r=this.getLoadPosition(),n=q.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,i.maxBufferHole),{end:o,len:l}=n,c=this.getFwdBufferInfo(this.media,U.MAIN),h=s.details,u=this.getMaxBufferLength(c==null?void 0:c.len)+h.levelTargetDuration;if(l>u)return;const d=h.fragments,f=d.length,g=h.edge;let p=null;const T=this.fragPrevious;if(og-y?0:y;p=Yt(T,d,Math.max(d[0].start,o),S),!p&&T&&T.start{if(i=i>>>0,i>r-1)throw new DOMException("Failed to execute '".concat(s,"' on 'TimeRanges': The index provided (").concat(i,") is greater than the maximum bound (").concat(r,")"));return t[i][s]};this.buffered={get length(){return t.length},end(s){return e("end",s,t.length)},start(s){return e("start",s,t.length)}}}}class $a extends Je{constructor(t){super(t,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.trackChangeListener=()=>this.onTextTracksChanged(),this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(t){this._subtitleDisplay=t,this.trackId>-1&&this.toggleTrackModes(this.trackId)}registerListeners(){const{hls:t}=this;t.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.MANIFEST_PARSED,this.onManifestParsed,this),t.on(m.LEVEL_LOADING,this.onLevelLoading,this),t.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.MANIFEST_PARSED,this.onManifestParsed,this),t.off(m.LEVEL_LOADING,this.onLevelLoading,this),t.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(m.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(m.ERROR,this.onError,this)}onMediaAttached(t,e){this.media=e.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),ke(this.media.textTracks).forEach(e=>{Ut(e)}),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(t,e){this.tracks=e.subtitleTracks}onSubtitleTrackLoaded(t,e){const{id:s,details:i}=e,{trackId:r}=this,n=this.tracksInGroup[r];if(!n){this.warn("Invalid subtitle track id ".concat(s));return}const o=n.details;n.details=e.details,this.log("subtitle track ".concat(s," loaded [").concat(i.startSN,"-").concat(i.endSN,"]")),s===this.trackId&&this.playlistLoaded(s,e,o)}onLevelLoading(t,e){this.switchLevel(e.level)}onLevelSwitching(t,e){this.switchLevel(e.level)}switchLevel(t){const e=this.hls.levels[t];if(!(e!=null&&e.textGroupIds))return;const s=e.textGroupIds[e.urlId],i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==s){const r=this.tracks.filter(l=>!s||l.groupId===s);this.tracksInGroup=r;const n=this.findTrackId(i==null?void 0:i.name)||this.findTrackId();this.groupId=s||null;const o={subtitleTracks:r};this.log("Updating subtitle tracks, ".concat(r.length,' track(s) found in "').concat(s,'" group-id')),this.hls.trigger(m.SUBTITLE_TRACKS_UPDATED,o),n!==-1&&this.setSubtitleTrack(n,i)}else this.shouldReloadPlaylist(i)&&this.setSubtitleTrack(this.trackId,i)}findTrackId(t){const e=this.tracksInGroup;for(let s=0;so.groupId===this.groupId);if(t===-1)[].slice.call(i).forEach(o=>{o.mode="disabled"});else{const o=r[s];o&&(o.mode="disabled")}const n=r[t];n&&(n.mode=this.subtitleDisplay?"showing":"hidden")}setSubtitleTrack(t,e){var s;const i=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(this.trackId!==t&&this.toggleTrackModes(t),this.trackId===t&&(t===-1||(s=i[t])!=null&&s.details)||t<-1||t>=i.length)return;this.clearTimer();const r=i[t];if(this.log("Switching to subtitle-track ".concat(t)+(r?' "'.concat(r.name,'" lang:').concat(r.lang," group:").concat(r.groupId):"")),this.trackId=t,r){const{id:n,groupId:o="",name:l,type:c,url:h}=r;this.hls.trigger(m.SUBTITLE_TRACK_SWITCH,{id:n,groupId:o,name:l,type:c,url:h});const u=this.switchParams(r.url,e==null?void 0:e.details);this.loadPlaylist(u)}else this.hls.trigger(m.SUBTITLE_TRACK_SWITCH,{id:t})}onTextTracksChanged(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=-1;const e=ke(this.media.textTracks);for(let s=0;s{e=r}),i={execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(i,t),s}executeNext(t){const{buffers:e,queues:s}=this,i=e[t],r=s[t];if(r.length){const n=r[0];try{n.execute()}catch(o){x.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),n.onError(o),i!=null&&i.updating||(r.shift(),this.executeNext(t))}}}shiftAndExecuteNext(t){this.queues[t].shift(),this.executeNext(t)}current(t){return this.queues[t][0]}}const Ys=fe(),qs=/([ha]vc.)(?:\.[^.,]+)+/;class Ka{constructor(t){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=()=>{const{media:e,mediaSource:s}=this;x.log("[buffer-controller]: Media source opened"),e&&(e.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(m.MEDIA_ATTACHED,{media:e})),s&&s.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{x.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=()=>{x.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=()=>{const{media:e,_objectUrl:s}=this;e&&e.src!==s&&x.error("Media element src was set while attaching MediaSource (".concat(s," > ").concat(e.src,")"))},this.hls=t,this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null}registerListeners(){const{hls:t}=this;t.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.MANIFEST_PARSED,this.onManifestParsed,this),t.on(m.BUFFER_RESET,this.onBufferReset,this),t.on(m.BUFFER_APPENDING,this.onBufferAppending,this),t.on(m.BUFFER_CODECS,this.onBufferCodecs,this),t.on(m.BUFFER_EOS,this.onBufferEos,this),t.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(m.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(m.FRAG_PARSED,this.onFragParsed,this),t.on(m.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:t}=this;t.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.MANIFEST_PARSED,this.onManifestParsed,this),t.off(m.BUFFER_RESET,this.onBufferReset,this),t.off(m.BUFFER_APPENDING,this.onBufferAppending,this),t.off(m.BUFFER_CODECS,this.onBufferCodecs,this),t.off(m.BUFFER_EOS,this.onBufferEos,this),t.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(m.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(m.FRAG_PARSED,this.onFragParsed,this),t.off(m.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new Ga(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(t,e){let s=2;(e.audio&&!e.video||!e.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,x.log("".concat(this.bufferCodecEventsExpected," bufferCodec event(s) expected"))}onMediaAttaching(t,e){const s=this.media=e.media;if(s&&Ys){const i=this.mediaSource=new Ys;i.addEventListener("sourceopen",this._onMediaSourceOpen),i.addEventListener("sourceended",this._onMediaSourceEnded),i.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(i),this._objectUrl=s.src,s.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:t,mediaSource:e,_objectUrl:s}=this;if(e){if(x.log("[buffer-controller]: media source detaching"),e.readyState==="open")try{e.endOfStream()}catch(i){x.warn("[buffer-controller]: onMediaDetaching: ".concat(i.message," while calling endOfStream"))}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(t.removeEventListener("emptied",this._onMediaEmptied),s&&self.URL.revokeObjectURL(s),t.src===s?(t.removeAttribute("src"),t.load()):x.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(m.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach(t=>{const e=this.sourceBuffer[t];try{e&&(this.removeBufferListeners(t),this.mediaSource&&this.mediaSource.removeSourceBuffer(e),this.sourceBuffer[t]=void 0)}catch(s){x.warn("[buffer-controller]: Failed to reset the ".concat(t," buffer"),s)}}),this._initSourceBuffer()}onBufferCodecs(t,e){const s=this.getSourceBufferTypes().length;Object.keys(e).forEach(i=>{if(s){const r=this.tracks[i];if(r&&typeof r.buffer.changeType=="function"){const{id:n,codec:o,levelCodec:l,container:c,metadata:h}=e[i],u=(r.levelCodec||r.codec).replace(qs,"$1"),d=(l||o).replace(qs,"$1");if(u!==d){const f="".concat(c,";codecs=").concat(l||o);this.appendChangeType(i,f),x.log("[buffer-controller]: switching codec ".concat(u," to ").concat(d)),this.tracks[i]={buffer:r.buffer,codec:o,container:c,levelCodec:l,metadata:h,id:n}}}}else this.pendingTracks[i]=e[i]}),!s&&(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())}appendChangeType(t,e){const{operationQueue:s}=this,i={execute:()=>{const r=this.sourceBuffer[t];r&&(x.log("[buffer-controller]: changing ".concat(t," sourceBuffer type to ").concat(e)),r.changeType(e)),s.shiftAndExecuteNext(t)},onStart:()=>{},onComplete:()=>{},onError:r=>{x.warn("[buffer-controller]: Failed to change ".concat(t," SourceBuffer type"),r)}};s.append(i,t)}onBufferAppending(t,e){const{hls:s,operationQueue:i,tracks:r}=this,{data:n,type:o,frag:l,part:c,chunkMeta:h}=e,u=h.buffering[o],d=self.performance.now();u.start=d;const f=l.stats.buffering,g=c?c.stats.buffering:null;f.start===0&&(f.start=d),g&&g.start===0&&(g.start=d);const p=r.audio;let T=!1;o==="audio"&&(p==null?void 0:p.container)==="audio/mpeg"&&(T=!this.lastMpegAudioChunk||h.id===1||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const y=l.start,S={execute:()=>{if(u.executeStart=self.performance.now(),T){const E=this.sourceBuffer[o];if(E){const R=y-E.timestampOffset;Math.abs(R)>=.1&&(x.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to ".concat(y," (delta: ").concat(R,") sn: ").concat(l.sn,")")),E.timestampOffset=y)}}this.appendExecutor(n,o)},onStart:()=>{},onComplete:()=>{const E=self.performance.now();u.executeEnd=u.end=E,f.first===0&&(f.first=E),g&&g.first===0&&(g.first=E);const{sourceBuffer:R}=this,A={};for(const k in R)A[k]=q.getBuffered(R[k]);this.appendError=0,this.hls.trigger(m.BUFFER_APPENDED,{type:o,frag:l,part:c,chunkMeta:h,parent:l.type,timeRanges:A})},onError:E=>{x.error("[buffer-controller]: Error encountered while trying to append to the ".concat(o," SourceBuffer"),E);const R={type:N.MEDIA_ERROR,parent:l.type,details:L.BUFFER_APPEND_ERROR,frag:l,part:c,chunkMeta:h,error:E,err:E,fatal:!1};E.code===DOMException.QUOTA_EXCEEDED_ERR?R.details=L.BUFFER_FULL_ERROR:(this.appendError++,R.details=L.BUFFER_APPEND_ERROR,this.appendError>s.config.appendErrorMaxRetry&&(x.error("[buffer-controller]: Failed ".concat(s.config.appendErrorMaxRetry," times to append segment in sourceBuffer")),R.fatal=!0)),s.trigger(m.ERROR,R)}};i.append(S,o)}onBufferFlushing(t,e){const{operationQueue:s}=this,i=r=>({execute:this.removeExecutor.bind(this,r,e.startOffset,e.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(m.BUFFER_FLUSHED,{type:r})},onError:n=>{x.warn("[buffer-controller]: Failed to remove from ".concat(r," SourceBuffer"),n)}});e.type?s.append(i(e.type),e.type):this.getSourceBufferTypes().forEach(r=>{s.append(i(r),r)})}onFragParsed(t,e){const{frag:s,part:i}=e,r=[],n=i?i.elementaryStreams:s.elementaryStreams;n[H.AUDIOVIDEO]?r.push("audiovideo"):(n[H.AUDIO]&&r.push("audio"),n[H.VIDEO]&&r.push("video"));const o=()=>{const l=self.performance.now();s.stats.buffering.end=l,i&&(i.stats.buffering.end=l);const c=i?i.stats:s.stats;this.hls.trigger(m.FRAG_BUFFERED,{frag:s,part:i,stats:c,id:s.type})};r.length===0&&x.warn("Fragments must have at least one ElementaryStreamType set. type: ".concat(s.type," level: ").concat(s.level," sn: ").concat(s.sn)),this.blockBuffers(o,r)}onFragChanged(t,e){this.flushBackBuffer()}onBufferEos(t,e){this.getSourceBufferTypes().reduce((i,r)=>{const n=this.sourceBuffer[r];return n&&(!e.type||e.type===r)&&(n.ending=!0,n.ended||(n.ended=!0,x.log("[buffer-controller]: ".concat(r," sourceBuffer now EOS")))),i&&!!(!n||n.ended)},!0)&&(x.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(()=>{this.getSourceBufferTypes().forEach(r=>{const n=this.sourceBuffer[r];n&&(n.ending=!1)});const{mediaSource:i}=this;if(!i||i.readyState!=="open"){i&&x.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: ".concat(i.readyState));return}x.log("[buffer-controller]: Calling mediaSource.endOfStream()"),i.endOfStream()}))}onLevelUpdated(t,{details:e}){e.fragments.length&&(this.details=e,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}flushBackBuffer(){const{hls:t,details:e,media:s,sourceBuffer:i}=this;if(!s||e===null)return;const r=this.getSourceBufferTypes();if(!r.length)return;const n=e.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!F(n)||n<0)return;const o=s.currentTime,l=e.levelTargetDuration,c=Math.max(n,l),h=Math.floor(o/l)*l-c;r.forEach(u=>{const d=i[u];if(d){const f=q.getBuffered(d);if(f.length>0&&h>f.start(0)){if(t.trigger(m.BACK_BUFFER_REACHED,{bufferEnd:h}),e.live)t.trigger(m.LIVE_BACK_BUFFER_REACHED,{bufferEnd:h});else if(d.ended&&f.end(f.length-1)-oo&&r>n||!F(n))&&(x.log("[buffer-controller]: Updating Media Source duration to ".concat(r.toFixed(3))),i.duration=r)}updateSeekableRange(t){const e=this.mediaSource,s=t.fragments;if(s.length&&t.live&&e!=null&&e.setLiveSeekableRange){const r=Math.max(0,s[0].start),n=Math.max(r,r+t.totalduration);e.setLiveSeekableRange(r,n)}}checkPendingTracks(){const{bufferCodecEventsExpected:t,operationQueue:e,pendingTracks:s}=this,i=Object.keys(s).length;if(i&&!t||i===2){this.createSourceBuffers(s),this.pendingTracks={};const r=this.getSourceBufferTypes();if(r.length)this.hls.trigger(m.BUFFER_CREATED,{tracks:this.tracks}),r.forEach(n=>{e.executeNext(n)});else{const n=new Error("could not create source buffer for media codec(s)");this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:n,reason:n.message})}}}createSourceBuffers(t){const{sourceBuffer:e,mediaSource:s}=this;if(!s)throw Error("createSourceBuffers called when mediaSource was null");for(const i in t)if(!e[i]){const r=t[i];if(!r)throw Error("source buffer exists for track ".concat(i,", however track does not"));const n=r.levelCodec||r.codec,o="".concat(r.container,";codecs=").concat(n);x.log("[buffer-controller]: creating sourceBuffer(".concat(o,")"));try{const l=e[i]=s.addSourceBuffer(o),c=i;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[i]={buffer:l,codec:n,container:r.container,levelCodec:r.levelCodec,metadata:r.metadata,id:r.id}}catch(l){x.error("[buffer-controller]: error while trying to add sourceBuffer: ".concat(l.message)),this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:l,mimeType:o})}}}_onSBUpdateStart(t){const{operationQueue:e}=this;e.current(t).onStart()}_onSBUpdateEnd(t){const{operationQueue:e}=this;e.current(t).onComplete(),e.shiftAndExecuteNext(t)}_onSBUpdateError(t,e){const s=new Error("".concat(t," SourceBuffer error"));x.error("[buffer-controller]: ".concat(s),e),this.hls.trigger(m.ERROR,{type:N.MEDIA_ERROR,details:L.BUFFER_APPENDING_ERROR,error:s,fatal:!1});const i=this.operationQueue.current(t);i&&i.onError(e)}removeExecutor(t,e,s){const{media:i,mediaSource:r,operationQueue:n,sourceBuffer:o}=this,l=o[t];if(!i||!r||!l){x.warn("[buffer-controller]: Attempting to remove from the ".concat(t," SourceBuffer, but it does not exist")),n.shiftAndExecuteNext(t);return}const c=F(i.duration)?i.duration:1/0,h=F(r.duration)?r.duration:1/0,u=Math.max(0,e),d=Math.min(s,c,h);d>u&&!l.ending?(l.ended=!1,x.log("[buffer-controller]: Removing [".concat(u,",").concat(d,"] from the ").concat(t," SourceBuffer")),l.remove(u,d)):n.shiftAndExecuteNext(t)}appendExecutor(t,e){const{operationQueue:s,sourceBuffer:i}=this,r=i[e];if(!r){x.warn("[buffer-controller]: Attempting to append to the ".concat(e," SourceBuffer, but it does not exist")),s.shiftAndExecuteNext(e);return}r.ended=!1,r.appendBuffer(t)}blockBuffers(t,e=this.getSourceBufferTypes()){if(!e.length){x.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(t);return}const{operationQueue:s}=this,i=e.map(r=>s.appendBlocker(r));Promise.all(i).then(()=>{t(),e.forEach(r=>{const n=this.sourceBuffer[r];n!=null&&n.updating||s.shiftAndExecuteNext(r)})})}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(t,e,s){const i=this.sourceBuffer[t];if(!i)return;const r=s.bind(this,t);this.listeners[t].push({event:e,listener:r}),i.addEventListener(e,r)}removeBufferListeners(t){const e=this.sourceBuffer[t];e&&this.listeners[t].forEach(s=>{e.removeEventListener(s.event,s.listener)})}}const js={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},ji=function(t){let e=t;return js.hasOwnProperty(t)&&(e=js[t]),String.fromCharCode(e)},pt=15,vt=100,Ha={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Va={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Wa={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Ya={25:2,26:4,29:6,30:8,31:10,27:13,28:15},qa=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class ja{constructor(){this.time=null,this.verboseLevel=0}log(t,e){if(this.verboseLevel>=t){const s=typeof e=="function"?e():e;x.log("".concat(this.time," [").concat(t,"] ").concat(s))}}}const kt=function(t){const e=[];for(let s=0;svt&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=vt)}moveCursor(t){const e=this.pos+t;if(t>1)for(let s=this.pos+1;s=144&&this.backSpace();const e=ji(t);if(this.pos>=vt){this.logger.log(0,()=>"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1)}clearFromPos(t){let e;for(e=t;e"pacData = "+JSON.stringify(t));let e=t.row-1;if(this.nrRollUpRows&&e"bkgData = "+JSON.stringify(t)),this.backSpace(),this.setPen(t),this.insertChar(32)}setRollUpRows(t){this.nrRollUpRows=t}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(2,"Rolling up")}getDisplayText(t){t=t||!1;const e=[];let s="",i=-1;for(let r=0;r0&&(t?s="["+e.join(" | ")+"]":s=e.join("\n")),s}getTextAndFormat(){return this.rows}}class Xs{constructor(t,e,s){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new _e(s),this.nonDisplayedMemory=new _e(s),this.lastOutputScreen=new _e(s),this.currRollUpRow=this.displayedMemory.rows[pt-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=s}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[pt-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(t){this.outputFilter=t}setPAC(t){this.writeScreen.setPAC(t)}setBkgData(t){this.writeScreen.setBkgData(t)}setMode(t){t!==this.mode&&(this.mode=t,this.logger.log(2,()=>"MODE="+t),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)}insertChars(t){for(let s=0;se+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(t){this.logger.log(2,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(t){this.logger.log(2,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)}ccMIDROW(t){const e={flash:!1};if(e.underline=t%2===1,e.italics=t>=46,e.italics)e.foreground="white";else{const s=Math.floor(t/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=i[s]}this.logger.log(2,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)}outputDataUpdate(t=!1){const e=this.logger.time;e!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=e:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))}}class zs{constructor(t,e,s){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;const i=new ja;this.channels=[null,new Xs(t,e,i),new Xs(t+1,s,i)],this.cmdHistory=Js(),this.logger=i}getHandler(t){return this.channels[t].getHandler()}setHandler(t,e){this.channels[t].setHandler(e)}addData(t,e){let s,i,r,n=!1;this.logger.time=t;for(let o=0;o ("+kt([i,r])+")"),s=this.parseCmd(i,r),s||(s=this.parseMidrow(i,r)),s||(s=this.parsePAC(i,r)),s||(s=this.parseBackgroundAttributes(i,r)),!s&&(n=this.parseChars(i,r),n)){const l=this.currentChannel;l&&l>0?this.channels[l].insertChars(n):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!s&&!n&&this.logger.log(2,"Couldn't parse cleaned data "+kt([i,r])+" orig: "+kt([e[o],e[o+1]]))}}parseCmd(t,e){const{cmdHistory:s}=this,i=(t===20||t===28||t===21||t===29)&&e>=32&&e<=47,r=(t===23||t===31)&&e>=33&&e<=35;if(!(i||r))return!1;if(Qs(t,e,s))return Nt(null,null,s),this.logger.log(3,"Repeated command ("+kt([t,e])+") is dropped"),!0;const n=t===20||t===21||t===23?1:2,o=this.channels[n];return t===20||t===21||t===28||t===29?e===32?o.ccRCL():e===33?o.ccBS():e===34?o.ccAOF():e===35?o.ccAON():e===36?o.ccDER():e===37?o.ccRU(2):e===38?o.ccRU(3):e===39?o.ccRU(4):e===40?o.ccFON():e===41?o.ccRDC():e===42?o.ccTR():e===43?o.ccRTD():e===44?o.ccEDM():e===45?o.ccCR():e===46?o.ccENM():e===47&&o.ccEOC():o.ccTO(e-32),Nt(t,e,s),this.currentChannel=n,!0}parseMidrow(t,e){let s=0;if((t===17||t===25)&&e>=32&&e<=47){if(t===17?s=1:s=2,s!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[s];return i?(i.ccMIDROW(e),this.logger.log(3,"MIDROW ("+kt([t,e])+")"),!0):!1}return!1}parsePAC(t,e){let s;const i=this.cmdHistory,r=(t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127,n=(t===16||t===24)&&e>=64&&e<=95;if(!(r||n))return!1;if(Qs(t,e,i))return Nt(null,null,i),!0;const o=t<=23?1:2;e>=64&&e<=95?s=o===1?Ha[t]:Wa[t]:s=o===1?Va[t]:Ya[t];const l=this.channels[o];return l?(l.setPAC(this.interpretPAC(s,e)),Nt(t,e,i),this.currentChannel=o,!0):!1}interpretPAC(t,e){let s;const i={color:null,italics:!1,indent:null,underline:!1,row:t};return e>95?s=e-96:s=e-64,i.underline=(s&1)===1,s<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(s/2)]:s<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((s-16)/2)*4,i}parseChars(t,e){let s,i=null,r=null;if(t>=25?(s=2,r=t-8):(s=1,r=t),r>=17&&r<=19){let n;r===17?n=e+80:r===18?n=e+112:n=e+144,this.logger.log(2,"Special char '"+ji(n)+"' in channel "+s),i=[n]}else t>=32&&t<=127&&(i=e===0?[t]:[t,e]);if(i){const n=kt(i);this.logger.log(3,"Char codes = "+n.join(",")),Nt(t,e,this.cmdHistory)}return i}parseBackgroundAttributes(t,e){const s=(t===16||t===24)&&e>=32&&e<=47,i=(t===23||t===31)&&e>=45&&e<=47;if(!(s||i))return!1;let r;const n={};t===16||t===24?(r=Math.floor((e-32)/2),n.background=qa[r],e%2===1&&(n.background=n.background+"_semi")):e===45?n.background="transparent":(n.foreground="black",e===47&&(n.underline=!0));const o=t<=23?1:2;return this.channels[o].setBkgData(n),Nt(t,e,this.cmdHistory),!0}reset(){for(let t=0;tt)&&(this.startTime=t),this.endTime=e,this.screen=s,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var os=function(){if(typeof self<"u"&&self.VTTCue)return self.VTTCue;const a=["","lr","rl"],t=["start","middle","end","left","right"];function e(o,l){if(typeof l!="string"||!Array.isArray(o))return!1;const c=l.toLowerCase();return~o.indexOf(c)?c:!1}function s(o){return e(a,o)}function i(o){return e(t,o)}function r(o,...l){let c=1;for(;c100)throw new Error("Position must be between 0 and 100.");k=I,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",r({},u,{get:function(){return D},set:function(I){const O=i(I);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");D=O,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",r({},u,{get:function(){return C},set:function(I){if(I<0||I>100)throw new Error("Size must be between 0 and 100.");C=I,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",r({},u,{get:function(){return _},set:function(I){const O=i(I);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");_=O,this.hasBeenReset=!0}})),h.displayState=void 0}return n.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},n}();class Qa{decode(t,e){if(!t)return"";if(typeof t!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}function zi(a){function t(s,i,r,n){return(s|0)*3600+(i|0)*60+(r|0)+parseFloat(n||0)}const e=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return e?parseFloat(e[2])>59?t(e[2],e[3],0,e[4]):t(e[1],e[2],e[3],e[4]):null}class Ja{constructor(){this.values=Object.create(null)}set(t,e){!this.get(t)&&e!==""&&(this.values[t]=e)}get(t,e,s){return s?this.has(t)?this.values[t]:e[s]:this.has(t)?this.values[t]:e}has(t){return t in this.values}alt(t,e,s){for(let i=0;i=0&&s<=100)return this.set(t,s),!0}return!1}}function Qi(a,t,e,s){const i=s?a.split(s):[a];for(const r in i){if(typeof i[r]!="string")continue;const n=i[r].split(e);if(n.length!==2)continue;const o=n[0],l=n[1];t(o,l)}}const Ye=new os(0,0,""),se=Ye.align==="middle"?"middle":"center";function Za(a,t,e){const s=a;function i(){const o=zi(a);if(o===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,l){const c=new Ja;Qi(o,function(d,f){let g;switch(d){case"region":for(let p=e.length-1;p>=0;p--)if(e[p].id===f){c.set(d,e[p].region);break}break;case"vertical":c.alt(d,f,["rl","lr"]);break;case"line":g=f.split(","),c.integer(d,g[0]),c.percent(d,g[0])&&c.set("snapToLines",!1),c.alt(d,g[0],["auto"]),g.length===2&&c.alt("lineAlign",g[1],["start",se,"end"]);break;case"position":g=f.split(","),c.percent(d,g[0]),g.length===2&&c.alt("positionAlign",g[1],["start",se,"end","line-left","line-right","auto"]);break;case"size":c.percent(d,f);break;case"align":c.alt(d,f,["start",se,"end","left","right"]);break}},/:/,/\s/),l.region=c.get("region",null),l.vertical=c.get("vertical","");let h=c.get("line","auto");h==="auto"&&Ye.line===-1&&(h=-1),l.line=h,l.lineAlign=c.get("lineAlign","start"),l.snapToLines=c.get("snapToLines",!0),l.size=c.get("size",100),l.align=c.get("align",se);let u=c.get("position","auto");u==="auto"&&Ye.position===50&&(u=l.align==="start"||l.align==="left"?0:l.align==="end"||l.align==="right"?100:50),l.position=u}function n(){a=a.replace(/^\s+/,"")}if(n(),t.startTime=i(),n(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.slice(3),n(),t.endTime=i(),n(),r(a,t)}function Ji(a){return a.replace(//gi,"\n")}class to{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Qa,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(t){const e=this;t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));function s(){let r=e.buffer,n=0;for(r=Ji(r);n")===-1){e.cue.id=r;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{Za(r,e.cue,e.regionList)}catch{e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":{const o=r.indexOf("-->")!==-1;if(!r||o&&(n=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(e.cue===null)continue;e.cue.text&&(e.cue.text+="\n"),e.cue.text+=r}continue;case"BADCUE":r||(e.state="ID")}}}catch{e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const t=this;try{if((t.cue||t.state==="HEADER")&&(t.buffer+="\n\n",t.parse()),t.state==="INITIAL"||t.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(e){t.onparsingerror&&t.onparsingerror(e)}return t.onflush&&t.onflush(),this}}const eo=/\r\n|\n\r|\n|\r/g,we=function(t,e,s=0){return t.slice(s,s+e.length)===e},so=function(t){let e=parseInt(t.slice(-3));const s=parseInt(t.slice(-6,-4)),i=parseInt(t.slice(-9,-7)),r=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!F(e)||!F(s)||!F(i)||!F(r))throw Error("Malformed X-TIMESTAMP-MAP: Local:".concat(t));return e+=1e3*s,e+=60*1e3*i,e+=60*60*1e3*r,e},Pe=function(t){let e=5381,s=t.length;for(;s;)e=e*33^t.charCodeAt(--s);return(e>>>0).toString()};function ls(a,t,e){return Pe(a.toString())+Pe(t.toString())+Pe(e)}const io=function(t,e,s){let i=t[e],r=t[i.prevCC];if(!r||!r.new&&i.new){t.ccOffset=t.presentationOffset=i.start,i.new=!1;return}for(;(n=r)!=null&&n.new;){var n;t.ccOffset+=i.start-r.start,i.new=!1,i=r,r=t[i.prevCC]}t.presentationOffset=s};function ro(a,t,e,s,i,r,n){const o=new to,l=St(new Uint8Array(a)).trim().replace(eo,"\n").split("\n"),c=[],h=t?ma(t.baseTime,t.timescale):0;let u="00:00.000",d=0,f=0,g,p=!0;o.oncue=function(T){const y=e[s];let S=e.ccOffset;const E=(d-h)/9e4;if(y!=null&&y.new&&(f!==void 0?S=e.ccOffset=y.start:io(e,s,E)),E){if(!t){g=new Error("Missing initPTS for VTT MPEGTS");return}S=E-e.presentationOffset}const R=T.endTime-T.startTime,A=gt((T.startTime+S-f)*9e4,i*9e4)/9e4;T.startTime=Math.max(A,0),T.endTime=Math.max(A+R,0);const k=T.text.trim();T.text=decodeURIComponent(encodeURIComponent(k)),T.id||(T.id=ls(T.startTime,T.endTime,k)),T.endTime>0&&c.push(T)},o.onparsingerror=function(T){g=T},o.onflush=function(){if(g){n(g);return}r(c)},l.forEach(T=>{if(p)if(we(T,"X-TIMESTAMP-MAP=")){p=!1,T.slice(16).split(",").forEach(y=>{we(y,"LOCAL:")?u=y.slice(6):we(y,"MPEGTS:")&&(d=parseInt(y.slice(7)))});try{f=so(u)/1e3}catch(y){g=y}return}else T===""&&(p=!1);o.parse(T+"\n")}),o.flush()}const Fe="stpp.ttml.im1t",Zi=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,tr=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,no={left:"start",center:"center",right:"end",start:"start",end:"end"};function Zs(a,t,e,s){const i=$(new Uint8Array(a),["mdat"]);if(i.length===0){s(new Error("Could not parse IMSC1 mdat"));return}const r=i.map(o=>St(o)),n=ga(t.baseTime,1,t.timescale);try{r.forEach(o=>e(ao(o,n)))}catch(o){s(o)}}function ao(a,t){const i=new DOMParser().parseFromString(a,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(r).reduce((u,d)=>(u[d]=i.getAttribute("ttp:".concat(d))||r[d],u),{}),o=i.getAttribute("xml:space")!=="preserve",l=ti(Oe(i,"styling","style")),c=ti(Oe(i,"layout","region")),h=Oe(i,"body","[begin]");return[].map.call(h,u=>{const d=er(u,o);if(!d||!u.hasAttribute("begin"))return null;const f=Ne(u.getAttribute("begin"),n),g=Ne(u.getAttribute("dur"),n);let p=Ne(u.getAttribute("end"),n);if(f===null)throw ei(u);if(p===null){if(g===null)throw ei(u);p=f+g}const T=new os(f-t,p-t,d);T.id=ls(T.startTime,T.endTime,T.text);const y=c[u.getAttribute("region")],S=l[u.getAttribute("style")],E=oo(y,S,l),{textAlign:R}=E;if(R){const A=no[R];A&&(T.lineAlign=A),T.align=R}return tt(T,E),T}).filter(u=>u!==null)}function Oe(a,t,e){const s=a.getElementsByTagName(t)[0];return s?[].slice.call(s.querySelectorAll(e)):[]}function ti(a){return a.reduce((t,e)=>{const s=e.getAttribute("xml:id");return s&&(t[s]=e),t},{})}function er(a,t){return[].slice.call(a.childNodes).reduce((e,s,i)=>{var r;return s.nodeName==="br"&&i?e+"\n":(r=s.childNodes)!=null&&r.length?er(s,t):t?e+s.textContent.trim().replace(/\s+/g," "):e+s.textContent},"")}function oo(a,t,e){const s="http://www.w3.org/ns/ttml#styling";let i=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],n=a!=null&&a.hasAttribute("style")?a.getAttribute("style"):null;return n&&e.hasOwnProperty(n)&&(i=e[n]),r.reduce((o,l)=>{const c=Me(t,s,l)||Me(a,s,l)||Me(i,s,l);return c&&(o[l]=c),o},{})}function Me(a,t,e){return a&&a.hasAttributeNS(t,e)?a.getAttributeNS(t,e):null}function ei(a){return new Error("Could not parse ttml timestamp ".concat(a))}function Ne(a,t){if(!a)return null;let e=zi(a);return e===null&&(Zi.test(a)?e=lo(a,t):tr.test(a)&&(e=co(a,t))),e}function lo(a,t){const e=Zi.exec(a),s=(e[4]|0)+(e[5]|0)/t.subFrameRate;return(e[1]|0)*3600+(e[2]|0)*60+(e[3]|0)+s/t.frameRate}function co(a,t){const e=tr.exec(a),s=Number(e[1]);switch(e[2]){case"h":return s*3600;case"m":return s*60;case"ms":return s*1e3;case"f":return s/t.frameRate;case"t":return s/t.tickRate}return s}class ho{constructor(t){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=si(),this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){const e=new ee(this,"textTrack1"),s=new ee(this,"textTrack2"),i=new ee(this,"textTrack3"),r=new ee(this,"textTrack4");this.cea608Parser1=new zs(1,e,s),this.cea608Parser2=new zs(3,i,r)}t.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(m.MANIFEST_LOADING,this.onManifestLoading,this),t.on(m.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(m.FRAG_LOADING,this.onFragLoading,this),t.on(m.FRAG_LOADED,this.onFragLoaded,this),t.on(m.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(m.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(m.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(m.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(m.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:t}=this;t.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(m.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(m.MANIFEST_LOADING,this.onManifestLoading,this),t.off(m.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(m.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(m.FRAG_LOADING,this.onFragLoading,this),t.off(m.FRAG_LOADED,this.onFragLoaded,this),t.off(m.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(m.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(m.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(m.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(m.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null}addCues(t,e,s,i,r){let n=!1;for(let o=r.length;o--;){const l=r[o],c=fo(l[0],l[1],e,s);if(c>=0&&(l[0]=Math.min(l[0],e),l[1]=Math.max(l[1],s),n=!0,c/(s-e)>.5))return}if(n||r.push([e,s]),this.config.renderTextTracksNatively){const o=this.captionsTracks[t];this.Cues.newCue(o,e,s,i)}else{const o=this.Cues.newCue(null,e,s,i);this.hls.trigger(m.CUES_PARSED,{type:"captions",cues:o,track:t})}}onInitPtsFound(t,{frag:e,id:s,initPTS:i,timescale:r}){const{unparsedVttFrags:n}=this;s==="main"&&(this.initPTS[e.cc]={baseTime:i,timescale:r}),n.length&&(this.unparsedVttFrags=[],n.forEach(o=>{this.onFragLoaded(m.FRAG_LOADED,o)}))}getExistingTrack(t){const{media:e}=this;if(e)for(let s=0;s{Ut(t[e]),delete t[e]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=si(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:t}=this;if(!t)return;const e=t.textTracks;if(e)for(let s=0;sr.textCodec===Fe);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(qi(this.tracks,s)){this.tracks=s;return}if(this.textTracks=[],this.tracks=s,this.config.renderTextTracksNatively){const n=this.media?this.media.textTracks:null;this.tracks.forEach((o,l)=>{let c;if(n&&l({label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}));this.hls.trigger(m.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:n})}}}_captionsOrSubtitlesFromCharacteristics(t){if(t.attrs.CHARACTERISTICS){const e=/transcribes-spoken-dialog/gi.test(t.attrs.CHARACTERISTICS),s=/describes-music-and-sound/gi.test(t.attrs.CHARACTERISTICS);if(e&&s)return"captions"}return"subtitles"}onManifestLoaded(t,e){this.config.enableCEA708Captions&&e.captions&&e.captions.forEach(s=>{const i=/(?:CC|SERVICE)([1-4])/.exec(s.instreamId);if(!i)return;const r="textTrack".concat(i[1]),n=this.captionsProperties[r];n&&(n.label=s.name,s.lang&&(n.languageCode=s.lang),n.media=s)})}closedCaptionsForLevel(t){const e=this.hls.levels[t.level];return e==null?void 0:e.attrs["CLOSED-CAPTIONS"]}onFragLoading(t,e){const{cea608Parser1:s,cea608Parser2:i,lastSn:r,lastPartIndex:n}=this;if(!(!this.enabled||!(s&&i))&&e.frag.type===U.MAIN){var o,l;const c=e.frag.sn,h=(o=e==null||(l=e.part)==null?void 0:l.index)!=null?o:-1;c===r+1||c===r&&h===n+1||(s.reset(),i.reset()),this.lastSn=c,this.lastPartIndex=h}}onFragLoaded(t,e){const{frag:s,payload:i}=e;if(s.type===U.SUBTITLE)if(i.byteLength){const r=s.decryptdata,n="stats"in e;if(r==null||!r.encrypted||n){const o=this.tracks[s.level],l=this.vttCCs;l[s.cc]||(l[s.cc]={start:s.start,prevCC:this.prevCC,new:!0},this.prevCC=s.cc),o&&o.textCodec===Fe?this._parseIMSC1(s,i):this._parseVTTs(e)}}else this.hls.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:new Error("Empty subtitle payload")})}_parseIMSC1(t,e){const s=this.hls;Zs(e,this.initPTS[t.cc],i=>{this._appendCues(i,t.level),s.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},i=>{x.log("Failed to parse IMSC1: ".concat(i)),s.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:i})})}_parseVTTs(t){var e;const{frag:s,payload:i}=t,{initPTS:r,unparsedVttFrags:n}=this,o=r.length-1;if(!r[s.cc]&&o===-1){n.push(t);return}const l=this.hls,c=(e=s.initSegment)!=null&&e.data?Pt(s.initSegment.data,new Uint8Array(i)):i;ro(c,this.initPTS[s.cc],this.vttCCs,s.cc,s.start,h=>{this._appendCues(h,s.level),l.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},h=>{const u=h.message==="Missing initPTS for VTT MPEGTS";u?n.push(t):this._fallbackToIMSC1(s,i),x.log("Failed to parse VTT cue: ".concat(h)),!(u&&o>s.cc)&&l.trigger(m.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:h})})}_fallbackToIMSC1(t,e){const s=this.tracks[t.level];s.textCodec||Zs(e,this.initPTS[t.cc],()=>{s.textCodec=Fe,this._parseIMSC1(t,e)},()=>{s.textCodec="wvtt"})}_appendCues(t,e){const s=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[e];if(!i||i.mode==="disabled")return;t.forEach(r=>Li(i,r))}else{const i=this.tracks[e];if(!i)return;const r=i.default?"default":"subtitles"+e;s.trigger(m.CUES_PARSED,{type:"subtitles",cues:t,track:r})}}onFragDecrypted(t,e){const{frag:s}=e;s.type===U.SUBTITLE&&this.onFragLoaded(m.FRAG_LOADED,e)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(t,e){const{cea608Parser1:s,cea608Parser2:i}=this;if(!this.enabled||!(s&&i))return;const{frag:r,samples:n}=e;if(!(r.type===U.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let o=0;o$e(o[l],e,s))}if(this.config.renderTextTracksNatively&&e===0&&i!==void 0){const{textTracks:o}=this;Object.keys(o).forEach(l=>$e(o[l],e,i))}}}extractCea608Data(t){const e=[[],[]],s=t[0]&31;let i=2;for(let r=0;r0&&this.mediaWidth>0){const t=this.hls.levels;if(t.length){const e=this.hls;e.autoLevelCapping=this.getMaxLevel(t.length-1),e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}}getMaxLevel(t){const e=this.hls.levels;if(!e.length)return-1;const s=e.filter((i,r)=>this.isLevelAllowed(i)&&r<=t);return this.clientRect=null,cs.getMaxLevelByMediaSize(s,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const t=this.media,e={width:0,height:0};if(t){const s=t.getBoundingClientRect();e.width=s.width,e.height=s.height,!e.width&&!e.height&&(e.width=s.right-s.left||t.width||0,e.height=s.bottom-s.top||t.height||0)}return this.clientRect=e,e}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch{}return t}isLevelAllowed(t){return!this.restrictedLevels.some(s=>t.bitrate===s.bitrate&&t.width===s.width&&t.height===s.height)}static getMaxLevelByMediaSize(t,e,s){if(!(t!=null&&t.length))return-1;const i=(n,o)=>o?n.width!==o.width||n.height!==o.height:!0;let r=t.length-1;for(let n=0;n=e||o.height>=s)&&i(o,t[n+1])){r=n;break}}return r}}class go{constructor(t){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}setStreamController(t){this.streamController=t}registerListeners(){this.hls.on(m.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(t,e){const s=this.hls.config;if(s.capLevelOnFPSDrop){const i=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}}checkFPS(t,e,s){const i=performance.now();if(e){if(this.lastTime){const r=i-this.lastTime,n=s-this.lastDroppedFrames,o=e-this.lastDecodedFrames,l=1e3*n/r,c=this.hls;if(c.trigger(m.FPS_DROP,{currentDropped:n,currentDecoded:o,totalDroppedFrames:s}),l>0&&n>c.config.fpsDroppedMonitoringThreshold*o){let h=c.currentLevel;x.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(c.autoLevelCapping===-1||c.autoLevelCapping>=h)&&(h=h-1,c.trigger(m.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:c.currentLevel}),c.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=s,this.lastDecodedFrames=e}}checkFPSInterval(){const t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){const e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)}}const ie="[eme]";class Bt{constructor(t){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=Bt.CDMCleanupPromise?[Bt.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=x.debug.bind(x,ie),this.log=x.log.bind(x,ie),this.warn=x.warn.bind(x,ie),this.error=x.error.bind(x,ie),this.hls=t,this.config=t.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(m.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(m.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(m.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(m.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(m.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(t){const{drmSystems:e,widevineLicenseUrl:s}=this.config,i=e[t];if(i)return i.licenseUrl;if(t===Q.WIDEVINE&&s)return s;throw new Error('no license server URL configured for key-system "'.concat(t,'"'))}getServerCertificateUrl(t){const{drmSystems:e}=this.config,s=e[t];if(s)return s.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'.concat(t,'"]'))}attemptKeySystemAccess(t){const e=this.hls.levels,s=(n,o,l)=>!!n&&l.indexOf(n)===o,i=e.map(n=>n.audioCodec).filter(s),r=e.map(n=>n.videoCodec).filter(s);return i.length+r.length===0&&r.push("avc1.42e01e"),new Promise((n,o)=>{const l=c=>{const h=c.shift();this.getMediaKeysPromise(h,i,r).then(u=>n({keySystem:h,mediaKeys:u})).catch(u=>{c.length?l(c):u instanceof dt?o(u):o(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_ACCESS,error:u,fatal:!0},u.message))})};l(t)})}requestMediaKeySystemAccess(t,e){const{requestMediaKeySystemAccessFunc:s}=this.config;if(typeof s!="function"){let i="Configured requestMediaKeySystemAccess is not a function ".concat(s);return ui===null&&self.location.protocol==="http:"&&(i="navigator.requestMediaKeySystemAccess is not available over insecure protocol ".concat(location.protocol)),Promise.reject(new Error(i))}return s(t,e)}getMediaKeysPromise(t,e,s){const i=Ir(t,e,s,this.config.drmSystemOptions),r=this.keySystemAccessPromises[t];let n=r==null?void 0:r.keySystemAccess;if(!n){this.log('Requesting encrypted media "'.concat(t,'" key-system access with config: ').concat(JSON.stringify(i))),n=this.requestMediaKeySystemAccess(t,i);const o=this.keySystemAccessPromises[t]={keySystemAccess:n};return n.catch(l=>{this.log('Failed to obtain access to key-system "'.concat(t,'": ').concat(l))}),n.then(l=>{this.log('Access for key-system "'.concat(l.keySystem,'" obtained'));const c=this.fetchServerCertificate(t);return this.log('Create media-keys for "'.concat(t,'"')),o.mediaKeys=l.createMediaKeys().then(h=>(this.log('Media-keys created for "'.concat(t,'"')),c.then(u=>u?this.setMediaKeysServerCertificate(h,t,u):h))),o.mediaKeys.catch(h=>{this.error('Failed to create media-keys for "'.concat(t,'"}: ').concat(h))}),o.mediaKeys})}return n.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:t,keySystem:e,mediaKeys:s}){this.log('Creating key-system session "'.concat(e,'" keyId: ').concat(xt.hexDump(t.keyId||[])));const i=s.createSession(),r={decryptdata:t,keySystem:e,mediaKeys:s,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(t){const e=t.decryptdata;if(e.pssh){const s=this.createMediaKeySessionContext(t),i=this.getKeyIdString(e),r="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(s,r,e.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)}getKeyIdString(t){if(!t)throw new Error("Could not read keyId of undefined decryptdata");if(t.keyId===null)throw new Error("keyId is null");return xt.hexDump(t.keyId)}updateKeySession(t,e){var s;const i=t.mediaKeysSession;return this.log('Updating key-session "'.concat(i.sessionId,'" for keyID ').concat(xt.hexDump(((s=t.decryptdata)==null?void 0:s.keyId)||[]),"\n } (data length: ").concat(e&&e.byteLength,")")),i.update(e)}selectKeySystemFormat(t){const e=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: ".concat(t.sn," ").concat(t.type,": ").concat(t.level,") key formats ").concat(e.join(", "))),this.keyFormatPromise=this.getKeyFormatPromise(e)),this.keyFormatPromise}getKeyFormatPromise(t){return new Promise((e,s)=>{const i=pe(this.config),r=t.map(fs).filter(n=>!!n&&i.indexOf(n)!==-1);return this.getKeySystemSelectionPromise(r).then(({keySystem:n})=>{const o=gs(n);o?e(o):s(new Error('Unable to find format for key-system "'.concat(n,'"')))}).catch(s)})}loadKey(t){const e=t.keyInfo.decryptdata,s=this.getKeyIdString(e),i="(keyId: ".concat(s,' format: "').concat(e.keyFormat,'" method: ').concat(e.method," uri: ").concat(e.uri,")");this.log("Starting session for key ".concat(i));let r=this.keyIdToKeySessionPromise[s];return r||(r=this.keyIdToKeySessionPromise[s]=this.getKeySystemForKeyPromise(e).then(({keySystem:n,mediaKeys:o})=>(this.throwIfDestroyed(),this.log("Handle encrypted media sn: ".concat(t.frag.sn," ").concat(t.frag.type,": ").concat(t.frag.level," using key ").concat(i)),this.attemptSetMediaKeys(n,o).then(()=>{this.throwIfDestroyed();const l=this.createMediaKeySessionContext({keySystem:n,mediaKeys:o,decryptdata:e});return this.generateRequestWithPreferredKeySession(l,"cenc",e.pssh,"playlist-key")}))),r.catch(n=>this.handleError(n))),r}throwIfDestroyed(t="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(t){this.hls&&(this.error(t.message),t instanceof dt?this.hls.trigger(m.ERROR,t.data):this.hls.trigger(m.ERROR,{type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0}))}getKeySystemForKeyPromise(t){const e=this.getKeyIdString(t),s=this.keyIdToKeySessionPromise[e];if(!s){const i=fs(t.keyFormat),r=i?[i]:pe(this.config);return this.attemptKeySystemAccess(r)}return s}getKeySystemSelectionPromise(t){if(t.length||(t=pe(this.config)),t.length===0)throw new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options ".concat(JSON.stringify({drmSystems:this.config.drmSystems})));return this.attemptKeySystemAccess(t)}_onMediaEncrypted(t){const{initDataType:e,initData:s}=t;if(this.debug('"'.concat(t.type,'" event: init data type: "').concat(e,'"')),s===null)return;let i,r;if(e==="sinf"&&this.config.drmSystems[Q.FAIRPLAY]){const h=st(new Uint8Array(s));try{const u=Xe(JSON.parse(h).sinf),d=xi(new Uint8Array(u));if(!d)return;i=d.subarray(8,24),r=Q.FAIRPLAY}catch{this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{const h=zr(s);if(h===null)return;h.version===0&&h.systemId===hi.WIDEVINE&&h.data&&(i=h.data.subarray(8,24)),r=Rr(h.systemId)}if(!r||!i)return;const n=xt.hexDump(i),{keyIdToKeySessionPromise:o,mediaKeySessions:l}=this;let c=o[n];for(let h=0;hthis.generateRequestWithPreferredKeySession(u,e,s,"encrypted-event-key-match"));break}}c||(c=o[n]=this.getKeySystemSelectionPromise([r]).then(({keySystem:h,mediaKeys:u})=>{var d;this.throwIfDestroyed();const f=new Vt("ISO-23001-7",n,(d=gs(h))!=null?d:"");return f.pssh=new Uint8Array(s),f.keyId=i,this.attemptSetMediaKeys(h,u).then(()=>{this.throwIfDestroyed();const g=this.createMediaKeySessionContext({decryptdata:f,keySystem:h,mediaKeys:u});return this.generateRequestWithPreferredKeySession(g,e,s,"encrypted-event-no-match")})})),c.catch(h=>this.handleError(h))}_onWaitingForKey(t){this.log('"'.concat(t.type,'" event'))}attemptSetMediaKeys(t,e){const s=this.setMediaKeysQueue.slice();this.log('Setting media-keys for "'.concat(t,'"'));const i=Promise.all(s).then(()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(e)});return this.setMediaKeysQueue.push(i),i.then(()=>{this.log('Media-keys set for "'.concat(t,'"')),s.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>s.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(t,e,s,i){var r,n;const o=(r=this.config.drmSystems)==null||(n=r[t.keySystem])==null?void 0:n.generateRequest;if(o)try{const d=o.call(this.hls,e,s,t);if(!d)throw new Error("Invalid response from configured generateRequest filter");e=d.initDataType,s=t.decryptdata.pssh=d.initData?new Uint8Array(d.initData):null}catch(d){var l;if(this.warn(d.message),(l=this.hls)!=null&&l.config.debug)throw d}if(s===null)return this.log('Skipping key-session request for "'.concat(i,'" (no initData)')),Promise.resolve(t);const c=this.getKeyIdString(t.decryptdata);this.log('Generating key-session request for "'.concat(i,'": ').concat(c," (init data type: ").concat(e," length: ").concat(s?s.byteLength:null,")"));const h=new as;t.mediaKeysSession.onmessage=d=>{const f=t.mediaKeysSession;if(!f){h.emit("error",new Error("invalid state"));return}const{messageType:g,message:p}=d;this.log('"'.concat(g,'" message event for session "').concat(f.sessionId,'" message size: ').concat(p.byteLength)),g==="license-request"||g==="license-renewal"?this.renewLicense(t,p).catch(T=>{this.handleError(T),h.emit("error",T)}):g==="license-release"?t.keySystem===Q.FAIRPLAY&&(this.updateKeySession(t,ci("acknowledged")),this.removeSession(t)):this.warn('unhandled media key message type "'.concat(g,'"'))},t.mediaKeysSession.onkeystatuseschange=d=>{if(!t.mediaKeysSession){h.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(t);const g=t.keyStatus;h.emit("keyStatus",g),g==="expired"&&(this.warn("".concat(t.keySystem," expired for key ").concat(c)),this.renewKeySession(t))};const u=new Promise((d,f)=>{h.on("error",f),h.on("keyStatus",g=>{g.startsWith("usable")?d():g==="output-restricted"?f(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):g==="internal-error"?f(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},'key status changed to "'.concat(g,'"'))):g==="expired"?f(new Error("key expired while generating request")):this.warn('unhandled key status change "'.concat(g,'"'))})});return t.mediaKeysSession.generateRequest(e,s).then(()=>{var d;this.log('Request generated for key-session "'.concat((d=t.mediaKeysSession)==null?void 0:d.sessionId,'" keyId: ').concat(c))}).catch(d=>{throw new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_NO_SESSION,error:d,fatal:!1},"Error generating key-session request: ".concat(d))}).then(()=>u).catch(d=>{throw h.removeAllListeners(),this.removeSession(t),d}).then(()=>(h.removeAllListeners(),t))}onKeyStatusChange(t){t.mediaKeysSession.keyStatuses.forEach((e,s)=>{this.log('key status change "'.concat(e,'" for keyStatuses keyId: ').concat(xt.hexDump("buffer"in s?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s))," session keyId: ").concat(xt.hexDump(new Uint8Array(t.decryptdata.keyId||[]))," uri: ").concat(t.decryptdata.uri)),t.keyStatus=e})}fetchServerCertificate(t){const e=this.config,s=e.loader,i=new s(e),r=this.getServerCertificateUrl(t);return r?(this.log('Fetching serverCertificate for "'.concat(t,'"')),new Promise((n,o)=>{const l={responseType:"arraybuffer",url:r},c=e.certLoadPolicy.default,h={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(d,f,g,p)=>{n(d.data)},onError:(d,f,g,p)=>{o(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:g,response:ct({url:l.url,data:void 0},d)},'"'.concat(t,'" certificate request failed (').concat(r,"). Status: ").concat(d.code," (").concat(d.text,")")))},onTimeout:(d,f,g)=>{o(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:g,response:{url:l.url,data:void 0}},'"'.concat(t,'" certificate request timed out (').concat(r,")")))},onAbort:(d,f,g)=>{o(new Error("aborted"))}};i.load(l,h,u)})):Promise.resolve()}setMediaKeysServerCertificate(t,e,s){return new Promise((i,r)=>{t.setServerCertificate(s).then(n=>{this.log("setServerCertificate ".concat(n?"success":"not supported by CDM"," (").concat(s==null?void 0:s.byteLength,') on "').concat(e,'"')),i(t)}).catch(n=>{r(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:n,fatal:!0},n.message))})})}renewLicense(t,e){return this.requestLicense(t,new Uint8Array(e)).then(s=>this.updateKeySession(t,new Uint8Array(s)).catch(i=>{throw new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:i,fatal:!0},i.message)}))}setupLicenseXHR(t,e,s,i){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!s.decryptdata)throw new Error("Key removed");return r.call(this.hls,t,e,s,i)}).catch(n=>{if(!s.decryptdata)throw n;return t.open("POST",e,!0),r.call(this.hls,t,e,s,i)}).then(n=>(t.readyState||t.open("POST",e,!0),{xhr:t,licenseChallenge:n||i})):(t.open("POST",e,!0),Promise.resolve({xhr:t,licenseChallenge:i}))}requestLicense(t,e){const s=this.config.keyLoadPolicy.default;return new Promise((i,r)=>{const n=this.getLicenseServerUrl(t.keySystem);this.log("Sending license request to URL: ".concat(n));const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!t.mediaKeysSession)return r(new Error("invalid state"));if(o.readyState===4)if(o.status===200){this._requestLicenseFailureCount=0;let l=o.response;this.log("License received ".concat(l instanceof ArrayBuffer?l.byteLength:l));const c=this.config.licenseResponseCallback;if(c)try{l=c.call(this.hls,o,n,t)}catch(h){this.error(h)}i(l)}else{const l=s.errorRetry,c=l?l.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c||o.status>=400&&o.status<500)r(new dt({type:N.KEY_SYSTEM_ERROR,details:L.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:n,data:void 0,code:o.status,text:o.statusText}},"License Request XHR failed (".concat(n,"). Status: ").concat(o.status," (").concat(o.statusText,")")));else{const h=c-this._requestLicenseFailureCount+1;this.warn("Retrying license request, ".concat(h," attempts left")),this.requestLicense(t,e).then(i,r)}}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=o,this.setupLicenseXHR(o,n,t,e).then(({xhr:l,licenseChallenge:c})=>{l.send(c)})})}onMediaAttached(t,e){if(!this.config.emeEnabled)return;const s=e.media;this.media=s,s.addEventListener("encrypted",this.onMediaEncrypted),s.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const t=this.media,e=this.mediaKeySessions;t&&(t.removeEventListener("encrypted",this.onMediaEncrypted),t.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Vt.clearKeyUriToKeyIdMap();const s=e.length;Bt.CDMCleanupPromise=Promise.all(e.map(i=>this.removeSession(i)).concat(t==null?void 0:t.setMediaKeys(null).catch(i=>{this.log("Could not clear media keys: ".concat(i,". media.src: ").concat(t==null?void 0:t.src))}))).then(()=>{s&&(this.log("finished closing key sessions and clearing media keys"),e.length=0)}).catch(i=>{this.log("Could not close sessions and clear media keys: ".concat(i,". media.src: ").concat(t==null?void 0:t.src))})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(t,{sessionKeys:e}){if(!(!e||!this.config.emeEnabled)&&!this.keyFormatPromise){const s=e.reduce((i,r)=>(i.indexOf(r.keyFormat)===-1&&i.push(r.keyFormat),i),[]);this.log("Selecting key-system from session-keys ".concat(s.join(", "))),this.keyFormatPromise=this.getKeyFormatPromise(s)}}removeSession(t){const{mediaKeysSession:e,licenseXhr:s}=t;if(e){this.log("Remove licenses and keys and close session ".concat(e.sessionId)),e.onmessage=null,e.onkeystatuseschange=null,s&&s.readyState!==XMLHttpRequest.DONE&&s.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(t);return i>-1&&this.mediaKeySessions.splice(i,1),e.remove().catch(r=>{this.log("Could not remove session: ".concat(r))}).then(()=>e.close()).catch(r=>{this.log("Could not close session: ".concat(r))})}}}Bt.CDMCleanupPromise=void 0;class dt extends Error{constructor(t,e){super(e),this.data=void 0,t.error||(t.error=new Error(e)),this.data=t,t.err=t.error}}const mo=1;var at={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"};const po="h";class Dt{constructor(t){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:at.MANIFEST,su:!this.initialized})}catch(r){x.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=i=>{try{const r=i.frag,n=this.hls.levels[r.level],o=this.getObjectType(r),l={d:r.duration*1e3,ot:o};(o===at.VIDEO||o===at.AUDIO||o==at.MUXED)&&(l.br=n.bitrate/1e3,l.tb=this.getTopBandwidth(o)/1e3,l.bl=this.getBufferLength(o)),this.apply(i,l)}catch(r){x.warn("Could not generate segment CMCD data.",r)}},this.hls=t;const e=this.config=t.config,{cmcd:s}=e;s!=null&&(e.pLoader=this.createPlaylistLoader(),e.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||Dt.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}registerListeners(){const t=this.hls;t.on(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(m.MEDIA_DETACHED,this.onMediaDetached,this),t.on(m.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const t=this.hls;t.off(m.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(m.MEDIA_DETACHED,this.onMediaDetached,this),t.off(m.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null}onMediaAttached(t,e){this.media=e.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(t,e){var s,i;this.audioBuffer=(s=e.tracks.audio)==null?void 0:s.buffer,this.videoBuffer=(i=e.tracks.video)==null?void 0:i.buffer}createData(){var t;return{v:mo,sf:po,sid:this.sid,cid:this.cid,pr:(t=this.media)==null?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(t,e={}){tt(e,this.createData());const s=e.ot===at.INIT||e.ot===at.VIDEO||e.ot===at.MUXED;if(this.starved&&s&&(e.bs=!0,e.su=!0,this.starved=!1),e.su==null&&(e.su=this.buffering),this.useHeaders){const i=Dt.toHeaders(e);if(!Object.keys(i).length)return;t.headers||(t.headers={}),tt(t.headers,i)}else{const i=Dt.toQuery(e);if(!i)return;t.url=Dt.appendQueryToUri(t.url,i)}}getObjectType(t){const{type:e}=t;if(e==="subtitle")return at.TIMED_TEXT;if(t.sn==="initSegment")return at.INIT;if(e==="audio")return at.AUDIO;if(e==="main")return this.hls.audioTracks.length?at.VIDEO:at.MUXED}getTopBandwidth(t){let e=0,s;const i=this.hls;if(t===at.AUDIO)s=i.audioTracks;else{const r=i.maxAutoLevel,n=r>-1?r+1:i.levels.length;s=i.levels.slice(0,n)}for(const r of s)r.bitrate>e&&(e=r.bitrate);return e>0?e:NaN}getBufferLength(t){const e=this.hls.media,s=t===at.AUDIO?this.audioBuffer:this.videoBuffer;return!s||!e?NaN:q.bufferInfo(s,e.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:t}=this.config,e=this.applyPlaylistData,s=t||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){e(r),this.loader.load(r,n,o)}}}createFragmentLoader(){const{fLoader:t}=this.config,e=this.applyFragmentData,s=t||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new s(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,n,o){e(r),this.loader.load(r,n,o)}}}static uuid(){const t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.slice(e.lastIndexOf("/")+1)}static serialize(t){const e=[],s=c=>!Number.isNaN(c)&&c!=null&&c!==""&&c!==!1,i=c=>Math.round(c),r=c=>i(c/100)*100,o={br:i,d:i,bl:r,dl:r,mtp:r,nor:c=>encodeURIComponent(c),rtp:r,tb:i},l=Object.keys(t||{}).sort();for(const c of l){let h=t[c];if(!s(h)||c==="v"&&h===1||c=="pr"&&h===1)continue;const u=o[c];u&&(h=u(h));const d=typeof h;let f;c==="ot"||c==="sf"||c==="st"?f="".concat(c,"=").concat(h):d==="boolean"?f=c:d==="number"?f="".concat(c,"=").concat(h):f="".concat(c,"=").concat(JSON.stringify(h)),e.push(f)}return e.join(",")}static toHeaders(t){const e=Object.keys(t),s={},i=["Object","Request","Session","Status"],r=[{},{},{},{}],n={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3};for(const o of e){const l=n[o]!=null?n[o]:1;r[l][o]=t[o]}for(let o=0;os!==t))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(t,e){const{contentSteering:s}=e;s!==null&&(this.pathwayId=s.pathwayId,this.uri=s.uri,this.started&&this.startLoad())}onManifestParsed(t,e){this.audioTracks=e.audioTracks,this.subtitleTracks=e.subtitleTracks}onError(t,e){const{errorAction:s}=e;if((s==null?void 0:s.action)===rt.SendAlternateToPenaltyBox&&s.flags===ft.MoveAllAlternatesMatchingHost){let i=this.pathwayPriority;const r=this.pathwayId;this.penalizedPathways[r]||(this.penalizedPathways[r]=performance.now()),!i&&this.levels&&(i=this.levels.reduce((n,o)=>(n.indexOf(o.pathwayId)===-1&&n.push(o.pathwayId),n),[])),i&&i.length>1&&(this.updatePathwayPriority(i),s.resolved=this.pathwayId!==r)}}filterParsedLevels(t){this.levels=t;let e=this.getLevelsForPathway(this.pathwayId);if(e.length===0){const s=t[0].pathwayId;this.log("No levels found in Pathway ".concat(this.pathwayId,'. Setting initial Pathway to "').concat(s,'"')),e=this.getLevelsForPathway(s),this.pathwayId=s}return e.length!==t.length?(this.log("Found ".concat(e.length,"/").concat(t.length,' levels in Pathway "').concat(this.pathwayId,'"')),e):t}getLevelsForPathway(t){return this.levels===null?[]:this.levels.filter(e=>t===e.pathwayId)}updatePathwayPriority(t){this.pathwayPriority=t;let e;const s=this.penalizedPathways,i=performance.now();Object.keys(s).forEach(r=>{i-s[r]>To&&delete s[r]});for(let r=0;r0){this.log('Setting Pathway to "'.concat(n,'"')),this.pathwayId=n,this.hls.trigger(m.LEVELS_UPDATED,{levels:e});const c=this.hls.levels[o];l&&c&&this.levels&&(c.attrs["STABLE-VARIANT-ID"]!==l.attrs["STABLE-VARIANT-ID"]&&c.bitrate!==l.bitrate&&this.log("Unstable Pathways change from bitrate ".concat(l.bitrate," to ").concat(c.bitrate)),this.hls.nextLoadLevel=o);break}}}clonePathways(t){const e=this.levels;if(!e)return;const s={},i={};t.forEach(r=>{const{ID:n,"BASE-ID":o,"URI-REPLACEMENT":l}=r;if(e.some(h=>h.pathwayId===n))return;const c=this.getLevelsForPathway(o).map(h=>{const u=tt({},h);u.details=void 0,u.url=sr(h.uri,h.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",l);const d=new z(h.attrs);d["PATHWAY-ID"]=n;const f=d.AUDIO&&"".concat(d.AUDIO,"_clone_").concat(n),g=d.SUBTITLES&&"".concat(d.SUBTITLES,"_clone_").concat(n);f&&(s[d.AUDIO]=f,d.AUDIO=f),g&&(i[d.SUBTITLES]=g,d.SUBTITLES=g),u.attrs=d;const p=new Wt(u);return ce(p,"audio",f),ce(p,"text",g),p});e.push(...c),ii(this.audioTracks,s,l,n),ii(this.subtitleTracks,i,l,n)})}loadSteeringManifest(t){const e=this.hls.config,s=e.loader;this.loader&&this.loader.destroy(),this.loader=new s(e);let i;try{i=new self.URL(t)}catch{this.enabled=!1,this.log("Failed to parse Steering Manifest URI: ".concat(t));return}if(i.protocol!=="data:"){const h=(this.hls.bandwidthEstimate||e.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+h)}const r={responseType:"json",url:i.href},n=e.steeringManifestLoadPolicy.default,o=n.errorRetry||n.timeoutRetry||{},l={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},c={onSuccess:(h,u,d,f)=>{this.log('Loaded steering manifest: "'.concat(i,'"'));const g=h.data;if(g.VERSION!==1){this.log("Steering VERSION ".concat(g.VERSION," not supported!"));return}this.updated=performance.now(),this.timeToLoad=g.TTL;const{"RELOAD-URI":p,"PATHWAY-CLONES":T,"PATHWAY-PRIORITY":y}=g;if(p)try{this.uri=new self.URL(p,i).href}catch{this.enabled=!1,this.log("Failed to parse Steering Manifest RELOAD-URI: ".concat(p));return}this.scheduleRefresh(this.uri||d.url),T&&this.clonePathways(T),y&&this.updatePathwayPriority(y)},onError:(h,u,d,f)=>{if(this.log("Error loading steering manifest: ".concat(h.code," ").concat(h.text," (").concat(u.url,")")),this.stopLoad(),h.code===410){this.enabled=!1,this.log("Steering manifest ".concat(u.url," no longer available"));return}let g=this.timeToLoad*1e3;if(h.code===429){const p=this.loader;if(typeof(p==null?void 0:p.getResponseHeader)=="function"){const T=p.getResponseHeader("Retry-After");T&&(g=parseFloat(T)*1e3)}this.log("Steering manifest ".concat(u.url," rate limited"));return}this.scheduleRefresh(this.uri||u.url,g)},onTimeout:(h,u,d)=>{this.log("Timeout loading steering manifest (".concat(u.url,")")),this.scheduleRefresh(this.uri||u.url)}};this.log("Requesting steering manifest: ".concat(i)),this.loader.load(r,l,c)}scheduleRefresh(t,e=this.timeToLoad*1e3){self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout(()=>{this.loadSteeringManifest(t)},e)}}function ii(a,t,e,s){a&&Object.keys(t).forEach(i=>{const r=a.filter(n=>n.groupId===i).map(n=>{const o=tt({},n);return o.details=void 0,o.attrs=new z(o.attrs),o.url=o.attrs.URI=sr(n.url,n.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",e),o.groupId=o.attrs["GROUP-ID"]=t[i],o.attrs["PATHWAY-ID"]=s,o});a.push(...r)})}function sr(a,t,e,s){const{HOST:i,PARAMS:r,[e]:n}=s;let o;t&&(o=n==null?void 0:n[t],o&&(a=o));const l=new self.URL(a);return i&&!o&&(l.host=i),r&&Object.keys(r).sort().forEach(c=>{c&&l.searchParams.set(c,r[c])}),l.href}const xo=/^age:\s*[\d.]+\s*$/im;class ir{constructor(t){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=t&&t.xhrSetup||null,this.stats=new ue,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null}abortInternal(){const t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,t.readyState!==4&&(this.stats.aborted=!0,t.abort()))}abort(){var t;this.abortInternal(),(t=this.callbacks)!=null&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(t,e,s){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=s,this.loadInternal()}loadInternal(){const{config:t,context:e}=this;if(!t)return;const s=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!this.stats.aborted)return r(s,e.url)}).catch(n=>(s.open("GET",e.url,!0),r(s,e.url))).then(()=>{this.stats.aborted||this.openAndSendXhr(s,e,t)}).catch(n=>{this.callbacks.onError({code:s.status,text:n.message},e,s,i)}):this.openAndSendXhr(s,e,t)}openAndSendXhr(t,e,s){t.readyState||t.open("GET",e.url,!0);const i=this.context.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:n}=s.loadPolicy;if(i)for(const o in i)t.setRequestHeader(o,i[o]);e.rangeEnd&&t.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,self.clearTimeout(this.requestTimeout),s.timeout=r&&F(r)?r:n,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout),t.send()}readystatechange(){const{context:t,loader:e,stats:s}=this;if(!t||!e)return;const i=e.readyState,r=this.config;if(!s.aborted&&i>=2&&(s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(s.loading.first-s.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),e.onreadystatechange=null,e.onprogress=null;const n=e.status,o=e.responseType!=="text";if(n>=200&&n<300&&(o&&e.response||e.responseText!==null)){s.loading.end=Math.max(self.performance.now(),s.loading.first);const l=o?e.response:e.responseText,c=e.responseType==="arraybuffer"?l.byteLength:l.length;if(s.loaded=s.total=c,s.bwEstimate=s.total*8e3/(s.loading.end-s.loading.first),!this.callbacks)return;const h=this.callbacks.onProgress;if(h&&h(s,t,l,e),!this.callbacks)return;const u={url:e.responseURL,data:l,code:n};this.callbacks.onSuccess(u,s,t,e)}else{const l=r.loadPolicy.errorRetry,c=s.retry;le(l,c,!1,n)?this.retry(l):(x.error("".concat(n," while loading ").concat(t.url)),this.callbacks.onError({code:n,text:e.statusText},t,e,s))}}}loadtimeout(){var t;const e=(t=this.config)==null?void 0:t.loadPolicy.timeoutRetry,s=this.stats.retry;if(le(e,s,!0))this.retry(e);else{x.warn("timeout while loading ".concat(this.context.url));const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(t){const{context:e,stats:s}=this;this.retryDelay=Qe(t,s.retry),s.retry++,x.warn("".concat(status?"HTTP Status "+status:"Timeout"," while loading ").concat(e.url,", retrying ").concat(s.retry,"/").concat(t.maxNumRetry," in ").concat(this.retryDelay,"ms")),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(t){const e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)}getCacheAge(){let t=null;if(this.loader&&xo.test(this.loader.getAllResponseHeaders())){const e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.loader&&new RegExp("^".concat(t,":\\s*[\\d.]+\\s*$"),"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(t):null}}function Eo(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const So=/(\d+)-(\d+)\/(\d+)/;class ri{constructor(t){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||Ro,this.controller=new self.AbortController,this.stats=new ue}destroy(){this.loader=this.callbacks=null,this.abortInternal()}abortInternal(){const t=this.response;t!=null&&t.ok||(this.stats.aborted=!0,this.controller.abort())}abort(){var t;this.abortInternal(),(t=this.callbacks)!=null&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(t,e,s){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const r=vo(t,this.controller.signal),n=s.onProgress,o=t.responseType==="arraybuffer",l=o?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:h}=e.loadPolicy;this.context=t,this.config=e,this.callbacks=s,this.request=this.fetchSetup(t,r),self.clearTimeout(this.requestTimeout),e.timeout=c&&F(c)?c:h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(i,t,this.response)},e.timeout),self.fetch(this.request).then(u=>{this.response=this.loader=u;const d=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),e.timeout=h,this.requestTimeout=self.setTimeout(()=>{this.abortInternal(),s.onTimeout(i,t,this.response)},h-(d-i.loading.start)),!u.ok){const{status:f,statusText:g}=u;throw new Io(g||"fetch, bad network response",f,u)}return i.loading.first=d,i.total=Lo(u.headers)||i.total,n&&F(e.highWaterMark)?this.loadProgressively(u,i,t,e.highWaterMark,n):o?u.arrayBuffer():t.responseType==="json"?u.json():u.text()}).then(u=>{const{response:d}=this;self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const f=u[l];f&&(i.loaded=i.total=f);const g={url:d.url,data:u,code:d.status};n&&!F(e.highWaterMark)&&n(i,t,u,d),s.onSuccess(g,i,t,d)}).catch(u=>{if(self.clearTimeout(this.requestTimeout),i.aborted)return;const d=u&&u.code||0,f=u?u.message:null;s.onError({code:d,text:f},t,u?u.details:null,i)})}getCacheAge(){let t=null;if(this.response){const e=this.response.headers.get("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.response?this.response.headers.get(t):null}loadProgressively(t,e,s,i=0,r){const n=new Yi,o=t.body.getReader(),l=()=>o.read().then(c=>{if(c.done)return n.dataLength&&r(e,s,n.flush(),t),Promise.resolve(new ArrayBuffer(0));const h=c.value,u=h.length;return e.loaded+=u,u=i&&r(e,s,n.flush(),t)):r(e,s,h,t),l()}).catch(()=>Promise.reject());return l()}}function vo(a,t){const e={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(tt({},a.headers))};return a.rangeEnd&&e.headers.set("Range","bytes="+a.rangeStart+"-"+String(a.rangeEnd-1)),e}function Ao(a){const t=So.exec(a);if(t)return parseInt(t[2])-parseInt(t[1])+1}function Lo(a){const t=a.get("Content-Range");if(t){const s=Ao(t);if(F(s))return s}const e=a.get("Content-Length");if(e)return parseInt(e)}function Ro(a,t){return new self.Request(a.url,t)}class Io extends Error{constructor(t,e,s){super(t),this.code=void 0,this.details=void 0,this.code=e,this.details=s}}const bo=/\s/,Do={newCue(a,t,e,s){const i=[];let r,n,o,l,c;const h=self.VTTCue||self.TextTrackCue;for(let d=0;d=16?l--:l++;const f=Ji(c.trim()),g=ls(t,e,f);a!=null&&(u=a.cues)!=null&&u.getCueById(g)||(n=new h(t,e,f),n.id=g,n.line=d+1,n.align="left",n.position=10+Math.min(80,Math.floor(l*8/32)*10),i.push(n))}return a&&i.length&&(i.sort((d,f)=>d.line==="auto"||f.line==="auto"?0:d.line>8&&f.line>8?f.line-d.line:d.line-f.line),i.forEach(d=>Li(a,d))),i}},Co={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},ko=ct(ct({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:ir,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Pa,bufferController:Ka,capLevelController:cs,errorController:Rn,fpsController:go,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:ui,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:Co},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},_o()),{},{subtitleStreamController:Ua,subtitleTrackController:$a,timelineController:ho,audioStreamController:Oa,audioTrackController:Ma,emeController:Bt,cmcdController:Dt,contentSteeringController:yo});function _o(){return{cueHandler:Do,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function wo(a,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(t.liveMaxLatencyDurationCount!==void 0&&(t.liveSyncDurationCount===void 0||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(t.liveMaxLatencyDuration!==void 0&&(t.liveSyncDuration===void 0||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const e=qe(a),s=["manifest","level","frag"],i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return s.forEach(r=>{const n="".concat(r==="level"?"playlist":r,"LoadPolicy"),o=t[n]===void 0,l=[];i.forEach(c=>{const h="".concat(r,"Loading").concat(c),u=t[h];if(u!==void 0&&o){l.push(h);const d=e[n].default;switch(t[n]={default:d},c){case"TimeOut":d.maxLoadTimeMs=u,d.maxTimeToFirstByteMs=u;break;case"MaxRetry":d.errorRetry.maxNumRetry=u,d.timeoutRetry.maxNumRetry=u;break;case"RetryDelay":d.errorRetry.retryDelayMs=u,d.timeoutRetry.retryDelayMs=u;break;case"MaxRetryTimeout":d.errorRetry.maxRetryDelayMs=u,d.timeoutRetry.maxRetryDelayMs=u;break}}}),l.length&&x.warn('hls.js config: "'.concat(l.join('", "'),'" setting(s) are deprecated, use "').concat(n,'": ').concat(JSON.stringify(t[n])))}),ct(ct({},e),t)}function qe(a){return a&&typeof a=="object"?Array.isArray(a)?a.map(qe):Object.keys(a).reduce((t,e)=>(t[e]=qe(a[e]),t),{}):a}function Po(a){const t=a.loader;t!==ri&&t!==ir?(x.log("[config]: Custom loader detected, cannot enable progressive streaming"),a.progressive=!1):Eo()&&(a.loader=ri,a.progressive=!0,a.enableSoftwareAES=!0,x.log("[config]: Progressive streaming enabled, using FetchLoader"))}class Rt{static get version(){return"1.4.12"}static isSupported(){return Vn()}static get Events(){return m}static get ErrorTypes(){return N}static get ErrorDetails(){return L}static get DefaultConfig(){return Rt.defaultConfig?Rt.defaultConfig:ko}static set DefaultConfig(t){Rt.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new as,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,mr(t.debug||!1,"Hls instance");const e=this.config=wo(Rt.DefaultConfig,t);this.userConfig=t,this._autoLevelCapping=-1,e.progressive&&Po(e);const{abrController:s,bufferController:i,capLevelController:r,errorController:n,fpsController:o}=e,l=new n(this),c=this.abrController=new s(this),h=this.bufferController=new i(this),u=this.capLevelController=new r(this),d=new o(this),f=new an(this),g=new un(this),p=e.contentSteeringController,T=p?new p(this):null,y=this.levelController=new bn(this,T),S=new Dn(this),E=new kn(this.config),R=this.streamController=new _a(this,S,E);u.setStreamController(R),d.setStreamController(R);const A=[f,y,R];T&&A.splice(1,0,T),this.networkControllers=A;const k=[c,h,u,d,g,S];this.audioTrackController=this.createController(e.audioTrackController,A);const D=e.audioStreamController;D&&A.push(new D(this,S,E)),this.subtitleTrackController=this.createController(e.subtitleTrackController,A);const C=e.subtitleStreamController;C&&A.push(new C(this,S,E)),this.createController(e.timelineController,k),E.emeController=this.emeController=this.createController(e.emeController,k),this.cmcdController=this.createController(e.cmcdController,k),this.latencyController=this.createController(dn,k),this.coreComponents=k,A.push(l);const _=l.onErrorOut;typeof _=="function"&&this.on(m.ERROR,_,l)}createController(t,e){if(t){const s=new t(this);return e&&e.push(s),s}return null}on(t,e,s=this){this._emitter.on(t,e,s)}once(t,e,s=this){this._emitter.once(t,e,s)}removeAllListeners(t){this._emitter.removeAllListeners(t)}off(t,e,s=this,i){this._emitter.off(t,e,s,i)}listeners(t){return this._emitter.listeners(t)}emit(t,e,s){return this._emitter.emit(t,e,s)}trigger(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(s){x.error("An internal error happened while handling event "+t+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(m.ERROR,{type:N.OTHER_ERROR,details:L.INTERNAL_EXCEPTION,fatal:!1,event:t,error:s})}return!1}listenerCount(t){return this._emitter.listenerCount(t)}destroy(){x.log("destroy"),this.trigger(m.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(e=>e.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(e=>e.destroy()),this.coreComponents.length=0;const t=this.config;t.xhrSetup=t.fetchSetup=void 0,this.userConfig=null}attachMedia(t){x.log("attachMedia"),this._media=t,this.trigger(m.MEDIA_ATTACHING,{media:t})}detachMedia(){x.log("detachMedia"),this.trigger(m.MEDIA_DETACHING,void 0),this._media=null}loadSource(t){this.stopLoad();const e=this.media,s=this.url,i=this.url=je.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});x.log("loadSource:".concat(i)),e&&s&&(s!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(e)),this.trigger(m.MANIFEST_LOADING,{url:t})}startLoad(t=-1){x.log("startLoad(".concat(t,")")),this.networkControllers.forEach(e=>{e.startLoad(t)})}stopLoad(){x.log("stopLoad"),this.networkControllers.forEach(t=>{t.stopLoad()})}swapAudioCodec(){x.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){x.log("recoverMediaError");const t=this._media;this.detachMedia(),t&&this.attachMedia(t)}removeLevel(t,e=0){this.levelController.removeLevel(t,e)}get levels(){const t=this.levelController.levels;return t||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(t){x.log("set currentLevel:".concat(t)),this.loadLevel=t,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(t){x.log("set nextLevel:".concat(t)),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(t){x.log("set loadLevel:".concat(t)),this.levelController.manualLevel=t}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(t){this.levelController.nextLoadLevel=t}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(t){x.log("set firstLevel:".concat(t)),this.levelController.firstLevel=t}get startLevel(){return this.levelController.startLevel}set startLevel(t){x.log("set startLevel:".concat(t)),t!==-1&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(t){const e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimate():NaN}get ttfbEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimateTTFB():NaN}set autoLevelCapping(t){this._autoLevelCapping!==t&&(x.log("set autoLevelCapping:".concat(t)),this._autoLevelCapping=t)}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(t){Ke.indexOf(t)>-1&&(this._maxHdcpLevel=t)}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:t,config:{minAutoBitrate:e}}=this;if(!t)return 0;const s=t.length;for(let i=0;i=e)return i;return 0}get maxAutoLevel(){const{levels:t,autoLevelCapping:e,maxHdcpLevel:s}=this;let i;if(e===-1&&t&&t.length?i=t.length-1:i=e,s)for(let r=i;r--;){const n=t[r].attrs["HDCP-LEVEL"];if(n&&n<=s)return r}return i}get nextAutoLevel(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)}set nextAutoLevel(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get audioTracks(){const t=this.audioTrackController;return t?t.audioTracks:[]}get audioTrack(){const t=this.audioTrackController;return t?t.audioTrack:-1}set audioTrack(t){const e=this.audioTrackController;e&&(e.audioTrack=t)}get subtitleTracks(){const t=this.subtitleTrackController;return t?t.subtitleTracks:[]}get subtitleTrack(){const t=this.subtitleTrackController;return t?t.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(t){const e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}get subtitleDisplay(){const t=this.subtitleTrackController;return t?t.subtitleDisplay:!1}set subtitleDisplay(t){const e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(t){this.config.lowLatencyMode=t}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}Rt.defaultConfig=void 0;var Fo=Object.defineProperty,Oo=Object.getOwnPropertyDescriptor,hs=(a,t,e,s)=>{for(var i=s>1?void 0:s?Oo(t,e):t,r=a.length-1,n;r>=0;r--)(n=a[r])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&Fo(t,e,i),i};let qt=class extends rr(nr,ar){constructor(){super(...arguments),this.aspectRatio=null,this.isVisible=!0,this.hls=null}get url(){var t;return this.convertUrl((t=this.camSettings)==null?void 0:t.stream_url,this.printerUrl)}get webcamStyle(){var e,s,i;const t={transform:this.generateTransform((e=this.camSettings.flip_horizontal)!=null?e:!1,(s=this.camSettings.flip_vertical)!=null?s:!1,(i=this.camSettings.rotation)!=null?i:0),aspectRatio:1.7777777777777777,maxHeight:window.innerHeight-155+"px",maxWidth:"auto"};return this.aspectRatio&&(t.aspectRatio=this.aspectRatio,t.maxWidth=(window.innerHeight-155)*this.aspectRatio+"px"),t}visibilityChanged(t){this.isVisible=t}mounted(){this.play();const t=this.$refs.video;t.onplaying=()=>{this.aspectRatio=t.videoWidth/t.videoHeight}}updated(){this.play()}play(){var e;const t=this.$refs.video;Rt.isSupported()?((e=this.hls)==null||e.destroy(),this.hls=new Rt({enableWorker:!0,lowLatencyMode:!0,maxLiveSyncPlaybackRate:2,liveSyncDuration:.5,liveMaxLatencyDuration:2,backBufferLength:5}),this.hls.loadSource(this.url),this.hls.attachMedia(t),this.hls.on(Rt.Events.MANIFEST_PARSED,()=>{t.play()})):t.canPlayType("application/vnd.apple.mpegurl")&&fetch(this.url).then(()=>{t.src=this.url,t.play()})}beforeUnmount(){var t;(t=this.hls)==null||t.destroy()}};hs([ni({required:!0})],qt.prototype,"camSettings",2);hs([ni({default:null})],qt.prototype,"printerUrl",2);qt=hs([or],qt);var Mo=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{staticClass:"d-flex justify-center"},[e("video",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:t.visibilityChanged,expression:"visibilityChanged"}],ref:"video",staticClass:"webcamImage",style:t.webcamStyle,attrs:{autoplay:"",muted:""},domProps:{muted:!0}})])},No=[],Uo=lr(qt,Mo,No,!1,null,"ffcea7e5");const Yo=Uo.exports;export{Yo as default}; diff --git a/assets/Hlsstreamer-Dpcrs_uP.css b/assets/Hlsstreamer-Dpcrs_uP.css new file mode 100644 index 0000000..e2ba3cb --- /dev/null +++ b/assets/Hlsstreamer-Dpcrs_uP.css @@ -0,0 +1 @@ +.webcamImage[data-v-ffcea7e5]{width:100%} diff --git a/assets/Ipstreamer-B2DsK1lF.css b/assets/Ipstreamer-B2DsK1lF.css new file mode 100644 index 0000000..e150681 --- /dev/null +++ b/assets/Ipstreamer-B2DsK1lF.css @@ -0,0 +1 @@ +.webcamImage[data-v-05ec379f]{width:100%} diff --git a/assets/Ipstreamer-BPf8FdFe.js b/assets/Ipstreamer-BPf8FdFe.js new file mode 100644 index 0000000..ce7fe7e --- /dev/null +++ b/assets/Ipstreamer-BPf8FdFe.js @@ -0,0 +1 @@ +import{m as p,B as c,H as v,P as m,C as _,n as u}from"./index-Bku7SJna.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./echarts-DzoUeqWp.js";var f=Object.defineProperty,b=Object.getOwnPropertyDescriptor,o=(a,e,t,r)=>{for(var s=r>1?void 0:r?b(e,t):e,n=a.length-1,l;n>=0;n--)(l=a[n])&&(s=(r?l(e,t,s):l(s))||s);return r&&s&&f(e,t,s),s};let i=class extends p(c,v){constructor(){super(...arguments),this.isVisible=!0}get url(){var e;return this.convertUrl((e=this.camSettings)==null?void 0:e.stream_url,this.printerUrl)}get webcamStyle(){var e,t,r;return{transform:this.generateTransform((e=this.camSettings.flip_horizontal)!=null?e:!1,(t=this.camSettings.flip_vertical)!=null?t:!1,(r=this.camSettings.rotation)!=null?r:0)}}visibilityChanged(e){this.isVisible=e}};o([m({required:!0})],i.prototype,"camSettings",2);o([m({default:null})],i.prototype,"printerUrl",2);i=o([_],i);var h=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("video",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.visibilityChanged,expression:"visibilityChanged"}],staticClass:"webcamImage",style:e.webcamStyle,attrs:{src:e.url,autoplay:""}})},g=[],y=u(i,h,g,!1,null,"05ec379f");const w=y.exports;export{w as default}; diff --git a/assets/JMuxerStream-COVqP7gw.css b/assets/JMuxerStream-COVqP7gw.css new file mode 100644 index 0000000..72ad116 --- /dev/null +++ b/assets/JMuxerStream-COVqP7gw.css @@ -0,0 +1 @@ +.webcamImage[data-v-90b79f69]{width:100%}._webcam_jmuxer_output[data-v-90b79f69]{aspect-ratio:1.5} diff --git a/assets/JMuxerStream-Cqmc9Hrb.js b/assets/JMuxerStream-Cqmc9Hrb.js new file mode 100644 index 0000000..6e0c2e5 --- /dev/null +++ b/assets/JMuxerStream-Cqmc9Hrb.js @@ -0,0 +1,6 @@ +import{c as he,a as xt}from"./overlayscrollbars-CiKU261J.js";import{I as yt,m as Rt,B as kt,H as At,P as vt,W as Tt,C as Bt,n as Lt}from"./index-Bku7SJna.js";import{m as Ct,n as Ut,r as Mt}from"./vuetify-Ce4WN_Dg.js";import"./echarts-DzoUeqWp.js";var gt={exports:{}},ge={exports:{}},Ve;function qe(){if(Ve)return ge.exports;Ve=1;var F=typeof Reflect=="object"?Reflect:null,x=F&&typeof F.apply=="function"?F.apply:function(y,R,V){return Function.prototype.apply.call(y,R,V)},A;F&&typeof F.ownKeys=="function"?A=F.ownKeys:Object.getOwnPropertySymbols?A=function(y){return Object.getOwnPropertyNames(y).concat(Object.getOwnPropertySymbols(y))}:A=function(y){return Object.getOwnPropertyNames(y)};function I(g){console&&console.warn&&console.warn(g)}var D=Number.isNaN||function(y){return y!==y};function v(){v.init.call(this)}ge.exports=v,ge.exports.once=p,v.EventEmitter=v,v.prototype._events=void 0,v.prototype._eventsCount=0,v.prototype._maxListeners=void 0;var b=10;function s(g){if(typeof g!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof g)}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return b},set:function(g){if(typeof g!="number"||g<0||D(g))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+g+".");b=g}}),v.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},v.prototype.setMaxListeners=function(y){if(typeof y!="number"||y<0||D(y))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+y+".");return this._maxListeners=y,this};function E(g){return g._maxListeners===void 0?v.defaultMaxListeners:g._maxListeners}v.prototype.getMaxListeners=function(){return E(this)},v.prototype.emit=function(y){for(var R=[],V=1;V0&&(J=R[0]),J instanceof Error)throw J;var te=new Error("Unhandled error."+(J?" ("+J.message+")":""));throw te.context=J,te}var ne=z[y];if(ne===void 0)return!1;if(typeof ne=="function")x(ne,this,R);else for(var ie=ne.length,ae=L(ne,ie),V=0;V0&&J.length>H&&!J.warned){J.warned=!0;var te=new Error("Possible EventEmitter memory leak detected. "+J.length+" "+String(y)+" listeners added. Use emitter.setMaxListeners() to increase limit");te.name="MaxListenersExceededWarning",te.emitter=g,te.type=y,te.count=J.length,I(te)}return g}v.prototype.addListener=function(y,R){return U(this,y,R,!1)},v.prototype.on=v.prototype.addListener,v.prototype.prependListener=function(y,R){return U(this,y,R,!0)};function W(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function O(g,y,R){var V={fired:!1,wrapFn:void 0,target:g,type:y,listener:R},H=W.bind(V);return H.listener=R,V.wrapFn=H,H}v.prototype.once=function(y,R){return s(R),this.on(y,O(this,y,R)),this},v.prototype.prependOnceListener=function(y,R){return s(R),this.prependListener(y,O(this,y,R)),this},v.prototype.removeListener=function(y,R){var V,H,z,J,te;if(s(R),H=this._events,H===void 0)return this;if(V=H[y],V===void 0)return this;if(V===R||V.listener===R)--this._eventsCount===0?this._events=Object.create(null):(delete H[y],H.removeListener&&this.emit("removeListener",y,V.listener||R));else if(typeof V!="function"){for(z=-1,J=V.length-1;J>=0;J--)if(V[J]===R||V[J].listener===R){te=V[J].listener,z=J;break}if(z<0)return this;z===0?V.shift():j(V,z),V.length===1&&(H[y]=V[0]),H.removeListener!==void 0&&this.emit("removeListener",y,te||R)}return this},v.prototype.off=v.prototype.removeListener,v.prototype.removeAllListeners=function(y){var R,V,H;if(V=this._events,V===void 0)return this;if(V.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):V[y]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete V[y]),this;if(arguments.length===0){var z=Object.keys(V),J;for(H=0;H=0;H--)this.removeListener(y,R[H]);return this};function N(g,y,R){var V=g._events;if(V===void 0)return[];var H=V[y];return H===void 0?[]:typeof H=="function"?R?[H.listener||H]:[H]:R?P(H):L(H,H.length)}v.prototype.listeners=function(y){return N(this,y,!0)},v.prototype.rawListeners=function(y){return N(this,y,!1)},v.listenerCount=function(g,y){return typeof g.listenerCount=="function"?g.listenerCount(y):M.call(g,y)},v.prototype.listenerCount=M;function M(g){var y=this._events;if(y!==void 0){var R=y[g];if(typeof R=="function")return 1;if(R!==void 0)return R.length}return 0}v.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function L(g,y){for(var R=new Array(y),V=0;V0)throw new Error("Invalid string. Length must be a multiple of 4");var j=M.indexOf("=");j===-1&&(j=L);var P=j===L?0:4-j%4;return[j,P]}function s(M){var L=b(M),j=L[0],P=L[1];return(j+P)*3/4-P}function E(M,L,j){return(L+j)*3/4-j}function U(M){var L,j=b(M),P=j[0],p=j[1],_=new A(E(M,P,p)),C=0,g=p>0?P-4:P,y;for(y=0;y>16&255,_[C++]=L>>8&255,_[C++]=L&255;return p===2&&(L=x[M.charCodeAt(y)]<<2|x[M.charCodeAt(y+1)]>>4,_[C++]=L&255),p===1&&(L=x[M.charCodeAt(y)]<<10|x[M.charCodeAt(y+1)]<<4|x[M.charCodeAt(y+2)]>>2,_[C++]=L>>8&255,_[C++]=L&255),_}function W(M){return F[M>>18&63]+F[M>>12&63]+F[M>>6&63]+F[M&63]}function O(M,L,j){for(var P,p=[],_=L;_g?g:C+_));return P===1?(L=M[j-1],p.push(F[L>>2]+F[L<<4&63]+"==")):P===2&&(L=(M[j-2]<<8)+M[j-1],p.push(F[L>>10]+F[L>>4&63]+F[L<<2&63]+"=")),p.join("")}return ve}var we={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */var Je;function Ft(){return Je||(Je=1,we.read=function(F,x,A,I,D){var v,b,s=D*8-I-1,E=(1<>1,W=-7,O=A?D-1:0,N=A?-1:1,M=F[x+O];for(O+=N,v=M&(1<<-W)-1,M>>=-W,W+=s;W>0;v=v*256+F[x+O],O+=N,W-=8);for(b=v&(1<<-W)-1,v>>=-W,W+=I;W>0;b=b*256+F[x+O],O+=N,W-=8);if(v===0)v=1-U;else{if(v===E)return b?NaN:(M?-1:1)*(1/0);b=b+Math.pow(2,I),v=v-U}return(M?-1:1)*b*Math.pow(2,v-I)},we.write=function(F,x,A,I,D,v){var b,s,E,U=v*8-D-1,W=(1<>1,N=D===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=I?0:v-1,L=I?1:-1,j=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(s=isNaN(x)?1:0,b=W):(b=Math.floor(Math.log(x)/Math.LN2),x*(E=Math.pow(2,-b))<1&&(b--,E*=2),b+O>=1?x+=N/E:x+=N*Math.pow(2,1-O),x*E>=2&&(b++,E/=2),b+O>=W?(s=0,b=W):b+O>=1?(s=(x*E-1)*Math.pow(2,D),b=b+O):(s=x*Math.pow(2,O-1)*Math.pow(2,D),b=0));D>=8;F[A+M]=s&255,M+=L,s/=256,D-=8);for(b=b<0;F[A+M]=b&255,M+=L,b/=256,U-=8);F[A+M-L]|=j*128}),we}/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */var $e;function Ee(){return $e||($e=1,function(F){var x=Dt(),A=Ft(),I=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;F.Buffer=s,F.SlowBuffer=_,F.INSPECT_MAX_BYTES=50;var D=2147483647;F.kMaxLength=D,s.TYPED_ARRAY_SUPPORT=v(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function v(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function b(r){if(r>D)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,s.prototype),e}function s(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return O(r)}return E(r,e,t)}s.poolSize=8192;function E(r,e,t){if(typeof r=="string")return N(r,e);if(ArrayBuffer.isView(r))return L(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(T(r,ArrayBuffer)||r&&T(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(T(r,SharedArrayBuffer)||r&&T(r.buffer,SharedArrayBuffer)))return j(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var f=r.valueOf&&r.valueOf();if(f!=null&&f!==r)return s.from(f,e,t);var m=P(r);if(m)return m;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return s.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}s.from=function(r,e,t){return E(r,e,t)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function U(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function W(r,e,t){return U(r),r<=0?b(r):e!==void 0?typeof t=="string"?b(r).fill(e,t):b(r).fill(e):b(r)}s.alloc=function(r,e,t){return W(r,e,t)};function O(r){return U(r),b(r<0?0:p(r)|0)}s.allocUnsafe=function(r){return O(r)},s.allocUnsafeSlow=function(r){return O(r)};function N(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=C(r,e)|0,f=b(t),m=f.write(r,e);return m!==t&&(f=f.slice(0,m)),f}function M(r){for(var e=r.length<0?0:p(r.length)|0,t=b(e),f=0;f=D)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D.toString(16)+" bytes");return r|0}function _(r){return+r!=r&&(r=0),s.alloc(+r)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(T(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),T(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var f=e.length,m=t.length,k=0,q=Math.min(f,m);km.length?s.from(q).copy(m,k):Uint8Array.prototype.set.call(m,q,k);else if(s.isBuffer(q))q.copy(m,k);else throw new TypeError('"list" argument must be an Array of Buffers');k+=q.length}return m};function C(r,e){if(s.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||T(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,f=arguments.length>2&&arguments[2]===!0;if(!f&&t===0)return 0;for(var m=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return S(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return i(r).length;default:if(m)return f?-1:S(r).length;e=(""+e).toLowerCase(),m=!0}}s.byteLength=C;function g(r,e,t){var f=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return l(this,e,t);case"utf8":case"utf-8":return ae(this,e,t);case"ascii":return oe(this,e,t);case"latin1":case"binary":return fe(this,e,t);case"base64":return ie(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n(this,e,t);default:if(f)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),f=!0}}s.prototype._isBuffer=!0;function y(r,e,t){var f=r[e];r[e]=r[t],r[t]=f}s.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tt&&(e+=" ... "),""},I&&(s.prototype[I]=s.prototype.inspect),s.prototype.compare=function(e,t,f,m,k){if(T(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),f===void 0&&(f=e?e.length:0),m===void 0&&(m=0),k===void 0&&(k=this.length),t<0||f>e.length||m<0||k>this.length)throw new RangeError("out of range index");if(m>=k&&t>=f)return 0;if(m>=k)return-1;if(t>=f)return 1;if(t>>>=0,f>>>=0,m>>>=0,k>>>=0,this===e)return 0;for(var q=k-m,$=f-t,X=Math.min(q,$),ee=this.slice(m,k),re=e.slice(t,f),Q=0;Q2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Y(t)&&(t=m?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(m)return-1;t=r.length-1}else if(t<0)if(m)t=0;else return-1;if(typeof e=="string"&&(e=s.from(e,f)),s.isBuffer(e))return e.length===0?-1:V(r,e,t,f,m);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?m?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):V(r,[e],t,f,m);throw new TypeError("val must be string, number or Buffer")}function V(r,e,t,f,m){var k=1,q=r.length,$=e.length;if(f!==void 0&&(f=String(f).toLowerCase(),f==="ucs2"||f==="ucs-2"||f==="utf16le"||f==="utf-16le")){if(r.length<2||e.length<2)return-1;k=2,q/=2,$/=2,t/=2}function X(He,Ge){return k===1?He[Ge]:He.readUInt16BE(Ge*k)}var ee;if(m){var re=-1;for(ee=t;eeq&&(t=q-$),ee=t;ee>=0;ee--){for(var Q=!0,se=0;se<$;se++)if(X(r,ee+se)!==X(e,se)){Q=!1;break}if(Q)return ee}return-1}s.prototype.includes=function(e,t,f){return this.indexOf(e,t,f)!==-1},s.prototype.indexOf=function(e,t,f){return R(this,e,t,f,!0)},s.prototype.lastIndexOf=function(e,t,f){return R(this,e,t,f,!1)};function H(r,e,t,f){t=Number(t)||0;var m=r.length-t;f?(f=Number(f),f>m&&(f=m)):f=m;var k=e.length;f>k/2&&(f=k/2);for(var q=0;q>>0,isFinite(f)?(f=f>>>0,m===void 0&&(m="utf8")):(m=f,f=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var k=this.length-t;if((f===void 0||f>k)&&(f=k),e.length>0&&(f<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");m||(m="utf8");for(var q=!1;;)switch(m){case"hex":return H(this,e,t,f);case"utf8":case"utf-8":return z(this,e,t,f);case"ascii":case"latin1":case"binary":return J(this,e,t,f);case"base64":return te(this,e,t,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,e,t,f);default:if(q)throw new TypeError("Unknown encoding: "+m);m=(""+m).toLowerCase(),q=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ie(r,e,t){return e===0&&t===r.length?x.fromByteArray(r):x.fromByteArray(r.slice(e,t))}function ae(r,e,t){t=Math.min(r.length,t);for(var f=[],m=e;m239?4:k>223?3:k>191?2:1;if(m+$<=t){var X,ee,re,Q;switch($){case 1:k<128&&(q=k);break;case 2:X=r[m+1],(X&192)===128&&(Q=(k&31)<<6|X&63,Q>127&&(q=Q));break;case 3:X=r[m+1],ee=r[m+2],(X&192)===128&&(ee&192)===128&&(Q=(k&15)<<12|(X&63)<<6|ee&63,Q>2047&&(Q<55296||Q>57343)&&(q=Q));break;case 4:X=r[m+1],ee=r[m+2],re=r[m+3],(X&192)===128&&(ee&192)===128&&(re&192)===128&&(Q=(k&15)<<18|(X&63)<<12|(ee&63)<<6|re&63,Q>65535&&Q<1114112&&(q=Q))}}q===null?(q=65533,$=1):q>65535&&(q-=65536,f.push(q>>>10&1023|55296),q=56320|q&1023),f.push(q),m+=$}return le(f)}var ue=4096;function le(r){var e=r.length;if(e<=ue)return String.fromCharCode.apply(String,r);for(var t="",f=0;ff)&&(t=f);for(var m="",k=e;kf&&(e=f),t<0?(t+=f,t<0&&(t=0)):t>f&&(t=f),tt)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,f){e=e>>>0,t=t>>>0,f||h(e,t,this.length);for(var m=this[e],k=1,q=0;++q>>0,t=t>>>0,f||h(e,t,this.length);for(var m=this[e+--t],k=1;t>0&&(k*=256);)m+=this[e+--t]*k;return m},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e=e>>>0,t||h(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||h(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||h(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||h(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||h(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,f){e=e>>>0,t=t>>>0,f||h(e,t,this.length);for(var m=this[e],k=1,q=0;++q=k&&(m-=Math.pow(2,8*t)),m},s.prototype.readIntBE=function(e,t,f){e=e>>>0,t=t>>>0,f||h(e,t,this.length);for(var m=t,k=1,q=this[e+--m];m>0&&(k*=256);)q+=this[e+--m]*k;return k*=128,q>=k&&(q-=Math.pow(2,8*t)),q},s.prototype.readInt8=function(e,t){return e=e>>>0,t||h(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e=e>>>0,t||h(e,2,this.length);var f=this[e]|this[e+1]<<8;return f&32768?f|4294901760:f},s.prototype.readInt16BE=function(e,t){e=e>>>0,t||h(e,2,this.length);var f=this[e+1]|this[e]<<8;return f&32768?f|4294901760:f},s.prototype.readInt32LE=function(e,t){return e=e>>>0,t||h(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e=e>>>0,t||h(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e=e>>>0,t||h(e,4,this.length),A.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e=e>>>0,t||h(e,4,this.length),A.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||h(e,8,this.length),A.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||h(e,8,this.length),A.read(this,e,!1,52,8)};function u(r,e,t,f,m,k){if(!s.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>m||er.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,f,m){if(e=+e,t=t>>>0,f=f>>>0,!m){var k=Math.pow(2,8*f)-1;u(this,e,t,f,k,0)}var q=1,$=0;for(this[t]=e&255;++$>>0,f=f>>>0,!m){var k=Math.pow(2,8*f)-1;u(this,e,t,f,k,0)}var q=f-1,$=1;for(this[t+q]=e&255;--q>=0&&($*=256);)this[t+q]=e/$&255;return t+f},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeIntLE=function(e,t,f,m){if(e=+e,t=t>>>0,!m){var k=Math.pow(2,8*f-1);u(this,e,t,f,k-1,-k)}var q=0,$=1,X=0;for(this[t]=e&255;++q>0)-X&255;return t+f},s.prototype.writeIntBE=function(e,t,f,m){if(e=+e,t=t>>>0,!m){var k=Math.pow(2,8*f-1);u(this,e,t,f,k-1,-k)}var q=f-1,$=1,X=0;for(this[t+q]=e&255;--q>=0&&($*=256);)e<0&&X===0&&this[t+q+1]!==0&&(X=1),this[t+q]=(e/$>>0)-X&255;return t+f},s.prototype.writeInt8=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,f){return e=+e,t=t>>>0,f||u(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function d(r,e,t,f,m,k){if(t+f>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function w(r,e,t,f,m){return e=+e,t=t>>>0,m||d(r,e,t,4),A.write(r,e,t,f,23,4),t+4}s.prototype.writeFloatLE=function(e,t,f){return w(this,e,t,!0,f)},s.prototype.writeFloatBE=function(e,t,f){return w(this,e,t,!1,f)};function B(r,e,t,f,m){return e=+e,t=t>>>0,m||d(r,e,t,8),A.write(r,e,t,f,52,8),t+8}s.prototype.writeDoubleLE=function(e,t,f){return B(this,e,t,!0,f)},s.prototype.writeDoubleBE=function(e,t,f){return B(this,e,t,!1,f)},s.prototype.copy=function(e,t,f,m){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(f||(f=0),!m&&m!==0&&(m=this.length),t>=e.length&&(t=e.length),t||(t=0),m>0&&m=this.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("sourceEnd out of bounds");m>this.length&&(m=this.length),e.length-t>>0,f=f===void 0?this.length:f>>>0,e||(e=0);var q;if(typeof e=="number")for(q=t;q55295&&t<57344){if(!m){if(t>56319){(e-=3)>-1&&k.push(239,191,189);continue}else if(q+1===f){(e-=3)>-1&&k.push(239,191,189);continue}m=t;continue}if(t<56320){(e-=3)>-1&&k.push(239,191,189),m=t;continue}t=(m-55296<<10|t-56320)+65536}else m&&(e-=3)>-1&&k.push(239,191,189);if(m=null,t<128){if((e-=1)<0)break;k.push(t)}else if(t<2048){if((e-=2)<0)break;k.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;k.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;k.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return k}function G(r){for(var e=[],t=0;t>8,m=t%256,k.push(m),k.push(f);return k}function i(r){return x.toByteArray(a(r))}function o(r,e,t,f){for(var m=0;m=e.length||m>=r.length);++m)e[m+t]=r[m];return m}function T(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function Y(r){return r!==r}var Z=function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var f=t*16,m=0;m<16;++m)e[f+m]=r[t]+r[m];return e}()}(xe)),xe}var Re,Ze;function Ot(){if(Ze)return Re;Ze=1;function F(L,j){var P=Object.keys(L);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(L);j&&(p=p.filter(function(_){return Object.getOwnPropertyDescriptor(L,_).enumerable})),P.push.apply(P,p)}return P}function x(L){for(var j=1;j0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(P){var p={data:P,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var P=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,P}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(P){if(this.length===0)return"";for(var p=this.head,_=""+p.data;p=p.next;)_+=P+p.data;return _}},{key:"concat",value:function(P){if(this.length===0)return U.alloc(0);for(var p=U.allocUnsafe(P>>>0),_=this.head,C=0;_;)M(_.data,p,C),C+=_.data.length,_=_.next;return p}},{key:"consume",value:function(P,p){var _;return Pg.length?g.length:P;if(y===g.length?C+=g:C+=g.slice(0,P),P-=y,P===0){y===g.length?(++_,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=g.slice(y));break}++_}return this.length-=_,C}},{key:"_getBuffer",value:function(P){var p=U.allocUnsafe(P),_=this.head,C=1;for(_.data.copy(p),P-=_.data.length;_=_.next;){var g=_.data,y=P>g.length?g.length:P;if(g.copy(p,p.length-P,0,y),P-=y,P===0){y===g.length?(++C,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=g.slice(y));break}++C}return this.length-=C,p}},{key:N,value:function(P,p){return O(this,x(x({},p),{},{depth:0,customInspect:!1}))}}]),L}(),Re}var ke,Xe;function wt(){if(Xe)return ke;Xe=1;function F(b,s){var E=this,U=this._readableState&&this._readableState.destroyed,W=this._writableState&&this._writableState.destroyed;return U||W?(s?s(b):b&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(D,this,b)):process.nextTick(D,this,b)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(b||null,function(O){!s&&O?E._writableState?E._writableState.errorEmitted?process.nextTick(A,E):(E._writableState.errorEmitted=!0,process.nextTick(x,E,O)):process.nextTick(x,E,O):s?(process.nextTick(A,E),s(O)):process.nextTick(A,E)}),this)}function x(b,s){D(b,s),A(b)}function A(b){b._writableState&&!b._writableState.emitClose||b._readableState&&!b._readableState.emitClose||b.emit("close")}function I(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function D(b,s){b.emit("error",s)}function v(b,s){var E=b._readableState,U=b._writableState;E&&E.autoDestroy||U&&U.autoDestroy?b.destroy(s):b.emit("error",s)}return ke={destroy:F,undestroy:I,errorOrDestroy:v},ke}var Ae={},Qe;function ye(){if(Qe)return Ae;Qe=1;function F(s,E){s.prototype=Object.create(E.prototype),s.prototype.constructor=s,s.__proto__=E}var x={};function A(s,E,U){U||(U=Error);function W(N,M,L){return typeof E=="string"?E:E(N,M,L)}var O=function(N){F(M,N);function M(L,j,P){return N.call(this,W(L,j,P))||this}return M}(U);O.prototype.name=U.name,O.prototype.code=s,x[s]=O}function I(s,E){if(Array.isArray(s)){var U=s.length;return s=s.map(function(W){return String(W)}),U>2?"one of ".concat(E," ").concat(s.slice(0,U-1).join(", "),", or ")+s[U-1]:U===2?"one of ".concat(E," ").concat(s[0]," or ").concat(s[1]):"of ".concat(E," ").concat(s[0])}else return"of ".concat(E," ").concat(String(s))}function D(s,E,U){return s.substr(0,E.length)===E}function v(s,E,U){return(U===void 0||U>s.length)&&(U=s.length),s.substring(U-E.length,U)===E}function b(s,E,U){return typeof U!="number"&&(U=0),U+E.length>s.length?!1:s.indexOf(E,U)!==-1}return A("ERR_INVALID_OPT_VALUE",function(s,E){return'The value "'+E+'" is invalid for option "'+s+'"'},TypeError),A("ERR_INVALID_ARG_TYPE",function(s,E,U){var W;typeof E=="string"&&D(E,"not ")?(W="must not be",E=E.replace(/^not /,"")):W="must be";var O;if(v(s," argument"))O="The ".concat(s," ").concat(W," ").concat(I(E,"type"));else{var N=b(s,".")?"property":"argument";O='The "'.concat(s,'" ').concat(N," ").concat(W," ").concat(I(E,"type"))}return O+=". Received type ".concat(typeof U),O},TypeError),A("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),A("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),A("ERR_STREAM_PREMATURE_CLOSE","Premature close"),A("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),A("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),A("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),A("ERR_STREAM_WRITE_AFTER_END","write after end"),A("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),A("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),A("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ae.codes=x,Ae}var Te,et;function bt(){if(et)return Te;et=1;var F=ye().codes.ERR_INVALID_OPT_VALUE;function x(I,D,v){return I.highWaterMark!=null?I.highWaterMark:D?I[v]:null}function A(I,D,v,b){var s=x(D,b,v);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var E=b?v:"highWaterMark";throw new F(E,s)}return Math.floor(s)}return I.objectMode?16:16*1024}return Te={getHighWaterMark:A},Te}var Be,tt;function It(){if(tt)return Be;tt=1,Be=F;function F(A,I){if(x("noDeprecation"))return A;var D=!1;function v(){if(!D){if(x("throwDeprecation"))throw new Error(I);x("traceDeprecation")?console.trace(I):console.warn(I),D=!0}return A.apply(this,arguments)}return v}function x(A){try{if(!he.localStorage)return!1}catch{return!1}var I=he.localStorage[A];return I==null?!1:String(I).toLowerCase()==="true"}return Be}var Le,rt;function Et(){if(rt)return Le;rt=1,Le=H;function F(c){var a=this;this.next=null,this.entry=null,this.finish=function(){B(a,c)}}var x;H.WritableState=R;var A={deprecate:It()},I=mt(),D=Ee().Buffer,v=(typeof he<"u"?he:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function b(c){return D.from(c)}function s(c){return D.isBuffer(c)||c instanceof v}var E=wt(),U=bt(),W=U.getHighWaterMark,O=ye().codes,N=O.ERR_INVALID_ARG_TYPE,M=O.ERR_METHOD_NOT_IMPLEMENTED,L=O.ERR_MULTIPLE_CALLBACK,j=O.ERR_STREAM_CANNOT_PIPE,P=O.ERR_STREAM_DESTROYED,p=O.ERR_STREAM_NULL_VALUES,_=O.ERR_STREAM_WRITE_AFTER_END,C=O.ERR_UNKNOWN_ENCODING,g=E.errorOrDestroy;pe()(H,I);function y(){}function R(c,a,S){x=x||ce(),c=c||{},typeof S!="boolean"&&(S=a instanceof x),this.objectMode=!!c.objectMode,S&&(this.objectMode=this.objectMode||!!c.writableObjectMode),this.highWaterMark=W(this,c,"writableHighWaterMark",S),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var G=c.decodeStrings===!1;this.decodeStrings=!G,this.defaultEncoding=c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){le(a,K)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=c.emitClose!==!1,this.autoDestroy=!!c.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new F(this)}R.prototype.getBuffer=function(){for(var a=this.bufferedRequest,S=[];a;)S.push(a),a=a.next;return S},function(){try{Object.defineProperty(R.prototype,"buffer",{get:A.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var V;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(V=Function.prototype[Symbol.hasInstance],Object.defineProperty(H,Symbol.hasInstance,{value:function(a){return V.call(this,a)?!0:this!==H?!1:a&&a._writableState instanceof R}})):V=function(a){return a instanceof this};function H(c){x=x||ce();var a=this instanceof x;if(!a&&!V.call(H,this))return new H(c);this._writableState=new R(c,this,a),this.writable=!0,c&&(typeof c.write=="function"&&(this._write=c.write),typeof c.writev=="function"&&(this._writev=c.writev),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.final=="function"&&(this._final=c.final)),I.call(this)}H.prototype.pipe=function(){g(this,new j)};function z(c,a){var S=new _;g(c,S),process.nextTick(a,S)}function J(c,a,S,G){var K;return S===null?K=new p:typeof S!="string"&&!a.objectMode&&(K=new N("chunk",["string","Buffer"],S)),K?(g(c,K),process.nextTick(G,K),!1):!0}H.prototype.write=function(c,a,S){var G=this._writableState,K=!1,i=!G.objectMode&&s(c);return i&&!D.isBuffer(c)&&(c=b(c)),typeof a=="function"&&(S=a,a=null),i?a="buffer":a||(a=G.defaultEncoding),typeof S!="function"&&(S=y),G.ending?z(this,S):(i||J(this,G,c,S))&&(G.pendingcb++,K=ne(this,G,i,c,a,S)),K},H.prototype.cork=function(){this._writableState.corked++},H.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,!c.writing&&!c.corked&&!c.bufferProcessing&&c.bufferedRequest&&l(this,c))},H.prototype.setDefaultEncoding=function(a){if(typeof a=="string"&&(a=a.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((a+"").toLowerCase())>-1))throw new C(a);return this._writableState.defaultEncoding=a,this},Object.defineProperty(H.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function te(c,a,S){return!c.objectMode&&c.decodeStrings!==!1&&typeof a=="string"&&(a=D.from(a,S)),a}Object.defineProperty(H.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ne(c,a,S,G,K,i){if(!S){var o=te(a,G,K);G!==o&&(S=!0,K="buffer",G=o)}var T=a.objectMode?1:G.length;a.length+=T;var Y=a.length */var it;function Pt(){return it||(it=1,function(F,x){var A=Ee(),I=A.Buffer;function D(b,s){for(var E in b)s[E]=b[E]}I.from&&I.alloc&&I.allocUnsafe&&I.allocUnsafeSlow?F.exports=A:(D(A,x),x.Buffer=v);function v(b,s,E){return I(b,s,E)}v.prototype=Object.create(I.prototype),D(I,v),v.from=function(b,s,E){if(typeof b=="number")throw new TypeError("Argument must not be a number");return I(b,s,E)},v.alloc=function(b,s,E){if(typeof b!="number")throw new TypeError("Argument must be a number");var U=I(b);return s!==void 0?typeof E=="string"?U.fill(s,E):U.fill(s):U.fill(0),U},v.allocUnsafe=function(b){if(typeof b!="number")throw new TypeError("Argument must be a number");return I(b)},v.allocUnsafeSlow=function(b){if(typeof b!="number")throw new TypeError("Argument must be a number");return A.SlowBuffer(b)}}(be,be.exports)),be.exports}var at;function ot(){if(at)return Ue;at=1;var F=Pt().Buffer,x=F.isEncoding||function(p){switch(p=""+p,p&&p.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function A(p){if(!p)return"utf8";for(var _;;)switch(p){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return p;default:if(_)return;p=(""+p).toLowerCase(),_=!0}}function I(p){var _=A(p);if(typeof _!="string"&&(F.isEncoding===x||!x(p)))throw new Error("Unknown encoding: "+p);return _||p}Ue.StringDecoder=D;function D(p){this.encoding=I(p);var _;switch(this.encoding){case"utf16le":this.text=O,this.end=N,_=4;break;case"utf8":this.fillLast=E,_=4;break;case"base64":this.text=M,this.end=L,_=3;break;default:this.write=j,this.end=P;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=F.allocUnsafe(_)}D.prototype.write=function(p){if(p.length===0)return"";var _,C;if(this.lastNeed){if(_=this.fillLast(p),_===void 0)return"";C=this.lastNeed,this.lastNeed=0}else C=0;return C>5===6?2:p>>4===14?3:p>>3===30?4:p>>6===2?-1:-2}function b(p,_,C){var g=_.length-1;if(g=0?(y>0&&(p.lastNeed=y-1),y):--g=0?(y>0&&(p.lastNeed=y-2),y):--g=0?(y>0&&(y===2?y=0:p.lastNeed=y-3),y):0))}function s(p,_,C){if((_[0]&192)!==128)return p.lastNeed=0,"�";if(p.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return p.lastNeed=1,"�";if(p.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return p.lastNeed=2,"�"}}function E(p){var _=this.lastTotal-this.lastNeed,C=s(this,p);if(C!==void 0)return C;if(this.lastNeed<=p.length)return p.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,_,0,p.length),this.lastNeed-=p.length}function U(p,_){var C=b(this,p,_);if(!this.lastNeed)return p.toString("utf8",_);this.lastTotal=C;var g=p.length-(C-this.lastNeed);return p.copy(this.lastChar,0,g),p.toString("utf8",_,g)}function W(p){var _=p&&p.length?this.write(p):"";return this.lastNeed?_+"�":_}function O(p,_){if((p.length-_)%2===0){var C=p.toString("utf16le",_);if(C){var g=C.charCodeAt(C.length-1);if(g>=55296&&g<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1],C.slice(0,-1)}return C}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=p[p.length-1],p.toString("utf16le",_,p.length-1)}function N(p){var _=p&&p.length?this.write(p):"";if(this.lastNeed){var C=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,C)}return _}function M(p,_){var C=(p.length-_)%3;return C===0?p.toString("base64",_):(this.lastNeed=3-C,this.lastTotal=3,C===1?this.lastChar[0]=p[p.length-1]:(this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1]),p.toString("base64",_,p.length-C))}function L(p){var _=p&&p.length?this.write(p):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function j(p){return p.toString(this.encoding)}function P(p){return p&&p.length?this.write(p):""}return Ue}var Me,st;function We(){if(st)return Me;st=1;var F=ye().codes.ERR_STREAM_PREMATURE_CLOSE;function x(v){var b=!1;return function(){if(!b){b=!0;for(var s=arguments.length,E=new Array(s),U=0;U0)if(typeof o!="string"&&!r.objectMode&&Object.getPrototypeOf(o)!==I.prototype&&(o=v(o)),Y)r.endEmitted?y(i,new p):te(i,r,o,!0);else if(r.ended)y(i,new j);else{if(r.destroyed)return!1;r.reading=!1,r.decoder&&!T?(o=r.decoder.write(o),r.objectMode||o.length!==0?te(i,r,o,!1):l(i,r)):te(i,r,o,!1)}else Y||(r.reading=!1,l(i,r))}return!r.ended&&(r.length=ie?i=ie:(i--,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i++),i}function ue(i,o){return i<=0||o.length===0&&o.ended?0:o.objectMode?1:i!==i?o.flowing&&o.length?o.buffer.head.data.length:o.length:(i>o.highWaterMark&&(o.highWaterMark=ae(i)),i<=o.length?i:o.ended?o.length:(o.needReadable=!0,0))}z.prototype.read=function(i){E("read",i),i=parseInt(i,10);var o=this._readableState,T=i;if(i!==0&&(o.emittedReadable=!1),i===0&&o.needReadable&&((o.highWaterMark!==0?o.length>=o.highWaterMark:o.length>0)||o.ended))return E("read: emitReadable",o.length,o.ended),o.length===0&&o.ended?S(this):oe(this),null;if(i=ue(i,o),i===0&&o.ended)return o.length===0&&S(this),null;var Y=o.needReadable;E("need readable",Y),(o.length===0||o.length-i0?Z=a(i,o):Z=null,Z===null?(o.needReadable=o.length<=o.highWaterMark,i=0):(o.length-=i,o.awaitDrain=0),o.length===0&&(o.ended||(o.needReadable=!0),T!==i&&o.ended&&S(this)),Z!==null&&this.emit("data",Z),Z};function le(i,o){if(E("onEofChunk"),!o.ended){if(o.decoder){var T=o.decoder.end();T&&T.length&&(o.buffer.push(T),o.length+=o.objectMode?1:T.length)}o.ended=!0,o.sync?oe(i):(o.needReadable=!1,o.emittedReadable||(o.emittedReadable=!0,fe(i)))}}function oe(i){var o=i._readableState;E("emitReadable",o.needReadable,o.emittedReadable),o.needReadable=!1,o.emittedReadable||(E("emitReadable",o.flowing),o.emittedReadable=!0,process.nextTick(fe,i))}function fe(i){var o=i._readableState;E("emitReadable_",o.destroyed,o.length,o.ended),!o.destroyed&&(o.length||o.ended)&&(i.emit("readable"),o.emittedReadable=!1),o.needReadable=!o.flowing&&!o.ended&&o.length<=o.highWaterMark,c(i)}function l(i,o){o.readingMore||(o.readingMore=!0,process.nextTick(n,i,o))}function n(i,o){for(;!o.reading&&!o.ended&&(o.length1&&K(Y.pipes,i)!==-1)&&!m&&(E("false write response, pause",Y.awaitDrain),Y.awaitDrain++),T.pause())}function $(Q){E("onerror",Q),re(),i.removeListener("error",$),x(i,"error")===0&&y(i,Q)}V(i,"error",$);function X(){i.removeListener("finish",ee),re()}i.once("close",X);function ee(){E("onfinish"),i.removeListener("close",X),re()}i.once("finish",ee);function re(){E("unpipe"),T.unpipe(i)}return i.emit("pipe",T),Y.flowing||(E("pipe resume"),T.resume()),i};function h(i){return function(){var T=i._readableState;E("pipeOnDrain",T.awaitDrain),T.awaitDrain&&T.awaitDrain--,T.awaitDrain===0&&x(i,"data")&&(T.flowing=!0,c(i))}}z.prototype.unpipe=function(i){var o=this._readableState,T={hasUnpiped:!1};if(o.pipesCount===0)return this;if(o.pipesCount===1)return i&&i!==o.pipes?this:(i||(i=o.pipes),o.pipes=null,o.pipesCount=0,o.flowing=!1,i&&i.emit("unpipe",this,T),this);if(!i){var Y=o.pipes,Z=o.pipesCount;o.pipes=null,o.pipesCount=0,o.flowing=!1;for(var r=0;r0,Y.flowing!==!1&&this.resume()):i==="readable"&&!Y.endEmitted&&!Y.readableListening&&(Y.readableListening=Y.needReadable=!0,Y.flowing=!1,Y.emittedReadable=!1,E("on readable",Y.length,Y.reading),Y.length?oe(this):Y.reading||process.nextTick(d,this)),T},z.prototype.addListener=z.prototype.on,z.prototype.removeListener=function(i,o){var T=A.prototype.removeListener.call(this,i,o);return i==="readable"&&process.nextTick(u,this),T},z.prototype.removeAllListeners=function(i){var o=A.prototype.removeAllListeners.apply(this,arguments);return(i==="readable"||i===void 0)&&process.nextTick(u,this),o};function u(i){var o=i._readableState;o.readableListening=i.listenerCount("readable")>0,o.resumeScheduled&&!o.paused?o.flowing=!0:i.listenerCount("data")>0&&i.resume()}function d(i){E("readable nexttick read 0"),i.read(0)}z.prototype.resume=function(){var i=this._readableState;return i.flowing||(E("resume"),i.flowing=!i.readableListening,w(this,i)),i.paused=!1,this};function w(i,o){o.resumeScheduled||(o.resumeScheduled=!0,process.nextTick(B,i,o))}function B(i,o){E("resume",o.reading),o.reading||i.read(0),o.resumeScheduled=!1,i.emit("resume"),c(i),o.flowing&&!o.reading&&i.read(0)}z.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function c(i){var o=i._readableState;for(E("flow",o.flowing);o.flowing&&i.read()!==null;);}z.prototype.wrap=function(i){var o=this,T=this._readableState,Y=!1;i.on("end",function(){if(E("wrapped end"),T.decoder&&!T.ended){var e=T.decoder.end();e&&e.length&&o.push(e)}o.push(null)}),i.on("data",function(e){if(E("wrapped data"),T.decoder&&(e=T.decoder.write(e)),!(T.objectMode&&e==null)&&!(!T.objectMode&&(!e||!e.length))){var t=o.push(e);t||(Y=!0,i.pause())}});for(var Z in i)this[Z]===void 0&&typeof i[Z]=="function"&&(this[Z]=function(t){return function(){return i[t].apply(i,arguments)}}(Z));for(var r=0;r=o.length?(o.decoder?T=o.buffer.join(""):o.buffer.length===1?T=o.buffer.first():T=o.buffer.concat(o.length),o.buffer.clear()):T=o.buffer.consume(i,o.decoder),T}function S(i){var o=i._readableState;E("endReadable",o.endEmitted),o.endEmitted||(o.ended=!0,process.nextTick(G,o,i))}function G(i,o){if(E("endReadableNT",i.endEmitted,i.length),!i.endEmitted&&i.length===0&&(i.endEmitted=!0,o.readable=!1,o.emit("end"),i.autoDestroy)){var T=o._writableState;(!T||T.autoDestroy&&T.finished)&&o.destroy()}}typeof Symbol=="function"&&(z.from=function(i,o){return g===void 0&&(g=jt()),g(z,i,o)});function K(i,o){for(var T=0,Y=i.length;T0;return s(_,g,y,function(R){P||(P=R),R&&p.forEach(E),!g&&(p.forEach(E),j(P))})});return M.reduce(U)}return Ne=O,Ne}var je,pt;function Ht(){if(pt)return je;pt=1,je=A;var F=qe().EventEmitter,x=pe();x(A,F),A.Readable=_t(),A.Writable=Et(),A.Duplex=ce(),A.Transform=St(),A.PassThrough=qt(),A.finished=We(),A.pipeline=Wt(),A.Stream=A;function A(){F.call(this)}return A.prototype.pipe=function(I,D){var v=this;function b(M){I.writable&&I.write(M)===!1&&v.pause&&v.pause()}v.on("data",b);function s(){v.readable&&v.resume&&v.resume()}I.on("drain",s),!I._isStdio&&(!D||D.end!==!1)&&(v.on("end",U),v.on("close",W));var E=!1;function U(){E||(E=!0,I.end())}function W(){E||(E=!0,typeof I.destroy=="function"&&I.destroy())}function O(M){if(N(),F.listenerCount(this,"error")===0)throw M}v.on("error",O),I.on("error",O);function N(){v.removeListener("data",b),I.removeListener("drain",s),v.removeListener("end",U),v.removeListener("close",W),v.removeListener("error",O),I.removeListener("error",O),v.removeListener("end",N),v.removeListener("close",N),I.removeListener("close",N)}return v.on("end",N),v.on("close",N),I.on("close",N),I.emit("pipe",v),I},je}(function(F,x){(function(A,I){F.exports=I(Ht())})(he,function(A){function I(l){return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},I(l)}function D(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function v(l,n){for(var h=0;h"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var h,u=U(l);if(n){var d=U(this).constructor;h=Reflect.construct(u,arguments,d)}else h=u.apply(this,arguments);return N(this,h)}}function L(l,n){return function(h){if(Array.isArray(h))return h}(l)||function(h,u){var d=h==null?null:typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(d!=null){var w,B,c=[],a=!0,S=!1;try{for(d=d.call(h);!(a=(w=d.next()).done)&&(c.push(w.value),!u||c.length!==u);a=!0);}catch(G){S=!0,B=G}finally{try{a||d.return==null||d.return()}finally{if(S)throw B}}return c}}(l,n)||j(l,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(l,n){if(l){if(typeof l=="string")return P(l,n);var h=Object.prototype.toString.call(l).slice(8,-1);return h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set"?Array.from(l):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?P(l,n):void 0}}function P(l,n){(n==null||n>l.length)&&(n=l.length);for(var h=0,u=new Array(n);h=l.length?{done:!0}:{done:!1,value:l[u++]}},e:function(a){throw a},f:d}}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 w,B=!0,c=!1;return{s:function(){h=h.call(l)},n:function(){var a=h.next();return B=a.done,a},e:function(a){c=!0,w=a},f:function(){try{B||h.return==null||h.return()}finally{if(c)throw w}}}}var _,C;function g(l){if(_){for(var n=arguments.length,h=new Array(n>1?n-1:0),u=1;u1?n-1:0),u=1;u>5,this.ntype=31&this.payload[0],this.isvcl=this.ntype==1||this.ntype==5,this.stype="",this.isfmb=!1}return b(l,[{key:"toString",value:function(){return"".concat(l.type(this),": NRI: ").concat(this.getNri())}},{key:"getNri",value:function(){return this.nri}},{key:"type",value:function(){return this.ntype}},{key:"isKeyframe",value:function(){return this.ntype===l.IDR}},{key:"getPayload",value:function(){return this.payload}},{key:"getPayloadSize",value:function(){return this.payload.byteLength}},{key:"getSize",value:function(){return 4+this.getPayloadSize()}},{key:"getData",value:function(){var n=new Uint8Array(this.getSize());return new DataView(n.buffer).setUint32(0,this.getSize()-4),n.set(this.getPayload(),4),n}}],[{key:"NDR",get:function(){return 1}},{key:"IDR",get:function(){return 5}},{key:"SEI",get:function(){return 6}},{key:"SPS",get:function(){return 7}},{key:"PPS",get:function(){return 8}},{key:"AUD",get:function(){return 9}},{key:"TYPES",get:function(){var n;return s(n={},l.IDR,"IDR"),s(n,l.SEI,"SEI"),s(n,l.SPS,"SPS"),s(n,l.PPS,"PPS"),s(n,l.NDR,"NDR"),s(n,l.AUD,"AUD"),n}},{key:"type",value:function(n){return n.ntype in l.TYPES?l.TYPES[n.ntype]:"UNKNOWN"}}]),l}();function V(l,n){var h=new Uint8Array((0|l.byteLength)+(0|n.byteLength));return h.set(l,0),h.set(n,0|l.byteLength),h}var H=function(){function l(n){D(this,l),this.data=n,this.index=0,this.bitLength=8*n.byteLength}return b(l,[{key:"setData",value:function(n){this.data=n,this.index=0,this.bitLength=8*n.byteLength}},{key:"bitsAvailable",get:function(){return this.bitLength-this.index}},{key:"skipBits",value:function(n){if(this.bitsAvailable1&&arguments[1]!==void 0)||arguments[1],u=this.getBits(n,this.index,h);return u}},{key:"getBits",value:function(n,h){var u=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(this.bitsAvailable>>d,B=8-d;if(B>=n)return u&&(this.index+=n),w>>B-n;u&&(this.index+=B);var c=n-B;return w<>>1:-1*(n>>>1)}},{key:"readBoolean",value:function(){return this.readBits(1)===1}},{key:"readUByte",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;return this.readBits(8*n)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}}]),l}(),z=function(){function l(n){D(this,l),this.remuxer=n,this.track=n.mp4track}return b(l,[{key:"parseSPS",value:function(n){var h=l.readSPS(new Uint8Array(n));this.track.fps=h.fps,this.track.width=h.width,this.track.height=h.height,this.track.sps=[new Uint8Array(n)],this.track.codec="avc1.";for(var u=new DataView(n.buffer,n.byteOffset+1,4),d=0;d<3;++d){var w=u.getUint8(d).toString(16);w.length<2&&(w="0"+w),this.track.codec+=w}}},{key:"parsePPS",value:function(n){this.track.pps=[new Uint8Array(n)]}},{key:"parseNAL",value:function(n){if(!n)return!1;var h=!1;switch(n.type()){case R.IDR:case R.NDR:h=!0;break;case R.PPS:this.track.pps||(this.parsePPS(n.getPayload()),!this.remuxer.readyToDecode&&this.track.pps&&this.track.sps&&(this.remuxer.readyToDecode=!0)),h=!0;break;case R.SPS:this.track.sps||(this.parseSPS(n.getPayload()),!this.remuxer.readyToDecode&&this.track.pps&&this.track.sps&&(this.remuxer.readyToDecode=!0)),h=!0;break;case R.AUD:g("AUD - ignoing");break;case R.SEI:g("SEI - ignoing")}return h}}],[{key:"extractNALu",value:function(n){for(var h,u,d=0,w=n.byteLength,B=0,c=[],a=0;d0&&k[1]>0&&(o=k[0]/k[1])}if(a.readBoolean()&&a.skipBits(1),a.readBoolean()&&(a.skipBits(4),a.readBoolean()&&a.skipBits(24)),a.readBoolean()&&(a.skipUEG(),a.skipUEG()),a.readBoolean()){var q=a.readUInt(),$=a.readUInt();a.readBoolean()&&(T=$/(2*q))}}return{fps:T>0?T:void 0,width:Math.ceil((16*(d+1)-2*S-2*G)*o),height:(2-B)*(w+1)*16-(B?2:4)*(K+i)}}},{key:"parseHeader",value:function(n){var h=new H(n.getPayload());h.readUByte(),n.isfmb=h.readUEG()===0,n.stype=h.readUEG()}}]),l}(),J=function(){function l(n){D(this,l),this.remuxer=n,this.track=n.mp4track}return b(l,[{key:"extractAAC",value:function(n){var h,u,d=0,w=n.byteLength,B=[];if(!l.isAACPattern(n))return y("Invalid ADTS audio format"),B;for(h=l.getHeaderLength(n),this.aacHeader||(this.aacHeader=n.subarray(0,h));d>>6),h=(60&w[2])>>>2,u=(1&w[2])<<2,u|=(192&w[3])>>>6,d[0]=n<<3,d[0]|=(14&h)>>1,d[1]|=(1&h)<<7,d[1]|=u<<3,this.track.codec="mp4a.40."+n,this.track.channelCount=u,this.track.config=d,this.remuxer.readyToDecode=!0)}}],[{key:"samplingRateMap",get:function(){return[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]}},{key:"getHeaderLength",value:function(n){return 1&n[1]?7:9}},{key:"getFrameLength",value:function(n){return(3&n[3])<<11|n[4]<<3|(224&n[5])>>>5}},{key:"isAACPattern",value:function(n){return n[0]===255&&(240&n[1])==240&&(6&n[1])==0}}]),l}(),te=function(){function l(n){D(this,l),this.listener={},this.type=""|n}return b(l,[{key:"on",value:function(n,h){return this.listener[n]||(this.listener[n]=[]),this.listener[n].push(h),!0}},{key:"off",value:function(n,h){if(this.listener[n]){var u=this.listener[n].indexOf(h);return u>-1&&this.listener[n].splice(u,1),!0}return!1}},{key:"offAll",value:function(){this.listener={}}},{key:"dispatch",value:function(n,h){return!!this.listener[n]&&(this.listener[n].map(function(u){u.apply(null,[h])}),!0)}}]),l}(),ne=function(){function l(){D(this,l)}return b(l,null,[{key:"init",value:function(){var n;for(n in l.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},l.types)l.types.hasOwnProperty(n)&&(l.types[n]=[n.charCodeAt(0),n.charCodeAt(1),n.charCodeAt(2),n.charCodeAt(3)]);var h=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),u=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);l.HDLR_TYPES={video:h,audio:u};var d=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),w=new Uint8Array([0,0,0,0,0,0,0,0]);l.STTS=l.STSC=l.STCO=w,l.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),l.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),l.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),l.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var B=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);l.FTYP=l.box(l.types.ftyp,B,a,B,c),l.DINF=l.box(l.types.dinf,l.box(l.types.dref,d))}},{key:"box",value:function(n){for(var h=arguments.length,u=new Array(h>1?h-1:0),d=1;d>24&255,w[1]=B>>16&255,w[2]=B>>8&255,w[3]=255&B,w.set(n,4),c=0,B=8;c>24&255,n>>16&255,n>>8&255,255&n,h>>24,h>>16&255,h>>8&255,255&h,85,196,0,0]))}},{key:"mdia",value:function(n){return l.box(l.types.mdia,l.mdhd(n.timescale,n.duration),l.hdlr(n.type),l.minf(n))}},{key:"mfhd",value:function(n){return l.box(l.types.mfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n]))}},{key:"minf",value:function(n){return n.type==="audio"?l.box(l.types.minf,l.box(l.types.smhd,l.SMHD),l.DINF,l.stbl(n)):l.box(l.types.minf,l.box(l.types.vmhd,l.VMHD),l.DINF,l.stbl(n))}},{key:"moof",value:function(n,h,u){return l.box(l.types.moof,l.mfhd(n),l.traf(u,h))}},{key:"moov",value:function(n,h,u){for(var d=n.length,w=[];d--;)w[d]=l.trak(n[d]);return l.box.apply(null,[l.types.moov,l.mvhd(u,h)].concat(w).concat(l.mvex(n)))}},{key:"mvex",value:function(n){for(var h=n.length,u=[];h--;)u[h]=l.trex(n[h]);return l.box.apply(null,[l.types.mvex].concat(u))}},{key:"mvhd",value:function(n,h){var u=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,n>>24&255,n>>16&255,n>>8&255,255&n,h>>24&255,h>>16&255,h>>8&255,255&h,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return l.box(l.types.mvhd,u)}},{key:"sdtp",value:function(n){var h,u,d=n.samples||[],w=new Uint8Array(4+d.length);for(u=0;u>>8&255),w.push(255&d),w=w.concat(Array.prototype.slice.call(u));for(h=0;h>>8&255),B.push(255&d),B=B.concat(Array.prototype.slice.call(u));var c=l.box(l.types.avcC,new Uint8Array([1,w[3],w[4],w[5],255,224|n.sps.length].concat(w).concat([n.pps.length]).concat(B))),a=n.width,S=n.height;return l.box(l.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,a>>8&255,255&a,S>>8&255,255&S,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,98,105,110,101,108,112,114,111,46,114,117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c,l.box(l.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))}},{key:"esds",value:function(n){var h=n.config.byteLength,u=new Uint8Array(26+h+3);return u.set([0,0,0,0,3,23+h,0,1,0,4,15+h,64,21,0,0,0,0,0,0,0,0,0,0,0,5,h]),u.set(n.config,26),u.set([6,1,2],26+h),u}},{key:"mp4a",value:function(n){var h=n.audiosamplerate;return l.box(l.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n.channelCount,0,16,0,0,0,0,h>>8&255,255&h,0,0]),l.box(l.types.esds,l.esds(n)))}},{key:"stsd",value:function(n){return n.type==="audio"?l.box(l.types.stsd,l.STSD,l.mp4a(n)):l.box(l.types.stsd,l.STSD,l.avc1(n))}},{key:"tkhd",value:function(n){var h=n.id,u=n.duration,d=n.width,w=n.height,B=n.volume;return l.box(l.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,h>>24&255,h>>16&255,h>>8&255,255&h,0,0,0,0,u>>24,u>>16&255,u>>8&255,255&u,0,0,0,0,0,0,0,0,0,0,0,0,B>>0&255,B%1*10>>0&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,d>>8&255,255&d,0,0,w>>8&255,255&w,0,0]))}},{key:"traf",value:function(n,h){var u=l.sdtp(n),d=n.id;return l.box(l.types.traf,l.box(l.types.tfhd,new Uint8Array([0,0,0,0,d>>24,d>>16&255,d>>8&255,255&d])),l.box(l.types.tfdt,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,255&h])),l.trun(n,u.length+16+16+8+16+8+8),u)}},{key:"trak",value:function(n){return n.duration=n.duration||4294967295,l.box(l.types.trak,l.tkhd(n),l.mdia(n))}},{key:"trex",value:function(n){var h=n.id;return l.box(l.types.trex,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,255&h,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(n,h){var u,d,w,B,c,a,S=n.samples||[],G=S.length,K=12+16*G,i=new Uint8Array(K);for(h+=8+K,i.set([0,0,15,1,G>>>24&255,G>>>16&255,G>>>8&255,255&G,h>>>24&255,h>>>16&255,h>>>8&255,255&h],0),u=0;u>>24&255,w>>>16&255,w>>>8&255,255&w,B>>>24&255,B>>>16&255,B>>>8&255,255&B,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.paddingValue<<1|c.isNonSync,61440&c.degradPrio,15&c.degradPrio,a>>>24&255,a>>>16&255,a>>>8&255,255&a],12+16*u);return l.box(l.types.trun,i)}},{key:"initSegment",value:function(n,h,u){l.types||l.init();var d,w=l.moov(n,h,u);return(d=new Uint8Array(l.FTYP.byteLength+w.byteLength)).set(l.FTYP),d.set(w,l.FTYP.byteLength),d}}]),l}(),ie=1,ae=function(){function l(){D(this,l)}return b(l,[{key:"flush",value:function(){this.mp4track.len=0,this.mp4track.samples=[]}},{key:"isReady",value:function(){return!(!this.readyToDecode||!this.samples.length)||null}}],[{key:"getTrackID",value:function(){return ie++}}]),l}(),ue=function(l){E(h,l);var n=M(h);function h(u){var d;return D(this,h),(d=n.call(this)).readyToDecode=!1,d.nextDts=0,d.dts=0,d.mp4track={id:ae.getTrackID(),type:"audio",channelCount:0,len:0,fragmented:!0,timescale:u,duration:u,samples:[],config:"",codec:""},d.samples=[],d.aac=new J(O(d)),d}return b(h,[{key:"resetTrack",value:function(){this.readyToDecode=!1,this.mp4track.codec="",this.mp4track.channelCount="",this.mp4track.config="",this.mp4track.timescale=this.timescale,this.nextDts=0,this.dts=0}},{key:"remux",value:function(u){if(u.length>0)for(var d=0;d0&&this.readyToDecode&&(this.mp4track.len+=S,this.samples.push({units:a,size:S,keyFrame:c.keyFrame,duration:c.duration,compositionTimeOffset:c.compositionTimeOffset}))}}catch(i){w.e(i)}finally{w.f()}}},{key:"getPayload",value:function(){if(!this.isReady())return null;var u,d,w=new Uint8Array(this.mp4track.len),B=0,c=this.mp4track.samples;for(this.dts=this.nextDts;this.samples.length;){var a=this.samples.shift(),S=a.units;if((d=a.duration)<=0)g("remuxer: invalid sample duration at DTS: ".concat(this.nextDts," :").concat(d)),this.mp4track.len-=a.size;else{this.nextDts+=d,u={size:a.size,duration:d,cts:a.compositionTimeOffset||0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,isNonSync:a.keyFrame?0:1,dependsOn:a.keyFrame?2:1}};var G,K=p(S);try{for(K.s();!(G=K.n()).done;){var i=G.value;w.set(i.getData(),B),B+=i.getSize()}}catch(o){K.e(o)}finally{K.f()}c.push(u)}}return c.length?new Uint8Array(w.buffer,0,this.mp4track.len):null}}]),h}(ae),oe=function(l){E(h,l);var n=M(h);function h(u){var d;return D(this,h),(d=n.call(this,"remuxer")).initialized=!1,d.trackTypes=[],d.tracks={},d.seq=1,d.env=u,d.timescale=1e3,d.mediaDuration=0,d.aacParser=null,d}return b(h,[{key:"addTrack",value:function(u){if(u!=="video"&&u!=="both"||(this.tracks.video=new le(this.timescale),this.trackTypes.push("video")),u==="audio"||u==="both"){var d=new ue(this.timescale);this.aacParser=d.getAacParser(),this.tracks.audio=d,this.trackTypes.push("audio")}}},{key:"reset",value:function(){var u,d=p(this.trackTypes);try{for(d.s();!(u=d.n()).done;){var w=u.value;this.tracks[w].resetTrack()}}catch(B){d.e(B)}finally{d.f()}this.initialized=!1}},{key:"destroy",value:function(){this.tracks={},this.offAll()}},{key:"flush",value:function(){if(this.initialized){var u,d=p(this.trackTypes);try{for(d.s();!(u=d.n()).done;){var w=u.value,B=this.tracks[w],c=B.getPayload();if(c&&c.byteLength){var a={type:w,payload:V(ne.moof(this.seq,B.dts,B.mp4track),ne.mdat(c)),dts:B.dts};w==="video"&&(a.fps=B.mp4track.fps),this.dispatch("buffer",a);var S=(G=B.dts/this.timescale,K=void 0,i=void 0,o=void 0,T=void 0,T="",K=Math.floor(G),(i=parseInt(K/3600,10)%24)>0&&(T+=(i<10?"0"+i:i)+":"),T+=((o=parseInt(K/60,10)%60)<10?"0"+o:o)+":"+((K=K<0?0:K%60)<10?"0"+K:K));g("put segment (".concat(w,"): dts: ").concat(B.dts," frames: ").concat(B.mp4track.samples.length," second: ").concat(S)),B.flush(),this.seq++}}}catch(Y){d.e(Y)}finally{d.f()}}else this.isReady()&&(this.dispatch("ready"),this.initSegment(),this.initialized=!0,this.flush());var G,K,i,o,T}},{key:"initSegment",value:function(){var u,d=[],w=p(this.trackTypes);try{for(w.s();!(u=w.n()).done;){var B=u.value,c=this.tracks[B];if(this.env=="browser"){var a={type:B,payload:ne.initSegment([c.mp4track],this.mediaDuration,this.timescale)};this.dispatch("buffer",a)}else d.push(c.mp4track)}}catch(G){w.e(G)}finally{w.f()}if(this.env=="node"){var S={type:"all",payload:ne.initSegment(d,this.mediaDuration,this.timescale)};this.dispatch("buffer",S)}g("Initial segment generated.")}},{key:"isReady",value:function(){var u,d=p(this.trackTypes);try{for(d.s();!(u=d.n()).done;){var w=u.value;if(!this.tracks[w].readyToDecode||!this.tracks[w].samples.length)return!1}}catch(B){d.e(B)}finally{d.f()}return!0}},{key:"remux",value:function(u){var d,w=p(this.trackTypes);try{for(w.s();!(d=w.n()).done;){var B=d.value,c=u[B];B==="audio"&&this.tracks.video&&!this.tracks.video.readyToDecode||c.length>0&&this.tracks[B].remux(c)}}catch(a){w.e(a)}finally{w.f()}this.flush()}}]),h}(te),fe=function(l){E(h,l);var n=M(h);function h(u,d){var w;return D(this,h),(w=n.call(this,"buffer")).type=d,w.queue=new Uint8Array,w.cleaning=!1,w.pendingCleaning=0,w.cleanOffset=30,w.cleanRanges=[],w.sourceBuffer=u,w.sourceBuffer.addEventListener("updateend",function(){w.pendingCleaning>0&&(w.initCleanup(w.pendingCleaning),w.pendingCleaning=0),w.cleaning=!1,w.cleanRanges.length&&w.doCleanup()}),w.sourceBuffer.addEventListener("error",function(){w.dispatch("error",{type:w.type,name:"buffer",error:"buffer error"})}),w}return b(h,[{key:"destroy",value:function(){this.queue=null,this.sourceBuffer=null,this.offAll()}},{key:"doCleanup",value:function(){if(this.cleanRanges.length){var u=this.cleanRanges.shift();g("".concat(this.type," remove range [").concat(u[0]," - ").concat(u[1],")")),this.cleaning=!0,this.sourceBuffer.remove(u[0],u[1])}else this.cleaning=!1}},{key:"initCleanup",value:function(u){try{if(this.sourceBuffer.updating)return void(this.pendingCleaning=u);if(this.sourceBuffer.buffered&&this.sourceBuffer.buffered.length&&!this.cleaning){for(var d=0;dthis.cleanOffset&&w<(B=u-this.cleanOffset)&&this.cleanRanges.push([w,B])}this.doCleanup()}}catch(c){y("Error occured while cleaning ".concat(this.type," buffer - ").concat(c.name,": ").concat(c.message))}}},{key:"doAppend",value:function(){if(this.queue.length&&this.sourceBuffer&&!this.sourceBuffer.updating)try{this.sourceBuffer.appendBuffer(this.queue),this.queue=new Uint8Array}catch(d){var u="unexpectedError";d.name==="QuotaExceededError"?(g("".concat(this.type," buffer quota full")),u="QuotaExceeded"):(y("Error occured while appending ".concat(this.type," buffer - ").concat(d.name,": ").concat(d.message)),u="InvalidStateError"),this.dispatch("error",{type:this.type,name:u,error:"buffer error"})}}},{key:"feed",value:function(u){this.queue=V(this.queue,u)}}]),h}(te);return function(l){E(h,l);var n=M(h);function h(u){var d;return D(this,h),(d=n.call(this,"jmuxer")).isReset=!1,d.options=Object.assign({},{node:"",mode:"both",flushingTime:500,maxDelay:500,clearBuffer:!0,fps:30,readFpsFromTrack:!1,debug:!1,onReady:function(){},onError:function(){},onMissingVideoFrames:function(){},onMissingAudioFrames:function(){}},u),d.env=(typeof process>"u"?"undefined":I(process))==="object"&&typeof window>"u"?"node":"browser",d.options.debug&&(_=console.log,C=console.error),d.options.fps||(d.options.fps=30),d.frameDuration=1e3/d.options.fps|0,d.remuxController=new oe(d.env),d.remuxController.addTrack(d.options.mode),d.initData(),d.remuxController.on("buffer",d.onBuffer.bind(O(d))),d.env=="browser"&&(d.remuxController.on("ready",d.createBuffer.bind(O(d))),d.initBrowser()),d}return b(h,[{key:"initData",value:function(){this.lastCleaningTime=Date.now(),this.kfPosition=[],this.kfCounter=0,this.pendingUnits={},this.remainingData=new Uint8Array,this.startInterval()}},{key:"initBrowser",value:function(){typeof this.options.node=="string"&&this.options.node==""&&y("no video element were found to render, provide a valid video element"),this.node=typeof this.options.node=="string"?document.getElementById(this.options.node):this.options.node,this.mseReady=!1,this.setupMSE()}},{key:"createStream",value:function(){var u=this.feed.bind(this),d=this.destroy.bind(this);return this.stream=new A.Duplex({writableObjectMode:!0,read:function(w){},write:function(w,B,c){u(w),c()},final:function(w){d(),w()}}),this.stream}},{key:"setupMSE",value:function(){if(window.MediaSource=window.MediaSource||window.WebKitMediaSource,!window.MediaSource)throw"Oops! Browser does not support media source extension.";this.isMSESupported=!!window.MediaSource,this.mediaSource=new MediaSource,this.url=URL.createObjectURL(this.mediaSource),this.node.src=this.url,this.mseEnded=!1,this.mediaSource.addEventListener("sourceopen",this.onMSEOpen.bind(this)),this.mediaSource.addEventListener("sourceclose",this.onMSEClose.bind(this)),this.mediaSource.addEventListener("webkitsourceopen",this.onMSEOpen.bind(this)),this.mediaSource.addEventListener("webkitsourceclose",this.onMSEClose.bind(this))}},{key:"endMSE",value:function(){if(!this.mseEnded)try{this.mseEnded=!0,this.mediaSource.endOfStream()}catch{y("mediasource is not available to end")}}},{key:"feed",value:function(u){var d,w,B,c=!1,a={video:[],audio:[]};if(u&&this.remuxController){if(B=u.duration?parseInt(u.duration):0,u.video){u.video=V(this.remainingData,u.video);var S=L(z.extractNALu(u.video),2);if(d=S[0],w=S[1],this.remainingData=w||new Uint8Array,!(d.length>0))return y("Failed to extract any NAL units from video data:",w),void(typeof this.options.onMissingVideoFrames=="function"&&this.options.onMissingVideoFrames.call(null,u));a.video=this.getVideoFrames(d,B,u.compositionTimeOffset),c=!0}if(u.audio){if(!((d=this.remuxController.aacParser.extractAAC(u.audio)).length>0))return y("Failed to extract audio data from:",u.audio),void(typeof this.options.onMissingAudioFrames=="function"&&this.options.onMissingAudioFrames.call(null,u));a.audio=this.getAudioFrames(d,B),c=!0}c?this.remuxController.remux(a):y("Input object must have video and/or audio property. Make sure it is a valid typed array")}}},{key:"getVideoFrames",value:function(u,d,w){var B,c=this,a=[],S=[],G=0,K=!1,i=!1;this.pendingUnits.units&&(a=this.pendingUnits.units,i=this.pendingUnits.vcl,K=this.pendingUnits.keyFrame,this.pendingUnits={});var o,T=p(u);try{for(T.s();!(o=T.n()).done;){var Y=o.value,Z=new R(Y);Z.type()!==R.IDR&&Z.type()!==R.NDR||z.parseHeader(Z),a.length&&i&&(Z.isfmb||!Z.isvcl)&&(S.push({units:a,keyFrame:K}),a=[],K=!1,i=!1),a.push(Z),K=K||Z.isKeyframe(),i=i||Z.isvcl}}catch(e){T.e(e)}finally{T.f()}if(a.length)if(d)if(i)S.push({units:a,keyFrame:K});else{var r=S.length-1;r>=0&&(S[r].units=S[r].units.concat(a))}else this.pendingUnits={units:a,keyFrame:K,vcl:i};return B=d?d/S.length|0:this.frameDuration,G=d?d-B*S.length:0,S.map(function(e){e.duration=B,e.compositionTimeOffset=w,G>0&&(e.duration++,G--),c.kfCounter++,e.keyFrame&&c.options.clearBuffer&&c.kfPosition.push(c.kfCounter*B/1e3)}),g("jmuxer: No. of frames of the last chunk: ".concat(S.length)),S}},{key:"getAudioFrames",value:function(u,d){var w,B,c=[],a=0,S=p(u);try{for(S.s();!(B=S.n()).done;){var G=B.value;c.push({units:G})}}catch(K){S.e(K)}finally{S.f()}return w=d?d/c.length|0:this.frameDuration,a=d?d-w*c.length:0,c.map(function(K){K.duration=w,a>0&&(K.duration++,a--)}),c}},{key:"destroy",value:function(){if(this.stopInterval(),this.stream&&(this.remuxController.flush(),this.stream.push(null),this.stream=null),this.remuxController&&(this.remuxController.destroy(),this.remuxController=null),this.bufferControllers){for(var u in this.bufferControllers)this.bufferControllers[u].destroy();this.bufferControllers=null,this.endMSE()}this.node=!1,this.mseReady=!1,this.videoStarted=!1,this.mediaSource=null}},{key:"reset",value:function(){if(this.stopInterval(),this.isReset=!0,this.node.pause(),this.remuxController&&this.remuxController.reset(),this.bufferControllers){for(var u in this.bufferControllers)this.bufferControllers[u].destroy();this.bufferControllers=null,this.endMSE()}this.initData(),this.env=="browser"&&this.initBrowser(),g("JMuxer was reset")}},{key:"createBuffer",value:function(){if(this.mseReady&&this.remuxController&&this.remuxController.isReady()&&!this.bufferControllers)for(var u in this.bufferControllers={},this.remuxController.tracks){var d=this.remuxController.tracks[u];if(!h.isSupported("".concat(u,'/mp4; codecs="').concat(d.mp4track.codec,'"')))return y("Browser does not support codec"),!1;var w=this.mediaSource.addSourceBuffer("".concat(u,'/mp4; codecs="').concat(d.mp4track.codec,'"'));this.bufferControllers[u]=new fe(w,u),this.bufferControllers[u].on("error",this.onBufferError.bind(this))}}},{key:"startInterval",value:function(){var u=this;this.interval=setInterval(function(){u.options.flushingTime?u.applyAndClearBuffer():u.bufferControllers&&u.cancelDelay()},this.options.flushingTime||1e3)}},{key:"stopInterval",value:function(){this.interval&&clearInterval(this.interval)}},{key:"cancelDelay",value:function(){if(this.node.buffered&&this.node.buffered.length>0&&!this.node.seeking){var u=this.node.buffered.end(0);u-this.node.currentTime>this.options.maxDelay/1e3&&(console.log("delay"),this.node.currentTime=u-.001)}}},{key:"releaseBuffer",value:function(){for(var u in this.bufferControllers)this.bufferControllers[u].doAppend()}},{key:"applyAndClearBuffer",value:function(){this.bufferControllers&&(this.releaseBuffer(),this.clearBuffer())}},{key:"getSafeClearOffsetOfBuffer",value:function(u){for(var d,w=this.options.mode==="audio"&&u||0,B=0;B=u);B++)d=this.kfPosition[B];return d&&(this.kfPosition=this.kfPosition.filter(function(c){return c=d})),w}},{key:"clearBuffer",value:function(){if(this.options.clearBuffer&&Date.now()-this.lastCleaningTime>1e4){for(var u in this.bufferControllers){var d=this.getSafeClearOffsetOfBuffer(this.node.currentTime);this.bufferControllers[u].initCleanup(d)}this.lastCleaningTime=Date.now()}}},{key:"onBuffer",value:function(u){this.options.readFpsFromTrack&&u.fps!==void 0&&this.options.fps!=u.fps&&(this.options.fps=u.fps,this.frameDuration=Math.ceil(1e3/u.fps),g("JMuxer changed FPS to ".concat(u.fps," from track data"))),this.env=="browser"?this.bufferControllers&&this.bufferControllers[u.type]&&this.bufferControllers[u.type].feed(u.payload):this.stream&&this.stream.push(u.payload),this.options.flushingTime===0&&this.applyAndClearBuffer()}},{key:"onMSEOpen",value:function(){this.mseReady=!0,URL.revokeObjectURL(this.url),typeof this.options.onReady=="function"&&this.options.onReady.call(null,this.isReset)}},{key:"onMSEClose",value:function(){this.mseReady=!1,this.videoStarted=!1}},{key:"onBufferError",value:function(u){if(u.name=="QuotaExceeded")return g("JMuxer cleaning ".concat(u.type," buffer due to QuotaExceeded error")),void this.bufferControllers[u.type].initCleanup(this.node.currentTime);u.name=="InvalidStateError"?(g("JMuxer is reseting due to InvalidStateError"),this.reset()):this.endMSE(),typeof this.options.onError=="function"&&this.options.onError.call(null,u)}}],[{key:"isSupported",value:function(u){return window.MediaSource&&window.MediaSource.isTypeSupported(u)}}]),h}(te)})})(gt);var Gt=gt.exports;const Vt=xt(Gt);var Yt=Object.defineProperty,zt=Object.getOwnPropertyDescriptor,_e=(F,x,A,I)=>{for(var D=I>1?void 0:I?zt(x,A):x,v=F.length-1,b;v>=0;v--)(b=F[v])&&(D=(I?b(x,A,D):b(D))||D);return I&&D&&Yt(x,A,D),D};let de=class extends Rt(kt,At){constructor(){super(...arguments),this.jmuxer=null,this.status="connecting"}get url(){var F;return this.convertUrl((F=this.camSettings)==null?void 0:F.stream_url,this.printerUrl)}get webcamStyle(){var F,x,A;return{transform:this.generateTransform((F=this.camSettings.flip_horizontal)!=null?F:!1,(x=this.camSettings.flip_vertical)!=null?x:!1,(A=this.camSettings.rotation)!=null?A:0)}}mounted(){this.play()}play(){var I;if(this.status="connecting",(I=this.jmuxer)==null||I.destroy(),!this.url.startsWith("ws://")&&!this.url.startsWith("wss://")){console.error("jmuxer error: only websocket streams supported (ws://.. or wss://..)"),this.status="error";return}const F=this.$refs.video,x=this.camSettings.target_fps||10;this.jmuxer=new Vt({node:F,mode:"video",flushingTime:0,fps:x,onReady:D=>{this.status="connected",console.log("jmuxer ready:",D)},onError:D=>{this.status="error",console.log("jmuxer error:",D)}});const A=new WebSocket(this.url);A.binaryType="arraybuffer",A.addEventListener("message",D=>{var v;(v=this.jmuxer)==null||v.feed({video:new Uint8Array(D.data)})}),A.addEventListener("error",D=>{this.status="error",console.log("jmuxer ws error:",D)})}beforeUnmount(){var F;(F=this.jmuxer)==null||F.destroy()}onCamSettingsChanged(){this.play()}};_e([vt({required:!0})],de.prototype,"camSettings",2);_e([vt({default:null})],de.prototype,"printerUrl",2);_e([Tt("camSettings",{deep:!0})],de.prototype,"onCamSettingsChanged",1);de=_e([Bt],de);var Kt=function(){var x=this,A=x._self._c;return x._self._setupProxy,A("div",[A("video",{ref:"video",staticClass:"webcamImage",style:x.webcamStyle,attrs:{autoplay:""}}),x.status!=="connected"?A(Ct,[A(Ut,{staticClass:"_webcam_jmuxer_output text-center d-flex flex-column justify-center align-center"},[x.status==="connecting"?A(Mt,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):x._e(),A("span",{staticClass:"mt-3"},[x._v(x._s(x.status))])],1)],1):x._e()],1)},Jt=[],$t=Lt(de,Kt,Jt,!1,null,"90b79f69");const tr=$t.exports;export{tr as default}; diff --git a/assets/JanusStreamer-CQyYvBpk.js b/assets/JanusStreamer-CQyYvBpk.js new file mode 100644 index 0000000..94acd48 --- /dev/null +++ b/assets/JanusStreamer-CQyYvBpk.js @@ -0,0 +1,8 @@ +import{m as ov,B as sv,H as av,P as Gu,R as uv,W as cv,C as fv,n as lv}from"./index-Bku7SJna.js";import{a as Wu,c as Kn}from"./overlayscrollbars-CiKU261J.js";import{a4 as Mo,a5 as Lo,a6 as ko,a7 as er}from"./echarts-DzoUeqWp.js";import{m as dv,n as pv,r as hv}from"./vuetify-Ce4WN_Dg.js";function gv(i,s){for(var n=0;no[a]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}f.sessions=new Map;f.isExtensionEnabled=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return!0;if(window.navigator.userAgent.match("Chrome")){let i=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),s=33;return window.navigator.userAgent.match("Linux")&&(s=35),i>=26&&i<=s?!0:f.extension.isInstalled()}else return!0};var Bu={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return document.querySelector("#janus-extension-installed")!==null},getScreen:function(i){let s=window.setTimeout(function(){let n=new Error("NavigatorUserMediaError");return n.name='The required Chrome extension is not installed: click here to install it. (NOTE: this will need you to refresh the page)',i(n)},1e3);this.cache[s]=i,window.postMessage({type:"janusGetScreen",id:s},"*")},init:function(){let i={};this.cache=i,window.addEventListener("message",function(s){if(s.origin==window.location.origin)if(s.data.type=="janusGotScreen"&&i[s.data.id]){let n=i[s.data.id];if(delete i[s.data.id],s.data.sourceId===""){let o=new Error("NavigatorUserMediaError");o.name="You cancelled the request for permission, giving up...",n(o)}else n(null,s.data.sourceId)}else s.data.type=="janusGetScreenPending"&&window.clearTimeout(s.data.id)})}};f.useDefaultDependencies=function(i){let s=i&&i.fetch||fetch,n=i&&i.Promise||Promise,o=i&&i.WebSocket||WebSocket;return{newWebSocket:function(a,u){return new o(a,u)},extension:i&&i.extension||Bu,isArray:function(a){return Array.isArray(a)},webRTCAdapter:i&&i.adapter||adapter,httpAPICall:function(a,u){let p={method:u.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};u.verb==="POST"&&(p.headers["Content-Type"]="application/json"),typeof u.withCredentials<"u"&&(p.credentials=u.withCredentials===!0?"include":u.withCredentials?u.withCredentials:"omit"),u.body&&(p.body=JSON.stringify(u.body));let m=s(a,p).catch(function(T){return n.reject({message:"Probably a network error, is the server down?",error:T})});if(u.timeout){let T=new n(function(l,_){let D=setTimeout(function(){return clearTimeout(D),_({message:"Request timed out",timeout:u.timeout})},u.timeout)});m=n.race([m,T])}return m.then(function(T){if(T.ok){if(typeof u.success==typeof f.noop)return T.json().then(function(l){try{u.success(l)}catch(_){f.error("Unhandled httpAPICall success callback error",_)}},function(l){return n.reject({message:"Failed to parse response body",error:l,response:T})})}else return n.reject({message:"API call failed",response:T})}).catch(function(T){typeof u.error==typeof f.noop&&u.error(T.message||"<< internal error >>",T)}),m}}};f.useOldDependencies=function(i){let s=i&&i.jQuery||jQuery,n=i&&i.WebSocket||WebSocket;return{newWebSocket:function(o,a){return new n(o,a)},isArray:function(o){return s.isArray(o)},extension:i&&i.extension||Bu,webRTCAdapter:i&&i.adapter||adapter,httpAPICall:function(o,a){let u=typeof a.body<"u"?{contentType:"application/json",data:JSON.stringify(a.body)}:{},p=typeof a.withCredentials<"u"?{xhrFields:{withCredentials:a.withCredentials}}:{};return s.ajax(s.extend(u,p,{url:o,type:a.verb,cache:!1,dataType:"json",async:a.async,timeout:a.timeout,success:function(m){typeof a.success==typeof f.noop&&a.success(m)},error:function(m,T,l){typeof a.error==typeof f.noop&&a.error(T,l)}}))}}};f.mediaToTracks=function(i){let s=[];if(!i)s.push({type:"audio",capture:!0,recv:!0}),s.push({type:"video",capture:!0,recv:!0});else{if(!i.keepAudio&&i.audio!==!1&&(typeof i.audio>"u"||i.audio||i.audioSend||i.audioRecv||i.addAudio||i.replaceAudio||i.removeAudio)){let n={type:"audio"};i.removeAudio?n.remove=!0:(i.addAudio?n.add=!0:i.replaceAudio&&(n.replace=!0),i.audioSend!==!1&&(n.capture=i.audio||!0),i.audioRecv!==!1&&(n.recv=!0)),(n.remove||n.capture||n.recv)&&s.push(n)}if(!i.keepVideo&&i.video!==!1&&(typeof i.video>"u"||i.video||i.videoSend||i.videoRecv||i.addVideo||i.replaceVideo||i.removeVideo)){let n={type:"video"};i.removeVideo?n.remove=!0:(i.addVideo?n.add=!0:i.replaceVideo&&(n.replace=!0),i.videoSend!==!1&&(n.capture=i.video||!0,["screen","window","desktop"].includes(n.capture)&&(n.type="screen",n.capture={video:{}},i.screenshareFrameRate&&(n.capture.frameRate=i.screenshareFrameRate),i.screenshareHeight&&(n.capture.height=i.screenshareHeight),i.screenshareWidth&&(n.capture.width=i.screenshareWidth))),i.videoRecv!==!1&&(n.recv=!0)),(n.remove||n.capture||n.recv)&&s.push(n)}i.data&&s.push({type:"data"})}return s};f.trackConstraints=function(i){let s={};if(!i||!i.capture)return s;if(i.type==="audio")s.audio=i.capture;else if(i.type==="video")if((i.simulcast||i.svc)&&i.capture===!0&&(i.capture="hires"),i.capture===!0||typeof i.capture=="object")s.video=i.capture;else{let n=0,o=0;i.capture==="lowres"?(n=320,o=240):i.capture==="lowres-16:9"?(n=320,o=180):i.capture==="hires"||i.capture==="hires-16:9"||i.capture==="hdres"?(n=1280,o=720):i.capture==="fhdres"?(n=1920,o=1080):i.capture==="4kres"?(n=3840,o=2160):i.capture==="stdres"?(n=640,o=480):i.capture==="stdres-16:9"?(n=640,o=360):(f.log("Default video setting is stdres 4:3"),n=640,o=480),s.video={width:{ideal:n},height:{ideal:o}}}else i.type==="screen"&&(s.video=i.capture);return s};f.noop=function(){};f.dataChanDefaultLabel="JanusDataChannel";f.endOfCandidates=null;f.stopAllTracks=function(i){try{let s=i.getTracks();for(let n of s)f.log(n),n&&n.dontStop!==!0&&n.stop()}catch{}};f.init=function(i){if(i=i||{},i.callback=typeof i.callback=="function"?i.callback:f.noop,f.initDone)i.callback();else{if(typeof console.log>"u"&&(console.log=function(){}),f.trace=f.noop,f.debug=f.noop,f.vdebug=f.noop,f.log=f.noop,f.warn=f.noop,f.error=f.noop,i.debug===!0||i.debug==="all")f.trace=console.trace.bind(console),f.debug=console.debug.bind(console),f.vdebug=console.debug.bind(console),f.log=console.log.bind(console),f.warn=console.warn.bind(console),f.error=console.error.bind(console);else if(Array.isArray(i.debug))for(let u of i.debug)switch(u){case"trace":f.trace=console.trace.bind(console);break;case"debug":f.debug=console.debug.bind(console);break;case"vdebug":f.vdebug=console.debug.bind(console);break;case"log":f.log=console.log.bind(console);break;case"warn":f.warn=console.warn.bind(console);break;case"error":f.error=console.error.bind(console);break}f.log("Initializing library");let s=i.dependencies||f.useDefaultDependencies();f.isArray=s.isArray,f.webRTCAdapter=s.webRTCAdapter,f.httpAPICall=s.httpAPICall,f.newWebSocket=s.newWebSocket,f.extension=s.extension,f.extension.init(),f.listDevices=function(u,p){u=typeof u=="function"?u:f.noop,p||(p={audio:!0,video:!0}),f.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(p).then(function(m){navigator.mediaDevices.enumerateDevices().then(function(T){f.debug(T),u(T),f.stopAllTracks(m)})}).catch(function(m){f.error(m),u([])}):(f.warn("navigator.mediaDevices unavailable"),u([]))},f.attachMediaStream=function(u,p){try{u.srcObject=p}catch{try{u.src=URL.createObjectURL(p)}catch(T){f.error("Error attaching stream to element",T)}}},f.reattachMediaStream=function(u,p){try{u.srcObject=p.srcObject}catch{try{u.src=p.src}catch(T){f.error("Error reattaching stream to element",T)}}};let o=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",a=window["on"+o];if(window.addEventListener(o,function(){f.log("Closing window");for(const[u,p]of f.sessions)p&&p.destroyOnUnload&&(f.log("Destroying session "+u),p.destroy({unload:!0,notifyDestroyed:!1}));a&&typeof a=="function"&&a()}),f.safariVp8=!1,f.safariVp9=!1,f.webRTCAdapter.browserDetails.browser==="safari"&&f.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(let u of RTCRtpSender.getCapabilities("video").codecs)u&&u.mimeType&&u.mimeType.toLowerCase()==="video/vp8"?f.safariVp8=!0:u&&u.mimeType&&u.mimeType.toLowerCase()==="video/vp9"&&(f.safariVp9=!0);f.safariVp8?f.log("This version of Safari supports VP8"):f.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu")}else{let u=new RTCPeerConnection({});u.createOffer({offerToReceiveVideo:!0}).then(function(p){f.safariVp8=p.sdp.indexOf("VP8")!==-1,f.safariVp9=p.sdp.indexOf("VP9")!==-1,f.safariVp8?f.log("This version of Safari supports VP8"):f.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu"),u.close(),u=null})}f.initDone=!0,i.callback()}};f.isWebrtcSupported=function(){return!!window.RTCPeerConnection};f.isGetUserMediaAvailable=function(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia};f.randomString=function(i){let s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="";for(let o=0;o3){_e=!1,i.error("Lost connection to the server (is it down?)");return}ht()}})}function Zt(v,C){if(st=0,!s&&typeof $<"u"&&$!==null&&C!==!0&&ht(),!s&&f.isArray(v)){for(let b=0;b0)for(let A in x){let B=x[A];if(B&&B.sender&&B.sender.track&&B.sender.track.kind==="video"){let re=B.sender.getParameters();re&&re.encodings&&re.encodings[0]&&re.encodings[0].scalabilityMode&&(W||(W=[]),W.push({mindex:parseInt(A),mid:B.mid,svc:re.encodings[0].scalabilityMode}))}}}W&&(w.jsep.svc=W)}if(f.debug("Sending message to plugin (handle="+v+"):"),f.debug(w),s){w.session_id=$,w.handle_id=v,me.set(I,function(W){if(f.debug("Message sent!"),f.debug(W),W.janus==="success"){let F=W.plugindata;if(!F){f.warn("Request succeeded, but missing plugindata..."),C.success();return}f.log("Synchronous transaction successful ("+F.plugin+")");let x=F.data;f.debug(x),C.success(x);return}else if(W.janus!=="ack"){W.error?(f.error("Ooops: "+W.error.code+" "+W.error.reason),C.error(W.error.code+" "+W.error.reason)):(f.error("Unknown error"),C.error("Unknown error"));return}C.success()}),n.send(JSON.stringify(w));return}f.httpAPICall(m+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:w,success:function(W){if(f.debug("Message sent!"),f.debug(W),W.janus==="success"){let F=W.plugindata;if(!F){f.warn("Request succeeded, but missing plugindata..."),C.success();return}f.log("Synchronous transaction successful ("+F.plugin+")");let x=F.data;f.debug(x),C.success(x);return}else if(W.janus!=="ack"){W.error?(f.error("Ooops: "+W.error.code+" "+W.error.reason),C.error(W.error.code+" "+W.error.reason)):(f.error("Unknown error"),C.error("Unknown error"));return}C.success()},error:function(W,F){f.error(W+":",F),C.error(W+": "+F)}})}function or(v,C){if(!_e){f.warn("Is the server down? (connected=false)");return}let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle");return}let y={janus:"trickle",candidate:C,transaction:f.randomString(12)};if(b.token&&(y.token=b.token),j&&(y.apisecret=j),f.vdebug("Sending trickle candidate (handle="+v+"):"),f.vdebug(y),s){y.session_id=$,y.handle_id=v,n.send(JSON.stringify(y));return}f.httpAPICall(m+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:y,success:function(O){if(f.vdebug("Candidate sent!"),f.vdebug(O),O.janus!=="ack"){f.error("Ooops: "+O.error.code+" "+O.error.reason);return}},error:function(O,I){f.error(O+":",I)}})}function Mt(v,C,b,y,O){let I=X.get(v);if(!I||!I.webrtcStuff){f.warn("Invalid handle");return}let w=I.webrtcStuff;if(!w.pc){f.warn("Invalid PeerConnection");return}let W=function(A){f.log("Received message on data channel:",A);let B=A.target.label;I.ondata(A.data,B)},F=function(A){f.log("Received state change on data channel:",A);let B=A.target.label,re=A.target.protocol,fe=w.dataChannel[B]?w.dataChannel[B].readyState:"null";if(f.log("State change on <"+B+"> data channel: "+fe),fe==="open"){if(w.dataChannel[B].pending&&w.dataChannel[B].pending.length>0){f.log("Sending pending messages on <"+B+">:",w.dataChannel[B].pending.length);for(let ct of w.dataChannel[B].pending)f.log("Sending data on data channel <"+B+">"),f.debug(ct),w.dataChannel[B].send(ct);w.dataChannel[B].pending=[]}I.ondataopen(B,re)}},x=function(A){f.error("Got error on data channel:",A)};if(y)w.dataChannel[C]=y;else{let A=w.dataChannelOptions;b&&(A.protocol=b),w.dataChannel[C]=w.pc.createDataChannel(C,A)}w.dataChannel[C].onmessage=W,w.dataChannel[C].onopen=F,w.dataChannel[C].onclose=F,w.dataChannel[C].onerror=x,w.dataChannel[C].pending=[],O&&w.dataChannel[C].pending.push(O)}function St(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle"),C.error("Invalid handle");return}let y=b.webrtcStuff,O=C.text||C.data;if(!O){f.warn("Invalid data"),C.error("Invalid data");return}let I=C.label?C.label:f.dataChanDefaultLabel;if(!y.dataChannel[I]){Mt(v,I,C.protocol,!1,O,C.protocol),C.success();return}if(y.dataChannel[I].readyState!=="open"){y.dataChannel[I].pending.push(O),C.success();return}f.log("Sending data on data channel <"+I+">"),f.debug(O),y.dataChannel[I].send(O),C.success()}function sr(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=X.get(v);if(!b||!b.webrtcStuff){f.warn("Invalid handle"),C.error("Invalid handle");return}let y=b.webrtcStuff;if(!y.dtmfSender){if(y.pc){let x=y.pc.getSenders().find(function(A){return A.track&&A.track.kind==="audio"});if(!x){f.warn("Invalid DTMF configuration (no audio track)"),C.error("Invalid DTMF configuration (no audio track)");return}y.dtmfSender=x.dtmf,y.dtmfSender&&(f.log("Created DTMF Sender"),y.dtmfSender.ontonechange=function(A){f.debug("Sent DTMF tone: "+A.tone)})}if(!y.dtmfSender){f.warn("Invalid DTMF configuration"),C.error("Invalid DTMF configuration");return}}let O=C.dtmf;if(!O){f.warn("Invalid DTMF parameters"),C.error("Invalid DTMF parameters");return}let I=O.tones;if(!I){f.warn("Invalid DTMF string"),C.error("Invalid DTMF string");return}let w=typeof O.duration=="number"?O.duration:500,W=typeof O.gap=="number"?O.gap:50;f.debug("Sending DTMF string "+I+" (duration "+w+"ms, gap "+W+"ms)"),y.dtmfSender.insertDTMF(I,w,W),C.success()}function Lt(v,C){C=C||{},C.success=typeof C.success=="function"?C.success:f.noop,C.error=typeof C.error=="function"?C.error:f.noop;let b=C.noRequest===!0;f.log("Destroying handle "+v+" (only-locally="+b+")"),qe(v);let y=X.get(v);if(!y||y.detached){X.delete(v),C.success();return}if(y.detached=!0,b){X.delete(v),C.success();return}if(!_e){f.warn("Is the server down? (connected=false)"),C.error("Is the server down? (connected=false)");return}let O={janus:"detach",transaction:f.randomString(12)};if(y.token&&(O.token=y.token),j&&(O.apisecret=j),s){O.session_id=$,O.handle_id=v,n.send(JSON.stringify(O)),X.delete(v),C.success();return}f.httpAPICall(m+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:O,success:function(I){f.log("Destroyed handle:"),f.debug(I),I.janus!=="success"&&f.error("Ooops: "+I.error.code+" "+I.error.reason),X.delete(v),C.success()},error:function(I,w){f.error(I+":",w),X.delete(v),C.success()}})}function Ye(v,C){let b=X.get(v);if(!b||!b.webrtcStuff)throw f.warn("Invalid handle"),"Invalid handle";let y=b.webrtcStuff;if(y.pc)return;let O={iceServers:T,iceTransportPolicy:l,bundlePolicy:_};O.sdpSemantics="unified-plan";let I=!1;if(C.tracks){for(let w of C.tracks)if(w.transforms&&(w.transforms.sender||w.transforms.receiver)){I=!0;break}}RTCRtpSender&&(RTCRtpSender.prototype.createEncodedStreams||RTCRtpSender.prototype.createEncodedAudioStreams&&RTCRtpSender.prototype.createEncodedVideoStreams)&&I&&(y.insertableStreams=!0,O.forceEncodedAudioInsertableStreams=!0,O.forceEncodedVideoInsertableStreams=!0,O.encodedInsertableStreams=!0),f.log("Creating PeerConnection"),y.pc=new RTCPeerConnection(O),f.debug(y.pc),y.pc.getStats&&(y.volume={},y.bitrate.value="0 kbits/sec"),f.log("Preparing local SDP and gathering candidates (trickle="+y.trickle+")"),y.pc.oniceconnectionstatechange=function(){y.pc&&b.iceState(y.pc.iceConnectionState)},y.pc.onicecandidate=function(w){if(!w.candidate||w.candidate.candidate&&w.candidate.candidate.indexOf("endOfCandidates")>0)f.log("End of candidates."),y.iceDone=!0,y.trickle===!0?or(v,{completed:!0}):hn(v,C);else{let W={candidate:w.candidate.candidate,sdpMid:w.candidate.sdpMid,sdpMLineIndex:w.candidate.sdpMLineIndex};y.trickle===!0&&or(v,W)}},y.pc.ontrack=function(w){if(f.log("Handling Remote Track",w),!w.streams||!w.track)return;let W=w.transceiver?w.transceiver.mid:w.track.id;try{b.onremotetrack(w.track,W,!0,{reason:"created"})}catch(x){f.error("Error calling onremotetrack",x)}if(w.track.onended)return;let F=null;f.log("Adding onended callback to track:",w.track),w.track.onended=function(x){f.log("Remote track removed:",x),clearTimeout(F);let A=y.pc?y.pc.getTransceivers():null,B=A?A.find(fe=>fe.receiver.track===x.target):null,re=B?B.mid:x.target.id;try{b.onremotetrack(x.target,re,!1,{reason:"ended"})}catch(fe){f.error("Error calling onremotetrack on removal",fe)}},w.track.onmute=function(x){f.log("Remote track muted:",x),F||(F=setTimeout(function(){f.log("Removing remote track");let A=y.pc?y.pc.getTransceivers():null,B=A?A.find(fe=>fe.receiver.track===x.target):null,re=B?B.mid:x.target.id;try{b.onremotetrack(x.target,re,!1,{reason:"mute"})}catch(fe){f.error("Error calling onremotetrack on mute",fe)}F=null},3*840))},w.track.onunmute=function(x){if(f.log("Remote track flowing again:",x),F!=null)clearTimeout(F),F=null;else try{let A=y.pc?y.pc.getTransceivers():null,B=A?A.find(fe=>fe.receiver.track===x.target):null,re=B?B.mid:x.target.id;b.onremotetrack(x.target,re,!0,{reason:"unmute"})}catch(A){f.error("Error calling onremotetrack on unmute",A)}}}}async function pn(v,C,b){b=b||{},b.success=typeof b.success=="function"?b.success:f.noop,b.error=typeof b.error=="function"?b.error:fr;let y=b.jsep;if(C&&y){f.error("Provided a JSEP to a createOffer"),b.error("Provided a JSEP to a createOffer");return}else if(!C&&(!y||!y.type||!y.sdp)){f.error("A valid JSEP is required for createAnswer"),b.error("A valid JSEP is required for createAnswer");return}if(b.media&&!b.tracks){if(b.tracks=f.mediaToTracks(b.media),b.simulcast===!0||b.simulcast2===!0||b.svc){for(let w of b.tracks)if(w.type==="video"){b.simulcast===!0||b.simulcast2===!0?w.simulcast=!0:b.svc&&(w.svc=b.svc);break}}f.warn("Deprecated media object passed, use tracks instead. Automatically translated to:",b.tracks)}if(b.tracks&&!Array.isArray(b.tracks)){f.error("Tracks must be an array"),b.error("Tracks must be an array");return}let O=X.get(v);if(!O||!O.webrtcStuff){f.warn("Invalid handle"),b.error("Invalid handle");return}let I=O.webrtcStuff;I.trickle=lr(b.trickle);try{if(Ye(v,b),C&&await Ct(v,b),y){if(await I.pc.setRemoteDescription(y),f.log("Remote description accepted!"),I.remoteSdp=y.sdp,I.candidates&&I.candidates.length>0){for(let W=0;W0){for(let I=0;I"u"||x.add===null)&&(typeof x.remove>"u"||x.remove===null)&&(typeof x.replace>"u"||x.replace===null)&&(x.add=!0),x.add&&x.remove||x.add&&x.remove&&x.replace){f.warn("Conflicting actions for track, ignoring:",x);continue}x.add&&x.replace?(f.warn("Both add and replace provided, falling back to replace:",x),delete x.add):x.remove&&x.replace&&(f.warn("Both remove and replace provided, falling back to remove:",x),delete x.replace);let A=x.type;x.type==="screen"&&(A="video");let B=null,re=null;if(x.mid?B=y.pc.getTransceivers().find(N=>N.mid===x.mid&&N.receiver.track.kind===A):B=y.pc.getTransceivers().find(N=>N.receiver.track.kind===A),x.replace||x.remove){if(!B){f.warn("Couldn't find a transceiver for track:",x);continue}if(!B.sender){f.warn("No sender in the transceiver for track:",x);continue}re=B.sender}if(F&&!B&&(B=y.pc.getTransceivers().find(N=>N.receiver.track.kind===A),!B)){f.warn("Couldn't find a transceiver for track:",x);continue}let fe=null,ct=null;if((x.remove||x.replace)&&(f.log("Removing track from PeerConnection",x),ct=re.track?re.track.id:null,await re.replaceTrack(null),ct&&y.myStream)){let N=null;if(A==="audio"&&y.myStream.getAudioTracks()&&y.myStream.getAudioTracks().length)for(let ne of y.myStream.getAudioTracks())ne.id===ct&&(N=ne,f.log("Removing audio track:",N));else if(A==="video"&&y.myStream.getVideoTracks()&&y.myStream.getVideoTracks().length)for(let ne of y.myStream.getVideoTracks())ne.id===ct&&(N=ne,f.log("Removing video track:",N));if(N){try{y.myStream.removeTrack(N),b.onlocaltrack(N,!1)}catch(ne){f.error("Error calling onlocaltrack on removal for renegotiation",ne)}if(N.dontStop!==!0)try{N.stop()}catch{}}}if(x.capture){if(x.gumGroup&&w[x.gumGroup]&&w[x.gumGroup].stream){let N=w[x.gumGroup].stream;fe=x.type==="audio"?N.getAudioTracks()[0]:N.getVideoTracks()[0],delete w[x.gumGroup].stream,delete w[x.gumGroup],delete x.gumGroup}else if(x.capture instanceof MediaStreamTrack)fe=x.capture;else{I||(I=!0,b.consentDialog(!0));let N=f.trackConstraints(x),ne=null;if(x.type==="audio"||x.type==="video"){if(x.gumGroup){let be=x.type==="audio"?"video":"audio";if(w[x.gumGroup]&&w[x.gumGroup][be]){let gt=w[x.gumGroup][be],mi=f.trackConstraints(gt);N[be]=mi[be]}}ne=await navigator.mediaDevices.getUserMedia(N),x.gumGroup&&N.audio&&N.video&&(w[x.gumGroup].stream=ne,delete x.gumGroup)}else ne=await navigator.mediaDevices.getDisplayMedia(N);fe=x.type==="audio"?ne.getAudioTracks()[0]:ne.getVideoTracks()[0]}if(x.replace){await re.replaceTrack(fe);let N="sendrecv";(x.recv===!1||B.direction==="inactive"||B.direction==="sendonly")&&(N="sendonly"),B.setDirection?B.setDirection(N):B.direction=N}else{if(y.myStream||(y.myStream=new MediaStream),A==="audio"||!x.simulcast&&!x.svc)re=y.pc.addTrack(fe,y.myStream),B=y.pc.getTransceivers().find(N=>N.sender===re);else if(x.simulcast){if(f.webRTCAdapter.browserDetails.browser!=="firefox"){f.log("Enabling rid-based simulcasting:",fe);let N=ot(x.simulcastMaxBitrates);B=y.pc.addTransceiver(fe,{direction:"sendrecv",streams:[y.myStream],sendEncodings:x.sendEncodings||[{rid:"h",active:!0,scalabilityMode:"L1T2",maxBitrate:N.high},{rid:"m",active:!0,scalabilityMode:"L1T2",maxBitrate:N.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,scalabilityMode:"L1T2",maxBitrate:N.low,scaleResolutionDownBy:4}]})}else if(f.log("Enabling Simulcasting for Firefox (RID)"),B=y.pc.addTransceiver(fe,{direction:"sendrecv",streams:[y.myStream]}),re=B?B.sender:null,re){let N=re.getParameters();N||(N={});let ne=ot(x.simulcastMaxBitrates);N.encodings=x.sendEncodings||[{rid:"h",active:!0,maxBitrate:ne.high},{rid:"m",active:!0,maxBitrate:ne.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:ne.low,scaleResolutionDownBy:4}],re.setParameters(N)}}else f.log("Enabling SVC ("+x.svc+"):",fe),B=y.pc.addTransceiver(fe,{direction:"sendrecv",streams:[y.myStream],sendEncodings:[{scalabilityMode:x.svc}]});if(re||(re=B?B.sender:null),x.codec)if(f.webRTCAdapter.browserDetails.browser==="firefox")f.warn("setCodecPreferences not supported in Firefox, ignoring codec for track:",x);else if(typeof x.codec!="string")f.warn("Invalid codec value, ignoring for track:",x);else{let N=A+"/"+x.codec.toLowerCase(),ne=RTCRtpReceiver.getCapabilities(A).codecs.filter(function(be){return be.mimeType.toLowerCase()===N});if(!ne||ne.length===0)f.warn("Codec not supported in this browser for this track, ignoring:",x);else if(B)try{B.setCodecPreferences(ne)}catch(be){f.warn("Failed enforcing codec for this "+A+" track:",be)}}if(x.bitrate){if(x.simulcast||x.svc)f.warn("Ignoring bitrate for simulcast/SVC track, use sendEncodings for that");else if(isNaN(x.bitrate)||x.bitrate<0)f.warn("Ignoring invalid bitrate for track:",x);else if(re){let N=re.getParameters();!N||!N.encodings||N.encodings.length===0?f.warn("No encodings in the sender parameters, ignoring bitrate for track:",x):(N.encodings[0].maxBitrate=x.bitrate,await re.setParameters(N))}}if(A==="video"&&x.framerate){if(x.simulcast||x.svc)f.warn("Ignoring framerate for simulcast/SVC track, use sendEncodings for that");else if(isNaN(x.framerate)||x.framerate<0)f.warn("Ignoring invalid framerate for track:",x);else if(re){let N=re.getParameters();!N||!N.encodings||N.encodings.length===0?f.warn("No encodings in the sender parameters, ignoring framerate for track:",x):(N.encodings[0].maxFramerate=x.framerate,await re.setParameters(N))}}if(x.transforms){if(re&&x.transforms.sender){let N=null;RTCRtpSender.prototype.createEncodedStreams?N=re.createEncodedStreams():(RTCRtpSender.prototype.createAudioEncodedStreams||RTCRtpSender.prototype.createEncodedVideoStreams)&&(A==="audio"?N=re.createEncodedAudioStreams():A==="video"&&(N=re.createEncodedVideoStreams())),N&&(N.readableStream&&N.writableStream?N.readableStream.pipeThrough(x.transforms.sender).pipeTo(N.writableStream):N.readable&&N.writable&&N.readable.pipeThrough(x.transforms.sender).pipeTo(N.writable))}if(B&&B.receiver&&x.transforms.receiver){let N=null;RTCRtpReceiver.prototype.createEncodedStreams?N=B.receiver.createEncodedStreams():(RTCRtpReceiver.prototype.createAudioEncodedStreams||RTCRtpReceiver.prototype.createEncodedVideoStreams)&&(A==="audio"?N=B.receiver.createEncodedAudioStreams():A==="video"&&(N=B.receiver.createEncodedVideoStreams())),N&&(N.readableStream&&N.writableStream?N.readableStream.pipeThrough(x.transforms.receiver).pipeTo(N.writableStream):N.readable&&N.writable&&N.readable.pipeThrough(x.transforms.receiver).pipeTo(N.writable))}}}fe&&x.dontStop===!0&&(fe.dontStop=!0)}else if(x.recv&&(B||(B=y.pc.addTransceiver(A)),B)){if(x.codec)if(f.webRTCAdapter.browserDetails.browser==="firefox")f.warn("setCodecPreferences not supported in Firefox, ignoring codec for track:",x);else if(typeof x.codec!="string")f.warn("Invalid codec value, ignoring for track:",x);else{let N=A+"/"+x.codec.toLowerCase(),ne=RTCRtpReceiver.getCapabilities(A).codecs.filter(function(be){return be.mimeType.toLowerCase()===N});if(!ne||ne.length===0)f.warn("Codec not supported in this browser for this track, ignoring:",x);else try{B.setCodecPreferences(ne)}catch(be){f.warn("Failed enforcing codec for this "+A+" track:",be)}}if(B.receiver&&x.transforms&&x.transforms.receiver){let N=null;RTCRtpReceiver.prototype.createEncodedStreams?N=B.receiver.createEncodedStreams():(RTCRtpReceiver.prototype.createAudioEncodedStreams||RTCRtpReceiver.prototype.createEncodedVideoStreams)&&(A==="audio"?N=B.receiver.createEncodedAudioStreams():A==="video"&&(N=B.receiver.createEncodedVideoStreams())),N&&(N.readableStream&&N.writableStream?N.readableStream.pipeThrough(x.transforms.receiver).pipeTo(N.writableStream):N.readable&&N.writable&&N.readable.pipeThrough(x.transforms.receiver).pipeTo(N.writable))}}if(fe){y.myStream.addTrack(fe),fe.onended=function(N){f.log("Local track removed:",N);try{b.onlocaltrack(N.target,!1)}catch(ne){f.error("Error calling onlocaltrack following end",ne)}};try{b.onlocaltrack(fe,!0)}catch(N){f.error("Error calling onlocaltrack for track add",N)}}if(B){let N=B.direction,ne=null,be=fe&&B.sender.track,gt=x.recv!==!1&&B.receiver.track;be&>?ne="sendrecv":be&&!gt?ne="sendonly":!be&>?ne="recvonly":!be&&!gt&&(ne="inactive"),ne&&ne!==N&&(f.warn("Changing direction of transceiver to "+ne+" (was "+N+")",x),B.setDirection?B.setDirection(ne):B.direction=ne)}}I&&b.consentDialog(!1)}function Ut(v){let C=X.get(v);if(!C||!C.webrtcStuff)return f.warn("Invalid handle"),null;let b=C.webrtcStuff;if(!b.pc)return f.warn("Invalid PeerConnection"),null;let y=[],O=b.pc.getTransceivers();for(let I of O){let w=null;I.sender&&I.sender.track&&(w={mid:I.mid},w.type=I.sender.track.kind,w.id=I.sender.track.id,w.label=I.sender.track.label),w&&y.push(w)}return y}function cr(v){let C=X.get(v);if(!C||!C.webrtcStuff)return f.warn("Invalid handle"),null;let b=C.webrtcStuff;if(!b.pc)return f.warn("Invalid PeerConnection"),null;let y=[],O=b.pc.getTransceivers();for(let I of O){let w=null;I.receiver&&I.receiver.track&&(w={mid:I.mid},w.type=I.receiver.track.kind,w.id=I.receiver.track.id,w.label=I.receiver.track.label),w&&y.push(w)}return y}function at(v,C,b,y){y=typeof y=="function"?y:f.noop;let O=X.get(v);if(!O||!O.webrtcStuff){f.warn("Invalid handle"),y(0);return}let I=b?"remote":"local",w=O.webrtcStuff;if(w.volume[I]||(w.volume[I]={value:0}),w.pc&&w.pc.getStats&&(f.webRTCAdapter.browserDetails.browser==="chrome"||f.webRTCAdapter.browserDetails.browser==="safari")){let W=w.pc;if(C){let F=w.pc.getTransceivers().find(x=>x.mid===C&&x.receiver.track.kind==="audio");if(!F){f.warn("No audio transceiver with mid "+C),y(0);return}if(b&&!F.receiver){f.warn("Remote transceiver track unavailable"),y(0);return}else if(!b&&!F.sender){f.warn("Local transceiver track unavailable"),y(0);return}W=b?F.receiver:F.sender}return W.getStats().then(function(F){F.forEach(function(x){!x||x.kind!=="audio"||b&&!x.remoteSource||!b&&x.type!=="media-source"||y(x.audioLevel?x.audioLevel:0)})}),w.volume[I].value}else{f.warn("Getting the "+I+" volume unsupported by browser"),y(0);return}}function bt(v,C,b){let y=X.get(v);if(!y||!y.webrtcStuff)return f.warn("Invalid handle"),!0;let O=y.webrtcStuff;if(!O.pc)return f.warn("Invalid PeerConnection"),!0;if(!O.myStream)return f.warn("Invalid local MediaStream"),!0;if(b){if(!O.myStream.getVideoTracks()||O.myStream.getVideoTracks().length===0)return f.warn("No video track"),!0;if(C){let I=O.pc.getTransceivers().find(w=>w.mid===C&&w.receiver.track.kind==="video");return I?!I.sender||!I.sender.track?(f.warn("No video sender with mid "+C),!0):!I.sender.track.enabled:(f.warn("No video transceiver with mid "+C),!0)}else return!O.myStream.getVideoTracks()[0].enabled}else{if(!O.myStream.getAudioTracks()||O.myStream.getAudioTracks().length===0)return f.warn("No audio track"),!0;if(C){let I=O.pc.getTransceivers().find(w=>w.mid===C&&w.receiver.track.kind==="audio");return I?!I.sender||!I.sender.track?(f.warn("No audio sender with mid "+C),!0):!I.sender.track.enabled:(f.warn("No audio transceiver with mid "+C),!0)}else return!O.myStream.getAudioTracks()[0].enabled}}function ut(v,C,b,y){let O=X.get(v);if(!O||!O.webrtcStuff)return f.warn("Invalid handle"),!1;let I=O.webrtcStuff;if(!I.pc)return f.warn("Invalid PeerConnection"),!1;if(!I.myStream)return f.warn("Invalid local MediaStream"),!1;if(b){if(!I.myStream.getVideoTracks()||I.myStream.getVideoTracks().length===0)return f.warn("No video track"),!1;if(C){let w=I.pc.getTransceivers().find(W=>W.mid===C&&W.receiver.track.kind==="video");if(!w)return f.warn("No video transceiver with mid "+C),!1;if(!w.sender||!w.sender.track)return f.warn("No video sender with mid "+C),!1;w.sender.track.enabled=!y}else for(const w of I.myStream.getVideoTracks())w.enabled=!y}else{if(!I.myStream.getAudioTracks()||I.myStream.getAudioTracks().length===0)return f.warn("No audio track"),!1;if(C){let w=I.pc.getTransceivers().find(W=>W.mid===C&&W.receiver.track.kind==="audio");if(!w)return f.warn("No audio transceiver with mid "+C),!1;if(!w.sender||!w.sender.track)return f.warn("No audio sender with mid "+C),!1;w.sender.track.enabled=!y}else for(const w of I.myStream.getAudioTracks())w.enabled=!y}return!0}function Ne(v,C){let b=X.get(v);if(!b||!b.webrtcStuff)return f.warn("Invalid handle"),"Invalid handle";let y=b.webrtcStuff;if(!y.pc)return"Invalid PeerConnection";if(y.pc.getStats){let O=y.pc,I=C||"default";if(C){let w=y.pc.getTransceivers().find(W=>W.mid===C&&W.receiver.track.kind==="video");if(!w)return f.warn("No video transceiver with mid "+C),"No video transceiver with mid "+C;if(!w.receiver)return f.warn("No video receiver with mid "+C),"No video receiver with mid "+C;O=w.receiver}return y.bitrate[I]||(y.bitrate[I]={timer:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,value:"0 kbits/sec"}),y.bitrate[I].timer?y.bitrate[I].value:(f.log("Starting bitrate timer"+(C?" for mid "+C:"")+" (via getStats)"),y.bitrate[I].timer=setInterval(function(){O.getStats().then(function(w){w.forEach(function(W){if(!W)return;let F=!1;if(((W.mediaType==="video"||W.id.toLowerCase().indexOf("video")>-1)&&W.type==="inbound-rtp"&&W.id.indexOf("rtcp")<0||W.type=="ssrc"&&W.bytesReceived&&(W.googCodecName==="VP8"||W.googCodecName===""))&&(F=!0),F)if(y.bitrate[I].bsnow=W.bytesReceived,y.bitrate[I].tsnow=W.timestamp,y.bitrate[I].bsbefore===null||y.bitrate[I].tsbefore===null)y.bitrate[I].bsbefore=y.bitrate[I].bsnow,y.bitrate[I].tsbefore=y.bitrate[I].tsnow;else{let x=y.bitrate[I].tsnow-y.bitrate[I].tsbefore;f.webRTCAdapter.browserDetails.browser==="safari"&&(x=x/1e3);let A=Math.round((y.bitrate[I].bsnow-y.bitrate[I].bsbefore)*8/x);f.webRTCAdapter.browserDetails.browser==="safari"&&(A=parseInt(A/1e3)),y.bitrate[I].value=A+" kbits/sec",y.bitrate[I].bsbefore=y.bitrate[I].bsnow,y.bitrate[I].tsbefore=y.bitrate[I].tsnow}})})},1e3),"0 kbits/sec")}else return f.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser"}function Ft(v,C,b){let y=X.get(v);if(!y||!y.webrtcStuff){f.warn("Invalid handle");return}let O=y.webrtcStuff;if(!O.pc){f.warn("Invalid PeerConnection");return}let I=O.pc.getTransceivers().find(W=>W.mid===C);if(!I){f.warn("No transceiver with mid",C);return}if(!I.sender){f.warn("No sender for transceiver with mid",C);return}let w=I.sender.getParameters();!w||!w.encodings||w.encodings.length===0?f.warn("No parameters encodings"):w.encodings.length>1?f.warn("Ignoring bitrate for simulcast track, use sendEncodings for that"):isNaN(b)||b<0?f.warn("Invalid bitrate (must be a positive integer)"):(w.encodings[0].maxBitrate=b,I.sender.setParameters(w))}function fr(v){f.error("WebRTC error:",v)}function qe(v,C){f.log("Cleaning WebRTC stuff");let b=X.get(v);if(!b)return;let y=b.webrtcStuff;if(y){if(C===!0){let O={janus:"hangup",transaction:f.randomString(12)};b.token&&(O.token=b.token),j&&(O.apisecret=j),f.debug("Sending hangup request (handle="+v+"):"),f.debug(O),s?(O.session_id=$,O.handle_id=v,n.send(JSON.stringify(O))):f.httpAPICall(m+"/"+$+"/"+v,{verb:"POST",withCredentials:D,body:O})}y.volume&&(y.volume.local&&y.volume.local.timer&&clearInterval(y.volume.local.timer),y.volume.remote&&y.volume.remote.timer&&clearInterval(y.volume.remote.timer));for(let O in y.bitrate)y.bitrate[O].timer&&clearInterval(y.bitrate[O].timer);y.bitrate={},!y.streamExternal&&y.myStream&&(f.log("Stopping local stream tracks"),f.stopAllTracks(y.myStream)),y.streamExternal=!1,y.myStream=null;try{y.pc.close()}catch{}y.pc=null,y.candidates=null,y.mySdp=null,y.remoteSdp=null,y.iceDone=!1,y.dataChannel={},y.dtmfSender=null,y.insertableStreams=!1}b.oncleanup()}function lr(v){return f.debug("isTrickleEnabled:",v),v!==!1}}let Hu=!0,qu=!0;function ri(i,s,n){const o=i.match(s);return o&&o.length>=n&&parseInt(o[n],10)}function In(i,s,n){if(!i.RTCPeerConnection)return;const o=i.RTCPeerConnection.prototype,a=o.addEventListener;o.addEventListener=function(p,m){if(p!==s)return a.apply(this,arguments);const T=l=>{const _=n(l);_&&(m.handleEvent?m.handleEvent(_):m(_))};return this._eventMap=this._eventMap||{},this._eventMap[s]||(this._eventMap[s]=new Map),this._eventMap[s].set(m,T),a.apply(this,[p,T])};const u=o.removeEventListener;o.removeEventListener=function(p,m){if(p!==s||!this._eventMap||!this._eventMap[s])return u.apply(this,arguments);if(!this._eventMap[s].has(m))return u.apply(this,arguments);const T=this._eventMap[s].get(m);return this._eventMap[s].delete(m),this._eventMap[s].size===0&&delete this._eventMap[s],Object.keys(this._eventMap).length===0&&delete this._eventMap,u.apply(this,[p,T])},Object.defineProperty(o,"on"+s,{get(){return this["_on"+s]},set(p){this["_on"+s]&&(this.removeEventListener(s,this["_on"+s]),delete this["_on"+s]),p&&this.addEventListener(s,this["_on"+s]=p)},enumerable:!0,configurable:!0})}function mv(i){return typeof i!="boolean"?new Error("Argument type: "+typeof i+". Please use a boolean."):(Hu=i,i?"adapter.js logging disabled":"adapter.js logging enabled")}function vv(i){return typeof i!="boolean"?new Error("Argument type: "+typeof i+". Please use a boolean."):(qu=!i,"adapter.js deprecation warnings "+(i?"disabled":"enabled"))}function Ju(){if(typeof window=="object"){if(Hu)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Jo(i,s){qu&&console.warn(i+" is deprecated, please use "+s+" instead.")}function yv(i){const s={browser:null,version:null};if(typeof i>"u"||!i.navigator)return s.browser="Not a browser.",s;const{navigator:n}=i;if(n.mozGetUserMedia)s.browser="firefox",s.version=ri(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||i.isSecureContext===!1&&i.webkitRTCPeerConnection&&!i.RTCIceGatherer)s.browser="chrome",s.version=ri(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(i.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))s.browser="safari",s.version=ri(n.userAgent,/AppleWebKit\/(\d+)\./,1),s.supportsUnifiedPlan=i.RTCRtpTransceiver&&"currentDirection"in i.RTCRtpTransceiver.prototype;else return s.browser="Not a supported browser.",s;return s}function Su(i){return Object.prototype.toString.call(i)==="[object Object]"}function zu(i){return Su(i)?Object.keys(i).reduce(function(s,n){const o=Su(i[n]),a=o?zu(i[n]):i[n],u=o&&!Object.keys(a).length;return a===void 0||u?s:Object.assign(s,{[n]:a})},{}):i}function Uo(i,s,n){!s||n.has(s.id)||(n.set(s.id,s),Object.keys(s).forEach(o=>{o.endsWith("Id")?Uo(i,i.get(s[o]),n):o.endsWith("Ids")&&s[o].forEach(a=>{Uo(i,i.get(a),n)})}))}function Cu(i,s,n){const o=n?"outbound-rtp":"inbound-rtp",a=new Map;if(s===null)return a;const u=[];return i.forEach(p=>{p.type==="track"&&p.trackIdentifier===s.id&&u.push(p)}),u.forEach(p=>{i.forEach(m=>{m.type===o&&m.trackId===p.id&&Uo(i,m,a)})}),a}const bu=Ju;function Vu(i,s){const n=i&&i.navigator;if(!n.mediaDevices)return;const o=function(m){if(typeof m!="object"||m.mandatory||m.optional)return m;const T={};return Object.keys(m).forEach(l=>{if(l==="require"||l==="advanced"||l==="mediaSource")return;const _=typeof m[l]=="object"?m[l]:{ideal:m[l]};_.exact!==void 0&&typeof _.exact=="number"&&(_.min=_.max=_.exact);const D=function(H,z){return H?H+z.charAt(0).toUpperCase()+z.slice(1):z==="deviceId"?"sourceId":z};if(_.ideal!==void 0){T.optional=T.optional||[];let H={};typeof _.ideal=="number"?(H[D("min",l)]=_.ideal,T.optional.push(H),H={},H[D("max",l)]=_.ideal,T.optional.push(H)):(H[D("",l)]=_.ideal,T.optional.push(H))}_.exact!==void 0&&typeof _.exact!="number"?(T.mandatory=T.mandatory||{},T.mandatory[D("",l)]=_.exact):["min","max"].forEach(H=>{_[H]!==void 0&&(T.mandatory=T.mandatory||{},T.mandatory[D(H,l)]=_[H])})}),m.advanced&&(T.optional=(T.optional||[]).concat(m.advanced)),T},a=function(m,T){if(s.version>=61)return T(m);if(m=JSON.parse(JSON.stringify(m)),m&&typeof m.audio=="object"){const l=function(_,D,H){D in _&&!(H in _)&&(_[H]=_[D],delete _[D])};m=JSON.parse(JSON.stringify(m)),l(m.audio,"autoGainControl","googAutoGainControl"),l(m.audio,"noiseSuppression","googNoiseSuppression"),m.audio=o(m.audio)}if(m&&typeof m.video=="object"){let l=m.video.facingMode;l=l&&(typeof l=="object"?l:{ideal:l});const _=s.version<66;if(l&&(l.exact==="user"||l.exact==="environment"||l.ideal==="user"||l.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!_)){delete m.video.facingMode;let D;if(l.exact==="environment"||l.ideal==="environment"?D=["back","rear"]:(l.exact==="user"||l.ideal==="user")&&(D=["front"]),D)return n.mediaDevices.enumerateDevices().then(H=>{H=H.filter(j=>j.kind==="videoinput");let z=H.find(j=>D.some(ee=>j.label.toLowerCase().includes(ee)));return!z&&H.length&&D.includes("back")&&(z=H[H.length-1]),z&&(m.video.deviceId=l.exact?{exact:z.deviceId}:{ideal:z.deviceId}),m.video=o(m.video),bu("chrome: "+JSON.stringify(m)),T(m)})}m.video=o(m.video)}return bu("chrome: "+JSON.stringify(m)),T(m)},u=function(m){return s.version>=64?m:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[m.name]||m.name,message:m.message,constraint:m.constraint||m.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},p=function(m,T,l){a(m,_=>{n.webkitGetUserMedia(_,T,D=>{l&&l(u(D))})})};if(n.getUserMedia=p.bind(n),n.mediaDevices.getUserMedia){const m=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(T){return a(T,l=>m(l).then(_=>{if(l.audio&&!_.getAudioTracks().length||l.video&&!_.getVideoTracks().length)throw _.getTracks().forEach(D=>{D.stop()}),new DOMException("","NotFoundError");return _},_=>Promise.reject(u(_))))}}}function _v(i,s){if(!(i.navigator.mediaDevices&&"getDisplayMedia"in i.navigator.mediaDevices)&&i.navigator.mediaDevices){if(typeof s!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}i.navigator.mediaDevices.getDisplayMedia=function(o){return s(o).then(a=>{const u=o.video&&o.video.width,p=o.video&&o.video.height,m=o.video&&o.video.frameRate;return o.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:a,maxFrameRate:m||3}},u&&(o.video.mandatory.maxWidth=u),p&&(o.video.mandatory.maxHeight=p),i.navigator.mediaDevices.getUserMedia(o)})}}}function $u(i){i.MediaStream=i.MediaStream||i.webkitMediaStream}function ju(i){if(typeof i=="object"&&i.RTCPeerConnection&&!("ontrack"in i.RTCPeerConnection.prototype)){Object.defineProperty(i.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(n){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=n)},enumerable:!0,configurable:!0});const s=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=o=>{o.stream.addEventListener("addtrack",a=>{let u;i.RTCPeerConnection.prototype.getReceivers?u=this.getReceivers().find(m=>m.track&&m.track.id===a.track.id):u={track:a.track};const p=new Event("track");p.track=a.track,p.receiver=u,p.transceiver={receiver:u},p.streams=[o.stream],this.dispatchEvent(p)}),o.stream.getTracks().forEach(a=>{let u;i.RTCPeerConnection.prototype.getReceivers?u=this.getReceivers().find(m=>m.track&&m.track.id===a.id):u={track:a};const p=new Event("track");p.track=a,p.receiver=u,p.transceiver={receiver:u},p.streams=[o.stream],this.dispatchEvent(p)})},this.addEventListener("addstream",this._ontrackpoly)),s.apply(this,arguments)}}else In(i,"track",s=>(s.transceiver||Object.defineProperty(s,"transceiver",{value:{receiver:s.receiver}}),s))}function Ku(i){if(typeof i=="object"&&i.RTCPeerConnection&&!("getSenders"in i.RTCPeerConnection.prototype)&&"createDTMFSender"in i.RTCPeerConnection.prototype){const s=function(a,u){return{track:u,get dtmf(){return this._dtmf===void 0&&(u.kind==="audio"?this._dtmf=a.createDTMFSender(u):this._dtmf=null),this._dtmf},_pc:a}};if(!i.RTCPeerConnection.prototype.getSenders){i.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const a=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addTrack=function(m,T){let l=a.apply(this,arguments);return l||(l=s(this,m),this._senders.push(l)),l};const u=i.RTCPeerConnection.prototype.removeTrack;i.RTCPeerConnection.prototype.removeTrack=function(m){u.apply(this,arguments);const T=this._senders.indexOf(m);T!==-1&&this._senders.splice(T,1)}}const n=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(u){this._senders=this._senders||[],n.apply(this,[u]),u.getTracks().forEach(p=>{this._senders.push(s(this,p))})};const o=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(u){this._senders=this._senders||[],o.apply(this,[u]),u.getTracks().forEach(p=>{const m=this._senders.find(T=>T.track===p);m&&this._senders.splice(this._senders.indexOf(m),1)})}}else if(typeof i=="object"&&i.RTCPeerConnection&&"getSenders"in i.RTCPeerConnection.prototype&&"createDTMFSender"in i.RTCPeerConnection.prototype&&i.RTCRtpSender&&!("dtmf"in i.RTCRtpSender.prototype)){const s=i.RTCPeerConnection.prototype.getSenders;i.RTCPeerConnection.prototype.getSenders=function(){const o=s.apply(this,[]);return o.forEach(a=>a._pc=this),o},Object.defineProperty(i.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Yu(i){if(!i.RTCPeerConnection)return;const s=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){const[o,a,u]=arguments;if(arguments.length>0&&typeof o=="function")return s.apply(this,arguments);if(s.length===0&&(arguments.length===0||typeof o!="function"))return s.apply(this,[]);const p=function(T){const l={};return T.result().forEach(D=>{const H={id:D.id,timestamp:D.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[D.type]||D.type};D.names().forEach(z=>{H[z]=D.stat(z)}),l[H.id]=H}),l},m=function(T){return new Map(Object.keys(T).map(l=>[l,T[l]]))};if(arguments.length>=2){const T=function(l){a(m(p(l)))};return s.apply(this,[T,o])}return new Promise((T,l)=>{s.apply(this,[function(_){T(m(p(_)))},l])}).then(a,u)}}function Zu(i){if(!(typeof i=="object"&&i.RTCPeerConnection&&i.RTCRtpSender&&i.RTCRtpReceiver))return;if(!("getStats"in i.RTCRtpSender.prototype)){const n=i.RTCPeerConnection.prototype.getSenders;n&&(i.RTCPeerConnection.prototype.getSenders=function(){const u=n.apply(this,[]);return u.forEach(p=>p._pc=this),u});const o=i.RTCPeerConnection.prototype.addTrack;o&&(i.RTCPeerConnection.prototype.addTrack=function(){const u=o.apply(this,arguments);return u._pc=this,u}),i.RTCRtpSender.prototype.getStats=function(){const u=this;return this._pc.getStats().then(p=>Cu(p,u.track,!0))}}if(!("getStats"in i.RTCRtpReceiver.prototype)){const n=i.RTCPeerConnection.prototype.getReceivers;n&&(i.RTCPeerConnection.prototype.getReceivers=function(){const a=n.apply(this,[]);return a.forEach(u=>u._pc=this),a}),In(i,"track",o=>(o.receiver._pc=o.srcElement,o)),i.RTCRtpReceiver.prototype.getStats=function(){const a=this;return this._pc.getStats().then(u=>Cu(u,a.track,!1))}}if(!("getStats"in i.RTCRtpSender.prototype&&"getStats"in i.RTCRtpReceiver.prototype))return;const s=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof i.MediaStreamTrack){const o=arguments[0];let a,u,p;return this.getSenders().forEach(m=>{m.track===o&&(a?p=!0:a=m)}),this.getReceivers().forEach(m=>(m.track===o&&(u?p=!0:u=m),m.track===o)),p||a&&u?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):a?a.getStats():u?u.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return s.apply(this,arguments)}}function Xu(i){i.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(p=>this._shimmedLocalStreams[p][0])};const s=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addTrack=function(p,m){if(!m)return s.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const T=s.apply(this,arguments);return this._shimmedLocalStreams[m.id]?this._shimmedLocalStreams[m.id].indexOf(T)===-1&&this._shimmedLocalStreams[m.id].push(T):this._shimmedLocalStreams[m.id]=[m,T],T};const n=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(p){this._shimmedLocalStreams=this._shimmedLocalStreams||{},p.getTracks().forEach(l=>{if(this.getSenders().find(D=>D.track===l))throw new DOMException("Track already exists.","InvalidAccessError")});const m=this.getSenders();n.apply(this,arguments);const T=this.getSenders().filter(l=>m.indexOf(l)===-1);this._shimmedLocalStreams[p.id]=[p].concat(T)};const o=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(p){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[p.id],o.apply(this,arguments)};const a=i.RTCPeerConnection.prototype.removeTrack;i.RTCPeerConnection.prototype.removeTrack=function(p){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},p&&Object.keys(this._shimmedLocalStreams).forEach(m=>{const T=this._shimmedLocalStreams[m].indexOf(p);T!==-1&&this._shimmedLocalStreams[m].splice(T,1),this._shimmedLocalStreams[m].length===1&&delete this._shimmedLocalStreams[m]}),a.apply(this,arguments)}}function Qu(i,s){if(!i.RTCPeerConnection)return;if(i.RTCPeerConnection.prototype.addTrack&&s.version>=65)return Xu(i);const n=i.RTCPeerConnection.prototype.getLocalStreams;i.RTCPeerConnection.prototype.getLocalStreams=function(){const _=n.apply(this);return this._reverseStreams=this._reverseStreams||{},_.map(D=>this._reverseStreams[D.id])};const o=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(_){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},_.getTracks().forEach(D=>{if(this.getSenders().find(z=>z.track===D))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[_.id]){const D=new i.MediaStream(_.getTracks());this._streams[_.id]=D,this._reverseStreams[D.id]=_,_=D}o.apply(this,[_])};const a=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(_){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},a.apply(this,[this._streams[_.id]||_]),delete this._reverseStreams[this._streams[_.id]?this._streams[_.id].id:_.id],delete this._streams[_.id]},i.RTCPeerConnection.prototype.addTrack=function(_,D){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const H=[].slice.call(arguments,1);if(H.length!==1||!H[0].getTracks().find(ee=>ee===_))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(ee=>ee.track===_))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const j=this._streams[D.id];if(j)j.addTrack(_),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const ee=new i.MediaStream([_]);this._streams[D.id]=ee,this._reverseStreams[ee.id]=D,this.addStream(ee)}return this.getSenders().find(ee=>ee.track===_)};function u(l,_){let D=_.sdp;return Object.keys(l._reverseStreams||[]).forEach(H=>{const z=l._reverseStreams[H],j=l._streams[z.id];D=D.replace(new RegExp(j.id,"g"),z.id)}),new RTCSessionDescription({type:_.type,sdp:D})}function p(l,_){let D=_.sdp;return Object.keys(l._reverseStreams||[]).forEach(H=>{const z=l._reverseStreams[H],j=l._streams[z.id];D=D.replace(new RegExp(z.id,"g"),j.id)}),new RTCSessionDescription({type:_.type,sdp:D})}["createOffer","createAnswer"].forEach(function(l){const _=i.RTCPeerConnection.prototype[l],D={[l](){const H=arguments;return arguments.length&&typeof arguments[0]=="function"?_.apply(this,[j=>{const ee=u(this,j);H[0].apply(null,[ee])},j=>{H[1]&&H[1].apply(null,j)},arguments[2]]):_.apply(this,arguments).then(j=>u(this,j))}};i.RTCPeerConnection.prototype[l]=D[l]});const m=i.RTCPeerConnection.prototype.setLocalDescription;i.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?m.apply(this,arguments):(arguments[0]=p(this,arguments[0]),m.apply(this,arguments))};const T=Object.getOwnPropertyDescriptor(i.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(i.RTCPeerConnection.prototype,"localDescription",{get(){const l=T.get.apply(this);return l.type===""?l:u(this,l)}}),i.RTCPeerConnection.prototype.removeTrack=function(_){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!_._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(_._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let H;Object.keys(this._streams).forEach(z=>{this._streams[z].getTracks().find(ee=>_.track===ee)&&(H=this._streams[z])}),H&&(H.getTracks().length===1?this.removeStream(this._reverseStreams[H.id]):H.removeTrack(_.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Fo(i,s){!i.RTCPeerConnection&&i.webkitRTCPeerConnection&&(i.RTCPeerConnection=i.webkitRTCPeerConnection),i.RTCPeerConnection&&s.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const o=i.RTCPeerConnection.prototype[n],a={[n](){return arguments[0]=new(n==="addIceCandidate"?i.RTCIceCandidate:i.RTCSessionDescription)(arguments[0]),o.apply(this,arguments)}};i.RTCPeerConnection.prototype[n]=a[n]})}function ec(i,s){In(i,"negotiationneeded",n=>{const o=n.target;if(!((s.version<72||o.getConfiguration&&o.getConfiguration().sdpSemantics==="plan-b")&&o.signalingState!=="stable"))return n})}const Tu=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:ec,shimAddTrackRemoveTrack:Qu,shimAddTrackRemoveTrackWithNative:Xu,shimGetDisplayMedia:_v,shimGetSendersWithDtmf:Ku,shimGetStats:Yu,shimGetUserMedia:Vu,shimMediaStream:$u,shimOnTrack:ju,shimPeerConnection:Fo,shimSenderReceiverGetStats:Zu},Symbol.toStringTag,{value:"Module"}));function tc(i,s){const n=i&&i.navigator,o=i&&i.MediaStreamTrack;if(n.getUserMedia=function(a,u,p){Jo("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(a).then(u,p)},!(s.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const a=function(p,m,T){m in p&&!(T in p)&&(p[T]=p[m],delete p[m])},u=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(p){return typeof p=="object"&&typeof p.audio=="object"&&(p=JSON.parse(JSON.stringify(p)),a(p.audio,"autoGainControl","mozAutoGainControl"),a(p.audio,"noiseSuppression","mozNoiseSuppression")),u(p)},o&&o.prototype.getSettings){const p=o.prototype.getSettings;o.prototype.getSettings=function(){const m=p.apply(this,arguments);return a(m,"mozAutoGainControl","autoGainControl"),a(m,"mozNoiseSuppression","noiseSuppression"),m}}if(o&&o.prototype.applyConstraints){const p=o.prototype.applyConstraints;o.prototype.applyConstraints=function(m){return this.kind==="audio"&&typeof m=="object"&&(m=JSON.parse(JSON.stringify(m)),a(m,"autoGainControl","mozAutoGainControl"),a(m,"noiseSuppression","mozNoiseSuppression")),p.apply(this,[m])}}}}function Sv(i,s){i.navigator.mediaDevices&&"getDisplayMedia"in i.navigator.mediaDevices||i.navigator.mediaDevices&&(i.navigator.mediaDevices.getDisplayMedia=function(o){if(!(o&&o.video)){const a=new DOMException("getDisplayMedia without video constraints is undefined");return a.name="NotFoundError",a.code=8,Promise.reject(a)}return o.video===!0?o.video={mediaSource:s}:o.video.mediaSource=s,i.navigator.mediaDevices.getUserMedia(o)})}function nc(i){typeof i=="object"&&i.RTCTrackEvent&&"receiver"in i.RTCTrackEvent.prototype&&!("transceiver"in i.RTCTrackEvent.prototype)&&Object.defineProperty(i.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function No(i,s){if(typeof i!="object"||!(i.RTCPeerConnection||i.mozRTCPeerConnection))return;!i.RTCPeerConnection&&i.mozRTCPeerConnection&&(i.RTCPeerConnection=i.mozRTCPeerConnection),s.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(a){const u=i.RTCPeerConnection.prototype[a],p={[a](){return arguments[0]=new(a==="addIceCandidate"?i.RTCIceCandidate:i.RTCSessionDescription)(arguments[0]),u.apply(this,arguments)}};i.RTCPeerConnection.prototype[a]=p[a]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},o=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){const[u,p,m]=arguments;return o.apply(this,[u||null]).then(T=>{if(s.version<53&&!p)try{T.forEach(l=>{l.type=n[l.type]||l.type})}catch(l){if(l.name!=="TypeError")throw l;T.forEach((_,D)=>{T.set(D,Object.assign({},_,{type:n[_.type]||_.type}))})}return T}).then(p,m)}}function rc(i){if(!(typeof i=="object"&&i.RTCPeerConnection&&i.RTCRtpSender)||i.RTCRtpSender&&"getStats"in i.RTCRtpSender.prototype)return;const s=i.RTCPeerConnection.prototype.getSenders;s&&(i.RTCPeerConnection.prototype.getSenders=function(){const a=s.apply(this,[]);return a.forEach(u=>u._pc=this),a});const n=i.RTCPeerConnection.prototype.addTrack;n&&(i.RTCPeerConnection.prototype.addTrack=function(){const a=n.apply(this,arguments);return a._pc=this,a}),i.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function ic(i){if(!(typeof i=="object"&&i.RTCPeerConnection&&i.RTCRtpSender)||i.RTCRtpSender&&"getStats"in i.RTCRtpReceiver.prototype)return;const s=i.RTCPeerConnection.prototype.getReceivers;s&&(i.RTCPeerConnection.prototype.getReceivers=function(){const o=s.apply(this,[]);return o.forEach(a=>a._pc=this),o}),In(i,"track",n=>(n.receiver._pc=n.srcElement,n)),i.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function oc(i){!i.RTCPeerConnection||"removeStream"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.removeStream=function(n){Jo("removeStream","removeTrack"),this.getSenders().forEach(o=>{o.track&&n.getTracks().includes(o.track)&&this.removeTrack(o)})})}function sc(i){i.DataChannel&&!i.RTCDataChannel&&(i.RTCDataChannel=i.DataChannel)}function ac(i){if(!(typeof i=="object"&&i.RTCPeerConnection))return;const s=i.RTCPeerConnection.prototype.addTransceiver;s&&(i.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const o=arguments[1],a=o&&"sendEncodings"in o;a&&o.sendEncodings.forEach(p=>{if("rid"in p&&!/^[a-z0-9]{0,16}$/i.test(p.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in p&&!(parseFloat(p.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in p&&!(parseFloat(p.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const u=s.apply(this,arguments);if(a){const{sender:p}=u,m=p.getParameters();(!("encodings"in m)||m.encodings.length===1&&Object.keys(m.encodings[0]).length===0)&&(m.encodings=o.sendEncodings,p.sendEncodings=o.sendEncodings,this.setParametersPromises.push(p.setParameters(m).then(()=>{delete p.sendEncodings}).catch(()=>{delete p.sendEncodings})))}return u})}function uc(i){if(!(typeof i=="object"&&i.RTCRtpSender))return;const s=i.RTCRtpSender.prototype.getParameters;s&&(i.RTCRtpSender.prototype.getParameters=function(){const o=s.apply(this,arguments);return"encodings"in o||(o.encodings=[].concat(this.sendEncodings||[{}])),o})}function cc(i){if(!(typeof i=="object"&&i.RTCPeerConnection))return;const s=i.RTCPeerConnection.prototype.createOffer;i.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>s.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):s.apply(this,arguments)}}function fc(i){if(!(typeof i=="object"&&i.RTCPeerConnection))return;const s=i.RTCPeerConnection.prototype.createAnswer;i.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>s.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):s.apply(this,arguments)}}const Ru=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:ac,shimCreateAnswer:fc,shimCreateOffer:cc,shimGetDisplayMedia:Sv,shimGetParameters:uc,shimGetUserMedia:tc,shimOnTrack:nc,shimPeerConnection:No,shimRTCDataChannel:sc,shimReceiverGetStats:ic,shimRemoveStream:oc,shimSenderGetStats:rc},Symbol.toStringTag,{value:"Module"}));function lc(i){if(!(typeof i!="object"||!i.RTCPeerConnection)){if("getLocalStreams"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in i.RTCPeerConnection.prototype)){const s=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addStream=function(o){this._localStreams||(this._localStreams=[]),this._localStreams.includes(o)||this._localStreams.push(o),o.getAudioTracks().forEach(a=>s.call(this,a,o)),o.getVideoTracks().forEach(a=>s.call(this,a,o))},i.RTCPeerConnection.prototype.addTrack=function(o,...a){return a&&a.forEach(u=>{this._localStreams?this._localStreams.includes(u)||this._localStreams.push(u):this._localStreams=[u]}),s.apply(this,arguments)}}"removeStream"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.removeStream=function(n){this._localStreams||(this._localStreams=[]);const o=this._localStreams.indexOf(n);if(o===-1)return;this._localStreams.splice(o,1);const a=n.getTracks();this.getSenders().forEach(u=>{a.includes(u.track)&&this.removeTrack(u)})})}}function dc(i){if(!(typeof i!="object"||!i.RTCPeerConnection)&&("getRemoteStreams"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in i.RTCPeerConnection.prototype))){Object.defineProperty(i.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(n){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=n),this.addEventListener("track",this._onaddstreampoly=o=>{o.streams.forEach(a=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(a))return;this._remoteStreams.push(a);const u=new Event("addstream");u.stream=a,this.dispatchEvent(u)})})}});const s=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){const o=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(a){a.streams.forEach(u=>{if(o._remoteStreams||(o._remoteStreams=[]),o._remoteStreams.indexOf(u)>=0)return;o._remoteStreams.push(u);const p=new Event("addstream");p.stream=u,o.dispatchEvent(p)})}),s.apply(o,arguments)}}}function pc(i){if(typeof i!="object"||!i.RTCPeerConnection)return;const s=i.RTCPeerConnection.prototype,n=s.createOffer,o=s.createAnswer,a=s.setLocalDescription,u=s.setRemoteDescription,p=s.addIceCandidate;s.createOffer=function(l,_){const D=arguments.length>=2?arguments[2]:arguments[0],H=n.apply(this,[D]);return _?(H.then(l,_),Promise.resolve()):H},s.createAnswer=function(l,_){const D=arguments.length>=2?arguments[2]:arguments[0],H=o.apply(this,[D]);return _?(H.then(l,_),Promise.resolve()):H};let m=function(T,l,_){const D=a.apply(this,[T]);return _?(D.then(l,_),Promise.resolve()):D};s.setLocalDescription=m,m=function(T,l,_){const D=u.apply(this,[T]);return _?(D.then(l,_),Promise.resolve()):D},s.setRemoteDescription=m,m=function(T,l,_){const D=p.apply(this,[T]);return _?(D.then(l,_),Promise.resolve()):D},s.addIceCandidate=m}function hc(i){const s=i&&i.navigator;if(s.mediaDevices&&s.mediaDevices.getUserMedia){const n=s.mediaDevices,o=n.getUserMedia.bind(n);s.mediaDevices.getUserMedia=a=>o(gc(a))}!s.getUserMedia&&s.mediaDevices&&s.mediaDevices.getUserMedia&&(s.getUserMedia=(function(o,a,u){s.mediaDevices.getUserMedia(o).then(a,u)}).bind(s))}function gc(i){return i&&i.video!==void 0?Object.assign({},i,{video:zu(i.video)}):i}function mc(i){if(!i.RTCPeerConnection)return;const s=i.RTCPeerConnection;i.RTCPeerConnection=function(o,a){if(o&&o.iceServers){const u=[];for(let p=0;pp.receiver.track.kind==="audio");o.offerToReceiveAudio===!1&&a?a.direction==="sendrecv"?a.setDirection?a.setDirection("sendonly"):a.direction="sendonly":a.direction==="recvonly"&&(a.setDirection?a.setDirection("inactive"):a.direction="inactive"):o.offerToReceiveAudio===!0&&!a&&this.addTransceiver("audio",{direction:"recvonly"}),typeof o.offerToReceiveVideo<"u"&&(o.offerToReceiveVideo=!!o.offerToReceiveVideo);const u=this.getTransceivers().find(p=>p.receiver.track.kind==="video");o.offerToReceiveVideo===!1&&u?u.direction==="sendrecv"?u.setDirection?u.setDirection("sendonly"):u.direction="sendonly":u.direction==="recvonly"&&(u.setDirection?u.setDirection("inactive"):u.direction="inactive"):o.offerToReceiveVideo===!0&&!u&&this.addTransceiver("video",{direction:"recvonly"})}return s.apply(this,arguments)}}function _c(i){typeof i!="object"||i.AudioContext||(i.AudioContext=i.webkitAudioContext)}const xu=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:_c,shimCallbacksAPI:pc,shimConstraints:gc,shimCreateOfferLegacy:yc,shimGetUserMedia:hc,shimLocalStreamsAPI:lc,shimRTCIceServerUrls:mc,shimRemoteStreamsAPI:dc,shimTrackEventTransceiver:vc},Symbol.toStringTag,{value:"Module"}));var Sc={exports:{}};(function(i){const s={};s.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},s.localCName=s.generateIdentifier(),s.splitLines=function(n){return n.trim().split("\n").map(o=>o.trim())},s.splitSections=function(n){return n.split("\nm=").map((a,u)=>(u>0?"m="+a:a).trim()+"\r\n")},s.getDescription=function(n){const o=s.splitSections(n);return o&&o[0]},s.getMediaSections=function(n){const o=s.splitSections(n);return o.shift(),o},s.matchPrefix=function(n,o){return s.splitLines(n).filter(a=>a.indexOf(o)===0)},s.parseCandidate=function(n){let o;n.indexOf("a=candidate:")===0?o=n.substring(12).split(" "):o=n.substring(10).split(" ");const a={foundation:o[0],component:{1:"rtp",2:"rtcp"}[o[1]]||o[1],protocol:o[2].toLowerCase(),priority:parseInt(o[3],10),ip:o[4],address:o[4],port:parseInt(o[5],10),type:o[7]};for(let u=8;u0?o[0].split("/")[1]:"sendrecv",uri:o[1],attributes:o.slice(2).join(" ")}},s.writeExtmap=function(n){return"a=extmap:"+(n.id||n.preferredId)+(n.direction&&n.direction!=="sendrecv"?"/"+n.direction:"")+" "+n.uri+(n.attributes?" "+n.attributes:"")+"\r\n"},s.parseFmtp=function(n){const o={};let a;const u=n.substring(n.indexOf(" ")+1).split(";");for(let p=0;p{n.parameters[p]!==void 0?u.push(p+"="+n.parameters[p]):u.push(p)}),o+="a=fmtp:"+a+" "+u.join(";")+"\r\n"}return o},s.parseRtcpFb=function(n){const o=n.substring(n.indexOf(" ")+1).split(" ");return{type:o.shift(),parameter:o.join(" ")}},s.writeRtcpFb=function(n){let o="",a=n.payloadType;return n.preferredPayloadType!==void 0&&(a=n.preferredPayloadType),n.rtcpFeedback&&n.rtcpFeedback.length&&n.rtcpFeedback.forEach(u=>{o+="a=rtcp-fb:"+a+" "+u.type+(u.parameter&&u.parameter.length?" "+u.parameter:"")+"\r\n"}),o},s.parseSsrcMedia=function(n){const o=n.indexOf(" "),a={ssrc:parseInt(n.substring(7,o),10)},u=n.indexOf(":",o);return u>-1?(a.attribute=n.substring(o+1,u),a.value=n.substring(u+1)):a.attribute=n.substring(o+1),a},s.parseSsrcGroup=function(n){const o=n.substring(13).split(" ");return{semantics:o.shift(),ssrcs:o.map(a=>parseInt(a,10))}},s.getMid=function(n){const o=s.matchPrefix(n,"a=mid:")[0];if(o)return o.substring(6)},s.parseFingerprint=function(n){const o=n.substring(14).split(" ");return{algorithm:o[0].toLowerCase(),value:o[1].toUpperCase()}},s.getDtlsParameters=function(n,o){return{role:"auto",fingerprints:s.matchPrefix(n+o,"a=fingerprint:").map(s.parseFingerprint)}},s.writeDtlsParameters=function(n,o){let a="a=setup:"+o+"\r\n";return n.fingerprints.forEach(u=>{a+="a=fingerprint:"+u.algorithm+" "+u.value+"\r\n"}),a},s.parseCryptoLine=function(n){const o=n.substring(9).split(" ");return{tag:parseInt(o[0],10),cryptoSuite:o[1],keyParams:o[2],sessionParams:o.slice(3)}},s.writeCryptoLine=function(n){return"a=crypto:"+n.tag+" "+n.cryptoSuite+" "+(typeof n.keyParams=="object"?s.writeCryptoKeyParams(n.keyParams):n.keyParams)+(n.sessionParams?" "+n.sessionParams.join(" "):"")+"\r\n"},s.parseCryptoKeyParams=function(n){if(n.indexOf("inline:")!==0)return null;const o=n.substring(7).split("|");return{keyMethod:"inline",keySalt:o[0],lifeTime:o[1],mkiValue:o[2]?o[2].split(":")[0]:void 0,mkiLength:o[2]?o[2].split(":")[1]:void 0}},s.writeCryptoKeyParams=function(n){return n.keyMethod+":"+n.keySalt+(n.lifeTime?"|"+n.lifeTime:"")+(n.mkiValue&&n.mkiLength?"|"+n.mkiValue+":"+n.mkiLength:"")},s.getCryptoParameters=function(n,o){return s.matchPrefix(n+o,"a=crypto:").map(s.parseCryptoLine)},s.getIceParameters=function(n,o){const a=s.matchPrefix(n+o,"a=ice-ufrag:")[0],u=s.matchPrefix(n+o,"a=ice-pwd:")[0];return a&&u?{usernameFragment:a.substring(12),password:u.substring(10)}:null},s.writeIceParameters=function(n){let o="a=ice-ufrag:"+n.usernameFragment+"\r\na=ice-pwd:"+n.password+"\r\n";return n.iceLite&&(o+="a=ice-lite\r\n"),o},s.parseRtpParameters=function(n){const o={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},u=s.splitLines(n)[0].split(" ");o.profile=u[2];for(let m=3;m{o.headerExtensions.push(s.parseExtmap(m))});const p=s.matchPrefix(n,"a=rtcp-fb:* ").map(s.parseRtcpFb);return o.codecs.forEach(m=>{p.forEach(T=>{m.rtcpFeedback.find(_=>_.type===T.type&&_.parameter===T.parameter)||m.rtcpFeedback.push(T)})}),o},s.writeRtpDescription=function(n,o){let a="";a+="m="+n+" ",a+=o.codecs.length>0?"9":"0",a+=" "+(o.profile||"UDP/TLS/RTP/SAVPF")+" ",a+=o.codecs.map(p=>p.preferredPayloadType!==void 0?p.preferredPayloadType:p.payloadType).join(" ")+"\r\n",a+="c=IN IP4 0.0.0.0\r\n",a+="a=rtcp:9 IN IP4 0.0.0.0\r\n",o.codecs.forEach(p=>{a+=s.writeRtpMap(p),a+=s.writeFmtp(p),a+=s.writeRtcpFb(p)});let u=0;return o.codecs.forEach(p=>{p.maxptime>u&&(u=p.maxptime)}),u>0&&(a+="a=maxptime:"+u+"\r\n"),o.headerExtensions&&o.headerExtensions.forEach(p=>{a+=s.writeExtmap(p)}),a},s.parseRtpEncodingParameters=function(n){const o=[],a=s.parseRtpParameters(n),u=a.fecMechanisms.indexOf("RED")!==-1,p=a.fecMechanisms.indexOf("ULPFEC")!==-1,m=s.matchPrefix(n,"a=ssrc:").map(H=>s.parseSsrcMedia(H)).filter(H=>H.attribute==="cname"),T=m.length>0&&m[0].ssrc;let l;const _=s.matchPrefix(n,"a=ssrc-group:FID").map(H=>H.substring(17).split(" ").map(j=>parseInt(j,10)));_.length>0&&_[0].length>1&&_[0][0]===T&&(l=_[0][1]),a.codecs.forEach(H=>{if(H.name.toUpperCase()==="RTX"&&H.parameters.apt){let z={ssrc:T,codecPayloadType:parseInt(H.parameters.apt,10)};T&&l&&(z.rtx={ssrc:l}),o.push(z),u&&(z=JSON.parse(JSON.stringify(z)),z.fec={ssrc:T,mechanism:p?"red+ulpfec":"red"},o.push(z))}}),o.length===0&&T&&o.push({ssrc:T});let D=s.matchPrefix(n,"b=");return D.length&&(D[0].indexOf("b=TIAS:")===0?D=parseInt(D[0].substring(7),10):D[0].indexOf("b=AS:")===0?D=parseInt(D[0].substring(5),10)*1e3*.95-50*40*8:D=void 0,o.forEach(H=>{H.maxBitrate=D})),o},s.parseRtcpParameters=function(n){const o={},a=s.matchPrefix(n,"a=ssrc:").map(m=>s.parseSsrcMedia(m)).filter(m=>m.attribute==="cname")[0];a&&(o.cname=a.value,o.ssrc=a.ssrc);const u=s.matchPrefix(n,"a=rtcp-rsize");o.reducedSize=u.length>0,o.compound=u.length===0;const p=s.matchPrefix(n,"a=rtcp-mux");return o.mux=p.length>0,o},s.writeRtcpParameters=function(n){let o="";return n.reducedSize&&(o+="a=rtcp-rsize\r\n"),n.mux&&(o+="a=rtcp-mux\r\n"),n.ssrc!==void 0&&n.cname&&(o+="a=ssrc:"+n.ssrc+" cname:"+n.cname+"\r\n"),o},s.parseMsid=function(n){let o;const a=s.matchPrefix(n,"a=msid:");if(a.length===1)return o=a[0].substring(7).split(" "),{stream:o[0],track:o[1]};const u=s.matchPrefix(n,"a=ssrc:").map(p=>s.parseSsrcMedia(p)).filter(p=>p.attribute==="msid");if(u.length>0)return o=u[0].value.split(" "),{stream:o[0],track:o[1]}},s.parseSctpDescription=function(n){const o=s.parseMLine(n),a=s.matchPrefix(n,"a=max-message-size:");let u;a.length>0&&(u=parseInt(a[0].substring(19),10)),isNaN(u)&&(u=65536);const p=s.matchPrefix(n,"a=sctp-port:");if(p.length>0)return{port:parseInt(p[0].substring(12),10),protocol:o.fmt,maxMessageSize:u};const m=s.matchPrefix(n,"a=sctpmap:");if(m.length>0){const T=m[0].substring(10).split(" ");return{port:parseInt(T[0],10),protocol:T[1],maxMessageSize:u}}},s.writeSctpDescription=function(n,o){let a=[];return n.protocol!=="DTLS/SCTP"?a=["m="+n.kind+" 9 "+n.protocol+" "+o.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+o.port+"\r\n"]:a=["m="+n.kind+" 9 "+n.protocol+" "+o.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+o.port+" "+o.protocol+" 65535\r\n"],o.maxMessageSize!==void 0&&a.push("a=max-message-size:"+o.maxMessageSize+"\r\n"),a.join("")},s.generateSessionId=function(){return Math.random().toString().substr(2,22)},s.writeSessionBoilerplate=function(n,o,a){let u;const p=o!==void 0?o:2;return n?u=n:u=s.generateSessionId(),"v=0\r\no="+(a||"thisisadapterortc")+" "+u+" "+p+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},s.getDirection=function(n,o){const a=s.splitLines(n);for(let u=0;u(n.candidate&&Object.defineProperty(n,"candidate",{value:new i.RTCIceCandidate(n.candidate),writable:"false"}),n))}function oi(i,s){if(!i.RTCPeerConnection)return;"sctp"in i.RTCPeerConnection.prototype||Object.defineProperty(i.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const n=function(m){if(!m||!m.sdp)return!1;const T=Xn.splitSections(m.sdp);return T.shift(),T.some(l=>{const _=Xn.parseMLine(l);return _&&_.kind==="application"&&_.protocol.indexOf("SCTP")!==-1})},o=function(m){const T=m.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(T===null||T.length<2)return-1;const l=parseInt(T[1],10);return l!==l?-1:l},a=function(m){let T=65536;return s.browser==="firefox"&&(s.version<57?m===-1?T=16384:T=2147483637:s.version<60?T=s.version===57?65535:65536:T=2147483637),T},u=function(m,T){let l=65536;s.browser==="firefox"&&s.version===57&&(l=65535);const _=Xn.matchPrefix(m.sdp,"a=max-message-size:");return _.length>0?l=parseInt(_[0].substr(19),10):s.browser==="firefox"&&T!==-1&&(l=2147483637),l},p=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,s.browser==="chrome"&&s.version>=76){const{sdpSemantics:T}=this.getConfiguration();T==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const T=o(arguments[0]),l=a(T),_=u(arguments[0],T);let D;l===0&&_===0?D=Number.POSITIVE_INFINITY:l===0||_===0?D=Math.max(l,_):D=Math.min(l,_);const H={};Object.defineProperty(H,"maxMessageSize",{get(){return D}}),this._sctp=H}return p.apply(this,arguments)}}function si(i){if(!(i.RTCPeerConnection&&"createDataChannel"in i.RTCPeerConnection.prototype))return;function s(o,a){const u=o.send;o.send=function(){const m=arguments[0],T=m.length||m.size||m.byteLength;if(o.readyState==="open"&&a.sctp&&T>a.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+a.sctp.maxMessageSize+" bytes)");return u.apply(o,arguments)}}const n=i.RTCPeerConnection.prototype.createDataChannel;i.RTCPeerConnection.prototype.createDataChannel=function(){const a=n.apply(this,arguments);return s(a,this),a},In(i,"datachannel",o=>(s(o.channel,o.target),o))}function Go(i){if(!i.RTCPeerConnection||"connectionState"in i.RTCPeerConnection.prototype)return;const s=i.RTCPeerConnection.prototype;Object.defineProperty(s,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(s,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(n){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),n&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=n)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(n=>{const o=s[n];s[n]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=a=>{const u=a.target;if(u._lastConnectionState!==u.connectionState){u._lastConnectionState=u.connectionState;const p=new Event("connectionstatechange",a);u.dispatchEvent(p)}return a},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),o.apply(this,arguments)}})}function Wo(i,s){if(!i.RTCPeerConnection||s.browser==="chrome"&&s.version>=71||s.browser==="safari"&&s.version>=605)return;const n=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(a){if(a&&a.sdp&&a.sdp.indexOf("\na=extmap-allow-mixed")!==-1){const u=a.sdp.split("\n").filter(p=>p.trim()!=="a=extmap-allow-mixed").join("\n");i.RTCSessionDescription&&a instanceof i.RTCSessionDescription?arguments[0]=new i.RTCSessionDescription({type:a.type,sdp:u}):a.sdp=u}return n.apply(this,arguments)}}function ai(i,s){if(!(i.RTCPeerConnection&&i.RTCPeerConnection.prototype))return;const n=i.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(i.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(s.browser==="chrome"&&s.version<78||s.browser==="firefox"&&s.version<68||s.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ui(i,s){if(!(i.RTCPeerConnection&&i.RTCPeerConnection.prototype))return;const n=i.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(i.RTCPeerConnection.prototype.setLocalDescription=function(){let a=arguments[0]||{};if(typeof a!="object"||a.type&&a.sdp)return n.apply(this,arguments);if(a={type:a.type,sdp:a.sdp},!a.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":a.type="offer";break;default:a.type="answer";break}return a.sdp||a.type!=="offer"&&a.type!=="answer"?n.apply(this,[a]):(a.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(p=>n.apply(this,[p]))})}const bv=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Wo,shimAddIceCandidateNullOrEmpty:ai,shimConnectionState:Go,shimMaxMessageSize:oi,shimParameterlessSetLocalDescription:ui,shimRTCIceCandidate:ii,shimSendThrowTypeError:si},Symbol.toStringTag,{value:"Module"}));function Tv({window:i}={},s={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=Ju,o=yv(i),a={browserDetails:o,commonShim:bv,extractVersion:ri,disableLog:mv,disableWarnings:vv,sdp:Cv};switch(o.browser){case"chrome":if(!Tu||!Fo||!s.shimChrome)return n("Chrome shim is not included in this adapter release."),a;if(o.version===null)return n("Chrome shim can not determine version, not shimming."),a;n("adapter.js shimming chrome."),a.browserShim=Tu,ai(i,o),ui(i),Vu(i,o),$u(i),Fo(i,o),ju(i),Qu(i,o),Ku(i),Yu(i),Zu(i),ec(i,o),ii(i),Go(i),oi(i,o),si(i),Wo(i,o);break;case"firefox":if(!Ru||!No||!s.shimFirefox)return n("Firefox shim is not included in this adapter release."),a;n("adapter.js shimming firefox."),a.browserShim=Ru,ai(i,o),ui(i),tc(i,o),No(i,o),nc(i),oc(i),rc(i),ic(i),sc(i),ac(i),uc(i),cc(i),fc(i),ii(i),Go(i),oi(i,o),si(i);break;case"safari":if(!xu||!s.shimSafari)return n("Safari shim is not included in this adapter release."),a;n("adapter.js shimming safari."),a.browserShim=xu,ai(i,o),ui(i),mc(i),yc(i),pc(i),lc(i),dc(i),vc(i),hc(i),_c(i),ii(i),oi(i,o),si(i),Wo(i,o);break;default:n("Unsupported browser!");break}return a}const Pu=Tv({window:typeof window>"u"?void 0:window});function Dt(i){return typeof i=="function"}function bc(i){var s=function(o){Error.call(o),o.stack=new Error().stack},n=i(s);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Ao=bc(function(i){return function(n){i(this),this.message=n?n.length+" errors occurred during unsubscription:\n"+n.map(function(o,a){return a+1+") "+o.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=n}});function Bo(i,s){if(i){var n=i.indexOf(s);0<=n&&i.splice(n,1)}}var di=function(){function i(s){this.initialTeardown=s,this.closed=!1,this._parentage=null,this._finalizers=null}return i.prototype.unsubscribe=function(){var s,n,o,a,u;if(!this.closed){this.closed=!0;var p=this._parentage;if(p)if(this._parentage=null,Array.isArray(p))try{for(var m=Mo(p),T=m.next();!T.done;T=m.next()){var l=T.value;l.remove(this)}}catch(ee){s={error:ee}}finally{try{T&&!T.done&&(n=m.return)&&n.call(m)}finally{if(s)throw s.error}}else p.remove(this);var _=this.initialTeardown;if(Dt(_))try{_()}catch(ee){u=ee instanceof Ao?ee.errors:[ee]}var D=this._finalizers;if(D){this._finalizers=null;try{for(var H=Mo(D),z=H.next();!z.done;z=H.next()){var j=z.value;try{wu(j)}catch(ee){u=u!=null?u:[],ee instanceof Ao?u=Lo(Lo([],ko(u)),ko(ee.errors)):u.push(ee)}}}catch(ee){o={error:ee}}finally{try{z&&!z.done&&(a=H.return)&&a.call(H)}finally{if(o)throw o.error}}}if(u)throw new Ao(u)}},i.prototype.add=function(s){var n;if(s&&s!==this)if(this.closed)wu(s);else{if(s instanceof i){if(s.closed||s._hasParent(this))return;s._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(s)}},i.prototype._hasParent=function(s){var n=this._parentage;return n===s||Array.isArray(n)&&n.includes(s)},i.prototype._addParent=function(s){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(s),n):n?[n,s]:s},i.prototype._removeParent=function(s){var n=this._parentage;n===s?this._parentage=null:Array.isArray(n)&&Bo(n,s)},i.prototype.remove=function(s){var n=this._finalizers;n&&Bo(n,s),s instanceof i&&s._removeParent(this)},i.EMPTY=function(){var s=new i;return s.closed=!0,s}(),i}(),Tc=di.EMPTY;function Rc(i){return i instanceof di||i&&"closed"in i&&Dt(i.remove)&&Dt(i.add)&&Dt(i.unsubscribe)}function wu(i){Dt(i)?i():i.unsubscribe()}var Rv={Promise:void 0},xv={setTimeout:function(i,s){for(var n=[],o=2;o0},enumerable:!1,configurable:!0}),s.prototype._trySubscribe=function(n){return this._throwIfClosed(),i.prototype._trySubscribe.call(this,n)},s.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},s.prototype._innerSubscribe=function(n){var o=this,a=this,u=a.hasError,p=a.isStopped,m=a.observers;return u||p?Tc:(this.currentObservers=null,m.push(n),new di(function(){o.currentObservers=null,Bo(m,n)}))},s.prototype._checkFinalizedStatuses=function(n){var o=this,a=o.hasError,u=o.thrownError,p=o.isStopped;a?n.error(u):p&&n.complete()},s.prototype.asObservable=function(){var n=new Ou;return n.source=this,n},s.create=function(n,o){return new Iu(n,o)},s}(Ou),Iu=function(i){er(s,i);function s(n,o){var a=i.call(this)||this;return a.destination=n,a.source=o,a}return s.prototype.next=function(n){var o,a;(a=(o=this.destination)===null||o===void 0?void 0:o.next)===null||a===void 0||a.call(o,n)},s.prototype.error=function(n){var o,a;(a=(o=this.destination)===null||o===void 0?void 0:o.error)===null||a===void 0||a.call(o,n)},s.prototype.complete=function(){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||o===void 0||o.call(n)},s.prototype._subscribe=function(n){var o,a;return(a=(o=this.source)===null||o===void 0?void 0:o.subscribe(n))!==null&&a!==void 0?a:Tc},s}(cn),_t=function(i){er(s,i);function s(n){var o=i.call(this)||this;return o._value=n,o}return Object.defineProperty(s.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),s.prototype._subscribe=function(n){var o=i.prototype._subscribe.call(this,n);return!o.closed&&n.next(this._value),o},s.prototype.getValue=function(){var n=this,o=n.hasError,a=n.thrownError,u=n._value;if(o)throw a;return this._throwIfClosed(),u},s.prototype.next=function(n){i.prototype.next.call(this,this._value=n)},s}(cn),fi={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */fi.exports;(function(i,s){(function(){var n,o="4.17.21",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",p="Expected a function",m="Invalid `variable` option passed into `_.template`",T="__lodash_hash_undefined__",l=500,_="__lodash_placeholder__",D=1,H=2,z=4,j=1,ee=2,xe=1,ot=2,_e=4,$=8,X=16,Ie=32,st=64,me=128,ht=256,Zt=512,nr=30,dn="...",pi=800,hi=16,rr=1,ir=2,or=3,Mt=1/0,St=9007199254740991,sr=17976931348623157e292,Lt=NaN,Ye=4294967295,pn=Ye-1,ar=Ye>>>1,gi=[["ary",me],["bind",xe],["bindKey",ot],["curry",$],["curryRight",X],["flip",Zt],["partial",Ie],["partialRight",st],["rearg",ht]],kt="[object Arguments]",hn="[object Array]",ur="[object AsyncFunction]",Ct="[object Boolean]",Ut="[object Date]",cr="[object DOMException]",at="[object Error]",bt="[object Function]",ut="[object GeneratorFunction]",Ne="[object Map]",Ft="[object Number]",fr="[object Null]",qe="[object Object]",lr="[object Promise]",v="[object Proxy]",C="[object RegExp]",b="[object Set]",y="[object String]",O="[object Symbol]",I="[object Undefined]",w="[object WeakMap]",W="[object WeakSet]",F="[object ArrayBuffer]",x="[object DataView]",A="[object Float32Array]",B="[object Float64Array]",re="[object Int8Array]",fe="[object Int16Array]",ct="[object Int32Array]",N="[object Uint8Array]",ne="[object Uint8ClampedArray]",be="[object Uint16Array]",gt="[object Uint32Array]",mi=/\b__p \+= '';/g,Pc=/\b(__p \+=) '' \+/g,wc=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zo=/&(?:amp|lt|gt|quot|#39);/g,Vo=/[&<>"']/g,Ec=RegExp(zo.source),Oc=RegExp(Vo.source),Ac=/<%-([\s\S]+?)%>/g,Ic=/<%([\s\S]+?)%>/g,$o=/<%=([\s\S]+?)%>/g,Dc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mc=/^\w*$/,Lc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vi=/[\\^$.*+?()[\]{}|]/g,kc=RegExp(vi.source),yi=/^\s+/,Uc=/\s/,Fc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Nc=/\{\n\/\* \[wrapped with (.+)\] \*/,Gc=/,? & /,Wc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Bc=/[()=,{}\[\]\/\s]/,Hc=/\\(\\)?/g,qc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,jo=/\w*$/,Jc=/^[-+]0x[0-9a-f]+$/i,zc=/^0b[01]+$/i,Vc=/^\[object .+?Constructor\]$/,$c=/^0o[0-7]+$/i,jc=/^(?:0|[1-9]\d*)$/,Kc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,dr=/($^)/,Yc=/['\n\r\u2028\u2029\\]/g,pr="\\ud800-\\udfff",Zc="\\u0300-\\u036f",Xc="\\ufe20-\\ufe2f",Qc="\\u20d0-\\u20ff",Ko=Zc+Xc+Qc,Yo="\\u2700-\\u27bf",Zo="a-z\\xdf-\\xf6\\xf8-\\xff",ef="\\xac\\xb1\\xd7\\xf7",tf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nf="\\u2000-\\u206f",rf=" \\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",Xo="A-Z\\xc0-\\xd6\\xd8-\\xde",Qo="\\ufe0e\\ufe0f",es=ef+tf+nf+rf,_i="['’]",of="["+pr+"]",ts="["+es+"]",hr="["+Ko+"]",ns="\\d+",sf="["+Yo+"]",rs="["+Zo+"]",is="[^"+pr+es+ns+Yo+Zo+Xo+"]",Si="\\ud83c[\\udffb-\\udfff]",af="(?:"+hr+"|"+Si+")",os="[^"+pr+"]",Ci="(?:\\ud83c[\\udde6-\\uddff]){2}",bi="[\\ud800-\\udbff][\\udc00-\\udfff]",gn="["+Xo+"]",ss="\\u200d",as="(?:"+rs+"|"+is+")",uf="(?:"+gn+"|"+is+")",us="(?:"+_i+"(?:d|ll|m|re|s|t|ve))?",cs="(?:"+_i+"(?:D|LL|M|RE|S|T|VE))?",fs=af+"?",ls="["+Qo+"]?",cf="(?:"+ss+"(?:"+[os,Ci,bi].join("|")+")"+ls+fs+")*",ff="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",lf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ds=ls+fs+cf,df="(?:"+[sf,Ci,bi].join("|")+")"+ds,pf="(?:"+[os+hr+"?",hr,Ci,bi,of].join("|")+")",hf=RegExp(_i,"g"),gf=RegExp(hr,"g"),Ti=RegExp(Si+"(?="+Si+")|"+pf+ds,"g"),mf=RegExp([gn+"?"+rs+"+"+us+"(?="+[ts,gn,"$"].join("|")+")",uf+"+"+cs+"(?="+[ts,gn+as,"$"].join("|")+")",gn+"?"+as+"+"+us,gn+"+"+cs,lf,ff,ns,df].join("|"),"g"),vf=RegExp("["+ss+pr+Ko+Qo+"]"),yf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_f=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Sf=-1,ve={};ve[A]=ve[B]=ve[re]=ve[fe]=ve[ct]=ve[N]=ve[ne]=ve[be]=ve[gt]=!0,ve[kt]=ve[hn]=ve[F]=ve[Ct]=ve[x]=ve[Ut]=ve[at]=ve[bt]=ve[Ne]=ve[Ft]=ve[qe]=ve[C]=ve[b]=ve[y]=ve[w]=!1;var ge={};ge[kt]=ge[hn]=ge[F]=ge[x]=ge[Ct]=ge[Ut]=ge[A]=ge[B]=ge[re]=ge[fe]=ge[ct]=ge[Ne]=ge[Ft]=ge[qe]=ge[C]=ge[b]=ge[y]=ge[O]=ge[N]=ge[ne]=ge[be]=ge[gt]=!0,ge[at]=ge[bt]=ge[w]=!1;var Cf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},bf={"&":"&","<":"<",">":">",'"':""","'":"'"},Tf={"&":"&","<":"<",">":">",""":'"',"'":"'"},Rf={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xf=parseFloat,Pf=parseInt,ps=typeof Kn=="object"&&Kn&&Kn.Object===Object&&Kn,wf=typeof self=="object"&&self&&self.Object===Object&&self,Oe=ps||wf||Function("return this")(),Ri=s&&!s.nodeType&&s,Xt=Ri&&!0&&i&&!i.nodeType&&i,hs=Xt&&Xt.exports===Ri,xi=hs&&ps.process,Ze=function(){try{var P=Xt&&Xt.require&&Xt.require("util").types;return P||xi&&xi.binding&&xi.binding("util")}catch{}}(),gs=Ze&&Ze.isArrayBuffer,ms=Ze&&Ze.isDate,vs=Ze&&Ze.isMap,ys=Ze&&Ze.isRegExp,_s=Ze&&Ze.isSet,Ss=Ze&&Ze.isTypedArray;function Je(P,L,M){switch(M.length){case 0:return P.call(L);case 1:return P.call(L,M[0]);case 2:return P.call(L,M[0],M[1]);case 3:return P.call(L,M[0],M[1],M[2])}return P.apply(L,M)}function Ef(P,L,M,J){for(var Q=-1,le=P==null?0:P.length;++Q-1}function Pi(P,L,M){for(var J=-1,Q=P==null?0:P.length;++J-1;);return M}function Es(P,L){for(var M=P.length;M--&&mn(L,P[M],0)>-1;);return M}function Ff(P,L){for(var M=P.length,J=0;M--;)P[M]===L&&++J;return J}var Nf=Ai(Cf),Gf=Ai(bf);function Wf(P){return"\\"+Rf[P]}function Bf(P,L){return P==null?n:P[L]}function vn(P){return vf.test(P)}function Hf(P){return yf.test(P)}function qf(P){for(var L,M=[];!(L=P.next()).done;)M.push(L.value);return M}function Li(P){var L=-1,M=Array(P.size);return P.forEach(function(J,Q){M[++L]=[Q,J]}),M}function Os(P,L){return function(M){return P(L(M))}}function Wt(P,L){for(var M=-1,J=P.length,Q=0,le=[];++M-1}function Al(e,t){var r=this.__data__,c=Dr(r,e);return c<0?(++this.size,r.push([e,t])):r[c][1]=t,this}Tt.prototype.clear=Pl,Tt.prototype.delete=wl,Tt.prototype.get=El,Tt.prototype.has=Ol,Tt.prototype.set=Al;function Rt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t=t?e:t)),e}function tt(e,t,r,c,d,g){var S,R=t&D,E=t&H,k=t&z;if(r&&(S=d?r(e,c,d,g):r(e)),S!==n)return S;if(!Se(e))return e;var U=te(e);if(U){if(S=Ld(e),!R)return Ge(e,S)}else{var G=Me(e),q=G==bt||G==ut;if(Vt(e))return la(e,R);if(G==qe||G==kt||q&&!d){if(S=E||q?{}:Aa(e),!R)return E?Td(e,Vl(S,e)):bd(e,Bs(S,e))}else{if(!ge[G])return d?e:{};S=kd(e,G,R)}}g||(g=new lt);var V=g.get(e);if(V)return V;g.set(e,S),ou(e)?e.forEach(function(Z){S.add(tt(Z,t,r,Z,e,g))}):ru(e)&&e.forEach(function(Z,ae){S.set(ae,tt(Z,t,r,ae,e,g))});var Y=k?E?so:oo:E?Be:Ee,oe=U?n:Y(e);return Xe(oe||e,function(Z,ae){oe&&(ae=Z,Z=e[ae]),Wn(S,ae,tt(Z,t,r,ae,e,g))}),S}function $l(e){var t=Ee(e);return function(r){return Hs(r,e,t)}}function Hs(e,t,r){var c=r.length;if(e==null)return!c;for(e=he(e);c--;){var d=r[c],g=t[d],S=e[d];if(S===n&&!(d in e)||!g(S))return!1}return!0}function qs(e,t,r){if(typeof e!="function")throw new Qe(p);return $n(function(){e.apply(n,r)},t)}function Bn(e,t,r,c){var d=-1,g=gr,S=!0,R=e.length,E=[],k=t.length;if(!R)return E;r&&(t=ye(t,ze(r))),c?(g=Pi,S=!1):t.length>=a&&(g=Ln,S=!1,t=new tn(t));e:for(;++dd?0:d+r),c=c===n||c>d?d:ie(c),c<0&&(c+=d),c=r>c?0:au(c);r0&&r(R)?t>1?Ae(R,t-1,r,c,d):Gt(d,R):c||(d[d.length]=R)}return d}var Bi=va(),Vs=va(!0);function mt(e,t){return e&&Bi(e,t,Ee)}function Hi(e,t){return e&&Vs(e,t,Ee)}function Lr(e,t){return Nt(t,function(r){return Ot(e[r])})}function rn(e,t){t=Jt(t,e);for(var r=0,c=t.length;e!=null&&rt}function Yl(e,t){return e!=null&&pe.call(e,t)}function Zl(e,t){return e!=null&&t in he(e)}function Xl(e,t,r){return e>=De(t,r)&&e=120&&U.length>=120)?new tn(S&&U):n}U=e[0];var G=-1,q=R[0];e:for(;++G-1;)R!==e&&xr.call(R,E,1),xr.call(e,E,1);return e}function ra(e,t){for(var r=e?t.length:0,c=r-1;r--;){var d=t[r];if(r==c||d!==g){var g=d;Et(d)?xr.call(e,d,1):Xi(e,d)}}return e}function Ki(e,t){return e+Er(Fs()*(t-e+1))}function ld(e,t,r,c){for(var d=-1,g=we(wr((t-e)/(r||1)),0),S=M(g);g--;)S[c?g:++d]=e,e+=r;return S}function Yi(e,t){var r="";if(!e||t<1||t>St)return r;do t%2&&(r+=e),t=Er(t/2),t&&(e+=e);while(t);return r}function se(e,t){return ho(Ma(e,t,He),e+"")}function dd(e){return Ws(En(e))}function pd(e,t){var r=En(e);return zr(r,nn(t,0,r.length))}function Jn(e,t,r,c){if(!Se(e))return e;t=Jt(t,e);for(var d=-1,g=t.length,S=g-1,R=e;R!=null&&++dd?0:d+t),r=r>d?d:r,r<0&&(r+=d),d=t>r?0:r-t>>>0,t>>>=0;for(var g=M(d);++c>>1,S=e[g];S!==null&&!$e(S)&&(r?S<=t:S=a){var k=t?null:wd(e);if(k)return vr(k);S=!1,d=Ln,E=new tn}else E=t?[]:R;e:for(;++c=c?e:nt(e,t,r)}var fa=il||function(e){return Oe.clearTimeout(e)};function la(e,t){if(t)return e.slice();var r=e.length,c=Ds?Ds(r):new e.constructor(r);return e.copy(c),c}function no(e){var t=new e.constructor(e.byteLength);return new Tr(t).set(new Tr(e)),t}function yd(e,t){var r=t?no(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function _d(e){var t=new e.constructor(e.source,jo.exec(e));return t.lastIndex=e.lastIndex,t}function Sd(e){return Gn?he(Gn.call(e)):{}}function da(e,t){var r=t?no(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function pa(e,t){if(e!==t){var r=e!==n,c=e===null,d=e===e,g=$e(e),S=t!==n,R=t===null,E=t===t,k=$e(t);if(!R&&!k&&!g&&e>t||g&&S&&E&&!R&&!k||c&&S&&E||!r&&E||!d)return 1;if(!c&&!g&&!k&&e=R)return E;var k=r[c];return E*(k=="desc"?-1:1)}}return e.index-t.index}function ha(e,t,r,c){for(var d=-1,g=e.length,S=r.length,R=-1,E=t.length,k=we(g-S,0),U=M(E+k),G=!c;++R1?r[d-1]:n,S=d>2?r[2]:n;for(g=e.length>3&&typeof g=="function"?(d--,g):n,S&&ke(r[0],r[1],S)&&(g=d<3?n:g,d=1),t=he(t);++c-1?d[g?t[S]:S]:n}}function Sa(e){return wt(function(t){var r=t.length,c=r,d=et.prototype.thru;for(e&&t.reverse();c--;){var g=t[c];if(typeof g!="function")throw new Qe(p);if(d&&!S&&qr(g)=="wrapper")var S=new et([],!0)}for(c=S?c:r;++c1&&ce.reverse(),U&&ER))return!1;var k=g.get(e),U=g.get(t);if(k&&U)return k==t&&U==e;var G=-1,q=!0,V=r&ee?new tn:n;for(g.set(e,t),g.set(t,e);++G1?"& ":"")+t[c],t=t.join(r>2?", ":" "),e.replace(Fc,"{\n/* [wrapped with "+t+"] */\n")}function Fd(e){return te(e)||an(e)||!!(ks&&e&&e[ks])}function Et(e,t){var r=typeof e;return t=t==null?St:t,!!t&&(r=="number"||r!="symbol"&&jc.test(e))&&e>-1&&e%1==0&&e0){if(++t>=pi)return arguments[0]}else t=0;return e.apply(n,arguments)}}function zr(e,t){var r=-1,c=e.length,d=c-1;for(t=t===n?c:t;++r1?e[t-1]:n;return r=typeof r=="function"?(e.pop(),r):n,za(e,r)});function Va(e){var t=h(e);return t.__chain__=!0,t}function jp(e,t){return t(e),e}function Vr(e,t){return t(e)}var Kp=wt(function(e){var t=e.length,r=t?e[0]:0,c=this.__wrapped__,d=function(g){return Wi(g,e)};return t>1||this.__actions__.length||!(c instanceof ue)||!Et(r)?this.thru(d):(c=c.slice(r,+r+(t?1:0)),c.__actions__.push({func:Vr,args:[d],thisArg:n}),new et(c,this.__chain__).thru(function(g){return t&&!g.length&&g.push(n),g}))});function Yp(){return Va(this)}function Zp(){return new et(this.value(),this.__chain__)}function Xp(){this.__values__===n&&(this.__values__=su(this.value()));var e=this.__index__>=this.__values__.length,t=e?n:this.__values__[this.__index__++];return{done:e,value:t}}function Qp(){return this}function eh(e){for(var t,r=this;r instanceof Ir;){var c=Ga(r);c.__index__=0,c.__values__=n,t?d.__wrapped__=c:t=c;var d=c;r=r.__wrapped__}return d.__wrapped__=e,t}function th(){var e=this.__wrapped__;if(e instanceof ue){var t=e;return this.__actions__.length&&(t=new ue(this)),t=t.reverse(),t.__actions__.push({func:Vr,args:[go],thisArg:n}),new et(t,this.__chain__)}return this.thru(go)}function nh(){return ua(this.__wrapped__,this.__actions__)}var rh=Nr(function(e,t,r){pe.call(e,r)?++e[r]:xt(e,r,1)});function ih(e,t,r){var c=te(e)?Cs:jl;return r&&ke(e,t,r)&&(t=n),c(e,K(t,3))}function oh(e,t){var r=te(e)?Nt:zs;return r(e,K(t,3))}var sh=_a(Wa),ah=_a(Ba);function uh(e,t){return Ae($r(e,t),1)}function ch(e,t){return Ae($r(e,t),Mt)}function fh(e,t,r){return r=r===n?1:ie(r),Ae($r(e,t),r)}function $a(e,t){var r=te(e)?Xe:Ht;return r(e,K(t,3))}function ja(e,t){var r=te(e)?Of:Js;return r(e,K(t,3))}var lh=Nr(function(e,t,r){pe.call(e,r)?e[r].push(t):xt(e,r,[t])});function dh(e,t,r,c){e=We(e)?e:En(e),r=r&&!c?ie(r):0;var d=e.length;return r<0&&(r=we(d+r,0)),Xr(e)?r<=d&&e.indexOf(t,r)>-1:!!d&&mn(e,t,r)>-1}var ph=se(function(e,t,r){var c=-1,d=typeof t=="function",g=We(e)?M(e.length):[];return Ht(e,function(S){g[++c]=d?Je(t,S,r):Hn(S,t,r)}),g}),hh=Nr(function(e,t,r){xt(e,r,t)});function $r(e,t){var r=te(e)?ye:Zs;return r(e,K(t,3))}function gh(e,t,r,c){return e==null?[]:(te(t)||(t=t==null?[]:[t]),r=c?n:r,te(r)||(r=r==null?[]:[r]),ta(e,t,r))}var mh=Nr(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]});function vh(e,t,r){var c=te(e)?wi:xs,d=arguments.length<3;return c(e,K(t,4),r,d,Ht)}function yh(e,t,r){var c=te(e)?Af:xs,d=arguments.length<3;return c(e,K(t,4),r,d,Js)}function _h(e,t){var r=te(e)?Nt:zs;return r(e,Yr(K(t,3)))}function Sh(e){var t=te(e)?Ws:dd;return t(e)}function Ch(e,t,r){(r?ke(e,t,r):t===n)?t=1:t=ie(t);var c=te(e)?ql:pd;return c(e,t)}function bh(e){var t=te(e)?Jl:gd;return t(e)}function Th(e){if(e==null)return 0;if(We(e))return Xr(e)?yn(e):e.length;var t=Me(e);return t==Ne||t==b?e.size:Vi(e).length}function Rh(e,t,r){var c=te(e)?Ei:md;return r&&ke(e,t,r)&&(t=n),c(e,K(t,3))}var xh=se(function(e,t){if(e==null)return[];var r=t.length;return r>1&&ke(e,t[0],t[1])?t=[]:r>2&&ke(t[0],t[1],t[2])&&(t=[t[0]]),ta(e,Ae(t,1),[])}),jr=ol||function(){return Oe.Date.now()};function Ph(e,t){if(typeof t!="function")throw new Qe(p);return e=ie(e),function(){if(--e<1)return t.apply(this,arguments)}}function Ka(e,t,r){return t=r?n:t,t=e&&t==null?e.length:t,Pt(e,me,n,n,n,n,t)}function Ya(e,t){var r;if(typeof t!="function")throw new Qe(p);return e=ie(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var vo=se(function(e,t,r){var c=xe;if(r.length){var d=Wt(r,Pn(vo));c|=Ie}return Pt(e,c,t,r,d)}),Za=se(function(e,t,r){var c=xe|ot;if(r.length){var d=Wt(r,Pn(Za));c|=Ie}return Pt(t,c,e,r,d)});function Xa(e,t,r){t=r?n:t;var c=Pt(e,$,n,n,n,n,n,t);return c.placeholder=Xa.placeholder,c}function Qa(e,t,r){t=r?n:t;var c=Pt(e,X,n,n,n,n,n,t);return c.placeholder=Qa.placeholder,c}function eu(e,t,r){var c,d,g,S,R,E,k=0,U=!1,G=!1,q=!0;if(typeof e!="function")throw new Qe(p);t=it(t)||0,Se(r)&&(U=!!r.leading,G="maxWait"in r,g=G?we(it(r.maxWait)||0,t):g,q="trailing"in r?!!r.trailing:q);function V(Re){var pt=c,It=d;return c=d=n,k=Re,S=e.apply(It,pt),S}function Y(Re){return k=Re,R=$n(ae,t),U?V(Re):S}function oe(Re){var pt=Re-E,It=Re-k,_u=t-pt;return G?De(_u,g-It):_u}function Z(Re){var pt=Re-E,It=Re-k;return E===n||pt>=t||pt<0||G&&It>=g}function ae(){var Re=jr();if(Z(Re))return ce(Re);R=$n(ae,oe(Re))}function ce(Re){return R=n,q&&c?V(Re):(c=d=n,S)}function je(){R!==n&&fa(R),k=0,c=E=d=R=n}function Ue(){return R===n?S:ce(jr())}function Ke(){var Re=jr(),pt=Z(Re);if(c=arguments,d=this,E=Re,pt){if(R===n)return Y(E);if(G)return fa(R),R=$n(ae,t),V(E)}return R===n&&(R=$n(ae,t)),S}return Ke.cancel=je,Ke.flush=Ue,Ke}var wh=se(function(e,t){return qs(e,1,t)}),Eh=se(function(e,t,r){return qs(e,it(t)||0,r)});function Oh(e){return Pt(e,Zt)}function Kr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new Qe(p);var r=function(){var c=arguments,d=t?t.apply(this,c):c[0],g=r.cache;if(g.has(d))return g.get(d);var S=e.apply(this,c);return r.cache=g.set(d,S)||g,S};return r.cache=new(Kr.Cache||Rt),r}Kr.Cache=Rt;function Yr(e){if(typeof e!="function")throw new Qe(p);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Ah(e){return Ya(2,e)}var Ih=vd(function(e,t){t=t.length==1&&te(t[0])?ye(t[0],ze(K())):ye(Ae(t,1),ze(K()));var r=t.length;return se(function(c){for(var d=-1,g=De(c.length,r);++d=t}),an=js(function(){return arguments}())?js:function(e){return Ce(e)&&pe.call(e,"callee")&&!Ls.call(e,"callee")},te=M.isArray,Vh=gs?ze(gs):ed;function We(e){return e!=null&&Zr(e.length)&&!Ot(e)}function Te(e){return Ce(e)&&We(e)}function $h(e){return e===!0||e===!1||Ce(e)&&Le(e)==Ct}var Vt=al||Oo,jh=ms?ze(ms):td;function Kh(e){return Ce(e)&&e.nodeType===1&&!jn(e)}function Yh(e){if(e==null)return!0;if(We(e)&&(te(e)||typeof e=="string"||typeof e.splice=="function"||Vt(e)||wn(e)||an(e)))return!e.length;var t=Me(e);if(t==Ne||t==b)return!e.size;if(Vn(e))return!Vi(e).length;for(var r in e)if(pe.call(e,r))return!1;return!0}function Zh(e,t){return qn(e,t)}function Xh(e,t,r){r=typeof r=="function"?r:n;var c=r?r(e,t):n;return c===n?qn(e,t,n,r):!!c}function _o(e){if(!Ce(e))return!1;var t=Le(e);return t==at||t==cr||typeof e.message=="string"&&typeof e.name=="string"&&!jn(e)}function Qh(e){return typeof e=="number"&&Us(e)}function Ot(e){if(!Se(e))return!1;var t=Le(e);return t==bt||t==ut||t==ur||t==v}function nu(e){return typeof e=="number"&&e==ie(e)}function Zr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=St}function Se(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ce(e){return e!=null&&typeof e=="object"}var ru=vs?ze(vs):rd;function eg(e,t){return e===t||zi(e,t,uo(t))}function tg(e,t,r){return r=typeof r=="function"?r:n,zi(e,t,uo(t),r)}function ng(e){return iu(e)&&e!=+e}function rg(e){if(Wd(e))throw new Q(u);return Ks(e)}function ig(e){return e===null}function og(e){return e==null}function iu(e){return typeof e=="number"||Ce(e)&&Le(e)==Ft}function jn(e){if(!Ce(e)||Le(e)!=qe)return!1;var t=Rr(e);if(t===null)return!0;var r=pe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Sr.call(r)==tl}var So=ys?ze(ys):id;function sg(e){return nu(e)&&e>=-9007199254740991&&e<=St}var ou=_s?ze(_s):od;function Xr(e){return typeof e=="string"||!te(e)&&Ce(e)&&Le(e)==y}function $e(e){return typeof e=="symbol"||Ce(e)&&Le(e)==O}var wn=Ss?ze(Ss):sd;function ag(e){return e===n}function ug(e){return Ce(e)&&Me(e)==w}function cg(e){return Ce(e)&&Le(e)==W}var fg=Hr($i),lg=Hr(function(e,t){return e<=t});function su(e){if(!e)return[];if(We(e))return Xr(e)?ft(e):Ge(e);if(kn&&e[kn])return qf(e[kn]());var t=Me(e),r=t==Ne?Li:t==b?vr:En;return r(e)}function At(e){if(!e)return e===0?e:0;if(e=it(e),e===Mt||e===-1/0){var t=e<0?-1:1;return t*sr}return e===e?e:0}function ie(e){var t=At(e),r=t%1;return t===t?r?t-r:t:0}function au(e){return e?nn(ie(e),0,Ye):0}function it(e){if(typeof e=="number")return e;if($e(e))return Lt;if(Se(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Se(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ps(e);var r=zc.test(e);return r||$c.test(e)?Pf(e.slice(2),r?2:8):Jc.test(e)?Lt:+e}function uu(e){return vt(e,Be(e))}function dg(e){return e?nn(ie(e),-9007199254740991,St):e===0?e:0}function de(e){return e==null?"":Ve(e)}var pg=Rn(function(e,t){if(Vn(t)||We(t)){vt(t,Ee(t),e);return}for(var r in t)pe.call(t,r)&&Wn(e,r,t[r])}),cu=Rn(function(e,t){vt(t,Be(t),e)}),Qr=Rn(function(e,t,r,c){vt(t,Be(t),e,c)}),hg=Rn(function(e,t,r,c){vt(t,Ee(t),e,c)}),gg=wt(Wi);function mg(e,t){var r=Tn(e);return t==null?r:Bs(r,t)}var vg=se(function(e,t){e=he(e);var r=-1,c=t.length,d=c>2?t[2]:n;for(d&&ke(t[0],t[1],d)&&(c=1);++r1),g}),vt(e,so(e),r),c&&(r=tt(r,D|H|z,Ed));for(var d=t.length;d--;)Xi(r,t[d]);return r});function kg(e,t){return lu(e,Yr(K(t)))}var Ug=wt(function(e,t){return e==null?{}:cd(e,t)});function lu(e,t){if(e==null)return{};var r=ye(so(e),function(c){return[c]});return t=K(t),na(e,r,function(c,d){return t(c,d[0])})}function Fg(e,t,r){t=Jt(t,e);var c=-1,d=t.length;for(d||(d=1,e=n);++ct){var c=e;e=t,t=c}if(r||e%1||t%1){var d=Fs();return De(e+d*(t-e+xf("1e-"+((d+"").length-1))),t)}return Ki(e,t)}var jg=xn(function(e,t,r){return t=t.toLowerCase(),e+(r?hu(t):t)});function hu(e){return To(de(e).toLowerCase())}function gu(e){return e=de(e),e&&e.replace(Kc,Nf).replace(gf,"")}function Kg(e,t,r){e=de(e),t=Ve(t);var c=e.length;r=r===n?c:nn(ie(r),0,c);var d=r;return r-=t.length,r>=0&&e.slice(r,d)==t}function Yg(e){return e=de(e),e&&Oc.test(e)?e.replace(Vo,Gf):e}function Zg(e){return e=de(e),e&&kc.test(e)?e.replace(vi,"\\$&"):e}var Xg=xn(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),Qg=xn(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),em=ya("toLowerCase");function tm(e,t,r){e=de(e),t=ie(t);var c=t?yn(e):0;if(!t||c>=t)return e;var d=(t-c)/2;return Br(Er(d),r)+e+Br(wr(d),r)}function nm(e,t,r){e=de(e),t=ie(t);var c=t?yn(e):0;return t&&c>>0,r?(e=de(e),e&&(typeof t=="string"||t!=null&&!So(t))&&(t=Ve(t),!t&&vn(e))?zt(ft(e),0,r):e.split(t,r)):[]}var cm=xn(function(e,t,r){return e+(r?" ":"")+To(t)});function fm(e,t,r){return e=de(e),r=r==null?0:nn(ie(r),0,e.length),t=Ve(t),e.slice(r,r+t.length)==t}function lm(e,t,r){var c=h.templateSettings;r&&ke(e,t,r)&&(t=n),e=de(e),t=Qr({},t,c,xa);var d=Qr({},t.imports,c.imports,xa),g=Ee(d),S=Mi(d,g),R,E,k=0,U=t.interpolate||dr,G="__p += '",q=ki((t.escape||dr).source+"|"+U.source+"|"+(U===$o?qc:dr).source+"|"+(t.evaluate||dr).source+"|$","g"),V="//# sourceURL="+(pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Sf+"]")+"\n";e.replace(q,function(Z,ae,ce,je,Ue,Ke){return ce||(ce=je),G+=e.slice(k,Ke).replace(Yc,Wf),ae&&(R=!0,G+="' +\n__e("+ae+") +\n'"),Ue&&(E=!0,G+="';\n"+Ue+";\n__p += '"),ce&&(G+="' +\n((__t = ("+ce+")) == null ? '' : __t) +\n'"),k=Ke+Z.length,Z}),G+="';\n";var Y=pe.call(t,"variable")&&t.variable;if(!Y)G="with (obj) {\n"+G+"\n}\n";else if(Bc.test(Y))throw new Q(m);G=(E?G.replace(mi,""):G).replace(Pc,"$1").replace(wc,"$1;"),G="function("+(Y||"obj")+") {\n"+(Y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(R?", __e = _.escape":"")+(E?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+G+"return __p\n}";var oe=vu(function(){return le(g,V+"return "+G).apply(n,S)});if(oe.source=G,_o(oe))throw oe;return oe}function dm(e){return de(e).toLowerCase()}function pm(e){return de(e).toUpperCase()}function hm(e,t,r){if(e=de(e),e&&(r||t===n))return Ps(e);if(!e||!(t=Ve(t)))return e;var c=ft(e),d=ft(t),g=ws(c,d),S=Es(c,d)+1;return zt(c,g,S).join("")}function gm(e,t,r){if(e=de(e),e&&(r||t===n))return e.slice(0,As(e)+1);if(!e||!(t=Ve(t)))return e;var c=ft(e),d=Es(c,ft(t))+1;return zt(c,0,d).join("")}function mm(e,t,r){if(e=de(e),e&&(r||t===n))return e.replace(yi,"");if(!e||!(t=Ve(t)))return e;var c=ft(e),d=ws(c,ft(t));return zt(c,d).join("")}function vm(e,t){var r=nr,c=dn;if(Se(t)){var d="separator"in t?t.separator:d;r="length"in t?ie(t.length):r,c="omission"in t?Ve(t.omission):c}e=de(e);var g=e.length;if(vn(e)){var S=ft(e);g=S.length}if(r>=g)return e;var R=r-yn(c);if(R<1)return c;var E=S?zt(S,0,R).join(""):e.slice(0,R);if(d===n)return E+c;if(S&&(R+=E.length-R),So(d)){if(e.slice(R).search(d)){var k,U=E;for(d.global||(d=ki(d.source,de(jo.exec(d))+"g")),d.lastIndex=0;k=d.exec(U);)var G=k.index;E=E.slice(0,G===n?R:G)}}else if(e.indexOf(Ve(d),R)!=R){var q=E.lastIndexOf(d);q>-1&&(E=E.slice(0,q))}return E+c}function ym(e){return e=de(e),e&&Ec.test(e)?e.replace(zo,$f):e}var _m=xn(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),To=ya("toUpperCase");function mu(e,t,r){return e=de(e),t=r?n:t,t===n?Hf(e)?Yf(e):Mf(e):e.match(t)||[]}var vu=se(function(e,t){try{return Je(e,n,t)}catch(r){return _o(r)?r:new Q(r)}}),Sm=wt(function(e,t){return Xe(t,function(r){r=yt(r),xt(e,r,vo(e[r],e))}),e});function Cm(e){var t=e==null?0:e.length,r=K();return e=t?ye(e,function(c){if(typeof c[1]!="function")throw new Qe(p);return[r(c[0]),c[1]]}):[],se(function(c){for(var d=-1;++dSt)return[];var r=Ye,c=De(e,Ye);t=K(t),e-=Ye;for(var d=Di(c,t);++r0||t<0)?new ue(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(t=ie(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},ue.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ue.prototype.toArray=function(){return this.take(Ye)},mt(ue.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),c=/^(?:head|last)$/.test(t),d=h[c?"take"+(t=="last"?"Right":""):t],g=c||/^find/.test(t);d&&(h.prototype[t]=function(){var S=this.__wrapped__,R=c?[1]:arguments,E=S instanceof ue,k=R[0],U=E||te(S),G=function(ae){var ce=d.apply(h,Gt([ae],R));return c&&q?ce[0]:ce};U&&r&&typeof k=="function"&&k.length!=1&&(E=U=!1);var q=this.__chain__,V=!!this.__actions__.length,Y=g&&!q,oe=E&&!V;if(!g&&U){S=oe?S:new ue(this);var Z=e.apply(S,R);return Z.__actions__.push({func:Vr,args:[G],thisArg:n}),new et(Z,q)}return Y&&oe?e.apply(this,R):(Z=this.thru(G),Y?c?Z.value()[0]:Z.value():Z)})}),Xe(["pop","push","shift","sort","splice","unshift"],function(e){var t=yr[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",c=/^(?:pop|shift)$/.test(e);h.prototype[e]=function(){var d=arguments;if(c&&!this.__chain__){var g=this.value();return t.apply(te(g)?g:[],d)}return this[r](function(S){return t.apply(te(S)?S:[],d)})}}),mt(ue.prototype,function(e,t){var r=h[t];if(r){var c=r.name+"";pe.call(bn,c)||(bn[c]=[]),bn[c].push({name:t,func:r})}}),bn[Gr(n,ot).name]=[{name:"wrapper",func:n}],ue.prototype.clone=yl,ue.prototype.reverse=_l,ue.prototype.value=Sl,h.prototype.at=Kp,h.prototype.chain=Yp,h.prototype.commit=Zp,h.prototype.next=Xp,h.prototype.plant=eh,h.prototype.reverse=th,h.prototype.toJSON=h.prototype.valueOf=h.prototype.value=nh,h.prototype.first=h.prototype.head,kn&&(h.prototype[kn]=Qp),h},_n=Zf();Xt?((Xt.exports=_n)._=_n,Ri._=_n):Oe._=_n}).call(Kn)})(fi,fi.exports);var Uv=fi.exports;const fn=Wu(Uv);var un=function(){return un=Object.assign||function(i){for(var s,n=1,o=arguments.length;n0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]0&&u[u.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!u||l[1]>u[0]&&l[1]{for(var a=o>1?void 0:o?Vv(s,n):s,u=i.length-1,p;u>=0;u--)(p=i[u])&&(a=(o?p(s,n,a):p(a))||a);return o&&a&&zv(s,n,a),a};let ln=class extends ov(sv,av){constructor(){super(...arguments),this.janusClient=null,this.session=null,this.handle=null,this.useStun=!1,this.aspectRatio=null,this.status="connecting"}get url(){var o;const s=this.camSettings.stream_url;let n=new URL(s,this.printerUrl===null?this.hostUrl.toString():this.printerUrl);if(n.port="8188",n.protocol=(o=this.printerUrl)!=null&&o.startsWith("https")?"wss":"ws",s.startsWith("ws")||s.startsWith("http")){n=new URL(s);const a=n.pathname.split("/");n.pathname=a.slice(0,a.length-1).join("/")}return n}get streamId(){const s=new URL(this.camSettings.stream_url).pathname.split("/");return s[s.length-1]}get webcamStyle(){var n,o,a;const s={transform:this.generateTransform((n=this.camSettings.flip_horizontal)!=null?n:!1,(o=this.camSettings.flip_vertical)!=null?o:!1,(a=this.camSettings.rotation)!=null?a:0),aspectRatio:1.7777777777777777};return this.aspectRatio&&(s.aspectRatio=this.aspectRatio),s}get streamConfig(){let s={server:this.url.toString()};return this.useStun&&(s.iceServers=[{urls:["stun:stun.l.google.com:19302"]}]),s}async startStream(){var n,o;this.janusClient=new qo(this.streamConfig),await this.janusClient.init({debug:!1}),this.session=await this.janusClient.createSession(),this.handle=await this.session.attach(Bv,{}),(n=this.handle)==null||n.onMessage.subscribe(async({message:a,jsep:u})=>{var p,m,T;if((p=a==null?void 0:a.result)!=null&&p.status&&(this.status=a.result.status),u){const l=await((m=this.handle)==null?void 0:m.createAnswer({jsep:u}));(T=this.handle)==null||T.send({message:{request:"start"},jsep:l})}});const s=new MediaStream;qo.attachMediaStream(this.stream,s),(o=this.handle)==null||o.onRemoteTrack.subscribe(({on:a,track:u})=>{a?s.addTrack(u):s.removeTrack(u)}),this.handle.onIceState.subscribe(a=>{console.log("ICE state changed to ".concat(a))}),this.handle.onError.subscribe(a=>{this.status="errored: ".concat(JSON.stringify(a))}),await this.handle.send({message:{request:"watch",id:parseInt(this.streamId)}})}mounted(){this.startStream()}updateAspectRatio(){this.aspectRatio=this.stream.videoWidth/this.stream.videoHeight}beforeDestroy(){var s;(s=this.session)==null||s.destroy({})}async changedUrl(){var s;await((s=this.session)==null?void 0:s.destroy({})),await this.startStream()}};tr([Gu({required:!0})],ln.prototype,"camSettings",2);tr([Gu({default:null})],ln.prototype,"printerUrl",2);tr([uv()],ln.prototype,"stream",2);tr([cv("url")],ln.prototype,"changedUrl",1);ln=tr([fv],ln);var $v=function(){var s=this,n=s._self._c;return s._self._setupProxy,n("div",[n("video",{directives:[{name:"show",rawName:"v-show",value:s.status==="started",expression:"status === 'started'"}],ref:"stream",staticClass:"webcamStream",style:s.webcamStyle,attrs:{autoplay:"",muted:"",playsinline:""},domProps:{muted:!0},on:{playing:s.updateAspectRatio}}),s.status!=="started"?n(dv,[n(pv,{staticClass:"_webcam_webrtc_output text-center d-flex flex-column justify-center align-center"},[s.status==="connecting"?n(hv,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):s._e(),n("span",{staticClass:"mt-3"},[s._v(s._s(s.status))])],1)],1):s._e()],1)},jv=[],Kv=lv(ln,$v,jv,!1,null,"1ca90143");const ty=Kv.exports;export{ty as default}; diff --git a/assets/JanusStreamer-CtR5HFZ8.css b/assets/JanusStreamer-CtR5HFZ8.css new file mode 100644 index 0000000..50565cf --- /dev/null +++ b/assets/JanusStreamer-CtR5HFZ8.css @@ -0,0 +1 @@ +.webcamStream[data-v-1ca90143]{width:100%}._webcam_webrtc_output[data-v-1ca90143]{aspect-ratio:1.5}video[data-v-1ca90143]{width:100%} diff --git a/assets/Mjpegstreamer-BgvUrWpO.css b/assets/Mjpegstreamer-BgvUrWpO.css new file mode 100644 index 0000000..844d924 --- /dev/null +++ b/assets/Mjpegstreamer-BgvUrWpO.css @@ -0,0 +1 @@ +.webcamImage[data-v-5cf3464a]{width:100%;background:#d3d3d3}.webcamFpsOutput[data-v-5cf3464a]{display:inline-block;position:absolute;bottom:0;right:0;background:#000c;padding:3px 10px;border-top-left-radius:5px}html.theme--light .webcamFpsOutput[data-v-5cf3464a]{background:#ffffffb3}._webcam_mjpegstreamer_output[data-v-5cf3464a]{aspect-ratio:1.5} diff --git a/assets/Mjpegstreamer-vxbaTGlP.js b/assets/Mjpegstreamer-vxbaTGlP.js new file mode 100644 index 0000000..60b0812 --- /dev/null +++ b/assets/Mjpegstreamer-vxbaTGlP.js @@ -0,0 +1 @@ +import{_ as S}from"./WebcamNozzleCrosshair-OgFJAMdG.js";import{m as w,B as _,H as y,P as u,R as b,W as f,C as v,n as C}from"./index-Bku7SJna.js";import{m as P,n as x,r as R}from"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./echarts-DzoUeqWp.js";var F=Object.defineProperty,L=Object.getOwnPropertyDescriptor,i=(c,t,e,a)=>{for(var s=a>1?void 0:a?L(t,e):t,n=c.length-1,o;n>=0;n--)(o=c[n])&&(s=(a?o(t,e,s):o(s))||s);return a&&s&&F(t,e,s),s};const M="content-length",m=new Uint8Array(2);m[0]=255;m[1]=216;let r=class extends w(_,y){constructor(){super(),this.frames=0,this.currentFPS=0,this.status="connecting",this.statusMessage="",this.streamState=!1,this.aspectRatio=null,this.timerFPS=null,this.timerRestart=null,this.reader=null}get url(){var t;return this.convertUrl((t=this.camSettings)==null?void 0:t.stream_url,this.printerUrl)}get webcamStyle(){var e,a,s;const t={transform:this.generateTransform((e=this.camSettings.flip_horizontal)!=null?e:!1,(a=this.camSettings.flip_vertical)!=null?a:!1,(s=this.camSettings.rotation)!=null?s:0),aspectRatio:1.7777777777777777,maxHeight:window.innerHeight-155+"px",maxWidth:"auto"};return this.aspectRatio&&(t.aspectRatio=this.aspectRatio,t.maxWidth=(window.innerHeight-155)*this.aspectRatio+"px"),t}get fpsOutput(){return this.currentFPS.toString().padStart(2,"0")}get showFpsCounter(){var t,e;return this.showFps?!((e=(t=this.camSettings.extra_data)==null?void 0:t.hideFps)!=null&&e):!1}get expanded(){var t;return this.page!=="dashboard"?!0:(t=this.$store.getters["gui/getPanelExpand"]("webcam-panel",this.viewport))!=null?t:!1}get showNozzleCrosshair(){var e,a;return((a=(e=this.camSettings.extra_data)==null?void 0:e.nozzleCrosshair)!=null?a:!1)&&this.status==="connected"}expandChanged(t){if(!t){this.stopStream();return}this.startStream()}log(t,e){if(e){window.console.log("[MJPEG streamer] ".concat(t),e);return}window.console.log("[MJPEG streamer] ".concat(t))}getLength(t){let e=-1;return t.split("\n").forEach(a=>{const s=a.split(":");s[0].toLowerCase()===M&&(e=s[1])}),e}async startStream(t=!1){var e;if(!this.streamState){this.streamState=!0,t||(this.status="connecting",this.statusMessage=this.$t("Panels.WebcamPanel.ConnectingTo",{url:this.url}).toString()),this.clearTimeouts();try{const a=new URL(this.url);a.searchParams.append("timestamp",new Date().getTime().toString());let s=await fetch(a.toString(),{mode:"cors"});if(!s.ok){this.log("".concat(s.status,": ").concat(s.statusText)),await this.stopStream();return}if(!s.body){this.log("ReadableStream not yet supported in this browser."),await this.stopStream();return}this.timerFPS=window.setInterval(()=>{this.currentFPS=this.frames,this.frames=0},1e3),this.timerRestart=window.setTimeout(()=>{this.restartStream(!0)},1e4),this.reader=(e=s.body)==null?void 0:e.getReader(),await this.readStream(),this.reader=null,s=null}catch(a){this.log(a.message),this.status="error",this.statusMessage=this.$t("Panels.WebcamPanel.ErrorWhileConnecting",{url:this.url}).toString(),this.timerRestart=window.setTimeout(()=>{this.restartStream()},5e3)}}}async readStream(){var t,e;if(this.reader)try{let a="",s=-1,n=new Uint8Array(0),o=0,p=!1,g=null,l;do if({done:g,value:l}=await this.reader.read(),!(g||!l))for(let h=0;h{URL.revokeObjectURL(d),p=!1}}this.frames++,s=0,o=0,a=""}while(!g)}catch(a){this.log("readStream error: ".concat((t=a.message)!=null?t:""),a)}finally{(e=this.reader)==null||e.releaseLock()}}mounted(){document.addEventListener("visibilitychange",this.documentVisibilityChanged)}beforeDestroy(){document.removeEventListener("visibilitychange",this.documentVisibilityChanged),this.stopStream()}clearTimeouts(){this.frames=0,this.timerFPS&&(window.clearInterval(this.timerFPS),this.timerFPS=null),this.timerRestart&&(window.clearTimeout(this.timerRestart),this.timerRestart=null)}async stopStream(t=!1){var e,a;this.streamState=!1,t||(this.status="disconnected",this.statusMessage=this.$t("Panels.WebcamPanel.Disconnected").toString()),this.clearTimeouts();try{await((e=this.reader)==null?void 0:e.cancel()),(a=this.reader)==null||a.releaseLock(),this.reader=null}catch(s){this.log("Error cancelling reader:",s)}}async restartStream(t=!1){await this.stopStream(t),await this.startStream(t)}camSettingsChanged(){this.aspectRatio=null,this.restartStream()}documentVisibilityChanged(){let e=document.visibilityState==="visible";if(this.page==="dashboard"&&!this.expanded&&(e=!1),!e){this.stopStream();return}this.startStream()}onload(){this.aspectRatio!==null||!this.image||(this.aspectRatio=this.image.naturalWidth/this.image.naturalHeight)}};i([u({required:!0})],r.prototype,"camSettings",2);i([u({default:null})],r.prototype,"printerUrl",2);i([u({default:!0})],r.prototype,"showFps",2);i([u({type:String,default:null})],r.prototype,"page",2);i([b("image")],r.prototype,"image",2);i([f("expanded",{immediate:!0})],r.prototype,"expandChanged",1);i([f("camSettings",{deep:!0})],r.prototype,"camSettingsChanged",1);r=i([v],r);var T=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{staticClass:"d-flex justify-center",staticStyle:{position:"relative"}},[e("img",{directives:[{name:"show",rawName:"v-show",value:t.status==="connected",expression:"status === 'connected'"}],ref:"image",staticClass:"webcamImage",style:t.webcamStyle,attrs:{draggable:"false",alt:t.camSettings.name,src:"#"},on:{load:t.onload}}),t.showFpsCounter&&t.status==="connected"?e("span",{staticClass:"webcamFpsOutput"},[t._v(" "+t._s(t.$t("Panels.WebcamPanel.FPS"))+": "+t._s(t.fpsOutput)+" ")]):t._e(),t.showNozzleCrosshair?e(S,{attrs:{webcam:t.camSettings}}):t._e(),t.status!=="connected"?e(P,[e(x,{staticClass:"_webcam_mjpegstreamer_output text-center d-flex flex-column justify-center align-center"},[t.status==="connecting"?e(R,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):t._e(),e("span",{staticClass:"mt-3"},[t._v(t._s(t.statusMessage))])],1)],1):t._e()],1)},z=[],U=C(r,T,z,!1,null,"5cf3464a");const N=U.exports;export{N as default}; diff --git a/assets/MjpegstreamerAdaptive-BIOOAIPf.css b/assets/MjpegstreamerAdaptive-BIOOAIPf.css new file mode 100644 index 0000000..fecb06c --- /dev/null +++ b/assets/MjpegstreamerAdaptive-BIOOAIPf.css @@ -0,0 +1 @@ +.webcamBackground[data-v-a21ba006]{position:relative;background:#000c}.webcamImage[data-v-a21ba006]{width:100%}._webcam_mjpegstreamer_output[data-v-a21ba006]{aspect-ratio:1.5}.webcamFpsOutput[data-v-a21ba006]{display:inline-block;position:absolute;bottom:0;right:0;padding:3px 10px;border-top-left-radius:5px;background:#000c}html.theme--light .webcamBackground[data-v-a21ba006],html.theme--light .webcamFpsOutput[data-v-a21ba006]{background:#ffffffb3} diff --git a/assets/MjpegstreamerAdaptive-Boi1-RyL.js b/assets/MjpegstreamerAdaptive-Boi1-RyL.js new file mode 100644 index 0000000..e735c62 --- /dev/null +++ b/assets/MjpegstreamerAdaptive-Boi1-RyL.js @@ -0,0 +1 @@ +import{_ as l}from"./WebcamNozzleCrosshair-OgFJAMdG.js";import{m as u,B as p,H as g,P as h,R as f,W as c,C as _,n as d}from"./index-Bku7SJna.js";import{m as w,n as b,r as v}from"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./echarts-DzoUeqWp.js";var S=Object.defineProperty,C=Object.getOwnPropertyDescriptor,a=(o,t,e,s)=>{for(var i=s>1?void 0:s?C(t,e):t,n=o.length-1,m;n>=0;n--)(m=o[n])&&(i=(s?m(t,e,i):m(i))||i);return s&&i&&S(t,e,i),i};let r=class extends u(p,g){constructor(){super(...arguments),this.isVisibleDocument=!0,this.isVisibleViewport=!1,this.status="connecting",this.statusMessage="",this.timer=null,this.request_start_time=performance.now(),this.time=0,this.request_time=0,this.request_time_smoothing=.2,this.currentFPS=null,this.fpsTimer=null,this.frames=0,this.aspectRatio=null}get webcamStyle(){var e,s,i;const t={transform:this.generateTransform((e=this.camSettings.flip_horizontal)!=null?e:!1,(s=this.camSettings.flip_vertical)!=null?s:!1,(i=this.camSettings.rotation)!=null?i:0),aspectRatio:1.7777777777777777,maxHeight:window.innerHeight-155+"px",maxWidth:"auto"};if(this.aspectRatio&&(t.aspectRatio=this.aspectRatio,t.maxWidth=(window.innerHeight-155)*this.aspectRatio+"px"),this.aspectRatio&&[90,270].includes(this.camSettings.rotation)){t.transform==="none"&&(t.transform="");const n=1/this.aspectRatio;t.transform+=" rotate("+this.camSettings.rotation+"deg) scale("+n+")"}return t}get fpsOutput(){return this.currentFPS===null?"--":this.currentFPS<10?"0"+this.currentFPS.toString():this.currentFPS}get showFpsCounter(){var t,e;return this.showFps?!((e=(t=this.camSettings.extra_data)==null?void 0:t.hideFps)!=null&&e):!1}get url(){var t;return this.convertUrl((t=this.camSettings)==null?void 0:t.snapshot_url,this.printerUrl)}get isVisible(){return this.isVisibleDocument&&this.isVisibleViewport}get showNozzleCrosshair(){var e,s;return((s=(e=this.camSettings.extra_data)==null?void 0:e.nozzleCrosshair)!=null?s:!1)&&this.status==="connected"}mounted(){document.addEventListener("visibilitychange",this.documentVisibilityChanged)}beforeDestroy(){document.removeEventListener("visibilitychange",this.documentVisibilityChanged),this.stopStream()}documentVisibilityChanged(){const t=document.visibilityState;this.isVisibleDocument=t==="visible"}viewportVisibilityChanged(t){this.isVisibleViewport=t}isVisibleChanged(t){if(t){this.startStream();return}this.stopStream()}refreshFrame(){if(!this.isVisible)return;this.timer!==null&&(window.clearTimeout(this.timer),this.timer=null);const t=new URL(this.url);t.searchParams.append("bypassCache",new Date().getTime().toString()),this.image.src=t.toString(),this.request_start_time=performance.now()}onLoad(){this.status!=="connected"&&(this.status="connected",this.statusMessage=""),this.frames++,this.aspectRatio===null&&(this.aspectRatio=this.image.naturalWidth/this.image.naturalHeight);const e=1e3/(this.camSettings.target_fps||10),s=performance.now()-this.request_start_time;this.request_time=this.request_time*this.request_time_smoothing+s*(1-this.request_time_smoothing);const i=Math.max(0,e-this.request_time);this.timer=window.setTimeout(this.refreshFrame,i)}onError(){this.status="error",this.statusMessage=this.$t("Panels.WebcamPanel.ErrorWhileConnecting",{url:this.url}).toString(),this.timer===null&&(this.timer=window.setTimeout(this.refreshFrame,1e3))}startStream(){this.isVisible&&(this.status!=="connected"&&(this.status="connecting",this.statusMessage=this.$t("Panels.WebcamPanel.ConnectingTo",{url:this.url}).toString()),this.clearTimers(),this.fpsTimer=window.setInterval(()=>{this.currentFPS=this.frames,this.frames=0},1e3),this.refreshFrame())}stopStream(){this.clearTimers()}clearTimers(){this.timer&&(window.clearTimeout(this.timer),this.timer=null),this.fpsTimer&&(window.clearTimeout(this.fpsTimer),this.fpsTimer=null,this.frames=0)}camSettingsChanged(){this.aspectRatio=null,this.stopStream(),this.status="connecting",this.startStream()}};a([h({required:!0})],r.prototype,"camSettings",2);a([h({default:null})],r.prototype,"printerUrl",2);a([h({default:!0})],r.prototype,"showFps",2);a([f("image")],r.prototype,"image",2);a([c("isVisible",{immediate:!0})],r.prototype,"isVisibleChanged",1);a([c("camSettings",{deep:!0})],r.prototype,"camSettingsChanged",1);r=a([_],r);var y=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:t.viewportVisibilityChanged,expression:"viewportVisibilityChanged"}],staticClass:"d-flex justify-center webcamBackground"},[e("img",{directives:[{name:"show",rawName:"v-show",value:t.status==="connected",expression:"status === 'connected'"}],ref:"image",staticClass:"webcamImage",style:t.webcamStyle,attrs:{draggable:"false",alt:t.camSettings.name,src:"#"},on:{error:t.onError,load:t.onLoad}}),t.status==="connected"&&t.showFpsCounter?e("span",{staticClass:"webcamFpsOutput"},[t._v(" "+t._s(t.$t("Panels.WebcamPanel.FPS"))+": "+t._s(t.fpsOutput)+" ")]):t._e(),t.showNozzleCrosshair?e(l,{attrs:{webcam:t.camSettings}}):t._e(),t.status!=="connected"?e(w,[e(b,{staticClass:"_webcam_mjpegstreamer_output text-center d-flex flex-column justify-center align-center"},[t.status==="connecting"?e(v,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):t._e(),e("span",{staticClass:"mt-3"},[t._v(t._s(t.statusMessage))])],1)],1):t._e()],1)},x=[],P=d(r,y,x,!1,null,"a21ba006");const M=P.exports;export{M as default}; diff --git a/assets/Uv4lMjpeg-1VbXGWjy.js b/assets/Uv4lMjpeg-1VbXGWjy.js new file mode 100644 index 0000000..8f20794 --- /dev/null +++ b/assets/Uv4lMjpeg-1VbXGWjy.js @@ -0,0 +1 @@ +import{m as h,B as c,H as p,P as m,W as g,C as u,n as v}from"./index-Bku7SJna.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./echarts-DzoUeqWp.js";var b=Object.defineProperty,f=Object.getOwnPropertyDescriptor,n=(r,t,i,s)=>{for(var e=s>1?void 0:s?f(t,i):t,l=r.length-1,o;l>=0;l--)(o=r[l])&&(e=(s?o(t,i,e):o(e))||e);return s&&e&&b(t,i,e),e};let a=class extends h(c,p){constructor(){super(...arguments),this.aspectRatio=null,this.isVisible=!1,this.isVisibleViewport=!1,this.isVisibleDocument=!0}get url(){var t;return this.convertUrl((t=this.camSettings)==null?void 0:t.stream_url,this.printerUrl)}get webcamStyle(){var i,s,e;const t={transform:this.generateTransform((i=this.camSettings.flip_horizontal)!=null?i:!1,(s=this.camSettings.flip_vertical)!=null?s:!1,(e=this.camSettings.rotation)!=null?e:0),aspectRatio:1.7777777777777777,maxHeight:window.innerHeight-155+"px",maxWidth:"auto"};return this.aspectRatio&&(t.aspectRatio=this.aspectRatio,t.maxWidth=(window.innerHeight-155)*this.aspectRatio+"px"),t}mounted(){document.addEventListener("visibilitychange",this.documentVisibilityChanged)}beforeDestroy(){document.removeEventListener("visibilitychange",this.documentVisibilityChanged),this.stopStream()}startStream(){this.isVisible||this.$refs.webcamUv4lMjpegImage&&this.$refs.webcamUv4lMjpegImage.setAttribute("src",this.url)}stopStream(){this.$refs.webcamUv4lMjpegImage&&(this.$refs.webcamUv4lMjpegImage.removeAttribute("src"),URL.revokeObjectURL(this.url))}documentVisibilityChanged(){const t=document.visibilityState;this.isVisibleDocument=t==="visible",this.isVisibleDocument||this.stopStream(),this.visibilityChanged()}viewportVisibilityChanged(t){this.isVisibleViewport=t,this.visibilityChanged()}visibilityChanged(){if(this.isVisibleViewport&&this.isVisibleDocument){this.startStream();return}this.stopStream()}onload(){this.aspectRatio===null&&this.$refs.webcamUv4lMjpegImage&&(this.aspectRatio=this.$refs.webcamUv4lMjpegImage.naturalWidth/this.$refs.webcamUv4lMjpegImage.naturalHeight)}async urlChanged(){await this.stopStream(),await this.startStream()}};n([m({required:!0})],a.prototype,"camSettings",2);n([m({default:null})],a.prototype,"printerUrl",2);n([g("url")],a.prototype,"urlChanged",1);a=n([u],a);var d=function(){var t=this,i=t._self._c;return t._self._setupProxy,i("div",{staticClass:"d-flex justify-center"},[i("img",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:t.viewportVisibilityChanged,expression:"viewportVisibilityChanged"}],ref:"webcamUv4lMjpegImage",staticClass:"webcamImage",style:t.webcamStyle,attrs:{draggable:"false"},on:{load:t.onload}})])},w=[],y=v(a,d,w,!1,null,"f00ff5d2");const j=y.exports;export{j as default}; diff --git a/assets/Uv4lMjpeg-DO1dNraK.css b/assets/Uv4lMjpeg-DO1dNraK.css new file mode 100644 index 0000000..8350784 --- /dev/null +++ b/assets/Uv4lMjpeg-DO1dNraK.css @@ -0,0 +1 @@ +.webcamImage[data-v-f00ff5d2]{width:100%;background:#d3d3d3} diff --git a/assets/Viewer-DVCEMRp5.js b/assets/Viewer-DVCEMRp5.js new file mode 100644 index 0000000..579aa14 --- /dev/null +++ b/assets/Viewer-DVCEMRp5.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ddsTextureLoader-7rBWB6fI.js","assets/dds-C4nWUSlI.js","assets/cubemapToSphericalPolynomial-DI79UW0r.js","assets/vuetify-Ce4WN_Dg.js","assets/overlayscrollbars-CiKU261J.js","assets/overlayscrollbars-BJn_P54_.css","assets/vuetify-BSwS9o2d.css","assets/index-Bku7SJna.js","assets/echarts-DzoUeqWp.js","assets/index-DdkGOISd.css","assets/codemirror-ZSHHXwGs.js","assets/basisTextureLoader-C2AKop91.js","assets/envTextureLoader-0a1UyQXk.js","assets/hdrTextureLoader-CbSWrxkf.js","assets/ktxTextureLoader-DFWsW27H.js","assets/tgaTextureLoader-CGo25llH.js","assets/exrTextureLoader-CpwykM8r.js","assets/postprocess.vertex-DvFhjUjz.js","assets/pass.fragment-CM2j9WLA.js","assets/pass.fragment-BkcfUm5b.js","assets/default.vertex-Caa9iT2n.js","assets/mainUVVaryingDeclaration-Byysp88Q.js","assets/bonesVertex-B72aYlMi.js","assets/clipPlaneVertex-L9tMAQxe.js","assets/vertexColorMixing-D-DdWwxQ.js","assets/morphTargetsVertex-B2hbMuPn.js","assets/logDepthDeclaration-QTuRqmDC.js","assets/logDepthVertex-SrVRb0bM.js","assets/default.fragment-DzWBfowK.js","assets/clipPlaneFragment-ef4zNzcj.js","assets/fogFragment-BYUe2MTZ.js","assets/logDepthFragment-CVSnEUp_.js","assets/default.vertex-B3P8Ow0L.js","assets/mainUVVaryingDeclaration-DltpozJN.js","assets/meshUboDeclaration-BEPmj8E0.js","assets/helperFunctions-CmftqOHQ.js","assets/bakedVertexAnimation-jXsepPDt.js","assets/morphTargetsVertex-Dur5DJ01.js","assets/vertexColorMixing-CVYhb6uZ.js","assets/default.fragment-BQ0cgw4g.js","assets/fxaa.fragment-CKBSH8ak.js","assets/fxaa.vertex-pl3gzfER.js","assets/fxaa.fragment-CQ-OctB5.js","assets/fxaa.vertex-D11BDiUg.js","assets/color.vertex-Ccg8Ge1R.js","assets/color.fragment-DNkpzaOC.js","assets/color.vertex-BL9BK6Le.js","assets/color.fragment-BjUREcw_.js","assets/line.vertex-ChOZncX4.js","assets/line.fragment-azBhzxfj.js","assets/line.vertex-DNyxgHBi.js","assets/line.fragment-thDij4Gq.js","assets/kernelBlur.fragment-BJnJE4Wi.js","assets/kernelBlurVaryingDeclaration-DuItmes5.js","assets/kernelBlur.vertex-SB8k7aXt.js","assets/kernelBlur.fragment-CAduVWsS.js","assets/kernelBlurVaryingDeclaration-DOqeMSlf.js","assets/kernelBlur.vertex-Dciph_cp.js","assets/glowMapGeneration.vertex-O7p-xSBA.js","assets/glowMapGeneration.fragment-CfLBq-Y2.js","assets/glowMapGeneration.vertex-BcKlBU7O.js","assets/glowMapGeneration.fragment-C2VnGqtj.js","assets/glowBlurPostProcess.fragment-D0h3Yhq8.js","assets/glowBlurPostProcess.fragment-BmYiq-YF.js","assets/glowMapMerge.fragment-z1wsxOL6.js","assets/glowMapMerge.vertex-BOpN3rPY.js","assets/glowMapMerge.fragment-C9pBmOul.js","assets/glowMapMerge.vertex-CYvG5BDv.js"])))=>i.map(i=>d[i]); +import{V as pf,f as Bt,c as Ri,i as Ro,m as sr,n as ds,S as gf,Y as mf,P as Io,D as vf,E as bf,y as Bi,q as Li,j as xf,w as Eo,k as da,h as yf,_ as Tf,a as Af,b as Rf,p as If,d as Ef}from"./vuetify-Ce4WN_Dg.js";import{k as Cf,l as Sf,P as Vr,W as nt,C as a0,n as o0,o as Oe,m as El,B as Cl,p as Mf,q as Pf,r as wf,s as Df,t as Ff,u as Of,v as Bf,w as Lf,x as Nf,y as Uf,z as kf,A as Vf,D as Gf,E as Co,F as zf,R as Sl,G as Ml,_ as Pl}from"./index-Bku7SJna.js";import{E as Wf,b as Hf,a as Kf}from"./codemirror-ZSHHXwGs.js";function Xf(a,e){return e===void 0&&(e={}),function(t,i){Cf(e,t,i),Sf(function(s,n){(s.props||(s.props={}))[a]=e,(s.computed||(s.computed={}))[n]={get:function(){return this[a]},set:function(r){this.$emit("update:"+a,r)}}})(t,i)}}var Yf=Object.defineProperty,qf=Object.getOwnPropertyDescriptor,Ws=(a,e,t,i)=>{for(var s=i>1?void 0:i?qf(e,t):e,n=a.length-1,r;n>=0;n--)(r=a[n])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&Yf(e,t,s),s};let ns=class extends pf{constructor(){super(...arguments),this.view=void 0}mounted(){this.view=new Wf({doc:this.document,extensions:[Hf,Kf.readOnly.of(!0)],parent:this.$refs.view})}mouseUp(){if(this.view){let a=this.view.state.doc.lineAt(this.view.state.selection.ranges[0].from);this.$emit("update:currentline",a.to),this.view.contentDOM.blur(),this.$emit("got-focus")}}keyPress(){if(this.view){let a=this.view.state.doc.lineAt(this.view.state.selection.ranges[0].from);this.$emit("update:currentline",a.to),this.$emit("got-focus")}}documentUpdated(){this.view&&this.shown&&this.view.dispatch({changes:{from:0,to:this.view.state.doc.length,insert:this.document}})}currentlineUpdated(a){if(this.view&&this.shown){let e=this.view.state.doc.lineAt(a);this.view.dispatch({selection:{anchor:e.from,head:e.from},scrollIntoView:!0})}}};Ws([Xf("currentline")],ns.prototype,"currentLineNumber",2);Ws([Vr({type:String,default:""})],ns.prototype,"document",2);Ws([Vr({type:Boolean,default:!1})],ns.prototype,"isSimulating",2);Ws([Vr({type:Boolean,default:!1})],ns.prototype,"shown",2);Ws([nt("document")],ns.prototype,"documentUpdated",1);Ws([nt("currentLineNumber")],ns.prototype,"currentlineUpdated",1);ns=Ws([a0({})],ns);var jf=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{ref:"view",staticClass:"codeview",on:{mouseup:e.mouseUp,keydown:e.keyPress}})},$f=[],Zf=o0(ns,jf,$f,!1,null,"083209f9");const wl=Zf.exports,Qf=typeof WeakRef<"u";class Jf{constructor(e,t=!1,i,s){this.initialize(e,t,i,s)}initialize(e,t=!1,i,s){return this.mask=e,this.skipNextObservers=t,this.target=i,this.currentTarget=s,this}}class ed{constructor(e,t,i=null){this.callback=e,this.mask=t,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1,this._remove=null}remove(){this._remove&&this._remove()}}class Z{static FromPromise(e,t){const i=new Z;return e.then(s=>{i.notifyObservers(s)}).catch(s=>{if(t)t.notifyObservers(s);else throw s}),i}get observers(){return this._observers}constructor(e,t=!1){this.notifyIfTriggered=t,this._observers=new Array,this._numObserversMarkedAsDeleted=0,this._hasNotified=!1,this._eventState=new Jf(0),e&&(this._onObserverAdded=e)}add(e,t=-1,i=!1,s=null,n=!1){if(!e)return null;const r=new ed(e,t,s);r.unregisterOnNextCall=n,i?this._observers.unshift(r):this._observers.push(r),this._onObserverAdded&&this._onObserverAdded(r),this._hasNotified&&this.notifyIfTriggered&&this._lastNotifiedValue!==void 0&&this.notifyObserver(r,this._lastNotifiedValue);const o=Qf?new WeakRef(this):{deref:()=>this};return r._remove=()=>{const h=o.deref();h&&h._remove(r)},r}addOnce(e){return this.add(e,void 0,void 0,void 0,!0)}remove(e){return e?(e._remove=null,this._observers.indexOf(e)!==-1?(this._deferUnregister(e),!0):!1):!1}removeCallback(e,t){for(let i=0;i{this._remove(e)},0))}_remove(e,t=!0){if(!e)return!1;const i=this._observers.indexOf(e);return i!==-1?(t&&this._numObserversMarkedAsDeleted--,this._observers.splice(i,1),!0):!1}makeObserverTopPriority(e){this._remove(e,!1),this._observers.unshift(e)}makeObserverBottomPriority(e){this._remove(e,!1),this._observers.push(e)}notifyObservers(e,t=-1,i,s,n){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=e),!this._observers.length)return!0;const r=this._eventState;r.mask=t,r.target=i,r.currentTarget=s,r.skipNextObservers=!1,r.lastReturnValue=e,r.userInfo=n;for(const o of this._observers)if(!o._willBeUnregistered&&(o.mask&t&&(o.unregisterOnNextCall&&this._deferUnregister(o),o.scope?r.lastReturnValue=o.callback.apply(o.scope,[e,r]):r.lastReturnValue=o.callback(e,r)),r.skipNextObservers))return!1;return!0}notifyObserver(e,t,i=-1){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=t),e._willBeUnregistered)return;const s=this._eventState;s.mask=i,s.skipNextObservers=!1,e.unregisterOnNextCall&&this._deferUnregister(e),e.callback(t,s)}hasObservers(){return this._observers.length-this._numObserversMarkedAsDeleted>0}clear(){for(;this._observers.length;){const e=this._observers.pop();e&&(e._remove=null)}this._onObserverAdded=null,this._numObserversMarkedAsDeleted=0,this.cleanLastNotifiedState()}cleanLastNotifiedState(){this._hasNotified=!1,this._lastNotifiedValue=void 0}clone(){const e=new Z;return e._observers=this._observers.slice(0),e}hasSpecificMask(e=-1){for(const t of this._observers)if(t.mask&e||t.mask===e)return!0;return!1}}class td{get wrapU(){return this._cachedWrapU}set wrapU(e){this._cachedWrapU=e}get wrapV(){return this._cachedWrapV}set wrapV(e){this._cachedWrapV=e}get wrapR(){return this._cachedWrapR}set wrapR(e){this._cachedWrapR=e}get anisotropicFilteringLevel(){return this._cachedAnisotropicFilteringLevel}set anisotropicFilteringLevel(e){this._cachedAnisotropicFilteringLevel=e}get comparisonFunction(){return this._comparisonFunction}set comparisonFunction(e){this._comparisonFunction=e}get useMipMaps(){return this._useMipMaps}set useMipMaps(e){this._useMipMaps=e}constructor(){this.samplingMode=-1,this._useMipMaps=!0,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this._comparisonFunction=0}setParameters(e=1,t=1,i=1,s=1,n=2,r=0){return this._cachedWrapU=e,this._cachedWrapV=t,this._cachedWrapR=i,this._cachedAnisotropicFilteringLevel=s,this.samplingMode=n,this._comparisonFunction=r,this}compareSampler(e){return this._cachedWrapU===e._cachedWrapU&&this._cachedWrapV===e._cachedWrapV&&this._cachedWrapR===e._cachedWrapR&&this._cachedAnisotropicFilteringLevel===e._cachedAnisotropicFilteringLevel&&this.samplingMode===e.samplingMode&&this._comparisonFunction===e._comparisonFunction&&this._useMipMaps===e._useMipMaps}}var So;(function(a){a[a.Unknown=0]="Unknown",a[a.Url=1]="Url",a[a.Temp=2]="Temp",a[a.Raw=3]="Raw",a[a.Dynamic=4]="Dynamic",a[a.RenderTarget=5]="RenderTarget",a[a.MultiRenderTarget=6]="MultiRenderTarget",a[a.Cube=7]="Cube",a[a.CubeRaw=8]="CubeRaw",a[a.CubePrefiltered=9]="CubePrefiltered",a[a.Raw3D=10]="Raw3D",a[a.Raw2DArray=11]="Raw2DArray",a[a.DepthStencil=12]="DepthStencil",a[a.CubeRawRGBD=13]="CubeRawRGBD",a[a.Depth=14]="Depth"})(So||(So={}));function Mo(a){return a===13||a===14||a===15||a===16||a===17||a===18||a===19}function id(a){switch(a){case 13:case 17:case 18:case 14:case 16:return 1;case 15:return 5;case 19:return 0}return 0}function br(a){return a===13||a===17||a===18||a===19}class ft extends td{get useMipMaps(){return this.generateMipMaps}set useMipMaps(e){this.generateMipMaps=e}get uniqueId(){return this._uniqueId}_setUniqueId(e){this._uniqueId=e}getEngine(){return this._engine}get source(){return this._source}constructor(e,t,i=!1){super(),this.isReady=!1,this.isCube=!1,this.is3D=!1,this.is2DArray=!1,this.isMultiview=!1,this.url="",this.generateMipMaps=!1,this.samples=0,this.type=-1,this.format=-1,this.onLoadedObservable=new Z,this.onErrorObservable=new Z,this.onRebuildCallback=null,this.width=0,this.height=0,this.depth=0,this.baseWidth=0,this.baseHeight=0,this.baseDepth=0,this.invertY=!1,this._invertVScale=!1,this._associatedChannel=-1,this._source=0,this._buffer=null,this._bufferView=null,this._bufferViewArray=null,this._bufferViewArrayArray=null,this._size=0,this._extension="",this._files=null,this._workingCanvas=null,this._workingContext=null,this._cachedCoordinatesMode=null,this._isDisabled=!1,this._compression=null,this._sphericalPolynomial=null,this._sphericalPolynomialPromise=null,this._sphericalPolynomialComputed=!1,this._lodGenerationScale=0,this._lodGenerationOffset=0,this._useSRGBBuffer=!1,this._creationFlags=0,this._lodTextureHigh=null,this._lodTextureMid=null,this._lodTextureLow=null,this._isRGBD=!1,this._linearSpecularLOD=!1,this._irradianceTexture=null,this._hardwareTexture=null,this._maxLodLevel=null,this._references=1,this._gammaSpace=null,this._premulAlpha=!1,this._dynamicTextureSource=null,this._autoMSAAManagement=!1,this._engine=e,this._source=t,this._uniqueId=ft._Counter++,i||(this._hardwareTexture=e._createHardwareTexture())}incrementReferences(){this._references++}updateSize(e,t,i=1){this._engine.updateTextureDimensions(this,e,t,i),this.width=e,this.height=t,this.depth=i,this.baseWidth=e,this.baseHeight=t,this.baseDepth=i,this._size=e*t*i}_rebuild(){var t,i;if(this.isReady=!1,this._cachedCoordinatesMode=null,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this.onRebuildCallback){const s=this.onRebuildCallback(this),n=r=>{r._swapAndDie(this,!1),this.isReady=s.isReady};s.isAsync?s.proxy.then(n):n(s.proxy);return}let e;switch(this.source){case 2:break;case 1:e=this._engine.createTexture((t=this._originalUrl)!=null?t:this.url,!this.generateMipMaps,this.invertY,null,this.samplingMode,s=>{s._swapAndDie(this,!1),this.isReady=!0},null,this._buffer,void 0,this.format,this._extension,void 0,void 0,void 0,this._useSRGBBuffer);return;case 3:e=this._engine.createRawTexture(this._bufferView,this.baseWidth,this.baseHeight,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type,this._creationFlags,this._useSRGBBuffer),e._swapAndDie(this,!1),this.isReady=!0;break;case 10:e=this._engine.createRawTexture3D(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type),e._swapAndDie(this,!1),this.isReady=!0;break;case 11:e=this._engine.createRawTexture2DArray(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type),e._swapAndDie(this,!1),this.isReady=!0;break;case 4:e=this._engine.createDynamicTexture(this.baseWidth,this.baseHeight,this.generateMipMaps,this.samplingMode),e._swapAndDie(this,!1),this._dynamicTextureSource&&this._engine.updateDynamicTexture(this,this._dynamicTextureSource,this.invertY,this._premulAlpha,this.format,!0);break;case 7:e=this._engine.createCubeTexture(this.url,null,this._files,!this.generateMipMaps,()=>{e._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension,!1,0,0,null,void 0,this._useSRGBBuffer,ArrayBuffer.isView(this._buffer)?this._buffer:null);return;case 8:e=this._engine.createRawCubeTexture(this._bufferViewArray,this.width,(i=this._originalFormat)!=null?i:this.format,this.type,this.generateMipMaps,this.invertY,this.samplingMode,this._compression),e._swapAndDie(this,!1),this.isReady=!0;break;case 13:return;case 9:e=this._engine.createPrefilteredCubeTexture(this.url,null,this._lodGenerationScale,this._lodGenerationOffset,s=>{s&&s._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension),e._sphericalPolynomial=this._sphericalPolynomial;return}}_swapAndDie(e,t=!0){var n;(n=this._hardwareTexture)==null||n.setUsage(e._source,this.generateMipMaps,this.is2DArray,this.isCube,this.is3D,this.width,this.height,this.depth),e._hardwareTexture=this._hardwareTexture,t&&(e._isRGBD=this._isRGBD),this._lodTextureHigh&&(e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureHigh=this._lodTextureHigh),this._lodTextureMid&&(e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureMid=this._lodTextureMid),this._lodTextureLow&&(e._lodTextureLow&&e._lodTextureLow.dispose(),e._lodTextureLow=this._lodTextureLow),this._irradianceTexture&&(e._irradianceTexture&&e._irradianceTexture.dispose(),e._irradianceTexture=this._irradianceTexture);const i=this._engine.getLoadedTexturesCache();let s=i.indexOf(this);s!==-1&&i.splice(s,1),s=i.indexOf(e),s===-1&&i.push(e)}dispose(){this._references--,this.onLoadedObservable.clear(),this.onErrorObservable.clear(),this._references===0&&(this._engine._releaseTexture(this),this._hardwareTexture=null,this._dynamicTextureSource=null)}}ft._Counter=0;class Ee{static get LastCreatedEngine(){return this.Instances.length===0?null:this.Instances[this.Instances.length-1]}static get LastCreatedScene(){return this._LastCreatedScene}}Ee.Instances=[];Ee.OnEnginesDisposedObservable=new Z;Ee._LastCreatedScene=null;Ee.UseFallbackTexture=!0;Ee.FallbackTexture="";class sd{constructor(){this._valueCache={},this.vertexCompilationError=null,this.fragmentCompilationError=null,this.programLinkError=null,this.programValidationError=null,this._isDisposed=!1}get isAsync(){return this.isParallelCompiled}get isReady(){return this.program?this.isParallelCompiled?this.engine._isRenderingStateCompiled(this):!0:!1}_handlesSpectorRebuildCallback(e){e&&this.program&&e(this.program)}setEngine(e){this.engine=e}_fillEffectInformation(e,t,i,s,n,r,o,h){const l=this.engine;if(l.supportsUniformBuffers)for(const f in t)e.bindUniformBlock(f,t[f]);this.engine.getUniforms(this,i).forEach((f,d)=>{s[i[d]]=f}),this._uniforms=s;let u;for(u=0;u{r[f]=d});for(const f of l.getAttributes(this,o))h.push(f)}dispose(){this._uniforms={},this._isDisposed=!0}_cacheMatrix(e,t){const i=this._valueCache[e],s=t.updateFlag;return i!==void 0&&i===s?!1:(this._valueCache[e]=s,!0)}_cacheFloat2(e,t,i){let s=this._valueCache[e];if(!s||s.length!==2)return s=[t,i],this._valueCache[e]=s,!0;let n=!1;return s[0]!==t&&(s[0]=t,n=!0),s[1]!==i&&(s[1]=i,n=!0),n}_cacheFloat3(e,t,i,s){let n=this._valueCache[e];if(!n||n.length!==3)return n=[t,i,s],this._valueCache[e]=n,!0;let r=!1;return n[0]!==t&&(n[0]=t,r=!0),n[1]!==i&&(n[1]=i,r=!0),n[2]!==s&&(n[2]=s,r=!0),r}_cacheFloat4(e,t,i,s,n){let r=this._valueCache[e];if(!r||r.length!==4)return r=[t,i,s,n],this._valueCache[e]=r,!0;let o=!1;return r[0]!==t&&(r[0]=t,o=!0),r[1]!==i&&(r[1]=i,o=!0),r[2]!==s&&(r[2]=s,o=!0),r[3]!==n&&(r[3]=n,o=!0),o}setInt(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setInt2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setInt3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setInt3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setInt4(e,t,i,s,n){this._cacheFloat4(e,t,i,s,n)&&(this.engine.setInt4(this._uniforms[e],t,i,s,n)||(this._valueCache[e]=null))}setIntArray(e,t){this._valueCache[e]=null,this.engine.setIntArray(this._uniforms[e],t)}setIntArray2(e,t){this._valueCache[e]=null,this.engine.setIntArray2(this._uniforms[e],t)}setIntArray3(e,t){this._valueCache[e]=null,this.engine.setIntArray3(this._uniforms[e],t)}setIntArray4(e,t){this._valueCache[e]=null,this.engine.setIntArray4(this._uniforms[e],t)}setUInt(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setUInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setUInt2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setUInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setUInt3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setUInt3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setUInt4(e,t,i,s,n){this._cacheFloat4(e,t,i,s,n)&&(this.engine.setUInt4(this._uniforms[e],t,i,s,n)||(this._valueCache[e]=null))}setUIntArray(e,t){this._valueCache[e]=null,this.engine.setUIntArray(this._uniforms[e],t)}setUIntArray2(e,t){this._valueCache[e]=null,this.engine.setUIntArray2(this._uniforms[e],t)}setUIntArray3(e,t){this._valueCache[e]=null,this.engine.setUIntArray3(this._uniforms[e],t)}setUIntArray4(e,t){this._valueCache[e]=null,this.engine.setUIntArray4(this._uniforms[e],t)}setArray(e,t){this._valueCache[e]=null,this.engine.setArray(this._uniforms[e],t)}setArray2(e,t){this._valueCache[e]=null,this.engine.setArray2(this._uniforms[e],t)}setArray3(e,t){this._valueCache[e]=null,this.engine.setArray3(this._uniforms[e],t)}setArray4(e,t){this._valueCache[e]=null,this.engine.setArray4(this._uniforms[e],t)}setMatrices(e,t){t&&(this._valueCache[e]=null,this.engine.setMatrices(this._uniforms[e],t))}setMatrix(e,t){this._cacheMatrix(e,t)&&(this.engine.setMatrices(this._uniforms[e],t.asArray())||(this._valueCache[e]=null))}setMatrix3x3(e,t){this._valueCache[e]=null,this.engine.setMatrix3x3(this._uniforms[e],t)}setMatrix2x2(e,t){this._valueCache[e]=null,this.engine.setMatrix2x2(this._uniforms[e],t)}setFloat(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setFloat(this._uniforms[e],t)&&(this._valueCache[e]=t)}setVector2(e,t){this._cacheFloat2(e,t.x,t.y)&&(this.engine.setFloat2(this._uniforms[e],t.x,t.y)||(this._valueCache[e]=null))}setFloat2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setFloat2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setVector3(e,t){this._cacheFloat3(e,t.x,t.y,t.z)&&(this.engine.setFloat3(this._uniforms[e],t.x,t.y,t.z)||(this._valueCache[e]=null))}setFloat3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setFloat3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setVector4(e,t){this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this.engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setQuaternion(e,t){this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this.engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setFloat4(e,t,i,s,n){this._cacheFloat4(e,t,i,s,n)&&(this.engine.setFloat4(this._uniforms[e],t,i,s,n)||(this._valueCache[e]=null))}setColor3(e,t){this._cacheFloat3(e,t.r,t.g,t.b)&&(this.engine.setFloat3(this._uniforms[e],t.r,t.g,t.b)||(this._valueCache[e]=null))}setColor4(e,t,i){this._cacheFloat4(e,t.r,t.g,t.b,i)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,i)||(this._valueCache[e]=null))}setDirectColor4(e,t){this._cacheFloat4(e,t.r,t.g,t.b,t.a)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,t.a)||(this._valueCache[e]=null))}_getVertexShaderCode(){return this.vertexShader?this.engine._getShaderSource(this.vertexShader):null}_getFragmentShaderCode(){return this.fragmentShader?this.engine._getShaderSource(this.fragmentShader):null}}const Po={};function ye(a,e=!1){if(!(e&&Po[a]))return Po[a]=!0,"".concat(a," needs to be imported before as it contains a side-effect required by your code.")}function St(){return typeof window<"u"}function Qs(){return typeof navigator<"u"}function En(){return typeof document<"u"}function h0(a){let e="",t=a.firstChild;for(;t;)t.nodeType===3&&(e+=t.textContent),t=t.nextSibling;return e}const xr={};function Dl(a,e,t=""){return t+(e?e+"\n":"")+a}function Fl(a,e,t,i,s,n,r){const o=r||xr.loadFile;if(o)return o(a,e,t,i,s,n);throw ye("FileTools")}function Ol(a,e,t,i){if(a){e?a.IS_NDC_HALF_ZRANGE="":delete a.IS_NDC_HALF_ZRANGE,t?a.USE_REVERSE_DEPTHBUFFER="":delete a.USE_REVERSE_DEPTHBUFFER,i?a.USE_EXACT_SRGB_CONVERSIONS="":delete a.USE_EXACT_SRGB_CONVERSIONS;return}else{let s="";return e&&(s+="#define IS_NDC_HALF_ZRANGE"),t&&(s&&(s+="\n"),s+="#define USE_REVERSE_DEPTHBUFFER"),i&&(s&&(s+="\n"),s+="#define USE_EXACT_SRGB_CONVERSIONS"),s}}function Pa(a,e,t=!1,i){switch(a){case 3:{const n=e instanceof ArrayBuffer?new Int8Array(e):new Int8Array(e);return i&&n.set(new Int8Array(i)),n}case 0:{const n=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e);return i&&n.set(new Uint8Array(i)),n}case 4:{const n=e instanceof ArrayBuffer?new Int16Array(e):new Int16Array(t?e/2:e);return i&&n.set(new Int16Array(i)),n}case 5:case 8:case 9:case 10:case 2:{const n=e instanceof ArrayBuffer?new Uint16Array(e):new Uint16Array(t?e/2:e);return i&&n.set(new Uint16Array(i)),n}case 6:{const n=e instanceof ArrayBuffer?new Int32Array(e):new Int32Array(t?e/4:e);return i&&n.set(new Int32Array(i)),n}case 7:case 11:case 12:case 13:case 14:case 15:{const n=e instanceof ArrayBuffer?new Uint32Array(e):new Uint32Array(t?e/4:e);return i&&n.set(new Uint32Array(i)),n}case 1:{const n=e instanceof ArrayBuffer?new Float32Array(e):new Float32Array(t?e/4:e);return i&&n.set(new Float32Array(i)),n}}const s=e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e);return i&&s.set(new Uint8Array(i)),s}const wa=new WeakMap,nd={_webGLVersion:2,cachedPipelines:{}};function ii(a){let e=wa.get(a);if(!e){if(!a)return nd;e={_webGLVersion:a.TEXTURE_BINDING_3D?2:1,_context:a,parallelShaderCompile:a.getExtension("KHR_parallel_shader_compile")||void 0,cachedPipelines:{}},wa.set(a,e)}return e}function rd(a){wa.delete(a)}function Bl(a,e,t,i,s,n){var l;const r=ii(i);n||(n=(l=r._createShaderProgramInjection)!=null?l:l0);const o=Da(e,"vertex",i,r._contextWasLost),h=Da(t,"fragment",i,r._contextWasLost);return n(a,o,h,i,s,r.validateShaderPrograms)}function Ll(a,e,t,i,s,n=null,r){var u;const o=ii(s);r||(r=(u=o._createShaderProgramInjection)!=null?u:l0);const h=o._webGLVersion>1?"#version 300 es\n#define WEBGL2 \n":"",l=wo(e,"vertex",i,h,s,o._contextWasLost),c=wo(t,"fragment",i,h,s,o._contextWasLost);return r(a,l,c,s,n,o.validateShaderPrograms)}function ad(a,e){const t=new sd,i=ii(a);return i.parallelShaderCompile&&(t.isParallelCompiled=!0),t.context=i._context,t}function l0(a,e,t,i,s=null,n){const r=i.createProgram();if(a.program=r,!r)throw new Error("Unable to create program");return i.attachShader(r,e),i.attachShader(r,t),i.linkProgram(r),a.context=i,a.vertexShader=e,a.fragmentShader=t,a.isParallelCompiled||c0(a,i,n),r}function od(a,e,t){const i=a;if(i._isDisposed)return!1;const s=ii(e);return e.getProgramParameter(i.program,s.parallelShaderCompile.COMPLETION_STATUS_KHR)?(c0(i,e,t),!0):!1}function c0(a,e,t){const i=a.context,s=a.vertexShader,n=a.fragmentShader,r=a.program;if(!i.getProgramParameter(r,i.LINK_STATUS)){if(!e.getShaderParameter(s,e.COMPILE_STATUS)){const l=e.getShaderInfoLog(s);if(l)throw a.vertexCompilationError=l,new Error("VERTEX SHADER "+l)}if(!e.getShaderParameter(n,e.COMPILE_STATUS)){const l=e.getShaderInfoLog(n);if(l)throw a.fragmentCompilationError=l,new Error("FRAGMENT SHADER "+l)}const h=i.getProgramInfoLog(r);if(h)throw a.programLinkError=h,new Error(h)}if(t&&(i.validateProgram(r),!i.getProgramParameter(r,i.VALIDATE_STATUS))){const l=i.getProgramInfoLog(r);if(l)throw a.programValidationError=l,new Error(l)}i.deleteShader(s),i.deleteShader(n),a.vertexShader=void 0,a.fragmentShader=void 0,a.onCompiled&&(a.onCompiled(),a.onCompiled=void 0)}function hd(a,e,t,i,s,n,r,o,h,l="",c,u,f){var p,g;const d=ii(a.context);u||(u=(p=d.createRawShaderProgramInjection)!=null?p:Bl),f||(f=(g=d.createShaderProgramInjection)!=null?g:Ll);const _=a;i?_.program=u(_,e,t,_.context,h):_.program=f(_,e,t,o,_.context,h),_.program.__SPECTOR_rebuildProgram=r,c()}function wo(a,e,t,i,s,n){return Da(Dl(a,t,i),e,s,n)}function Da(a,e,t,i){const s=t.createShader(e==="vertex"?t.VERTEX_SHADER:t.FRAGMENT_SHADER);if(!s){let n=t.NO_ERROR,r=t.NO_ERROR;for(;(r=t.getError())!==t.NO_ERROR;)n=r;throw new Error("Something went wrong while creating a gl ".concat(e," shader object. gl error=").concat(n,", gl isContextLost=").concat(t.isContextLost(),", _contextWasLost=").concat(i))}return t.shaderSource(s,a),t.compileShader(s),s}function ld(a,e){e.useProgram(a)}function cd(a,e){const t=a;if(!t.isParallelCompiled){e(a);return}const i=t.onCompiled;t.onCompiled=()=>{i==null||i(),e(a)}}function Nl(a){return a.getPipelineContext===void 0}class U{static _CheckLimit(e,t){let i=U._LogLimitOutputs[e];return i?i.current++:(i={limit:t,current:1},U._LogLimitOutputs[e]=i),i.current<=i.limit}static _GenerateLimitMessage(e,t=1){var n;const i=U._LogLimitOutputs[e];if(!i||!U.MessageLimitReached)return;const s=this._Levels[t];i.current===i.limit&&U[s.name](U.MessageLimitReached.replace(/%LIMIT%/g,""+i.limit).replace(/%TYPE%/g,(n=s.name)!=null?n:""))}static _AddLogEntry(e){U._LogCache=e+U._LogCache,U.OnNewCacheEntry&&U.OnNewCacheEntry(e)}static _FormatMessage(e){const t=s=>s<10?"0"+s:""+s,i=new Date;return"["+t(i.getHours())+":"+t(i.getMinutes())+":"+t(i.getSeconds())+"]: "+e}static _LogDisabled(e,t){}static _LogEnabled(e=1,t,i){const s=Array.isArray(t)?t[0]:t;if(i!==void 0&&!U._CheckLimit(s,i))return;const n=U._FormatMessage(s),r=this._Levels[e],o=Array.isArray(t)?t.slice(1):[];r.logFunc&&r.logFunc("BJS - "+n,...o);const h="
").concat(n,"

");U._AddLogEntry(h),U._GenerateLimitMessage(s,e)}static get LogCache(){return U._LogCache}static ClearLogCache(){U._LogCache="",U._LogLimitOutputs={},U.errorsCount=0}static set LogLevels(e){U.Log=U._LogDisabled,U.Warn=U._LogDisabled,U.Error=U._LogDisabled,[U.MessageLogLevel,U.WarningLogLevel,U.ErrorLogLevel].forEach(t=>{if((e&t)===t){const i=this._Levels[t];U[i.name]=U._LogEnabled.bind(U,t)}})}}U.NoneLogLevel=0;U.MessageLogLevel=1;U.WarningLogLevel=2;U.ErrorLogLevel=4;U.AllLogLevel=7;U.MessageLimitReached="Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.";U._LogCache="";U._LogLimitOutputs={};U._Levels=[{},{color:"white",logFunc:console.log,name:"Log"},{color:"orange",logFunc:console.warn,name:"Warn"},{},{color:"red",logFunc:console.error,name:"Error"}];U.errorsCount=0;U.Log=U._LogEnabled.bind(U,U.MessageLogLevel);U.Warn=U._LogEnabled.bind(U,U.WarningLogLevel);U.Error=U._LogEnabled.bind(U,U.ErrorLogLevel);class ud{constructor(){this.shaderLanguage=0}postProcessor(e,t,i,s,n){if(n.drawBuffersExtensionDisabled){const r=/#extension.+GL_EXT_draw_buffers.+(enable|require)/g;e=e.replace(r,"")}return e}}const fd=/(flat\s)?\s*varying\s*.*/;class dd{constructor(){this.shaderLanguage=0}attributeProcessor(e){return e.replace("attribute","in")}varyingCheck(e,t){return fd.test(e)}varyingProcessor(e,t){return e.replace("varying",t?"in":"out")}postProcessor(e,t,i){const s=e.search(/#extension.+GL_EXT_draw_buffers.+require/)!==-1,n=/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g;if(e=e.replace(n,""),e=e.replace(/texture2D\s*\(/g,"texture("),i){const r=e.search(/layout *\(location *= *0\) *out/g)!==-1;e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCubeLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCube\s*\(/g,"texture("),e=e.replace(/gl_FragDepthEXT/g,"gl_FragDepth"),e=e.replace(/gl_FragColor/g,"glFragColor"),e=e.replace(/gl_FragData/g,"glFragData"),e=e.replace(/void\s+?main\s*\(/g,(s||r?"":"layout(location = 0) out vec4 glFragColor;\n")+"void main(")}else if(t.indexOf("#define MULTIVIEW")!==-1)return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e;return e}}class pn{get underlyingResource(){return null}constructor(){this.references=0,this.capacity=0,this.is32Bits=!1,this.uniqueId=pn._Counter++}}pn._Counter=0;class Pn extends pn{constructor(e){super(),this._buffer=e}get underlyingResource(){return this._buffer}}function wn(a){let e=1;do e*=2;while(ea-t?t:e}function kl(a){return a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a++,a}function u0(a){return a=a|a>>1,a=a|a>>2,a=a|a>>4,a=a|a>>8,a=a|a>>16,a-(a>>1)}function fi(a,e,t=2){let i;switch(t){case 1:i=u0(a);break;case 2:i=Ul(a);break;case 3:default:i=kl(a);break}return Math.min(i,e)}class Me{static GetShadersRepository(e=0){return e===0?Me.ShadersRepository:Me.ShadersRepositoryWGSL}static GetShadersStore(e=0){return e===0?Me.ShadersStore:Me.ShadersStoreWGSL}static GetIncludesShadersStore(e=0){return e===0?Me.IncludesShadersStore:Me.IncludesShadersStoreWGSL}}Me.ShadersRepository="src/Shaders/";Me.ShadersStore={};Me.IncludesShadersStore={};Me.ShadersRepositoryWGSL="src/ShadersWGSL/";Me.ShadersStoreWGSL={};Me.IncludesShadersStoreWGSL={};const _d="attribute",pd="varying";class Hn{constructor(){this.children=[]}isValid(e){return!0}process(e,t){var s,n,r,o,h,l,c;let i="";if(this.line){let u=this.line;const f=t.processor;if(f){f.lineProcessor&&(u=f.lineProcessor(u,t.isFragment,t.processingContext));const d=(n=(s=t.processor)==null?void 0:s.attributeKeywordName)!=null?n:_d,_=t.isFragment&&((r=t.processor)!=null&&r.varyingFragmentKeywordName)?(o=t.processor)==null?void 0:o.varyingFragmentKeywordName:!t.isFragment&&((h=t.processor)!=null&&h.varyingVertexKeywordName)?(l=t.processor)==null?void 0:l.varyingVertexKeywordName:pd;!t.isFragment&&f.attributeProcessor&&this.line.startsWith(d)?u=f.attributeProcessor(this.line,e,t.processingContext):f.varyingProcessor&&((c=f.varyingCheck)!=null&&c.call(f,this.line,t.isFragment)||!f.varyingCheck&&this.line.startsWith(_))?u=f.varyingProcessor(this.line,t.isFragment,e,t.processingContext):f.uniformProcessor&&f.uniformRegexp&&f.uniformRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(u=f.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):f.uniformBufferProcessor&&f.uniformBufferRegexp&&f.uniformBufferRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(u=f.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0):f.textureProcessor&&f.textureRegexp&&f.textureRegexp.test(this.line)?u=f.textureProcessor(this.line,t.isFragment,e,t.processingContext):(f.uniformProcessor||f.uniformBufferProcessor)&&this.line.startsWith("uniform")&&!t.lookForClosingBracketForUniformBuffer&&(/uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/.test(this.line)?f.uniformProcessor&&(u=f.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):f.uniformBufferProcessor&&(u=f.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0)),t.lookForClosingBracketForUniformBuffer&&this.line.indexOf("}")!==-1&&(t.lookForClosingBracketForUniformBuffer=!1,f.endOfUniformBufferProcessor&&(u=f.endOfUniformBufferProcessor(this.line,t.isFragment,t.processingContext)))}i+=u+"\n"}return this.children.forEach(u=>{i+=u.process(e,t)}),this.additionalDefineKey&&(e[this.additionalDefineKey]=this.additionalDefineValue||"true"),i}}class gd{constructor(){this._lines=[]}get currentLine(){return this._lines[this.lineIndex]}get canRead(){return this.lineIndex1&&this._lines.push(i);else{const n=t.split(";");for(let r=0;r{c=c.trim(),c!==""&&(i.push(c),c="")},r=u=>{sct._Stack[s],h=()=>s===-1?"!!INVALID EXPRESSION!!":ct._Stack[s--];let l=0,c="";for(;l1){for(n();s!==-1&&ct._OperatorPriority[o()]>=ct._OperatorPriority[f];)i.push(h());r(f),l++}else c+=u;l++}for(n();s!==-1;)o()==="("?h():i.push(h());return ct._InfixToPostfixCache.size>=ct.InfixToPostfixCacheLimitSize&&ct.ClearCache(),ct._InfixToPostfixCache.set(e,{result:i,accessTime:Date.now()}),i}static ClearCache(){const e=Array.from(ct._InfixToPostfixCache.entries()).sort((t,i)=>t[1].accessTime-i[1].accessTime);for(let t=0;t":i=s>n;break;case"<":i=s=":i=s>=n;break;case"==":i=s===n;break;case"!=":i=s!==n;break}return i}}const yd=/defined\s*?\((.+?)\)/g,pa=/defined\s*?\[(.+?)\]/g,Td=/#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g,Ad=/__decl__/,Do=/light\{X\}.(\w*)/g,Fo=/\{X\}/g,nr=[],Rd=/(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;function f0(a){a.processor&&a.processor.initializeShaders&&a.processor.initializeShaders(a.processingContext)}function Tr(a,e,t,i){var s;(s=e.processor)!=null&&s.preProcessShaderCode&&(a=e.processor.preProcessShaderCode(a,e.isFragment)),Dn(a,e,n=>{e.processCodeAfterIncludes&&(n=e.processCodeAfterIncludes(e.isFragment?"fragment":"vertex",n,e.defines));const r=Sd(n,e,i);t(r,n)})}function Id(a,e,t,i){var s;(s=e.processor)!=null&&s.preProcessShaderCode&&(a=e.processor.preProcessShaderCode(a,e.isFragment)),Dn(a,e,n=>{e.processCodeAfterIncludes&&(n=e.processCodeAfterIncludes(e.isFragment?"fragment":"vertex",n,e.defines));const r=Md(n,e,i);t(r,n)})}function d0(a,e,t){return!t.processor||!t.processor.finalizeShaders?{vertexCode:a,fragmentCode:e}:t.processor.finalizeShaders(a,e,t.processingContext)}function Ed(a,e){var i;if((i=e.processor)!=null&&i.noPrecision)return a;const t=e.shouldUseHighPrecisionShader;return a.indexOf("precision highp float")===-1?t?a="precision highp float;\n"+a:a="precision mediump float;\n"+a:t||(a=a.replace("precision highp float","precision mediump float")),a}function ga(a){const t=/defined\((.+)\)/.exec(a);if(t&&t.length)return new yr(t[1].trim(),a[0]==="!");const i=["==","!=",">=","<=","<",">"];let s="",n=0;for(s of i)if(n=a.indexOf(s),n>-1)break;if(n===-1)return new yr(a);const r=a.substring(0,n).trim(),o=a.substring(n+s.length).trim();return new xd(r,s,o)}function Cd(a){a=a.replace(yd,"defined[$1]");const e=ct.infixToPostfix(a),t=[];for(const s of e)if(s!=="||"&&s!=="&&")t.push(s);else if(t.length>=2){let n=t[t.length-1],r=t[t.length-2];t.length-=2;const o=s=="&&"?new bd:new vd;typeof n=="string"&&(n=n.replace(pa,"defined($1)")),typeof r=="string"&&(r=r.replace(pa,"defined($1)")),o.leftOperand=typeof r=="string"?ga(r):r,o.rightOperand=typeof n=="string"?ga(n):n,t.push(o)}let i=t[t.length-1];return typeof i=="string"&&(i=i.replace(pa,"defined($1)")),typeof i=="string"?ga(i):i}function dr(a,e){const t=new md,i=a.substring(0,e);let s=a.substring(e);return s=s.substring(0,(s.indexOf("//")+1||s.length+1)-1).trim(),i==="#ifdef"?t.testExpression=new yr(s):i==="#ifndef"?t.testExpression=new yr(s,!0):t.testExpression=Cd(s),t}function ma(a,e,t){let i=a.currentLine;for(;Oa(a,t);){i=a.currentLine;const s=i.substring(0,5).toLowerCase();if(s==="#else"){const n=new Hn;e.children.push(n),Oa(a,n);return}else if(s==="#elif"){const n=dr(i,5);e.children.push(n),t=n}}}function Oa(a,e){for(;a.canRead;){a.lineIndex++;const t=a.currentLine;if(t.indexOf("#")>=0){const s=Rd.exec(t);if(s&&s.length){switch(s[0]){case"#ifdef":{const r=new _a;e.children.push(r);const o=dr(t,6);r.children.push(o),ma(a,r,o);break}case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":{const r=new _a;e.children.push(r);const o=dr(t,7);r.children.push(o),ma(a,r,o);break}case"#if":{const r=new _a,o=dr(t,3);e.children.push(r),r.children.push(o),ma(a,r,o);break}}continue}}const i=new Hn;if(i.line=t,e.children.push(i),t[0]==="#"&&t[1]==="d"){const s=t.replace(";","").split(" ");i.additionalDefineKey=s[1],s.length===3&&(i.additionalDefineValue=s[2])}}return!1}function Vl(a,e,t){const i=new Hn,s=new gd;return s.lineIndex=-1,s.lines=a.split("\n"),Oa(s,i),i.process(e,t)}function Gl(a,e){var s;const t=a.defines,i={};for(const n of t){const o=n.replace("#define","").replace(";","").trim().split(" ");i[o[0]]=o.length>1?o[1]:""}return((s=a.processor)==null?void 0:s.shaderLanguage)===0&&(i.GL_ES="true"),i.__VERSION__=a.version,i[a.platformName]="true",Ol(i,e==null?void 0:e.isNDCHalfZRange,e==null?void 0:e.useReverseDepthBuffer,e==null?void 0:e.useExactSrgbConversions),i}function Sd(a,e,t){let i=Ed(a,e);if(!e.processor||e.processor.shaderLanguage===0&&i.indexOf("#version 3")!==-1&&(i=i.replace("#version 300 es",""),!e.processor.parseGLES3))return i;const s=e.defines,n=Gl(e,t);return e.processor.preProcessor&&(i=e.processor.preProcessor(i,s,n,e.isFragment,e.processingContext)),i=Vl(i,n,e),e.processor.postProcessor&&(i=e.processor.postProcessor(i,s,e.isFragment,e.processingContext,t?{drawBuffersExtensionDisabled:!t.getCaps().drawBuffersExtension}:{})),t!=null&&t._features.needShaderCodeInlining&&(i=t.inlineShaderCode(i)),i}function Md(a,e,t){var r,o;let i=a;const s=e.defines,n=Gl(e,t);return(r=e.processor)!=null&&r.preProcessor&&(i=e.processor.preProcessor(i,s,n,e.isFragment,e.processingContext)),i=Vl(i,n,e),(o=e.processor)!=null&&o.postProcessor&&(i=e.processor.postProcessor(i,s,e.isFragment,e.processingContext,t?{drawBuffersExtensionDisabled:!t.getCaps().drawBuffersExtension}:{})),t._features.needShaderCodeInlining&&(i=t.inlineShaderCode(i)),i}function Dn(a,e,t){nr.length=0;let i;for(;(i=Td.exec(a))!==null;)nr.push(i);let s=String(a),n=[a],r=!1;for(const o of nr){let h=o[1];if(h.indexOf("__decl__")!==-1&&(h=h.replace(Ad,""),e.supportsUniformBuffers&&(h=h.replace("Vertex","Ubo").replace("Fragment","Ubo")),h=h+"Declaration"),e.includesShadersStore[h]){let l=e.includesShadersStore[h];if(o[2]){const u=o[3].split(",");for(let f=0;fb+"{X}")),l+=p.replace(Fo,g.toString())+"\n"}else e.supportsUniformBuffers||(l=l.replace(Do,(f,d)=>d+"{X}")),l=l.replace(Fo,u)}const c=[];for(const u of n){const f=u.split(o[0]);for(let d=0;d=0||l.indexOf("#include <")>=0}else{const l=e.shadersRepository+"ShadersInclude/"+h+".fx";zl.loadFile(l,c=>{e.includesShadersStore[h]=c,Dn(n.join(""),e,t)});return}}nr.length=0,s=n.join(""),r?Dn(s.toString(),e,t):t(s)}const zl={loadFile:(a,e,t,i,s,n)=>{throw ye("FileTools")}};function Pd(a,e){return ii(e).cachedPipelines[a]}function _0(a){const e=a._name,t=a.context;if(e&&t){const i=ii(t),s=i.cachedPipelines[e];s==null||s.dispose(),delete i.cachedPipelines[e]}}function wd(a,e,t,i,s,n,r){let o,h;const l=St()?n==null?void 0:n.getHostDocument():null;typeof e=="string"?o=e:e.vertexSource?o="source:"+e.vertexSource:e.vertexElement?o=(l==null?void 0:l.getElementById(e.vertexElement))||e.vertexElement:o=e.vertex||e,typeof e=="string"?h=e:e.fragmentSource?h="source:"+e.fragmentSource:e.fragmentElement?h=(l==null?void 0:l.getElementById(e.fragmentElement))||e.fragmentElement:h=e.fragment||e;const c=[void 0,void 0],u=()=>{if(c[0]&&c[1]){a.isFragment=!0;const[f,d]=c;Tr(d,a,(_,p)=>{r&&(r._fragmentSourceCodeBeforeMigration=p),t&&(_=t("fragment",_));const g=d0(f,_,a);a=null;const m=Dd(g.vertexCode,g.fragmentCode,e,s);i==null||i(m.vertexSourceCode,m.fragmentSourceCode)},n)}};Oo(o,"Vertex","",f=>{f0(a),Tr(f,a,(d,_)=>{r&&(r._rawVertexSourceCode=f,r._vertexSourceCodeBeforeMigration=_),t&&(d=t("vertex",d)),c[0]=d,u()},n)},s),Oo(h,"Fragment","Pixel",f=>{r&&(r._rawFragmentSourceCode=f),c[1]=f,u()},s)}function Oo(a,e,t,i,s,n){if(typeof HTMLElement<"u"&&a instanceof HTMLElement){const h=h0(a);i(h);return}if(a.substring(0,7)==="source:"){i(a.substring(7));return}if(a.substring(0,7)==="base64:"){const h=window.atob(a.substring(7));i(h);return}const r=Me.GetShadersStore(s);if(r[a+e+"Shader"]){i(r[a+e+"Shader"]);return}if(t&&r[a+t+"Shader"]){i(r[a+t+"Shader"]);return}let o;if(a[0]==="."||a[0]==="/"||a.indexOf("http")>-1?o=a:o=Me.GetShadersRepository(s)+a,n=n||Fl,!n)throw new Error("loadFileInjection is not defined");n(o+"."+e.toLowerCase()+".fx",i)}function Dd(a,e,t,i){if(t){const s=t.vertexElement||t.vertex||t.spectorName||t,n=t.fragmentElement||t.fragment||t.spectorName||t;return{vertexSourceCode:(i===1?"//":"")+"#define SHADER_NAME vertex:"+s+"\n"+a,fragmentSourceCode:(i===1?"//":"")+"#define SHADER_NAME fragment:"+n+"\n"+e}}else return{vertexSourceCode:a,fragmentSourceCode:e}}const Fd=(a,e,t,i)=>{try{const s=a.existingPipelineContext||e(a.shaderProcessingContext);if(s._name=a.name,a.name&&a.context){const n=ii(a.context);n.cachedPipelines[a.name]=s}return t(s,a.vertex,a.fragment,!!a.createAsRaw,"","",a.rebuildRebind,a.defines,a.transformFeedbackVaryings,"",()=>{i(s,()=>{var n;(n=a.onRenderingStateCompiled)==null||n.call(a,s)})}),s}catch(s){throw U.Error("Error compiling effect"),s}},Od=(a,e,t,i=16,s=1e3)=>{const n=setInterval(()=>{try{a()&&(clearInterval(n),e())}catch(r){clearInterval(n),t==null||t(r)}s-=i,s<0&&(clearInterval(n),t==null||t())},i)};class Et{static get ShadersRepository(){return Me.ShadersRepository}static set ShadersRepository(e){Me.ShadersRepository=e}get isDisposed(){return this._isDisposed}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new Z),this._onBindObservable}get shaderLanguage(){return this._shaderLanguage}constructor(e,t,i,s=null,n,r=null,o=null,h=null,l=null,c,u="",f=0,d){var g,m,b,I;this.defines="",this.onCompiled=null,this.onError=null,this.onBind=null,this.uniqueId=0,this.onCompileObservable=new Z,this.onErrorObservable=new Z,this._onBindObservable=null,this._isDisposed=!1,this._refCount=1,this._bonesComputationForcedToCPU=!1,this._uniformBuffersNames={},this._multiTarget=!1,this._samplers={},this._isReady=!1,this._compilationError="",this._allFallbacksProcessed=!1,this._uniforms={},this._key="",this._fallbacks=null,this._vertexSourceCodeOverride="",this._fragmentSourceCodeOverride="",this._transformFeedbackVaryings=null,this._pipelineContext=null,this._vertexSourceCode="",this._fragmentSourceCode="",this._vertexSourceCodeBeforeMigration="",this._fragmentSourceCodeBeforeMigration="",this._rawVertexSourceCode="",this._rawFragmentSourceCode="",this._processCodeAfterIncludes=void 0,this._processFinalCode=null,this.name=e,this._key=u;const _=this._key.replace(/\r/g,"").replace(/\n/g,"|");let p;if(t.attributes){const T=t;if(this._engine=i,this._attributesNames=T.attributes,this._uniformsNames=T.uniformsNames.concat(T.samplers),this._samplerList=T.samplers.slice(),this.defines=T.defines,this.onError=T.onError,this.onCompiled=T.onCompiled,this._fallbacks=T.fallbacks,this._indexParameters=T.indexParameters,this._transformFeedbackVaryings=T.transformFeedbackVaryings||null,this._multiTarget=!!T.multiTarget,this._shaderLanguage=(g=T.shaderLanguage)!=null?g:0,T.uniformBuffersNames){this._uniformBuffersNamesList=T.uniformBuffersNames.slice();for(let x=0;x{this._vertexSourceCode=r,this._fragmentSourceCode=o,this._prepareEffect(t)},this._shaderLanguage,this._engine,this)}get key(){return this._key}isReady(){try{return this._isReadyInternal()}catch{return!1}}_isReadyInternal(){return this._engine.isDisposed||this._isReady?!0:this._pipelineContext?this._pipelineContext.isReady:!1}getEngine(){return this._engine}getPipelineContext(){return this._pipelineContext}getAttributesNames(){return this._attributesNames}getAttributeLocation(e){return this._attributes[e]}getAttributeLocationByName(e){return this._attributeLocationByName[e]}getAttributesCount(){return this._attributes.length}getUniformIndex(e){return this._uniformsNames.indexOf(e)}getUniform(e){return this._uniforms[e]}getSamplers(){return this._samplerList}getUniformNames(){return this._uniformsNames}getUniformBuffersNames(){return this._uniformBuffersNamesList}getIndexParameters(){return this._indexParameters}getCompilationError(){return this._compilationError}allFallbacksProcessed(){return this._allFallbacksProcessed}executeWhenCompiled(e){if(this.isReady()){e(this);return}this.onCompileObservable.add(t=>{e(t)}),(!this._pipelineContext||this._pipelineContext.isAsync)&&this._checkIsReady(null)}_checkIsReady(e){Od(()=>this._isReadyInternal()||this._isDisposed,()=>{},t=>{this._processCompilationErrors(t,e)})}get vertexSourceCode(){var e,t;return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._vertexSourceCodeOverride:(t=(e=this._pipelineContext)==null?void 0:e._getVertexShaderCode())!=null?t:this._vertexSourceCode}get fragmentSourceCode(){var e,t;return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._fragmentSourceCodeOverride:(t=(e=this._pipelineContext)==null?void 0:e._getFragmentShaderCode())!=null?t:this._fragmentSourceCode}get vertexSourceCodeBeforeMigration(){return this._vertexSourceCodeBeforeMigration}get fragmentSourceCodeBeforeMigration(){return this._fragmentSourceCodeBeforeMigration}get rawVertexSourceCode(){return this._rawVertexSourceCode}get rawFragmentSourceCode(){return this._rawFragmentSourceCode}getPipelineGenerationOptions(){return{platformName:this._engine.shaderPlatformName,shaderLanguage:this._shaderLanguage,shaderNameOrContent:this.name,key:this._key,defines:this.defines.split("\n"),addGlobalDefines:!1,extendedProcessingOptions:{indexParameters:this._indexParameters,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,supportsUniformBuffers:this._engine.supportsUniformBuffers},extendedCreatePipelineOptions:{transformFeedbackVaryings:this._transformFeedbackVaryings,createAsRaw:!!(this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride)}}}_rebuildProgram(e,t,i,s){this._isReady=!1,this._vertexSourceCodeOverride=e,this._fragmentSourceCodeOverride=t,this.onError=(n,r)=>{s&&s(r)},this.onCompiled=()=>{var r,o;const n=this.getEngine().scenes;if(n)for(let h=0;hthis._rebuildProgram(h,l,c,u),defines:s,transformFeedbackVaryings:this._transformFeedbackVaryings,name:this._key.replace(/\r/g,"").replace(/\n/g,"|"),createAsRaw:i,parallelShaderCompile:o._caps.parallelShaderCompile,shaderProcessingContext:this._processingContext,onRenderingStateCompiled:h=>{t&&!e&&this._engine._deletePipelineContext(t),h&&this._onRenderingStateCompiled(h)}},this._engine.createPipelineContext.bind(this._engine),this._engine._preparePipelineContext.bind(this._engine),this._engine._executeWhenRenderingStateIsCompiled.bind(this._engine)),this._pipelineContext.isAsync&&this._checkIsReady(t)}catch(i){this._processCompilationErrors(i,t)}}_getShaderCodeAndErrorLine(e,t,i){const s=i?/FRAGMENT SHADER ERROR: 0:(\d+?):/:/VERTEX SHADER ERROR: 0:(\d+?):/;let n=null;if(t&&e){const r=t.match(s);if(r&&r.length===2){const o=parseInt(r[1]),h=e.split("\n",-1);h.length>=o&&(n="Offending line [".concat(o,"] in ").concat(i?"fragment":"vertex"," code: ").concat(h[o-1]))}}return[e,n]}_processCompilationErrors(e,t=null){var r,o,h;this._compilationError=e.message;const i=this._attributesNames,s=this._fallbacks;if(U.Error("Unable to compile effect:"),U.Error("Uniforms: "+this._uniformsNames.map(function(l){return" "+l})),U.Error("Attributes: "+i.map(function(l){return" "+l})),U.Error("Defines:\n"+this.defines),Et.LogShaderCodeOnCompilationError){let l=null,c=null,u=null;(r=this._pipelineContext)!=null&&r._getVertexShaderCode()&&([u,l]=this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(),this._compilationError,!1),u&&(U.Error("Vertex code:"),U.Error(u))),(o=this._pipelineContext)!=null&&o._getFragmentShaderCode()&&([u,c]=this._getShaderCodeAndErrorLine((h=this._pipelineContext)==null?void 0:h._getFragmentShaderCode(),this._compilationError,!0),u&&(U.Error("Fragment code:"),U.Error(u))),l&&U.Error(l),c&&U.Error(c)}U.Error("Error: "+this._compilationError);const n=()=>{this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this)};t&&(this._pipelineContext=t,this._isReady=!0,n()),s?(this._pipelineContext=null,s.hasMoreFallbacks?(this._allFallbacksProcessed=!1,U.Error("Trying next fallback."),this.defines=s.reduce(this.defines,this),this._prepareEffect()):(this._allFallbacksProcessed=!0,n(),this.onErrorObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh())):(this._allFallbacksProcessed=!0,t||n())}get isSupported(){return this._compilationError===""}_bindTexture(e,t){this._engine._bindTexture(this._samplers[e],t,e)}setTexture(e,t){this._engine.setTexture(this._samplers[e],this._uniforms[e],t,e)}setTextureArray(e,t){const i=e+"Ex";if(this._samplerList.indexOf(i+"0")===-1){const s=this._samplerList.indexOf(e);for(let r=1;r0||this._isDisposed)&&(this._pipelineContext&&_0(this._pipelineContext),this._engine._releaseEffect(this),this.clearCodeCache(),this._isDisposed=!0)}static RegisterShader(e,t,i,s=0){t&&(Me.GetShadersStore(s)["".concat(e,"PixelShader")]=t),i&&(Me.GetShadersStore(s)["".concat(e,"VertexShader")]=i)}static ResetCache(){Et._BaseCache={}}}Et.LogShaderCodeOnCompilationError=!0;Et.AutomaticallyClearCodeCache=!1;Et._UniqueIdSeed=0;Et._BaseCache={};Et.ShadersStore=Me.ShadersStore;Et.IncludesShadersStore=Me.IncludesShadersStore;class Dt{static SetMatrixPrecision(e){if(Dt.MatrixTrackPrecisionChange=!1,e&&!Dt.MatrixUse64Bits&&Dt.MatrixTrackedMatrices)for(let t=0;tOe(()=>import("./ddsTextureLoader-7rBWB6fI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(i=>new i._DDSTextureLoader)),a.endsWith(".basis")&&_s(".basis",()=>Oe(()=>import("./basisTextureLoader-C2AKop91.js"),__vite__mapDeps([11,3,4,5,6,7,8,9,10])).then(i=>new i._BasisTextureLoader)),a.endsWith(".env")&&_s(".env",()=>Oe(()=>import("./envTextureLoader-0a1UyQXk.js"),__vite__mapDeps([12,7,3,4,5,6,8,9,2,10])).then(i=>new i._ENVTextureLoader)),a.endsWith(".hdr")&&_s(".hdr",()=>Oe(()=>import("./hdrTextureLoader-CbSWrxkf.js"),__vite__mapDeps([13,3,4,5,6,7,8,9,10])).then(i=>new i._HDRTextureLoader)),(a.endsWith(".ktx")||a.endsWith(".ktx2"))&&(_s(".ktx",()=>Oe(()=>import("./ktxTextureLoader-DFWsW27H.js"),__vite__mapDeps([14,3,4,5,6,7,8,9,10])).then(i=>new i._KTXTextureLoader)),_s(".ktx2",()=>Oe(()=>import("./ktxTextureLoader-DFWsW27H.js"),__vite__mapDeps([14,3,4,5,6,7,8,9,10])).then(i=>new i._KTXTextureLoader))),a.endsWith(".tga")&&_s(".tga",()=>Oe(()=>import("./tgaTextureLoader-CGo25llH.js"),__vite__mapDeps([15,3,4,5,6,7,8,9,10])).then(i=>new i._TGATextureLoader)),a.endsWith(".exr")&&_s(".exr",()=>Oe(()=>import("./exrTextureLoader-CpwykM8r.js"),__vite__mapDeps([16,3,4,5,6,7,8,9,10])).then(i=>new i._ExrTextureLoader)));const t=Ar.get(a);return t?Promise.resolve(t(e)):null}function Kl(a,e){if(St()){const{requestAnimationFrame:t}=e||window;if(typeof t=="function")return t(a)}else if(typeof requestAnimationFrame=="function")return requestAnimationFrame(a);return setTimeout(a,16)}class ae{get frameId(){return this._frameId}get isWebGPU(){return this._isWebGPU}_getShaderProcessor(e){return this._shaderProcessor}get shaderPlatformName(){return this._shaderPlatformName}_clearEmptyResources(){this._emptyTexture=null,this._emptyCubeTexture=null,this._emptyTexture3D=null,this._emptyTexture2DArray=null}get useReverseDepthBuffer(){return this._useReverseDepthBuffer}set useReverseDepthBuffer(e){e!==this._useReverseDepthBuffer&&(this._useReverseDepthBuffer=e,e?this._depthCullingState.depthFunc=518:this._depthCullingState.depthFunc=515)}setColorWrite(e){e!==this._colorWrite&&(this._colorWriteChanged=!0,this._colorWrite=e)}getColorWrite(){return this._colorWrite}get depthCullingState(){return this._depthCullingState}get alphaState(){return this._alphaState}get stencilState(){return this._stencilState}get stencilStateComposer(){return this._stencilStateComposer}_getGlobalDefines(e){if(e){this.isNDCHalfZRange?e.IS_NDC_HALF_ZRANGE="":delete e.IS_NDC_HALF_ZRANGE,this.useReverseDepthBuffer?e.USE_REVERSE_DEPTHBUFFER="":delete e.USE_REVERSE_DEPTHBUFFER,this.useExactSrgbConversions?e.USE_EXACT_SRGB_CONVERSIONS="":delete e.USE_EXACT_SRGB_CONVERSIONS;return}else{let t="";return this.isNDCHalfZRange&&(t+="#define IS_NDC_HALF_ZRANGE"),this.useReverseDepthBuffer&&(t&&(t+="\n"),t+="#define USE_REVERSE_DEPTHBUFFER"),this.useExactSrgbConversions&&(t&&(t+="\n"),t+="#define USE_EXACT_SRGB_CONVERSIONS"),t}}_rebuildInternalTextures(){const e=this._internalTexturesCache.slice();for(const t of e)t._rebuild()}_rebuildRenderTargetWrappers(){const e=this._renderTargetWrapperCache.slice();for(const t of e)t._rebuild()}_rebuildEffects(){for(const e in this._compiledEffects){const t=this._compiledEffects[e];t._pipelineContext=null,t._prepareEffect()}Et.ResetCache()}_rebuildGraphicsResources(){var e;this.wipeCaches(!0),this._rebuildEffects(),(e=this._rebuildComputeEffects)==null||e.call(this),this._rebuildBuffers(),this._rebuildInternalTextures(),this._rebuildTextures(),this._rebuildRenderTargetWrappers(),this.wipeCaches(!0)}_flagContextRestored(){U.Warn(this.name+" context successfully restored."),this.onContextRestoredObservable.notifyObservers(this),this._contextWasLost=!1}_restoreEngineAfterContextLost(e){setTimeout(async()=>{this._clearEmptyResources();const t=this._depthCullingState.depthTest,i=this._depthCullingState.depthFunc,s=this._depthCullingState.depthMask,n=this._stencilState.stencilTest;await e(),this._rebuildGraphicsResources(),this._depthCullingState.depthTest=t,this._depthCullingState.depthFunc=i,this._depthCullingState.depthMask=s,this._stencilState.stencilTest=n,this._flagContextRestored()},0)}get isDisposed(){return this._isDisposed}get snapshotRendering(){return!1}set snapshotRendering(e){}get snapshotRenderingMode(){return 0}set snapshotRenderingMode(e){}getClassName(){return"AbstractEngine"}get emptyTexture(){return this._emptyTexture||(this._emptyTexture=this.createRawTexture(new Uint8Array(4),1,1,5,!1,!1,1)),this._emptyTexture}get emptyTexture3D(){return this._emptyTexture3D||(this._emptyTexture3D=this.createRawTexture3D(new Uint8Array(4),1,1,1,5,!1,!1,1)),this._emptyTexture3D}get emptyTexture2DArray(){return this._emptyTexture2DArray||(this._emptyTexture2DArray=this.createRawTexture2DArray(new Uint8Array(4),1,1,1,5,!1,!1,1)),this._emptyTexture2DArray}get emptyCubeTexture(){if(!this._emptyCubeTexture){const e=new Uint8Array(4),t=[e,e,e,e,e,e];this._emptyCubeTexture=this.createRawCubeTexture(t,1,5,0,!1,!1,1)}return this._emptyCubeTexture}get activeRenderLoops(){return this._activeRenderLoops}stopRenderLoop(e){if(!e){this._activeRenderLoops.length=0,this._cancelFrame();return}const t=this._activeRenderLoops.indexOf(e);t>=0&&(this._activeRenderLoops.splice(t,1),this._activeRenderLoops.length==0&&this._cancelFrame())}_cancelFrame(){if(this._frameHandler!==0){const e=this._frameHandler;if(this._frameHandler=0,St()){const{cancelAnimationFrame:t}=this.getHostWindow()||window;if(typeof t=="function")return t(e)}else if(typeof cancelAnimationFrame=="function")return cancelAnimationFrame(e);return clearTimeout(e)}}beginFrame(){this.onBeginFrameObservable.notifyObservers(this)}endFrame(){this._frameId++,this.onEndFrameObservable.notifyObservers(this)}_renderLoop(){if(this._frameHandler=0,!this._contextWasLost){let e=!0;(this._isDisposed||!this.renderEvenInBackground&&this._windowIsBackground)&&(e=!1),e&&(this.beginFrame(),this._renderViews()||this._renderFrame(),this.endFrame())}this._activeRenderLoops.length>0&&this._frameHandler===0&&(this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()))}_renderFrame(){for(let e=0;e-1?e.substring(y).toLowerCase():"");R.indexOf("?")>-1&&(R=R.split("?")[0]);const C=Nd(R,_);s&&s.addPendingData(T),T.url=e,T.generateMipMaps=!t,T.samplingMode=n,T.invertY=i,T._useSRGBBuffer=this._getUseSRGBBuffer(!!g,t),this._doNotHandleContextLost||(T._buffer=c);let S=null;r&&!u&&(S=T.onLoadedObservable.add(r)),u||this._internalTexturesCache.push(T);const w=(P,G)=>{s&&s.removePendingData(T),e===x?(S&&T.onLoadedObservable.remove(S),Ee.UseFallbackTexture&&e!==Ee.FallbackTexture&&this._createTextureBase(Ee.FallbackTexture,t,T.invertY,s,n,null,o,h,l,c,T),P=(P||"Unknown error")+(Ee.UseFallbackTexture?" - Fallback texture was used":""),T.onErrorObservable.notifyObservers({message:P,exception:G}),o&&o(P,G)):(U.Warn("Failed to load ".concat(e,", falling back to ").concat(x)),this._createTextureBase(x,t,T.invertY,s,n,r,o,h,l,c,T,f,d,_,p,g))};if(C){const P=async G=>{(await C).loadData(G,T,(W,K,ce,$,z,k)=>{k?w("TextureLoader failed to load data"):h(T,R,s,{width:W,height:K},T.invertY,!ce,$,()=>(z(),!1),n)},p)};c?c instanceof ArrayBuffer?P(new Uint8Array(c)):ArrayBuffer.isView(c)?P(c):o&&o("Unable to load: only ArrayBuffer or ArrayBufferView is supported",null):this._loadFile(e,G=>P(new Uint8Array(G)),void 0,s?s.offlineProvider:void 0,!0,(G,L)=>{w("Unable to load "+(G&&G.responseURL,L))})}else{const P=G=>{b&&!this._doNotHandleContextLost&&(T._buffer=G),h(T,R,s,G,T.invertY,t,!1,l,n)};!m||I?c&&(typeof c.decoding=="string"||c.close)?P(c):ae._FileToolsLoadImage(e||"",P,w,s?s.offlineProvider:null,_,T.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0):typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)||c instanceof Blob?ae._FileToolsLoadImage(c,P,w,s?s.offlineProvider:null,_,T.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0):c&&P(c)}return T}_rebuildBuffers(){for(const e of this._uniformBuffers)e._rebuildAfterContextLost()}get _shouldUseHighPrecisionShader(){return!!(this._caps.highPrecisionShaderSupported&&this._highPrecisionShadersAllowed)}getHostDocument(){return this._renderingCanvas&&this._renderingCanvas.ownerDocument?this._renderingCanvas.ownerDocument:En()?document:null}getLoadedTexturesCache(){return this._internalTexturesCache}clearInternalTexturesCache(){this._internalTexturesCache.length=0}getCaps(){return this._caps}resetTextureCache(){for(const e in this._boundTexturesCache)Object.prototype.hasOwnProperty.call(this._boundTexturesCache,e)&&(this._boundTexturesCache[e]=null);this._currentTextureChannel=-1}get name(){return this._name}set name(e){this._name=e}static get NpmPackage(){return"babylonjs@7.37.0"}static get Version(){return"7.37.0"}getRenderingCanvas(){return this._renderingCanvas}getAudioContext(){return this._audioContext}getAudioDestination(){return this._audioDestination}setHardwareScalingLevel(e){this._hardwareScalingLevel=e,this.resize()}getHardwareScalingLevel(){return this._hardwareScalingLevel}get doNotHandleContextLost(){return this._doNotHandleContextLost}set doNotHandleContextLost(e){this._doNotHandleContextLost=e}get isStencilEnable(){return this._isStencilEnable}getCreationOptions(){return this._creationOptions}constructor(e,t,i){var r,o,h,l,c,u,f,d,_,p,g;this._colorWrite=!0,this._colorWriteChanged=!0,this._depthCullingState=new Wl,this._stencilStateComposer=new Hl,this._stencilState=new ss,this._alphaState=new Bd,this._alphaMode=1,this._alphaEquation=0,this._activeRequests=[],this._badOS=!1,this._badDesktopOS=!1,this._compatibilityMode=!0,this._internalTexturesCache=new Array,this._currentRenderTarget=null,this._boundTexturesCache={},this._activeChannel=0,this._currentTextureChannel=-1,this._viewportCached={x:0,y:0,z:0,w:0},this._isWebGPU=!1,this.onCanvasBlurObservable=new Z,this.onCanvasFocusObservable=new Z,this.onNewSceneAddedObservable=new Z,this.onResizeObservable=new Z,this.onCanvasPointerOutObservable=new Z,this.disablePerformanceMonitorInBackground=!1,this.disableVertexArrayObjects=!1,this._frameId=0,this.hostInformation={isMobile:!1},this.isFullscreen=!1,this.enableOfflineSupport=!1,this.disableManifestCheck=!1,this.disableContextMenu=!0,this.currentRenderPassId=0,this.isPointerLock=!1,this.postProcesses=[],this.canvasTabIndex=1,this._contextWasLost=!1,this._useReverseDepthBuffer=!1,this.isNDCHalfZRange=!1,this.hasOriginBottomLeft=!0,this._renderTargetWrapperCache=new Array,this._compiledEffects={},this._isDisposed=!1,this.scenes=[],this._virtualScenes=new Array,this.onBeforeTextureInitObservable=new Z,this.renderEvenInBackground=!0,this.preventCacheWipeBetweenFrames=!1,this._frameHandler=0,this._activeRenderLoops=new Array,this._windowIsBackground=!1,this._boundRenderFunction=()=>this._renderLoop(),this.onBeforeShaderCompilationObservable=new Z,this.onAfterShaderCompilationObservable=new Z,this.onBeginFrameObservable=new Z,this.onEndFrameObservable=new Z,this._transformTextureUrl=null,this._uniformBuffers=new Array,this._storageBuffers=new Array,this._highPrecisionShadersAllowed=!0,this.onContextLostObservable=new Z,this.onContextRestoredObservable=new Z,this._name="",this.premultipliedAlpha=!0,this.adaptToDeviceRatio=!1,this._lastDevicePixelRatio=1,this._doNotHandleContextLost=!1,this.cullBackFaces=null,this._renderPassNames=["main"],this._fps=60,this._deltaTime=0,this._deterministicLockstep=!1,this._lockstepMaxSteps=4,this._timeStep=1/60,this.onDisposeObservable=new Z,Ee.Instances.push(this),this.startTime=bi.Now,this._stencilStateComposer.stencilGlobal=this._stencilState,Dt.SetMatrixPrecision(!!t.useHighPrecisionMatrix),Qs()&&navigator.userAgent&&(this._badOS=/iPad/i.test(navigator.userAgent)||/iPhone/i.test(navigator.userAgent),this._badDesktopOS=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),this.adaptToDeviceRatio=i!=null?i:!1,t.antialias=e!=null?e:t.antialias,t.deterministicLockstep=(r=t.deterministicLockstep)!=null?r:!1,t.lockstepMaxSteps=(o=t.lockstepMaxSteps)!=null?o:4,t.timeStep=(h=t.timeStep)!=null?h:1/60,t.audioEngine=(l=t.audioEngine)!=null?l:!0,t.stencil=(c=t.stencil)!=null?c:!0,this._audioContext=(f=(u=t.audioEngineOptions)==null?void 0:u.audioContext)!=null?f:null,this._audioDestination=(_=(d=t.audioEngineOptions)==null?void 0:d.audioDestination)!=null?_:null,this.premultipliedAlpha=(p=t.premultipliedAlpha)!=null?p:!0,this._doNotHandleContextLost=!!t.doNotHandleContextLost,this._isStencilEnable=!!t.stencil,this.useExactSrgbConversions=(g=t.useExactSrgbConversions)!=null?g:!1;const s=St()&&window.devicePixelRatio||1,n=t.limitDeviceRatio||s;i=i||t.adaptToDeviceRatio||!1,this._hardwareScalingLevel=i?1/Math.min(n,s):1,this._lastDevicePixelRatio=s,this._creationOptions=t}resize(e=!1){let t,i;if(this.adaptToDeviceRatio){const s=St()&&window.devicePixelRatio||1,n=this._lastDevicePixelRatio/s;this._lastDevicePixelRatio=s,this._hardwareScalingLevel*=n}if(St()&&En())if(this._renderingCanvas){const s=this._renderingCanvas.getBoundingClientRect?this._renderingCanvas.getBoundingClientRect():{width:this._renderingCanvas.width*this._hardwareScalingLevel,height:this._renderingCanvas.height*this._hardwareScalingLevel};t=this._renderingCanvas.clientWidth||s.width||this._renderingCanvas.width||100,i=this._renderingCanvas.clientHeight||s.height||this._renderingCanvas.height||100}else t=window.innerWidth,i=window.innerHeight;else t=this._renderingCanvas?this._renderingCanvas.width:100,i=this._renderingCanvas?this._renderingCanvas.height:100;this.setSize(t/this._hardwareScalingLevel,i/this._hardwareScalingLevel,e)}setSize(e,t,i=!1){if(!this._renderingCanvas||(e=e|0,t=t|0,!i&&this._renderingCanvas.width===e&&this._renderingCanvas.height===t))return!1;if(this._renderingCanvas.width=e,this._renderingCanvas.height=t,this.scenes){for(let s=0;s{const e=navigator.userAgent;this.hostInformation.isMobile=e.indexOf("Mobile")!==-1||e.indexOf("Mac")!==-1&&En()&&"ontouchend"in document},this._checkForMobile(),St()&&window.addEventListener("resize",this._checkForMobile))}createVideoElement(e){return document.createElement("video")}_reportDrawCall(e=1){var t;(t=this._drawCalls)==null||t.addCount(e,!1)}getFps(){return this._fps}getDeltaTime(){return this._deltaTime}isDeterministicLockStep(){return this._deterministicLockstep}getLockstepMaxSteps(){return this._lockstepMaxSteps}getTimeStep(){return this._timeStep*1e3}_createImageBitmapFromSource(e,t){throw new Error("createImageBitmapFromSource is not implemented")}createImageBitmap(e,t){return createImageBitmap(e,t)}resizeImageBitmap(e,t,i){throw new Error("resizeImageBitmap is not implemented")}getFontOffset(e){throw new Error("getFontOffset is not implemented")}static _CreateCanvas(e,t){if(typeof document>"u")return new OffscreenCanvas(e,t);const i=document.createElement("canvas");return i.width=e,i.height=t,i}createCanvas(e,t){return ae._CreateCanvas(e,t)}static _FileToolsLoadImage(e,t,i,s,n,r){throw ye("FileTools")}_loadFile(e,t,i,s,n,r){const o=Fl(e,t,i,s,n,r);return this._activeRequests.push(o),o.onCompleteObservable.add(()=>{const h=this._activeRequests.indexOf(o);h!==-1&&this._activeRequests.splice(h,1)}),o}static _FileToolsLoadFile(e,t,i,s,n,r){if(xr.loadFile)return xr.loadFile(e,t,i,s,n,r);throw ye("FileTools")}dispose(){var t;for(this.releaseEffects(),this._isDisposed=!0,this.stopRenderLoop(),this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this._renderingCanvas=null,this.onBeforeTextureInitObservable&&this.onBeforeTextureInitObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(;this.scenes.length;)this.scenes[0].dispose();for(;this._virtualScenes.length;)this._virtualScenes[0].dispose();(t=this.releaseComputeEffects)==null||t.call(this),Et.ResetCache();for(const i of this._activeRequests)i.abort();this._boundRenderFunction=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onNewSceneAddedObservable.clear(),St()&&window.removeEventListener("resize",this._checkForMobile);const e=Ee.Instances.indexOf(this);e>=0&&Ee.Instances.splice(e,1),Ee.Instances.length||(Ee.OnEnginesDisposedObservable.notifyObservers(this),Ee.OnEnginesDisposedObservable.clear()),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear()}static DefaultLoadingScreenFactory(e){throw ye("LoadingScreen")}static MarkAllMaterialsAsDirty(e,t){for(let i=0;i1&&!this.disableUniformBuffers}get needPOTTextures(){return this._webGLVersion<2||this.forcePOTTextures}get _supportsHardwareTextureRescaling(){return!1}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e}snapshotRenderingReset(){this.snapshotRendering=!1}constructor(e,t,i,s){if(i=i||{},super(t!=null?t:i.antialias,i,s),this._name="WebGL",this.forcePOTTextures=!1,this.validateShaderPrograms=!1,this.disableUniformBuffers=!1,this._webGLVersion=1,this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=new Array,this._currentFramebuffer=null,this._dummyFramebuffer=null,this._currentBufferPointers=new Array,this._currentInstanceLocations=new Array,this._currentInstanceBuffers=new Array,this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=new Array,this._maxSimultaneousTextures=0,this._maxMSAASamplesOverride=null,this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._boundUniforms={},!e)return;let n=null;if(e.getContext){if(n=e,this._renderingCanvas=n,i.preserveDrawingBuffer===void 0&&(i.preserveDrawingBuffer=!1),i.xrCompatible===void 0&&(i.xrCompatible=!1),navigator&&navigator.userAgent){this._setupMobileChecks();const h=navigator.userAgent;for(const l of we.ExceptionList){const c=l.key,u=l.targets;if(new RegExp(c).test(h)){if(l.capture&&l.captureConstraint){const d=l.capture,_=l.captureConstraint,g=new RegExp(d).exec(h);if(g&&g.length>0&&parseInt(g[g.length-1])>=_)continue}for(const d of u)switch(d){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0;break;case"antialias":i.antialias=!1;break;case"maxMSAASamples":this._maxMSAASamplesOverride=1;break}}}}if(this._doNotHandleContextLost||(this._onContextLost=h=>{h.preventDefault(),this._contextWasLost=!0,U.Warn("WebGL context lost."),this.onContextLostObservable.notifyObservers(this)},this._onContextRestored=()=>{this._restoreEngineAfterContextLost(()=>this._initGLContext())},n.addEventListener("webglcontextlost",this._onContextLost,!1),n.addEventListener("webglcontextrestored",this._onContextRestored,!1),i.powerPreference=i.powerPreference||"high-performance"),this._badDesktopOS&&(i.xrCompatible=!1),!i.disableWebGL2Support)try{this._gl=n.getContext("webgl2",i)||n.getContext("experimental-webgl2",i),this._gl&&(this._webGLVersion=2,this._shaderPlatformName="WEBGL2",this._gl.deleteQuery||(this._webGLVersion=1,this._shaderPlatformName="WEBGL1"))}catch{}if(!this._gl){if(!n)throw new Error("The provided canvas is null or undefined.");try{this._gl=n.getContext("webgl",i)||n.getContext("experimental-webgl",i)}catch{throw new Error("WebGL not supported")}}if(!this._gl)throw new Error("WebGL not supported")}else{this._gl=e,this._renderingCanvas=this._gl.canvas,this._gl.renderbufferStorageMultisample?(this._webGLVersion=2,this._shaderPlatformName="WEBGL2"):this._shaderPlatformName="WEBGL1";const h=this._gl.getContextAttributes();h&&(i.stencil=h.stencil)}this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),i.useHighPrecisionFloats!==void 0&&(this._highPrecisionShadersAllowed=i.useHighPrecisionFloats),this.resize(),this._initGLContext(),this._initFeatures();for(let h=0;h1?new dd:new ud;const r="Babylon.js v".concat(we.Version);U.Log(r+" - ".concat(this.description)),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",r);const o=ii(this._gl);o.validateShaderPrograms=this.validateShaderPrograms,o.parallelShaderCompile=this._caps.parallelShaderCompile}_clearEmptyResources(){this._dummyFramebuffer=null,super._clearEmptyResources()}_getShaderProcessingContext(e){return null}areAllEffectsReady(){for(const e in this._compiledEffects)if(!this._compiledEffects[e].isReady())return!1;return!0}_initGLContext(){var t;this._caps={maxTexturesImageUnits:this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),maxCombinedTexturesImageUnits:this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),maxSamples:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile")||void 0,standardDerivatives:this._webGLVersion>1||this._gl.getExtension("OES_standard_derivatives")!==null,maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),bptc:this._gl.getExtension("EXT_texture_compression_bptc")||this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),s3tc_srgb:this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||this._gl.getExtension("OES_element_index_uint")!==null,fragmentDepthSupported:this._webGLVersion>1||this._gl.getExtension("EXT_frag_depth")!==null,highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),supportOcclusionQuery:this._webGLVersion>1,canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float")),supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:!1,colorBufferHalfFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_half_float")),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),texelFetch:this._webGLVersion!==1,blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1,canUseGLInstanceID:this._webGLVersion>1,canUseGLVertexID:this._webGLVersion>1,supportComputeShaders:!1,supportSRGBBuffers:!1,supportTransformFeedbacks:this._webGLVersion>1,textureMaxLevel:this._webGLVersion>1,texture2DArrayMaxLayerCount:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS):128,disableMorphTargetTexture:!1,textureNorm16:!!this._gl.getExtension("EXT_texture_norm16")},this._caps.supportFloatTexturesResolve=this._caps.colorBufferFloat,this._caps.rg11b10ufColorRenderable=this._caps.colorBufferFloat,this._glVersion=this._gl.getParameter(this._gl.VERSION);const e=this._gl.getExtension("WEBGL_debug_renderer_info");if(e!=null&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor=this._gl.getParameter(this._gl.VENDOR)||"Unknown vendor"),this._glRenderer||(this._glRenderer=this._gl.getParameter(this._gl.RENDERER)||"Unknown renderer"),this._gl.HALF_FLOAT_OES!==36193&&(this._gl.HALF_FLOAT_OES=36193),this._gl.RGBA16F!==34842&&(this._gl.RGBA16F=34842),this._gl.RGBA32F!==34836&&(this._gl.RGBA32F=34836),this._gl.DEPTH24_STENCIL8!==35056&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(this._webGLVersion===1&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=((t=this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT))!=null?t:0)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!!(this._caps.textureFloat&&this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!!(this._caps.textureFloat&&this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._caps.textureNorm16&&(this._gl.R16_EXT=33322,this._gl.RG16_EXT=33324,this._gl.RGB16_EXT=32852,this._gl.RGBA16_EXT=32859,this._gl.R16_SNORM_EXT=36760,this._gl.RG16_SNORM_EXT=36761,this._gl.RGB16_SNORM_EXT=36762,this._gl.RGBA16_SNORM_EXT=36763),this._caps.astc&&(this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR),this._caps.bptc&&(this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT),this._caps.s3tc_srgb&&(this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),this._caps.etc2&&(this._gl.COMPRESSED_SRGB8_ETC2=this._caps.etc2.COMPRESSED_SRGB8_ETC2,this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC),this._webGLVersion>1&&this._gl.HALF_FLOAT_OES!==5131&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=this._maxMSAASamplesOverride!==null?this._maxMSAASamplesOverride:this._gl.getParameter(this._gl.MAX_SAMPLES),this._caps.maxDrawBuffers=this._gl.getParameter(this._gl.MAX_DRAW_BUFFERS);else{const i=this._gl.getExtension("WEBGL_draw_buffers");if(i!==null){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=i.drawBuffersWEBGL.bind(i),this._caps.maxDrawBuffers=this._gl.getParameter(i.MAX_DRAW_BUFFERS_WEBGL),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(let s=0;s<16;s++)this._gl["COLOR_ATTACHMENT"+s+"_WEBGL"]=i["COLOR_ATTACHMENT"+s+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{const i=this._gl.getExtension("WEBGL_depth_texture");i!=null&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=i.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{const i=this._gl.getExtension("OES_vertex_array_object");i!=null&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=i.createVertexArrayOES.bind(i),this._gl.bindVertexArray=i.bindVertexArrayOES.bind(i),this._gl.deleteVertexArray=i.deleteVertexArrayOES.bind(i))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{const i=this._gl.getExtension("ANGLE_instanced_arrays");i!=null?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=i.drawArraysInstancedANGLE.bind(i),this._gl.drawElementsInstanced=i.drawElementsInstancedANGLE.bind(i),this._gl.vertexAttribDivisor=i.vertexAttribDivisorANGLE.bind(i)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){const i=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),s=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);i&&s&&(this._caps.highPrecisionShaderSupported=i.precision!==0&&s.precision!==0)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{const i=this._gl.getExtension("EXT_blend_minmax");i!=null&&(this._caps.blendMinMax=!0,this._gl.MAX=i.MAX_EXT,this._gl.MIN=i.MIN_EXT)}if(!this._caps.supportSRGBBuffers){if(this._webGLVersion>1)this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:WebGL2RenderingContext.SRGB,SRGB8:WebGL2RenderingContext.SRGB8,SRGB8_ALPHA8:WebGL2RenderingContext.SRGB8_ALPHA8};else{const i=this._gl.getExtension("EXT_sRGB");i!=null&&(this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:i.SRGB_EXT,SRGB8:i.SRGB_ALPHA_EXT,SRGB8_ALPHA8:i.SRGB_ALPHA_EXT})}if(this._creationOptions){const i=this._creationOptions.forceSRGBBufferSupportState;i!==void 0&&(this._caps.supportSRGBBuffers=this._caps.supportSRGBBuffers&&i)}}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(let i=0;i"u",supportRenderAndCopyToLodForFloatTextures:this._webGLVersion!==1,supportDepthStencilTexture:this._webGLVersion!==1,supportShadowSamplers:this._webGLVersion!==1,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:this._webGLVersion!==1,trackUbosInFrame:!1,checkUbosContentBeforeUpload:!1,supportCSM:this._webGLVersion!==1,basisNeedsPOT:this._webGLVersion===1,support3DTextures:this._webGLVersion!==1,needTypeSuffixInShaderConstants:this._webGLVersion!==1,supportMSAA:this._webGLVersion!==1,supportSSAO2:this._webGLVersion!==1,supportIBLShadows:this._webGLVersion!==1,supportExtendedTextureFormats:this._webGLVersion!==1,supportSwitchCaseInShader:this._webGLVersion!==1,supportSyncTextureRead:!0,needsInvertingBitmap:!0,useUBOBindingCache:!0,needShaderCodeInlining:!1,needToAlwaysBindUniformBuffers:!1,supportRenderPasses:!1,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!1,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!1,_collectUbosUpdatedInFrame:!1}}get webGLVersion(){return this._webGLVersion}getClassName(){return"ThinEngine"}_prepareWorkingCanvas(){if(this._workingCanvas)return;this._workingCanvas=this.createCanvas(1,1);const e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}getInfo(){return this.getGlInfo()}getGlInfo(){return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}}extractDriverInfo(){const e=this.getGlInfo();return e&&e.renderer?e.renderer:""}getRenderWidth(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth}getRenderHeight(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight}clear(e,t,i,s=!1){var o,h;const n=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=n;let r=0;if(t&&e){let l=!0;if(this._currentRenderTarget){const c=(o=this._currentRenderTarget.texture)==null?void 0:o.format;if(c===8||c===9||c===10||c===11){const u=(h=this._currentRenderTarget.texture)==null?void 0:h.type;u===7||u===5?(we._TempClearColorUint32[0]=e.r*255,we._TempClearColorUint32[1]=e.g*255,we._TempClearColorUint32[2]=e.b*255,we._TempClearColorUint32[3]=e.a*255,this._gl.clearBufferuiv(this._gl.COLOR,0,we._TempClearColorUint32),l=!1):(we._TempClearColorInt32[0]=e.r*255,we._TempClearColorInt32[1]=e.g*255,we._TempClearColorInt32[2]=e.b*255,we._TempClearColorInt32[3]=e.a*255,this._gl.clearBufferiv(this._gl.COLOR,0,we._TempClearColorInt32),l=!1)}}l&&(this._gl.clearColor(e.r,e.g,e.b,e.a!==void 0?e.a:1),r|=this._gl.COLOR_BUFFER_BIT)}i&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GEQUAL,this._gl.clearDepth(0)):this._gl.clearDepth(1),r|=this._gl.DEPTH_BUFFER_BIT),s&&(this._gl.clearStencil(0),r|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(r)}_viewport(e,t,i,s){(e!==this._viewportCached.x||t!==this._viewportCached.y||i!==this._viewportCached.z||s!==this._viewportCached.w)&&(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=i,this._viewportCached.w=s,this._gl.viewport(e,t,i,s))}endFrame(){super.endFrame(),this._badOS&&this.flushFramebuffer()}get performanceMonitor(){throw new Error("Not Supported by ThinEngine")}bindFramebuffer(e,t=0,i,s,n,r=0,o=0){var u,f,d,_,p,g;const h=e;this._currentRenderTarget&&this.unBindFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(h._framebuffer);const l=this._gl;e.isMulti||(e.is2DArray||e.is3D?(l.framebufferTextureLayer(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,(u=e.texture._hardwareTexture)==null?void 0:u.underlyingResource,r,o),h._currentLOD=r):e.isCube?l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_CUBE_MAP_POSITIVE_X+t,(f=e.texture._hardwareTexture)==null?void 0:f.underlyingResource,r):h._currentLOD!==r&&(l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,(d=e.texture._hardwareTexture)==null?void 0:d.underlyingResource,r),h._currentLOD=r));const c=e._depthStencilTexture;if(c){e.is3D&&(e.texture.width!==c.width||e.texture.height!==c.height||e.texture.depth!==c.depth)&&U.Warn("Depth/Stencil attachment for 3D target must have same dimensions as color attachment");const m=e._depthStencilTextureWithStencil?l.DEPTH_STENCIL_ATTACHMENT:l.DEPTH_ATTACHMENT;e.is2DArray||e.is3D?l.framebufferTextureLayer(l.FRAMEBUFFER,m,(_=c._hardwareTexture)==null?void 0:_.underlyingResource,r,o):e.isCube?l.framebufferTexture2D(l.FRAMEBUFFER,m,l.TEXTURE_CUBE_MAP_POSITIVE_X+t,(p=c._hardwareTexture)==null?void 0:p.underlyingResource,r):l.framebufferTexture2D(l.FRAMEBUFFER,m,l.TEXTURE_2D,(g=c._hardwareTexture)==null?void 0:g.underlyingResource,r)}h._MSAAFramebuffer&&this._bindUnboundFramebuffer(h._MSAAFramebuffer),this._cachedViewport&&!n?this.setViewport(this._cachedViewport,i,s):(i||(i=e.width,r&&(i=i/Math.pow(2,r))),s||(s=e.height,r&&(s=s/Math.pow(2,r))),this._viewport(0,0,i,s)),this.wipeCaches()}setState(e,t=0,i,s=!1,n,r,o=0){var c,u;(this._depthCullingState.cull!==e||i)&&(this._depthCullingState.cull=e);const h=(u=(c=this.cullBackFaces)!=null?c:n)==null||u?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==h||i)&&(this._depthCullingState.cullFace=h),this.setZOffset(t),this.setZOffsetUnits(o);const l=s?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==l||i)&&(this._depthCullingState.frontFace=l),this._stencilStateComposer.stencilMaterial=r}_bindUnboundFramebuffer(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)}_currentFrameBufferIsDefaultFrameBuffer(){return this._currentFramebuffer===null}generateMipmaps(e){const t=this._getTextureTarget(e);this._bindTextureDirectly(t,e,!0),this._gl.generateMipmap(t),this._bindTextureDirectly(t,null)}unBindFramebuffer(e,t=!1,i){const s=e;this._currentRenderTarget=null,s.disableAutomaticMSAAResolve||(e.isMulti?this.resolveMultiFramebuffer(e):this.resolveFramebuffer(e)),t||(e.isMulti?this.generateMipMapsMultiFramebuffer(e):this.generateMipMapsFramebuffer(e)),i&&(s._MSAAFramebuffer&&this._bindUnboundFramebuffer(s._framebuffer),i()),this._bindUnboundFramebuffer(null)}generateMipMapsFramebuffer(e){var t;!e.isMulti&&((t=e.texture)!=null&&t.generateMipMaps)&&!e.isCube&&this.generateMipmaps(e.texture)}resolveFramebuffer(e){const t=e,i=this._gl;if(!t._MSAAFramebuffer||t.isMulti)return;let s=t.resolveMSAAColors?i.COLOR_BUFFER_BIT:0;s|=t._generateDepthBuffer&&t.resolveMSAADepth?i.DEPTH_BUFFER_BIT:0,s|=t._generateStencilBuffer&&t.resolveMSAAStencil?i.STENCIL_BUFFER_BIT:0,i.bindFramebuffer(i.READ_FRAMEBUFFER,t._MSAAFramebuffer),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,t._framebuffer),i.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,s,i.NEAREST)}flushFramebuffer(){this._gl.flush()}restoreDefaultFramebuffer(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()}_resetVertexBufferBinding(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null}createVertexBuffer(e,t,i){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)}_createVertexBuffer(e,t){const i=this._gl.createBuffer();if(!i)throw new Error("Unable to create vertex buffer");const s=new Pn(i);return this.bindArrayBuffer(s),typeof e!="number"?e instanceof Array?(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t),s.capacity=e.length*4):(this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),s.capacity=e.byteLength):(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Uint8Array(e),t),s.capacity=e),this._resetVertexBufferBinding(),s.references=1,s}createDynamicVertexBuffer(e,t){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)}_resetIndexBufferBinding(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null}createIndexBuffer(e,t,i){const s=this._gl.createBuffer(),n=new Pn(s);if(!s)throw new Error("Unable to create index buffer");this.bindIndexBuffer(n);const r=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,r,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),n.references=1,n.is32Bits=r.BYTES_PER_ELEMENT===4,n}_normalizeIndexData(e){if(e.BYTES_PER_ELEMENT===2)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;for(let i=0;i=65535)return new Uint32Array(e);return new Uint16Array(e)}return new Uint16Array(e)}bindArrayBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ARRAY_BUFFER)}bindUniformBlock(e,t,i){const s=e.program,n=this._gl.getUniformBlockIndex(s,t);this._gl.uniformBlockBinding(s,n,i)}bindIndexBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)}_bindBuffer(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)}updateArrayBuffer(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)}_vertexAttribPointer(e,t,i,s,n,r,o){const h=this._currentBufferPointers[t];if(!h)return;let l=!1;h.active?(h.buffer!==e&&(h.buffer=e,l=!0),h.size!==i&&(h.size=i,l=!0),h.type!==s&&(h.type=s,l=!0),h.normalized!==n&&(h.normalized=n,l=!0),h.stride!==r&&(h.stride=r,l=!0),h.offset!==o&&(h.offset=o,l=!0)):(l=!0,h.active=!0,h.index=t,h.size=i,h.type=s,h.normalized=n,h.stride=r,h.offset=o,h.buffer=e),(l||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),s===this._gl.UNSIGNED_INT||s===this._gl.INT?this._gl.vertexAttribIPointer(t,i,s,r,o):this._gl.vertexAttribPointer(t,i,s,n,r,o))}_bindIndexBufferWithCache(e){e!=null&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)}_bindVertexBuffersAttributes(e,t,i){const s=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(let n=0;n=0){const o=s[n];let h=null;if(i&&(h=i[o]),h||(h=e[o]),!h)continue;this._gl.enableVertexAttribArray(r),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[r]=!0);const l=h.getBuffer();l&&(this._vertexAttribPointer(l,r,h.getSize(),h.type,h.normalized,h.byteStride,h.byteOffset),h.getIsInstanced()&&(this._gl.vertexAttribDivisor(r,h.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(r),this._currentInstanceBuffers.push(l))))}}}recordVertexArrayObject(e,t,i,s){const n=this._gl.createVertexArray();if(!n)throw new Error("Unable to create VAO");return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(n),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,i,s),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),n}bindVertexArrayObject(e,t){this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=t!=null&&t.is32Bits,this._mustWipeVertexAttributes=!0)}bindBuffersDirectly(e,t,i,s,n){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==n){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=n;const r=n.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();let o=0;for(let h=0;h=0&&(this._gl.enableVertexAttribArray(l),this._vertexAttribArraysEnabled[l]=!0,this._vertexAttribPointer(e,l,i[h],this._gl.FLOAT,!1,s,o)),o+=i[h]*4}}this._bindIndexBufferWithCache(t)}_unbindVertexArrayObject(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))}bindBuffers(e,t,i,s){(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==i)&&(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=i,this._bindVertexBuffersAttributes(e,i,s)),this._bindIndexBufferWithCache(t)}unbindInstanceAttributes(){let e;for(let t=0,i=this._currentInstanceLocations.length;t1||this.isWebGPU)),(o===1&&!this._caps.textureFloatLinearFiltering||o===2&&!this._caps.textureHalfFloatLinearFiltering)&&(h=1),o===1&&!this._caps.textureFloat&&(o=0,U.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const p=Mo(l),g=br(l),m=this._gl,b=new ft(this,s),I=e.width||e,T=e.height||e,x=e.depth||0,y=e.layers||0,R=this._getSamplingParameters(h,(n||r)&&!p),E=y!==0?m.TEXTURE_2D_ARRAY:x!==0?m.TEXTURE_3D:m.TEXTURE_2D,C=p?this._getInternalFormatFromDepthTextureFormat(l,!0,g):this._getRGBABufferInternalSizedFormat(o,l,c),S=p?g?m.DEPTH_STENCIL:m.DEPTH_COMPONENT:this._getInternalFormat(l),w=p?this._getWebGLTextureTypeFromDepthTextureFormat(l):this._getWebGLTextureType(o);if(this._bindTextureDirectly(E,b),y!==0?(b.is2DArray=!0,m.texImage3D(E,0,C,I,T,y,0,S,w,null)):x!==0?(b.is3D=!0,m.texImage3D(E,0,C,I,T,x,0,S,w,null)):m.texImage2D(E,0,C,I,T,0,S,w,null),m.texParameteri(E,m.TEXTURE_MAG_FILTER,R.mag),m.texParameteri(E,m.TEXTURE_MIN_FILTER,R.min),m.texParameteri(E,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(E,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),p&&this.webGLVersion>1&&(_===0?(m.texParameteri(E,m.TEXTURE_COMPARE_FUNC,515),m.texParameteri(E,m.TEXTURE_COMPARE_MODE,m.NONE)):(m.texParameteri(E,m.TEXTURE_COMPARE_FUNC,_),m.texParameteri(E,m.TEXTURE_COMPARE_MODE,m.COMPARE_REF_TO_TEXTURE))),(n||r)&&this._gl.generateMipmap(E),this._bindTextureDirectly(E,null),b._useSRGBBuffer=c,b.baseWidth=I,b.baseHeight=T,b.width=I,b.height=T,b.depth=y||x,b.isReady=!0,b.samples=u,b.generateMipMaps=n,b.samplingMode=h,b.type=o,b.format=l,b.label=f,b.comparisonFunction=_,this._internalTexturesCache.push(b),d){let G=null;if(Mo(b.format)?G=this._setupFramebufferDepthAttachments(br(b.format),b.format!==19,b.width,b.height,u,b.format,!0):G=this._createRenderBuffer(b.width,b.height,u,-1,this._getRGBABufferInternalSizedFormat(b.type,b.format,b._useSRGBBuffer),-1),!G)throw new Error("Unable to create render buffer");b._autoMSAAManagement=!0;let L=b._hardwareTexture;L||(L=b._hardwareTexture=this._createHardwareTexture()),L.addMSAARenderBuffer(G)}return b}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||t)}createTexture(e,t,i,s,n=3,r=null,o=null,h=null,l=null,c=null,u=null,f,d,_,p){return this._createTextureBase(e,t,i,s,n,r,o,(...g)=>this._prepareWebGLTexture(...g,c),(g,m,b,I,T,x)=>{const y=this._gl,R=b.width===g&&b.height===m;T._creationFlags=_!=null?_:0;const E=this._getTexImageParametersForCreateTexture(T.format,T._useSRGBBuffer);if(R)return y.texImage2D(y.TEXTURE_2D,0,E.internalFormat,E.format,E.type,b),!1;const C=this._caps.maxTextureSize;if(b.width>C||b.height>C||!this._supportsHardwareTextureRescaling)return this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext||(this._workingCanvas.width=g,this._workingCanvas.height=m,this._workingContext.drawImage(b,0,0,b.width,b.height,0,0,g,m),y.texImage2D(y.TEXTURE_2D,0,E.internalFormat,E.format,E.type,this._workingCanvas),T.width=g,T.height=m),!1;{const S=new ft(this,2);this._bindTextureDirectly(y.TEXTURE_2D,S,!0),y.texImage2D(y.TEXTURE_2D,0,E.internalFormat,E.format,E.type,b),this._rescaleTexture(S,T,s,E.format,()=>{this._releaseTexture(S),this._bindTextureDirectly(y.TEXTURE_2D,T,!0),x()})}return!0},h,l,c,u,f,d,p)}_getTexImageParametersForCreateTexture(e,t){let i,s;return this.webGLVersion===1?(i=this._getInternalFormat(e,t),s=i):(i=this._getInternalFormat(e,!1),s=this._getRGBABufferInternalSizedFormat(0,e,t)),{internalFormat:s,format:i,type:this._gl.UNSIGNED_BYTE}}_rescaleTexture(e,t,i,s,n){}_unpackFlipY(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e?1:0),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))}_getUnpackAlignement(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)}_getTextureTarget(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D}updateTextureSamplingMode(e,t,i=!1){const s=this._getTextureTarget(t),n=this._getSamplingParameters(e,t.useMipMaps||i);this._setTextureParameterInteger(s,this._gl.TEXTURE_MAG_FILTER,n.mag,t),this._setTextureParameterInteger(s,this._gl.TEXTURE_MIN_FILTER,n.min),i&&(t.generateMipMaps=!0,this._gl.generateMipmap(s)),this._bindTextureDirectly(s,null),t.samplingMode=e}updateTextureDimensions(e,t,i,s=1){}updateTextureWrappingMode(e,t,i=null,s=null){const n=this._getTextureTarget(e);t!==null&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),i!==null&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(i),e),e._cachedWrapV=i),(e.is2DArray||e.is3D)&&s!==null&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(s),e),e._cachedWrapR=s),this._bindTextureDirectly(n,null)}_uploadCompressedDataToTextureDirectly(e,t,i,s,n,r=0,o=0){const h=this._gl;let l=h.TEXTURE_2D;if(e.isCube&&(l=h.TEXTURE_CUBE_MAP_POSITIVE_X+r),e._useSRGBBuffer)switch(t){case 37492:case 36196:this._caps.etc2?t=h.COMPRESSED_SRGB8_ETC2:e._useSRGBBuffer=!1;break;case 37496:this._caps.etc2?t=h.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:e._useSRGBBuffer=!1;break;case 36492:t=h.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;break;case 37808:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;break;case 33776:this._caps.s3tc_srgb?t=h.COMPRESSED_SRGB_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33777:this._caps.s3tc_srgb?t=h.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33779:this._caps.s3tc_srgb?t=h.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:e._useSRGBBuffer=!1;break;default:e._useSRGBBuffer=!1;break}this._gl.compressedTexImage2D(l,o,t,i,s,0,n)}_uploadDataToTextureDirectly(e,t,i=0,s=0,n,r=!1){const o=this._gl,h=this._getWebGLTextureType(e.type),l=this._getInternalFormat(e.format),c=n===void 0?this._getRGBABufferInternalSizedFormat(e.type,e.format,e._useSRGBBuffer):this._getInternalFormat(n,e._useSRGBBuffer);this._unpackFlipY(e.invertY);let u=o.TEXTURE_2D;e.isCube&&(u=o.TEXTURE_CUBE_MAP_POSITIVE_X+i);const f=Math.round(Math.log(e.width)*Math.LOG2E),d=Math.round(Math.log(e.height)*Math.LOG2E),_=r?e.width:Math.pow(2,Math.max(f-s,0)),p=r?e.height:Math.pow(2,Math.max(d-s,0));o.texImage2D(u,s,c,_,p,0,l,h,t)}updateTextureData(e,t,i,s,n,r,o=0,h=0,l=!1){const c=this._gl,u=this._getWebGLTextureType(e.type),f=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);let d=c.TEXTURE_2D,_=c.TEXTURE_2D;e.isCube&&(_=c.TEXTURE_CUBE_MAP_POSITIVE_X+o,d=c.TEXTURE_CUBE_MAP),this._bindTextureDirectly(d,e,!0),c.texSubImage2D(_,h,i,s,n,r,f,u,t),l&&this._gl.generateMipmap(_),this._bindTextureDirectly(d,null)}_uploadArrayBufferViewToTexture(e,t,i=0,s=0){const n=this._gl,r=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(r,e,!0),this._uploadDataToTextureDirectly(e,t,i,s),this._bindTextureDirectly(r,null,!0)}_prepareWebGLTextureContinuation(e,t,i,s,n){const r=this._gl;if(!r)return;const o=this._getSamplingParameters(n,!i);r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,o.mag),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,o.min),!i&&!s&&r.generateMipmap(r.TEXTURE_2D),this._bindTextureDirectly(r.TEXTURE_2D,null),t&&t.removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}_prepareWebGLTexture(e,t,i,s,n,r,o,h,l,c){const u=this.getCaps().maxTextureSize,f=Math.min(u,this.needPOTTextures?fi(s.width,u):s.width),d=Math.min(u,this.needPOTTextures?fi(s.height,u):s.height),_=this._gl;if(_){if(!e._hardwareTexture){i&&i.removePendingData(e);return}this._bindTextureDirectly(_.TEXTURE_2D,e,!0),this._unpackFlipY(n===void 0?!0:!!n),e.baseWidth=s.width,e.baseHeight=s.height,e.width=f,e.height=d,e.isReady=!0,e.type=e.type!==-1?e.type:0,e.format=e.format!==-1?e.format:c!=null?c:t===".jpg"&&!e._useSRGBBuffer?4:5,!h(f,d,s,t,e,()=>{this._prepareWebGLTextureContinuation(e,i,r,o,l)})&&this._prepareWebGLTextureContinuation(e,i,r,o,l)}}_getInternalFormatFromDepthTextureFormat(e,t,i){const s=this._gl;if(!t)return s.STENCIL_INDEX8;let r=i?s.DEPTH_STENCIL:s.DEPTH_COMPONENT;return this.webGLVersion>1?e===15?r=s.DEPTH_COMPONENT16:e===16?r=s.DEPTH_COMPONENT24:e===17||e===13?r=i?s.DEPTH24_STENCIL8:s.DEPTH_COMPONENT24:e===14?r=s.DEPTH_COMPONENT32F:e===18&&(r=i?s.DEPTH32F_STENCIL8:s.DEPTH_COMPONENT32F):r=s.DEPTH_COMPONENT16,r}_getWebGLTextureTypeFromDepthTextureFormat(e){const t=this._gl;let i=t.UNSIGNED_INT;return e===15?i=t.UNSIGNED_SHORT:e===17||e===13?i=t.UNSIGNED_INT_24_8:e===14?i=t.FLOAT:e===18?i=t.FLOAT_32_UNSIGNED_INT_24_8_REV:e===19&&(i=t.UNSIGNED_BYTE),i}_setupFramebufferDepthAttachments(e,t,i,s,n=1,r,o=!1){const h=this._gl;r=r!=null?r:e?13:14;const l=this._getInternalFormatFromDepthTextureFormat(r,t,e);return e&&t?this._createRenderBuffer(i,s,n,h.DEPTH_STENCIL,l,o?-1:h.DEPTH_STENCIL_ATTACHMENT):t?this._createRenderBuffer(i,s,n,l,l,o?-1:h.DEPTH_ATTACHMENT):e?this._createRenderBuffer(i,s,n,l,l,o?-1:h.STENCIL_ATTACHMENT):null}_createRenderBuffer(e,t,i,s,n,r,o=!0){const l=this._gl.createRenderbuffer();return this._updateRenderBuffer(l,e,t,i,s,n,r,o)}_updateRenderBuffer(e,t,i,s,n,r,o,h=!0){const l=this._gl;return l.bindRenderbuffer(l.RENDERBUFFER,e),s>1&&l.renderbufferStorageMultisample?l.renderbufferStorageMultisample(l.RENDERBUFFER,s,r,t,i):l.renderbufferStorage(l.RENDERBUFFER,n,t,i),o!==-1&&l.framebufferRenderbuffer(l.FRAMEBUFFER,o,l.RENDERBUFFER,e),h&&l.bindRenderbuffer(l.RENDERBUFFER,null),e}_releaseTexture(e){this._deleteTexture(e._hardwareTexture),this.unbindAllTextures();const t=this._internalTexturesCache.indexOf(e);t!==-1&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()}_deleteTexture(e){e==null||e.release()}_setProgram(e){this._currentProgram!==e&&(ld(e,this._gl),this._currentProgram=e)}bindSamplers(e){const t=e.getPipelineContext();this._setProgram(t.program);const i=e.getSamplers();for(let s=0;s-1;if(i&&r&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||s){if(this._activateCurrentTexture(),t&&t.isMultiview)throw U.Error(["_bindTextureDirectly called with a multiview texture!",e,t]),"_bindTextureDirectly called with a multiview texture!";this._gl.bindTexture(e,(l=(h=t==null?void 0:t._hardwareTexture)==null?void 0:h.underlyingResource)!=null?l:null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)}else i&&(n=!0,this._activateCurrentTexture());return r&&!i&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),n}_bindTexture(e,t,i){if(e===void 0)return;t&&(t._associatedChannel=e),this._activeChannel=e;const s=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(s,t)}unbindAllTextures(){for(let e=0;e1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))}setTexture(e,t,i,s){e!==void 0&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,i))}_bindSamplerUniformToChannel(e,t){const i=this._boundUniforms[e];!i||i._currentState===t||(this._gl.uniform1i(i,t),i._currentState=t)}_getTextureWrapMode(e){switch(e){case 1:return this._gl.REPEAT;case 0:return this._gl.CLAMP_TO_EDGE;case 2:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT}_setTexture(e,t,i=!1,s=!1,n=""){if(!t)return this._boundTexturesCache[e]!=null&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video){this._activeChannel=e;const l=t.getInternalTexture();l&&(l._associatedChannel=e),t.update()}else if(t.delayLoadState===4)return t.delayLoad(),!1;let r;s?r=t.depthStencilTexture:t.isReady()?r=t.getInternalTexture():t.isCube?r=this.emptyCubeTexture:t.is3D?r=this.emptyTexture3D:t.is2DArray?r=this.emptyTexture2DArray:r=this.emptyTexture,!i&&r&&(r._associatedChannel=e);let o=!0;this._boundTexturesCache[e]===r&&(i||this._bindSamplerUniformToChannel(r._associatedChannel,e),o=!1),this._activeChannel=e;const h=this._getTextureTarget(r);if(o&&this._bindTextureDirectly(h,r,i),r&&!r.isMultiview){if(r.isCube&&r._cachedCoordinatesMode!==t.coordinatesMode){r._cachedCoordinatesMode=t.coordinatesMode;const l=t.coordinatesMode!==3&&t.coordinatesMode!==5?1:0;t.wrapU=l,t.wrapV=l}r._cachedWrapU!==t.wrapU&&(r._cachedWrapU=t.wrapU,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),r)),r._cachedWrapV!==t.wrapV&&(r._cachedWrapV=t.wrapV,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),r)),r.is3D&&r._cachedWrapR!==t.wrapR&&(r._cachedWrapR=t.wrapR,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),r)),this._setAnisotropicLevel(h,r,t.anisotropicFilteringLevel)}return!0}setTextureArray(e,t,i,s){if(!(e===void 0||!t)){(!this._textureUnits||this._textureUnits.length!==i.length)&&(this._textureUnits=new Int32Array(i.length));for(let n=0;n=this._caps.maxVertexAttribs||!this._vertexAttribArraysEnabled[e]||this.disableAttributeByIndex(e)}releaseEffects(){const e=Object.keys(this._compiledEffects);for(const t of e)this._compiledEffects[t].dispose(!0);this._compiledEffects={}}dispose(){var e;St()&&this._renderingCanvas&&(this._doNotHandleContextLost||(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored))),super.dispose(),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.unbindAllAttributes(),this._boundUniforms={},this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers.length=0,this._currentProgram=null,this._creationOptions.loseContextOnDispose&&((e=this._gl.getExtension("WEBGL_lose_context"))==null||e.loseContext()),rd(this._gl)}attachContextLostEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextlost",e,!1)}attachContextRestoredEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextrestored",e,!1)}getError(){return this._gl.getError()}_canRenderToFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(1)}_canRenderToHalfFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(2)}_canRenderToFramebuffer(e){const t=this._gl;for(;t.getError()!==t.NO_ERROR;);let i=!0;const s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);const n=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0);const r=t.checkFramebufferStatus(t.FRAMEBUFFER);if(i=i&&r===t.FRAMEBUFFER_COMPLETE,i=i&&t.getError()===t.NO_ERROR,i&&(t.clear(t.COLOR_BUFFER_BIT),i=i&&t.getError()===t.NO_ERROR),i){t.bindFramebuffer(t.FRAMEBUFFER,null);const o=t.RGBA,h=t.UNSIGNED_BYTE,l=new Uint8Array(4);t.readPixels(0,0,1,1,o,h,l),i=i&&t.getError()===t.NO_ERROR}for(t.deleteTexture(s),t.deleteFramebuffer(n),t.bindFramebuffer(t.FRAMEBUFFER,null);!i&&t.getError()!==t.NO_ERROR;);return i}_getWebGLTextureType(e){if(this._webGLVersion===1){switch(e){case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT_OES;case 0:return this._gl.UNSIGNED_BYTE;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case 3:return this._gl.BYTE;case 0:return this._gl.UNSIGNED_BYTE;case 4:return this._gl.SHORT;case 5:return this._gl.UNSIGNED_SHORT;case 6:return this._gl.INT;case 7:return this._gl.UNSIGNED_INT;case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5;case 11:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case 12:return this._gl.UNSIGNED_INT_24_8;case 13:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case 14:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case 15:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE}_getInternalFormat(e,t=!1){let i=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;switch(e){case 0:i=this._gl.ALPHA;break;case 1:i=this._gl.LUMINANCE;break;case 2:i=this._gl.LUMINANCE_ALPHA;break;case 6:case 33322:case 36760:i=this._gl.RED;break;case 7:case 33324:case 36761:i=this._gl.RG;break;case 4:case 32852:case 36762:i=t?this._glSRGBExtensionValues.SRGB:this._gl.RGB;break;case 5:case 32859:case 36763:i=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;break}if(this._webGLVersion>1)switch(e){case 8:i=this._gl.RED_INTEGER;break;case 9:i=this._gl.RG_INTEGER;break;case 10:i=this._gl.RGB_INTEGER;break;case 11:i=this._gl.RGBA_INTEGER;break}return i}_getRGBABufferInternalSizedFormat(e,t,i=!1){if(this._webGLVersion===1){if(t!==void 0)switch(t){case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;case 4:return i?this._glSRGBExtensionValues.SRGB:this._gl.RGB}return this._gl.RGBA}switch(e){case 3:switch(t){case 6:return this._gl.R8_SNORM;case 7:return this._gl.RG8_SNORM;case 4:return this._gl.RGB8_SNORM;case 8:return this._gl.R8I;case 9:return this._gl.RG8I;case 10:return this._gl.RGB8I;case 11:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case 0:switch(t){case 6:return this._gl.R8;case 7:return this._gl.RG8;case 4:return i?this._glSRGBExtensionValues.SRGB8:this._gl.RGB8;case 5:return i?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8;case 8:return this._gl.R8UI;case 9:return this._gl.RG8UI;case 10:return this._gl.RGB8UI;case 11:return this._gl.RGBA8UI;case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case 4:switch(t){case 8:return this._gl.R16I;case 36760:return this._gl.R16_SNORM_EXT;case 36761:return this._gl.RG16_SNORM_EXT;case 36762:return this._gl.RGB16_SNORM_EXT;case 36763:return this._gl.RGBA16_SNORM_EXT;case 9:return this._gl.RG16I;case 10:return this._gl.RGB16I;case 11:return this._gl.RGBA16I;default:return this._gl.RGBA16I}case 5:switch(t){case 8:return this._gl.R16UI;case 33322:return this._gl.R16_EXT;case 33324:return this._gl.RG16_EXT;case 32852:return this._gl.RGB16_EXT;case 32859:return this._gl.RGBA16_EXT;case 9:return this._gl.RG16UI;case 10:return this._gl.RGB16UI;case 11:return this._gl.RGBA16UI;default:return this._gl.RGBA16UI}case 6:switch(t){case 8:return this._gl.R32I;case 9:return this._gl.RG32I;case 10:return this._gl.RGB32I;case 11:return this._gl.RGBA32I;default:return this._gl.RGBA32I}case 7:switch(t){case 8:return this._gl.R32UI;case 9:return this._gl.RG32UI;case 10:return this._gl.RGB32UI;case 11:return this._gl.RGBA32UI;default:return this._gl.RGBA32UI}case 1:switch(t){case 6:return this._gl.R32F;case 7:return this._gl.RG32F;case 4:return this._gl.RGB32F;case 5:return this._gl.RGBA32F;default:return this._gl.RGBA32F}case 2:switch(t){case 6:return this._gl.R16F;case 7:return this._gl.RG16F;case 4:return this._gl.RGB16F;case 5:return this._gl.RGBA16F;default:return this._gl.RGBA16F}case 10:return this._gl.RGB565;case 13:return this._gl.R11F_G11F_B10F;case 14:return this._gl.RGB9_E5;case 8:return this._gl.RGBA4;case 9:return this._gl.RGB5_A1;case 11:switch(t){case 5:return this._gl.RGB10_A2;case 11:return this._gl.RGB10_A2UI;default:return this._gl.RGB10_A2}}return i?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8}readPixels(e,t,i,s,n=!0,r=!0){const o=n?4:3,h=n?this._gl.RGBA:this._gl.RGB,l=new Uint8Array(s*i*o);return r&&this.flushFramebuffer(),this._gl.readPixels(e,t,i,s,h,this._gl.UNSIGNED_BYTE,l),Promise.resolve(l)}static get IsSupportedAsync(){return Promise.resolve(this.isSupported())}static get IsSupported(){return this.isSupported()}static isSupported(){if(this._HasMajorPerformanceCaveat!==null)return!this._HasMajorPerformanceCaveat;if(this._IsSupported===null)try{const e=ae._CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._IsSupported=t!=null&&!!window.WebGLRenderingContext}catch{this._IsSupported=!1}return this._IsSupported}static get HasMajorPerformanceCaveat(){if(this._HasMajorPerformanceCaveat===null)try{const e=ae._CreateCanvas(1,1),t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0});this._HasMajorPerformanceCaveat=!t}catch{this._HasMajorPerformanceCaveat=!1}return this._HasMajorPerformanceCaveat}}we._TempClearColorUint32=new Uint32Array(4);we._TempClearColorInt32=new Int32Array(4);we.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/12\\d\\..+?Mobile",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:".*AppleWebKit.*(15.4).*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]},{key:".*(15.4).*AppleWebKit.*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]}];we._ConcatenateShader=Dl;we._IsSupported=null;we._HasMajorPerformanceCaveat=null;const kd=Object.freeze(Object.defineProperty({__proto__:null,ThinEngine:we},Symbol.toStringTag,{value:"Module"}));class Yl{constructor(e=30){this._enabled=!0,this._rollingFrameTime=new Vd(e)}sampleFrame(e=bi.Now){if(this._enabled){if(this._lastFrameTimeMs!=null){const t=e-this._lastFrameTimeMs;this._rollingFrameTime.add(t)}this._lastFrameTimeMs=e}}get averageFrameTime(){return this._rollingFrameTime.average}get averageFrameTimeVariance(){return this._rollingFrameTime.variance}get instantaneousFrameTime(){return this._rollingFrameTime.history(0)}get averageFPS(){return 1e3/this._rollingFrameTime.average}get instantaneousFPS(){const e=this._rollingFrameTime.history(0);return e===0?0:1e3/e}get isSaturated(){return this._rollingFrameTime.isSaturated()}enable(){this._enabled=!0}disable(){this._enabled=!1,this._lastFrameTimeMs=null}get isEnabled(){return this._enabled}reset(){this._lastFrameTimeMs=null,this._rollingFrameTime.reset()}}class Vd{constructor(e){this._samples=new Array(e),this.reset()}add(e){let t;if(this.isSaturated()){const i=this._samples[this._pos];t=i-this.average,this.average-=t/(this._sampleCount-1),this._m2-=t*(i-this.average)}else this._sampleCount++;t=e-this.average,this.average+=t/this._sampleCount,this._m2+=t*(e-this.average),this.variance=this._m2/(this._sampleCount-1),this._samples[this._pos]=e,this._pos++,this._pos%=this._samples.length}history(e){if(e>=this._sampleCount||e>=this._samples.length)return 0;const t=this._wrapPosition(this._pos-1);return this._samples[this._wrapPosition(t-e)]}isSaturated(){return this._sampleCount>=this._samples.length}reset(){this.average=0,this.variance=0,this._sampleCount=0,this._pos=0,this._m2=0}_wrapPosition(e){const t=this._samples.length;return(e%t+t)%t}}we.prototype.setAlphaMode=function(a,e=!1){if(this._alphaMode===a){if(!e){const t=a===0;this.depthCullingState.depthMask!==t&&(this.depthCullingState.depthMask=t)}return}switch(a){case 0:this._alphaState.alphaBlend=!1;break;case 7:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 8:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case 2:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 6:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 1:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 3:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 4:this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR,this._gl.ZERO,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 5:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 9:this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR,this._gl.ONE_MINUS_CONSTANT_COLOR,this._gl.CONSTANT_ALPHA,this._gl.ONE_MINUS_CONSTANT_ALPHA),this._alphaState.alphaBlend=!0;break;case 10:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case 11:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 12:this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA,this._gl.ONE,this._gl.ZERO,this._gl.ZERO),this._alphaState.alphaBlend=!0;break;case 13:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE_MINUS_DST_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case 14:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case 15:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ONE,this._gl.ZERO),this._alphaState.alphaBlend=!0;break;case 16:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case 17:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break}e||(this.depthCullingState.depthMask=a===0),this._alphaMode=a};we.prototype.updateRawTexture=function(a,e,t,i,s=null,n=0,r=!1){if(!a)return;const o=this._getRGBABufferInternalSizedFormat(n,t,r),h=this._getInternalFormat(t),l=this._getWebGLTextureType(n);this._bindTextureDirectly(this._gl.TEXTURE_2D,a,!0),this._unpackFlipY(i===void 0?!0:!!i),this._doNotHandleContextLost||(a._bufferView=e,a.format=t,a.type=n,a.invertY=i,a._compression=s),a.width%4!==0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),s&&e?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[s],a.width,a.height,0,e):this._gl.texImage2D(this._gl.TEXTURE_2D,0,o,a.width,a.height,0,h,l,e),a.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),a.isReady=!0};we.prototype.createRawTexture=function(a,e,t,i,s,n,r,o=null,h=0,l=0,c=!1){const u=new ft(this,3);u.baseWidth=e,u.baseHeight=t,u.width=e,u.height=t,u.format=i,u.generateMipMaps=s,u.samplingMode=r,u.invertY=n,u._compression=o,u.type=h,u._useSRGBBuffer=this._getUseSRGBBuffer(c,!s),this._doNotHandleContextLost||(u._bufferView=a),this.updateRawTexture(u,a,i,n,o,h,u._useSRGBBuffer),this._bindTextureDirectly(this._gl.TEXTURE_2D,u,!0);const f=this._getSamplingParameters(r,s);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,f.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,f.min),s&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(u),u};we.prototype.createRawCubeTexture=function(a,e,t,i,s,n,r,o=null){const h=this._gl,l=new ft(this,8);l.isCube=!0,l.format=t,l.type=i,this._doNotHandleContextLost||(l._bufferViewArray=a);const c=this._getWebGLTextureType(i);let u=this._getInternalFormat(t);u===h.RGB&&(u=h.RGBA),c===h.FLOAT&&!this._caps.textureFloatLinearFiltering?(s=!1,r=1,U.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):c===this._gl.HALF_FLOAT_OES&&!this._caps.textureHalfFloatLinearFiltering?(s=!1,r=1,U.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):c===h.FLOAT&&!this._caps.textureFloatRender?(s=!1,U.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):c===h.HALF_FLOAT&&!this._caps.colorBufferFloat&&(s=!1,U.Warn("Render to half float textures is not supported. Mipmap generation forced to false."));const f=e,d=f;if(l.width=f,l.height=d,l.invertY=n,l._compression=o,!this.needPOTTextures||wn(l.width)&&wn(l.height)||(s=!1),a)this.updateRawCubeTexture(l,a,t,i,n,o);else{const g=this._getRGBABufferInternalSizedFormat(i),m=0;this._bindTextureDirectly(h.TEXTURE_CUBE_MAP,l,!0);for(let b=0;b<6;b++)o?h.compressedTexImage2D(h.TEXTURE_CUBE_MAP_POSITIVE_X+b,m,this.getCaps().s3tc[o],l.width,l.height,0,void 0):h.texImage2D(h.TEXTURE_CUBE_MAP_POSITIVE_X+b,m,g,l.width,l.height,0,u,c,null);this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)}this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,l,!0),a&&s&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);const p=this._getSamplingParameters(r,s);return h.texParameteri(h.TEXTURE_CUBE_MAP,h.TEXTURE_MAG_FILTER,p.mag),h.texParameteri(h.TEXTURE_CUBE_MAP,h.TEXTURE_MIN_FILTER,p.min),h.texParameteri(h.TEXTURE_CUBE_MAP,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_CUBE_MAP,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),this._bindTextureDirectly(h.TEXTURE_CUBE_MAP,null),l.generateMipMaps=s,l.samplingMode=r,l.isReady=!0,l};we.prototype.updateRawCubeTexture=function(a,e,t,i,s,n=null,r=0){a._bufferViewArray=e,a.format=t,a.type=i,a.invertY=s,a._compression=n;const o=this._gl,h=this._getWebGLTextureType(i);let l=this._getInternalFormat(t);const c=this._getRGBABufferInternalSizedFormat(i);let u=!1;l===o.RGB&&(l=o.RGBA,u=!0),this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,a,!0),this._unpackFlipY(s===void 0?!0:!!s),a.width%4!==0&&o.pixelStorei(o.UNPACK_ALIGNMENT,1);for(let d=0;d<6;d++){let _=e[d];n?o.compressedTexImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+d,r,this.getCaps().s3tc[n],a.width,a.height,0,_):(u&&(_=ql(_,a.width,a.height,i)),o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+d,r,c,a.width,a.height,0,l,h,_))}(!this.needPOTTextures||wn(a.width)&&wn(a.height))&&a.generateMipMaps&&r===0&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),a.isReady=!0};we.prototype.createRawCubeTextureFromUrl=function(a,e,t,i,s,n,r,o,h=null,l=null,c=3,u=!1){const f=this._gl,d=this.createRawCubeTexture(null,t,i,s,!n,u,c,null);e==null||e.addPendingData(d),d.url=a,d.isReady=!1,this._internalTexturesCache.push(d);const _=(g,m)=>{e==null||e.removePendingData(d),l&&g&&l(g.status+" "+g.statusText,m)},p=g=>{const m=d.width,b=r(g);if(b){if(o){const I=this._getWebGLTextureType(s);let T=this._getInternalFormat(i);const x=this._getRGBABufferInternalSizedFormat(s);let y=!1;T===f.RGB&&(T=f.RGBA,y=!0),this._bindTextureDirectly(f.TEXTURE_CUBE_MAP,d,!0),this._unpackFlipY(!1);const R=o(b);for(let E=0;E>E;for(let S=0;S<6;S++){let w=R[E][S];y&&(w=ql(w,C,C,s)),f.texImage2D(S,E,x,C,C,0,T,I,w)}}this._bindTextureDirectly(f.TEXTURE_CUBE_MAP,null)}else this.updateRawCubeTexture(d,b,i,s,u);d.isReady=!0,e==null||e.removePendingData(d),d.onLoadedObservable.notifyObservers(d),d.onLoadedObservable.clear(),h&&h()}};return this._loadFile(a,g=>{p(g)},void 0,e==null?void 0:e.offlineProvider,!0,_),d};function ql(a,e,t,i){let s,n=1;i===1?s=new Float32Array(e*t*4):i===2?(s=new Uint16Array(e*t*4),n=15360):i===7?s=new Uint32Array(e*t*4):s=new Uint8Array(e*t*4);for(let r=0;r-1?c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_CUBE_MAP_POSITIVE_X+i,(f=a._hardwareTexture)==null?void 0:f.underlyingResource,s):c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,(d=a._hardwareTexture)==null?void 0:d.underlyingResource,s);let u=a.type!==void 0?this._getWebGLTextureType(a.type):c.UNSIGNED_BYTE;if(o)n||(n=Pa(a.type,4*e*t));else switch(u){case c.UNSIGNED_BYTE:n||(n=new Uint8Array(4*e*t)),u=c.UNSIGNED_BYTE;break;default:n||(n=new Float32Array(4*e*t)),u=c.FLOAT;break}return r&&this.flushFramebuffer(),c.readPixels(h,l,e,t,c.RGBA,u,n),c.bindFramebuffer(c.FRAMEBUFFER,this._currentFramebuffer),n};we.prototype._readTexturePixels=function(a,e,t,i=-1,s=0,n=null,r=!0,o=!1,h=0,l=0){return Promise.resolve(this._readTexturePixelsSync(a,e,t,i,s,n,r,o,h,l))};we.prototype.updateDynamicIndexBuffer=function(a,e,t=0){this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER]=null,this.bindIndexBuffer(a);let i;a.is32Bits?i=e instanceof Uint32Array?e:new Uint32Array(e):i=e instanceof Uint16Array?e:new Uint16Array(e),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,i,this._gl.DYNAMIC_DRAW),this._resetIndexBufferBinding()};we.prototype.updateDynamicVertexBuffer=function(a,e,t,i){this.bindArrayBuffer(a),t===void 0&&(t=0);const s=e.byteLength||e.length;i===void 0||i>=s&&t===0?e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,new Float32Array(e)):this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,e):e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,new Float32Array(e).subarray(t,t+i)):(e instanceof ArrayBuffer?e=new Uint8Array(e,t,i):e=new Uint8Array(e.buffer,e.byteOffset+t,i),this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)),this._resetVertexBufferBinding()};we.prototype._createDepthStencilCubeTexture=function(a,e){const t=new ft(this,12);if(t.isCube=!0,this.webGLVersion===1)return U.Error("Depth cube texture is not supported by WebGL 1."),t;const i={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...e},s=this._gl;this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,t,!0),this._setupDepthStencilTexture(t,a,i.bilinearFiltering,i.comparisonFunction);for(let n=0;n<6;n++)i.generateStencil?s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,s.DEPTH24_STENCIL8,a,a,0,s.DEPTH_STENCIL,s.UNSIGNED_INT_24_8,null):s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,s.DEPTH_COMPONENT24,a,a,0,s.DEPTH_COMPONENT,s.UNSIGNED_INT,null);return this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,null),this._internalTexturesCache.push(t),t};we.prototype._setCubeMapTextureParams=function(a,e,t){const i=this._gl;i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,e?i.LINEAR_MIPMAP_LINEAR:i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),a.samplingMode=e?3:2,e&&this.getCaps().textureMaxLevel&&t!==void 0&&t>0&&(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAX_LEVEL,t),a._maxLodLevel=t),this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,null)};we.prototype.createCubeTexture=function(a,e,t,i,s=null,n=null,r,o=null,h=!1,l=0,c=0,u=null,f,d=!1,_=null){const p=this._gl;return this.createCubeTextureBase(a,e,t,!!i,s,n,r,o,h,l,c,u,g=>this._bindTextureDirectly(p.TEXTURE_CUBE_MAP,g,!0),(g,m)=>{const b=this.needPOTTextures?fi(m[0].width,this._caps.maxCubemapTextureSize):m[0].width,I=b,T=[p.TEXTURE_CUBE_MAP_POSITIVE_X,p.TEXTURE_CUBE_MAP_POSITIVE_Y,p.TEXTURE_CUBE_MAP_POSITIVE_Z,p.TEXTURE_CUBE_MAP_NEGATIVE_X,p.TEXTURE_CUBE_MAP_NEGATIVE_Y,p.TEXTURE_CUBE_MAP_NEGATIVE_Z];this._bindTextureDirectly(p.TEXTURE_CUBE_MAP,g,!0),this._unpackFlipY(!1);const x=r?this._getInternalFormat(r,g._useSRGBBuffer):g._useSRGBBuffer?this._glSRGBExtensionValues.SRGB8_ALPHA8:p.RGBA;let y=r?this._getInternalFormat(r):p.RGBA;g._useSRGBBuffer&&this.webGLVersion===1&&(y=x);for(let R=0;R0}get is3D(){return this.depth>0}get size(){return this.width}get width(){var e;return(e=this._size.width)!=null?e:this._size}get height(){var e;return(e=this._size.height)!=null?e:this._size}get layers(){return this._size.layers||0}get depth(){return this._size.depth||0}get texture(){var e,t;return(t=(e=this._textures)==null?void 0:e[0])!=null?t:null}get textures(){return this._textures}get faceIndices(){return this._faceIndices}get layerIndices(){return this._layerIndices}getBaseArrayLayer(e){var n,r,o,h;if(!this._textures)return-1;const t=this._textures[e],i=(r=(n=this._layerIndices)==null?void 0:n[e])!=null?r:0,s=(h=(o=this._faceIndices)==null?void 0:o[e])!=null?h:0;return t.isCube?i*6+s:t.is3D?0:i}get samples(){return this._samples}setSamples(e,t=!0,i=!1){if(this.samples===e&&!i)return e;const s=this._isMulti?this._engine.updateMultipleRenderTargetTextureSampleCount(this,e,t):this._engine.updateRenderTargetTextureSampleCount(this,e);return this._samples=e,s}resolveMSAATextures(){this.isMulti?this._engine.resolveMultiFramebuffer(this):this._engine.resolveFramebuffer(this)}generateMipMaps(){this._engine._currentRenderTarget===this&&this._engine.unBindFramebuffer(this,!0),this.isMulti?this._engine.generateMipMapsMultiFramebuffer(this):this._engine.generateMipMapsFramebuffer(this)}constructor(e,t,i,s,n){this._textures=null,this._faceIndices=null,this._layerIndices=null,this._samples=1,this._attachments=null,this._generateStencilBuffer=!1,this._generateDepthBuffer=!1,this._depthStencilTextureWithStencil=!1,this.disableAutomaticMSAAResolve=!1,this.resolveMSAAColors=!0,this.resolveMSAADepth=!1,this.resolveMSAAStencil=!1,this._isMulti=e,this._isCube=t,this._size=i,this._engine=s,this._depthStencilTexture=null,this.label=n}setTextures(e){Array.isArray(e)?this._textures=e:e?this._textures=[e]:this._textures=null}setTexture(e,t=0,i=!0){this._textures||(this._textures=[]),this._textures[t]!==e&&(this._textures[t]&&i&&this._textures[t].dispose(),this._textures[t]=e)}setLayerAndFaceIndices(e,t){this._layerIndices=e,this._faceIndices=t}setLayerAndFaceIndex(e=0,t,i){this._layerIndices||(this._layerIndices=[]),this._faceIndices||(this._faceIndices=[]),t!==void 0&&t>=0&&(this._layerIndices[e]=t),i!==void 0&&i>=0&&(this._faceIndices[e]=i)}createDepthStencilTexture(e=0,t=!0,i=!1,s=1,n=14,r){var o;return(o=this._depthStencilTexture)==null||o.dispose(),this._depthStencilTextureWithStencil=i,this._depthStencilTextureLabel=r,this._depthStencilTexture=this._engine.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:i,isCube:this._isCube,samples:s,depthTextureFormat:n,label:r},this),this._depthStencilTexture}_shareDepth(e){this.shareDepth(e)}shareDepth(e){this._depthStencilTexture&&(e._depthStencilTexture&&e._depthStencilTexture.dispose(),e._depthStencilTexture=this._depthStencilTexture,e._depthStencilTextureWithStencil=this._depthStencilTextureWithStencil,this._depthStencilTexture.incrementReferences())}_swapAndDie(e){this.texture&&this.texture._swapAndDie(e),this._textures=null,this.dispose(!0)}_cloneRenderTargetWrapper(){var t,i,s,n,r,o,h,l;let e=null;if(this._isMulti){const c=this.textures;if(c&&c.length>0){let u=!1,f=c.length,d=-1;const _=c[c.length-1]._source;(_===14||_===12)&&(u=!0,d=c[c.length-1].format,f--);const p=[],g=[],m=[],b=[],I=[],T=[],x=[],y={};for(let C=0;C1&&e.setSamples(this.samples),e._swapRenderTargetWrapper(this),e.dispose()}}releaseTextures(){if(this._textures)for(let e=0;e1){const _=this._context;l=_["COLOR_ATTACHMENT"+t],e.is2DArray||e.is3D?(i=(u=i!=null?i:(c=this.layerIndices)==null?void 0:c[t])!=null?u:0,_.framebufferTextureLayer(_.FRAMEBUFFER,l,n.underlyingResource,s,i)):e.isCube?(i=(d=i!=null?i:(f=this.faceIndices)==null?void 0:f[t])!=null?d:0,_.framebufferTexture2D(_.FRAMEBUFFER,l,_.TEXTURE_CUBE_MAP_POSITIVE_X+i,n.underlyingResource,s)):_.framebufferTexture2D(_.FRAMEBUFFER,l,_.TEXTURE_2D,n.underlyingResource,s)}else{const _=this._context;l=_["COLOR_ATTACHMENT"+t+"_WEBGL"];const p=i!==void 0?_.TEXTURE_CUBE_MAP_POSITIVE_X+i:_.TEXTURE_2D;_.framebufferTexture2D(_.FRAMEBUFFER,l,p,n.underlyingResource,s)}if(e._autoMSAAManagement&&this._MSAAFramebuffer){const _=this._context;o._bindUnboundFramebuffer(this._MSAAFramebuffer),_.framebufferRenderbuffer(_.FRAMEBUFFER,l,_.RENDERBUFFER,n.getMSAARenderBuffer())}o._bindUnboundFramebuffer(h)}setTexture(e,t=0,i=!0){super.setTexture(e,t,i),this._bindTextureRenderTarget(e,t)}setLayerAndFaceIndices(e,t){var s,n;if(super.setLayerAndFaceIndices(e,t),!this.textures||!this.layerIndices||!this.faceIndices)return;const i=(n=(s=this._attachments)==null?void 0:s.length)!=null?n:this.textures.length;for(let r=0;r1){const m=r._hardwareTexture.getMSAARenderBuffer(0);t._MSAAFramebuffer=d.createFramebuffer(),this._bindUnboundFramebuffer(t._MSAAFramebuffer),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.RENDERBUFFER,m),this._bindUnboundFramebuffer(null)}return t};we.prototype._createDepthStencilTexture=function(a,e,t){var d;const i=this._gl,s=a.layers||0,n=a.depth||0;let r=i.TEXTURE_2D;s!==0?r=i.TEXTURE_2D_ARRAY:n!==0&&(r=i.TEXTURE_3D);const o=new ft(this,12);if(o.label=e.label,!this._caps.depthTextureExtension)return U.Error("Depth texture is not supported by your browser or hardware."),o;const h={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...e};if(this._bindTextureDirectly(r,o,!0),this._setupDepthStencilTexture(o,a,h.comparisonFunction===0?!1:h.bilinearFiltering,h.comparisonFunction,h.samples),h.depthTextureFormat!==void 0){if(h.depthTextureFormat!==15&&h.depthTextureFormat!==16&&h.depthTextureFormat!==17&&h.depthTextureFormat!==13&&h.depthTextureFormat!==14&&h.depthTextureFormat!==18)return U.Error("Depth texture ".concat(h.depthTextureFormat," format is not supported.")),o;o.format=h.depthTextureFormat}else o.format=h.generateStencil?13:16;const l=o.format===17||o.format===13||o.format===18,c=this._getWebGLTextureTypeFromDepthTextureFormat(o.format),u=l?i.DEPTH_STENCIL:i.DEPTH_COMPONENT,f=this._getInternalFormatFromDepthTextureFormat(o.format,!0,l);return o.is2DArray?i.texImage3D(r,0,f,o.width,o.height,s,0,u,c,null):o.is3D?i.texImage3D(r,0,f,o.width,o.height,n,0,u,c,null):i.texImage2D(r,0,f,o.width,o.height,0,u,c,null),this._bindTextureDirectly(r,null),this._internalTexturesCache.push(o),t._depthStencilBuffer&&(i.deleteRenderbuffer(t._depthStencilBuffer),t._depthStencilBuffer=null),this._bindUnboundFramebuffer((d=t._MSAAFramebuffer)!=null?d:t._framebuffer),t._generateStencilBuffer=l,t._depthStencilTextureWithStencil=l,t._depthStencilBuffer=this._setupFramebufferDepthAttachments(t._generateStencilBuffer,t._generateDepthBuffer,t.width,t.height,t.samples,o.format),this._bindUnboundFramebuffer(null),o};we.prototype.updateRenderTargetTextureSampleCount=function(a,e){var n,r;if(this.webGLVersion<2||!a)return 1;if(a.samples===e)return e;const t=this._gl;e=Math.min(e,this.getCaps().maxMSAASamples),a._depthStencilBuffer&&(t.deleteRenderbuffer(a._depthStencilBuffer),a._depthStencilBuffer=null),a._MSAAFramebuffer&&(t.deleteFramebuffer(a._MSAAFramebuffer),a._MSAAFramebuffer=null);const i=(n=a.texture)==null?void 0:n._hardwareTexture;if(i==null||i.releaseMSAARenderBuffers(),a.texture&&e>1&&typeof t.renderbufferStorageMultisample=="function"){const o=t.createFramebuffer();if(!o)throw new Error("Unable to create multi sampled framebuffer");a._MSAAFramebuffer=o,this._bindUnboundFramebuffer(a._MSAAFramebuffer);const h=this._createRenderBuffer(a.texture.width,a.texture.height,e,-1,this._getRGBABufferInternalSizedFormat(a.texture.type,a.texture.format,a.texture._useSRGBBuffer),t.COLOR_ATTACHMENT0,!1);if(!h)throw new Error("Unable to create multi sampled framebuffer");i==null||i.addMSAARenderBuffer(h)}this._bindUnboundFramebuffer((r=a._MSAAFramebuffer)!=null?r:a._framebuffer),a.texture&&(a.texture.samples=e),a._samples=e;const s=a._depthStencilTexture?a._depthStencilTexture.format:void 0;return a._depthStencilBuffer=this._setupFramebufferDepthAttachments(a._generateStencilBuffer,a._generateDepthBuffer,a.width,a.height,e,s),this._bindUnboundFramebuffer(null),e};we.prototype._setupDepthStencilTexture=function(a,e,t,i,s=1){var f,d;const n=(f=e.width)!=null?f:e,r=(d=e.height)!=null?d:e,o=e.layers||0,h=e.depth||0;a.baseWidth=n,a.baseHeight=r,a.width=n,a.height=r,a.is2DArray=o>0,a.depth=o||h,a.isReady=!0,a.samples=s,a.generateMipMaps=!1,a.samplingMode=t?2:1,a.type=0,a._comparisonFunction=i;const l=this._gl,c=this._getTextureTarget(a),u=this._getSamplingParameters(a.samplingMode,!1);l.texParameteri(c,l.TEXTURE_MAG_FILTER,u.mag),l.texParameteri(c,l.TEXTURE_MIN_FILTER,u.min),l.texParameteri(c,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(c,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),this.webGLVersion>1&&(i===0?(l.texParameteri(c,l.TEXTURE_COMPARE_FUNC,515),l.texParameteri(c,l.TEXTURE_COMPARE_MODE,l.NONE)):(l.texParameteri(c,l.TEXTURE_COMPARE_FUNC,i),l.texParameteri(c,l.TEXTURE_COMPARE_MODE,l.COMPARE_REF_TO_TEXTURE)))};we.prototype.setDepthStencilTexture=function(a,e,t,i){a!==void 0&&(e&&(this._boundUniforms[a]=e),!t||!t.depthStencilTexture?this._setTexture(a,null,void 0,void 0,i):this._setTexture(a,t,!1,!0,i))};we.prototype.createRenderTargetCubeTexture=function(a,e){const t=this._createHardwareRenderTargetWrapper(!1,!0,a),i={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,...e};i.generateStencilBuffer=i.generateDepthBuffer&&i.generateStencilBuffer,(i.type===1&&!this._caps.textureFloatLinearFiltering||i.type===2&&!this._caps.textureHalfFloatLinearFiltering)&&(i.samplingMode=1);const s=this._gl,n=new ft(this,5);this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,n,!0);const r=this._getSamplingParameters(i.samplingMode,i.generateMipMaps);i.type===1&&!this._caps.textureFloat&&(i.type=0,U.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,r.mag),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,r.min),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE);for(let h=0;h<6;h++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,this._getRGBABufferInternalSizedFormat(i.type,i.format),a,a,0,this._getInternalFormat(i.format),this._getWebGLTextureType(i.type),null);const o=s.createFramebuffer();return this._bindUnboundFramebuffer(o),t._depthStencilBuffer=this._setupFramebufferDepthAttachments(i.generateStencilBuffer,i.generateDepthBuffer,a,a),i.generateMipMaps&&s.generateMipmap(s.TEXTURE_CUBE_MAP),this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),t._framebuffer=o,t._generateDepthBuffer=i.generateDepthBuffer,t._generateStencilBuffer=i.generateStencilBuffer,n.width=a,n.height=a,n.isReady=!0,n.isCube=!0,n.samples=1,n.generateMipMaps=i.generateMipMaps,n.samplingMode=i.samplingMode,n.type=i.type,n.format=i.format,this._internalTexturesCache.push(n),t.setTextures(n),t};const zd=1/2.2,Wd=2.2,yt=(1+Math.sqrt(5))/2,Le=.001;function zi(a,e){const t=[];for(let i=0;i{const n=s.previous;if(!n)return;const r=s.next;r?(n.next=r,r.previous=n):(n.next=void 0,a[e]=n),s.next=void 0,s.previous=void 0}}const Kd=["push","splice","pop","shift","unshift"];function Ql(a,e){const t=Kd.map(i=>Hd(a,i,e));return()=>{t.forEach(i=>{i==null||i()})}}const Jl={};function vt(a,e){Jl[a]=e}function ys(a){return Jl[a]}function lt(a,e,t=1401298e-51){return Math.abs(a-e)<=t}function gt(a,e){return a===e?a:Math.random()*(e-a)+a}function Rr(a,e,t){return a+(e-a)*t}function Xd(a,e,t,i,s){const n=s*s,r=s*n,o=2*r-3*n+1,h=-2*r+3*n,l=r-2*n+s,c=r-n;return a*o+t*h+e*l+i*c}function ht(a,e=0,t=1){return Math.min(t,Math.max(e,a))}function Yd(a){return a-=Math.PI*2*Math.floor((a+Math.PI)/(Math.PI*2)),a}function Ui(a){const e=a.toString(16);return a<=15?("0"+e).toUpperCase():e.toUpperCase()}function ec(a){if(Math.log2)return Math.floor(Math.log2(a));if(a<0)return NaN;if(a===0)return-1/0;let e=0;if(a<1){for(;a<1;)e++,a=a*2;e=-e}else if(a>1)for(;a>1;)e++,a=Math.floor(a/2);return e}function Ba(a,e){const t=a%e;return t===0?e:Ba(e,t)}const $t=a=>parseInt(a.toString().replace(/\W/g,""));class oe{constructor(e=0,t=0){this.x=e,this.y=t}toString(){return"{X: ".concat(this.x," Y: ").concat(this.y,"}")}getClassName(){return"Vector2"}getHashCode(){const e=$t(this.x),t=$t(this.y);let i=e;return i=i*397^t,i}toArray(e,t=0){return e[t]=this.x,e[t+1]=this.y,this}fromArray(e,t=0){return oe.FromArrayToRef(e,t,this),this}asArray(){return[this.x,this.y]}copyFrom(e){return this.x=e.x,this.y=e.y,this}copyFromFloats(e,t){return this.x=e,this.y=t,this}set(e,t){return this.copyFromFloats(e,t)}setAll(e){return this.copyFromFloats(e,e)}add(e){return new oe(this.x+e.x,this.y+e.y)}addToRef(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,t}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}addInPlaceFromFloats(e,t){return this.x+=e,this.y+=t,this}addVector3(e){return new oe(this.x+e.x,this.y+e.y)}subtract(e){return new oe(this.x-e.x,this.y-e.y)}subtractToRef(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,t}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this}multiply(e){return new oe(this.x*e.x,this.y*e.y)}multiplyToRef(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,t}multiplyByFloats(e,t){return new oe(this.x*e,this.y*t)}divide(e){return new oe(this.x/e.x,this.y/e.y)}divideToRef(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,t}divideInPlace(e){return this.x=this.x/e.x,this.y=this.y/e.y,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e.x,e.y)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e.x,e.y)}minimizeInPlaceFromFloats(e,t){return this.x=Math.min(e,this.x),this.y=Math.min(t,this.y),this}maximizeInPlaceFromFloats(e,t){return this.x=Math.max(e,this.x),this.y=Math.max(t,this.y),this}subtractFromFloats(e,t){return new oe(this.x-e,this.y-t)}subtractFromFloatsToRef(e,t,i){return i.x=this.x-e,i.y=this.y-t,i}negate(){return new oe(-this.x,-this.y)}negateInPlace(){return this.x*=-1,this.y*=-1,this}negateToRef(e){return e.x=-this.x,e.y=-this.y,e}scaleInPlace(e){return this.x*=e,this.y*=e,this}scale(e){return new oe(this.x*e,this.y*e)}scaleToRef(e,t){return t.x=this.x*e,t.y=this.y*e,t}scaleAndAddToRef(e,t){return t.x+=this.x*e,t.y+=this.y*e,t}equals(e){return e&&this.x===e.x&&this.y===e.y}equalsWithEpsilon(e,t=Le){return e&<(this.x,e.x,t)&<(this.y,e.y,t)}equalsToFloats(e,t){return this.x===e&&this.y===t}floor(){return new oe(Math.floor(this.x),Math.floor(this.y))}floorToRef(e){return e.x=Math.floor(this.x),e.y=Math.floor(this.y),e}fract(){return new oe(this.x-Math.floor(this.x),this.y-Math.floor(this.y))}fractToRef(e){return e.x=this.x-Math.floor(this.x),e.y=this.y-Math.floor(this.y),e}rotateToRef(e,t){const i=Math.cos(e),s=Math.sin(e),n=i*this.x-s*this.y,r=s*this.x+i*this.y;return t.x=n,t.y=r,t}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){const e=new oe;return this.normalizeToRef(e),e}normalizeToRef(e){const t=this.length();return t===0&&(e.x=this.x,e.y=this.y),this.scaleToRef(1/t,e)}clone(){return new oe(this.x,this.y)}dot(e){return this.x*e.x+this.y*e.y}static Zero(){return new oe(0,0)}static One(){return new oe(1,1)}static Random(e=0,t=1){return new oe(gt(e,t),gt(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(gt(e,t),gt(e,t))}static get ZeroReadOnly(){return oe._ZeroReadOnly}static FromArray(e,t=0){return new oe(e[t],e[t+1])}static FromArrayToRef(e,t,i){return i.x=e[t],i.y=e[t+1],i}static FromFloatsToRef(e,t,i){return i.copyFromFloats(e,t),i}static CatmullRom(e,t,i,s,n){const r=n*n,o=n*r,h=.5*(2*t.x+(-e.x+i.x)*n+(2*e.x-5*t.x+4*i.x-s.x)*r+(-e.x+3*t.x-3*i.x+s.x)*o),l=.5*(2*t.y+(-e.y+i.y)*n+(2*e.y-5*t.y+4*i.y-s.y)*r+(-e.y+3*t.y-3*i.y+s.y)*o);return new oe(h,l)}static ClampToRef(e,t,i,s){return s.x=ht(e.x,t.x,i.x),s.y=ht(e.y,t.y,i.y),s}static Clamp(e,t,i){const s=ht(e.x,t.x,i.x),n=ht(e.y,t.y,i.y);return new oe(s,n)}static Hermite(e,t,i,s,n){const r=n*n,o=n*r,h=2*o-3*r+1,l=-2*o+3*r,c=o-2*r+n,u=o-r,f=e.x*h+i.x*l+t.x*c+s.x*u,d=e.y*h+i.y*l+t.y*c+s.y*u;return new oe(f,d)}static Hermite1stDerivative(e,t,i,s,n){return this.Hermite1stDerivativeToRef(e,t,i,s,n,new oe)}static Hermite1stDerivativeToRef(e,t,i,s,n,r){const o=n*n;return r.x=(o-n)*6*e.x+(3*o-4*n+1)*t.x+(-o+n)*6*i.x+(3*o-2*n)*s.x,r.y=(o-n)*6*e.y+(3*o-4*n+1)*t.y+(-o+n)*6*i.y+(3*o-2*n)*s.y,r}static Lerp(e,t,i){return oe.LerpToRef(e,t,i,new oe)}static LerpToRef(e,t,i,s){return s.x=e.x+(t.x-e.x)*i,s.y=e.y+(t.y-e.y)*i,s}static Dot(e,t){return e.x*t.x+e.y*t.y}static Normalize(e){return oe.NormalizeToRef(e,new oe)}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Minimize(e,t){const i=e.xt.x?e.x:t.x,s=e.y>t.y?e.y:t.y;return new oe(i,s)}static Transform(e,t){return oe.TransformToRef(e,t,new oe)}static TransformToRef(e,t,i){const s=t.m,n=e.x*s[0]+e.y*s[4]+s[12],r=e.x*s[1]+e.y*s[5]+s[13];return i.x=n,i.y=r,i}static PointInTriangle(e,t,i,s){const n=.5*(-i.y*s.x+t.y*(-i.x+s.x)+t.x*(i.y-s.y)+i.x*s.y),r=n<0?-1:1,o=(t.y*s.x-t.x*s.y+(s.y-t.y)*e.x+(t.x-s.x)*e.y)*r,h=(t.x*i.y-t.y*i.x+(t.y-i.y)*e.x+(i.x-t.x)*e.y)*r;return o>0&&h>0&&o+h<2*n*r}static Distance(e,t){return Math.sqrt(oe.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y;return i*i+s*s}static Center(e,t){return oe.CenterToRef(e,t,new oe)}static CenterToRef(e,t,i){return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2)}static DistanceOfPointFromSegment(e,t,i){const s=oe.DistanceSquared(t,i);if(s===0)return oe.Distance(e,t);const n=i.subtract(t),r=Math.max(0,Math.min(1,oe.Dot(e.subtract(t),n)/s)),o=t.add(n.multiplyByFloats(r,r));return oe.Distance(e,o)}}oe._V8PerformanceHack=new oe(.5,.5);oe._ZeroReadOnly=oe.Zero();Object.defineProperties(oe.prototype,{dimension:{value:[2]},rank:{value:1}});class v{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}constructor(e=0,t=0,i=0){this._isDirty=!0,this._x=e,this._y=t,this._z=i}toString(){return"{X: ".concat(this._x," Y: ").concat(this._y," Z: ").concat(this._z,"}")}getClassName(){return"Vector3"}getHashCode(){const e=$t(this._x),t=$t(this._y),i=$t(this._z);let s=e;return s=s*397^t,s=s*397^i,s}asArray(){return[this._x,this._y,this._z]}toArray(e,t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,this}fromArray(e,t=0){return v.FromArrayToRef(e,t,this),this}toQuaternion(){return re.RotationYawPitchRoll(this._y,this._x,this._z)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._isDirty=!0,this}addInPlaceFromFloats(e,t,i){return this._x+=e,this._y+=t,this._z+=i,this._isDirty=!0,this}add(e){return new v(this._x+e._x,this._y+e._y,this._z+e._z)}addToRef(e,t){return t._x=this._x+e._x,t._y=this._y+e._y,t._z=this._z+e._z,t._isDirty=!0,t}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._isDirty=!0,this}subtract(e){return new v(this._x-e._x,this._y-e._y,this._z-e._z)}subtractToRef(e,t){return this.subtractFromFloatsToRef(e._x,e._y,e._z,t)}subtractFromFloats(e,t,i){return new v(this._x-e,this._y-t,this._z-i)}subtractFromFloatsToRef(e,t,i,s){return s._x=this._x-e,s._y=this._y-t,s._z=this._z-i,s._isDirty=!0,s}negate(){return new v(-this._x,-this._y,-this._z)}negateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}negateToRef(e){return e._x=this._x*-1,e._y=this._y*-1,e._z=this._z*-1,e._isDirty=!0,e}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._isDirty=!0,this}scale(e){return new v(this._x*e,this._y*e,this._z*e)}scaleToRef(e,t){return t._x=this._x*e,t._y=this._y*e,t._z=this._z*e,t._isDirty=!0,t}getNormalToRef(e){const t=this.length();let i=Math.acos(this.y/t);const s=Math.atan2(this.z,this.x);i>Math.PI/2?i-=Math.PI/2:i+=Math.PI/2;const n=t*Math.sin(i)*Math.cos(s),r=t*Math.cos(i),o=t*Math.sin(i)*Math.sin(s);return e.set(n,r,o),e}applyRotationQuaternionToRef(e,t){const i=this._x,s=this._y,n=this._z,r=e._x,o=e._y,h=e._z,l=e._w,c=2*(o*n-h*s),u=2*(h*i-r*n),f=2*(r*s-o*i);return t._x=i+l*c+o*f-h*u,t._y=s+l*u+h*c-r*f,t._z=n+l*f+r*u-o*c,t._isDirty=!0,t}applyRotationQuaternionInPlace(e){return this.applyRotationQuaternionToRef(e,this)}applyRotationQuaternion(e){return this.applyRotationQuaternionToRef(e,new v)}scaleAndAddToRef(e,t){return t._x+=this._x*e,t._y+=this._y*e,t._z+=this._z*e,t._isDirty=!0,t}projectOnPlane(e,t){return this.projectOnPlaneToRef(e,t,new v)}projectOnPlaneToRef(e,t,i){const s=e.normal,n=e.d,r=_e.Vector3[0];this.subtractToRef(t,r),r.normalize();const o=v.Dot(r,s);if(Math.abs(o)<1e-10)i.setAll(1/0);else{const h=-(v.Dot(t,s)+n)/o,l=r.scaleInPlace(h);t.addToRef(l,i)}return i}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z}equalsWithEpsilon(e,t=Le){return e&<(this._x,e._x,t)&<(this._y,e._y,t)&<(this._z,e._z,t)}equalsToFloats(e,t,i){return this._x===e&&this._y===t&&this._z===i}multiplyInPlace(e){return this._x*=e._x,this._y*=e._y,this._z*=e._z,this._isDirty=!0,this}multiply(e){return this.multiplyByFloats(e._x,e._y,e._z)}multiplyToRef(e,t){return t._x=this._x*e._x,t._y=this._y*e._y,t._z=this._z*e._z,t._isDirty=!0,t}multiplyByFloats(e,t,i){return new v(this._x*e,this._y*t,this._z*i)}divide(e){return new v(this._x/e._x,this._y/e._y,this._z/e._z)}divideToRef(e,t){return t._x=this._x/e._x,t._y=this._y/e._y,t._z=this._z/e._z,t._isDirty=!0,t}divideInPlace(e){return this._x=this._x/e._x,this._y=this._y/e._y,this._z=this._z/e._z,this._isDirty=!0,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e._x,e._y,e._z)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e._x,e._y,e._z)}minimizeInPlaceFromFloats(e,t,i){return ethis._x&&(this.x=e),t>this._y&&(this.y=t),i>this._z&&(this.z=i),this}isNonUniformWithinEpsilon(e){const t=Math.abs(this._x),i=Math.abs(this._y);if(!lt(t,i,e))return!0;const s=Math.abs(this._z);return!lt(t,s,e)||!lt(i,s,e)}get isNonUniform(){const e=Math.abs(this._x),t=Math.abs(this._y);if(e!==t)return!0;const i=Math.abs(this._z);return e!==i}floorToRef(e){return e._x=Math.floor(this._x),e._y=Math.floor(this._y),e._z=Math.floor(this._z),e._isDirty=!0,e}floor(){return new v(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z))}fractToRef(e){return e._x=this.x-Math.floor(this._x),e._y=this.y-Math.floor(this._y),e._z=this.z-Math.floor(this._z),e._isDirty=!0,e}fract(){return new v(this.x-Math.floor(this._x),this.y-Math.floor(this._y),this.z-Math.floor(this._z))}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z}get hasAZeroComponent(){return this._x*this._y*this._z===0}normalize(){return this.normalizeFromLength(this.length())}reorderInPlace(e){if(e=e.toLowerCase(),e==="xyz")return this;const t=_e.Vector3[0].copyFrom(this);return this.x=t[e[0]],this.y=t[e[1]],this.z=t[e[2]],this}rotateByQuaternionToRef(e,t){return e.toRotationMatrix(_e.Matrix[0]),v.TransformCoordinatesToRef(this,_e.Matrix[0],t),t}rotateByQuaternionAroundPointToRef(e,t,i){return this.subtractToRef(t,_e.Vector3[0]),_e.Vector3[0].rotateByQuaternionToRef(e,_e.Vector3[0]),t.addToRef(_e.Vector3[0],i),i}cross(e){return v.CrossToRef(this,e,new v)}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new v)}normalizeToRef(e){const t=this.length();return t===0||t===1?(e._x=this._x,e._y=this._y,e._z=this._z,e._isDirty=!0,e):this.scaleToRef(1/t,e)}clone(){return new v(this._x,this._y,this._z)}copyFrom(e){return this.copyFromFloats(e._x,e._y,e._z)}copyFromFloats(e,t,i){return this._x=e,this._y=t,this._z=i,this._isDirty=!0,this}set(e,t,i){return this.copyFromFloats(e,t,i)}setAll(e){return this._x=this._y=this._z=e,this._isDirty=!0,this}static GetClipFactor(e,t,i,s){const n=v.Dot(e,i),r=v.Dot(t,i);return(n-s)/(n-r)}static GetAngleBetweenVectors(e,t,i){const s=e.normalizeToRef(_e.Vector3[1]),n=t.normalizeToRef(_e.Vector3[2]);let r=v.Dot(s,n);r=ht(r,-1,1);const o=Math.acos(r),h=_e.Vector3[3];return v.CrossToRef(s,n,h),v.Dot(h,i)>0?isNaN(o)?0:o:isNaN(o)?-Math.PI:-Math.acos(r)}static GetAngleBetweenVectorsOnPlane(e,t,i){_e.Vector3[0].copyFrom(e);const s=_e.Vector3[0];_e.Vector3[1].copyFrom(t);const n=_e.Vector3[1];_e.Vector3[2].copyFrom(i);const r=_e.Vector3[2],o=_e.Vector3[3],h=_e.Vector3[4];s.normalize(),n.normalize(),r.normalize(),v.CrossToRef(r,s,o),v.CrossToRef(o,r,h);const l=Math.atan2(v.Dot(n,o),v.Dot(n,h));return Yd(l)}static PitchYawRollToMoveBetweenPointsToRef(e,t,i){const s=N.Vector3[0];return t.subtractToRef(e,s),i._y=Math.atan2(s.x,s.z)||0,i._x=Math.atan2(Math.sqrt(s.x**2+s.z**2),s.y)||0,i._z=0,i._isDirty=!0,i}static PitchYawRollToMoveBetweenPoints(e,t){const i=v.Zero();return v.PitchYawRollToMoveBetweenPointsToRef(e,t,i)}static SlerpToRef(e,t,i,s){i=ht(i,0,1);const n=_e.Vector3[0],r=_e.Vector3[1];n.copyFrom(e);const o=n.length();n.normalizeFromLength(o),r.copyFrom(t);const h=r.length();r.normalizeFromLength(h);const l=v.Dot(n,r);let c,u;if(l<1-Le){const f=Math.acos(l),d=1/Math.sin(f);c=Math.sin((1-i)*f)*d,u=Math.sin(i*f)*d}else c=1-i,u=i;return n.scaleInPlace(c),r.scaleInPlace(u),s.copyFrom(n).addInPlace(r),s.scaleInPlace(Rr(o,h,i)),s}static SmoothToRef(e,t,i,s,n){return v.SlerpToRef(e,t,s===0?1:i/s,n),n}static FromArray(e,t=0){return new v(e[t],e[t+1],e[t+2])}static FromFloatArray(e,t){return v.FromArray(e,t)}static FromArrayToRef(e,t,i){return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._isDirty=!0,i}static FromFloatArrayToRef(e,t,i){return v.FromArrayToRef(e,t,i)}static FromFloatsToRef(e,t,i,s){return s.copyFromFloats(e,t,i),s}static Zero(){return new v(0,0,0)}static One(){return new v(1,1,1)}static Up(){return new v(0,1,0)}static get UpReadOnly(){return v._UpReadOnly}static get DownReadOnly(){return v._DownReadOnly}static get RightReadOnly(){return v._RightReadOnly}static get LeftReadOnly(){return v._LeftReadOnly}static get LeftHandedForwardReadOnly(){return v._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){return v._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){return v._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){return v._RightHandedBackwardReadOnly}static get ZeroReadOnly(){return v._ZeroReadOnly}static get OneReadOnly(){return v._OneReadOnly}static Down(){return new v(0,-1,0)}static Forward(e=!1){return new v(0,0,e?-1:1)}static Backward(e=!1){return new v(0,0,e?1:-1)}static Right(){return new v(1,0,0)}static Left(){return new v(-1,0,0)}static Random(e=0,t=1){return new v(gt(e,t),gt(e,t),gt(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(gt(e,t),gt(e,t),gt(e,t))}static TransformCoordinates(e,t){const i=v.Zero();return v.TransformCoordinatesToRef(e,t,i),i}static TransformCoordinatesToRef(e,t,i){return v.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformCoordinatesFromFloatsToRef(e,t,i,s,n){const r=s.m,o=e*r[0]+t*r[4]+i*r[8]+r[12],h=e*r[1]+t*r[5]+i*r[9]+r[13],l=e*r[2]+t*r[6]+i*r[10]+r[14],c=1/(e*r[3]+t*r[7]+i*r[11]+r[15]);return n._x=o*c,n._y=h*c,n._z=l*c,n._isDirty=!0,n}static TransformNormal(e,t){const i=v.Zero();return v.TransformNormalToRef(e,t,i),i}static TransformNormalToRef(e,t,i){return this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformNormalFromFloatsToRef(e,t,i,s,n){const r=s.m;return n._x=e*r[0]+t*r[4]+i*r[8],n._y=e*r[1]+t*r[5]+i*r[9],n._z=e*r[2]+t*r[6]+i*r[10],n._isDirty=!0,n}static CatmullRom(e,t,i,s,n){const r=n*n,o=n*r,h=.5*(2*t._x+(-e._x+i._x)*n+(2*e._x-5*t._x+4*i._x-s._x)*r+(-e._x+3*t._x-3*i._x+s._x)*o),l=.5*(2*t._y+(-e._y+i._y)*n+(2*e._y-5*t._y+4*i._y-s._y)*r+(-e._y+3*t._y-3*i._y+s._y)*o),c=.5*(2*t._z+(-e._z+i._z)*n+(2*e._z-5*t._z+4*i._z-s._z)*r+(-e._z+3*t._z-3*i._z+s._z)*o);return new v(h,l,c)}static Clamp(e,t,i){const s=new v;return v.ClampToRef(e,t,i,s),s}static ClampToRef(e,t,i,s){let n=e._x;n=n>i._x?i._x:n,n=ni._y?i._y:r,r=ri._z?i._z:o,o=o0&&S<0?(P.copyFrom(r),G=t,L=i):S>0&&w<0?(P.copyFrom(h),G=i,L=s):(P.copyFrom(o).scaleInPlace(-1),G=s,L=t);const W=_e.Vector3[9],K=_e.Vector3[4];if(G.subtractToRef(b,y),L.subtractToRef(b,W),v.CrossToRef(y,W,K),!(v.Dot(K,l)<0))return n.copyFrom(b),Math.abs(p*g);const $=_e.Vector3[5];v.CrossToRef(P,K,$),$.normalize();const z=_e.Vector3[9];z.copyFrom(G).subtractInPlace(b);const k=z.length();if(kthis.x&&(this.x=e.x),e.y>this.y&&(this.y=e.y),e.z>this.z&&(this.z=e.z),e.w>this.w&&(this.w=e.w),this}minimizeInPlaceFromFloats(e,t,i,s){return this.x=Math.min(e,this.x),this.y=Math.min(t,this.y),this.z=Math.min(i,this.z),this.w=Math.min(s,this.w),this}maximizeInPlaceFromFloats(e,t,i,s){return this.x=Math.max(e,this.x),this.y=Math.max(t,this.y),this.z=Math.max(i,this.z),this.w=Math.max(s,this.w),this}floorToRef(e){return e.x=Math.floor(this.x),e.y=Math.floor(this.y),e.z=Math.floor(this.z),e.w=Math.floor(this.w),e}floor(){return new Pe(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))}fractToRef(e){return e.x=this.x-Math.floor(this.x),e.y=this.y-Math.floor(this.y),e.z=this.z-Math.floor(this.z),e.w=this.w-Math.floor(this.w),e}fract(){return new Pe(this.x-Math.floor(this.x),this.y-Math.floor(this.y),this.z-Math.floor(this.z),this.w-Math.floor(this.w))}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}lengthSquared(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new Pe)}normalizeToRef(e){const t=this.length();return t===0||t===1?(e.x=this.x,e.y=this.y,e.z=this.z,e.w=this.w,e):this.scaleToRef(1/t,e)}toVector3(){return new v(this.x,this.y,this.z)}clone(){return new Pe(this.x,this.y,this.z,this.w)}copyFrom(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}copyFromFloats(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}setAll(e){return this.x=this.y=this.z=this.w=e,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}static FromArray(e,t){return t||(t=0),new Pe(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,i){return i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i}static FromFloatArrayToRef(e,t,i){return Pe.FromArrayToRef(e,t,i),i}static FromFloatsToRef(e,t,i,s,n){return n.x=e,n.y=t,n.z=i,n.w=s,n}static Zero(){return new Pe(0,0,0,0)}static One(){return new Pe(1,1,1,1)}static Random(e=0,t=1){return new Pe(gt(e,t),gt(e,t),gt(e,t),gt(e,t))}static RandomToRef(e=0,t=1,i){return i.x=gt(e,t),i.y=gt(e,t),i.z=gt(e,t),i.w=gt(e,t),i}static Clamp(e,t,i){return Pe.ClampToRef(e,t,i,new Pe)}static ClampToRef(e,t,i,s){return s.x=ht(e.x,t.x,i.x),s.y=ht(e.y,t.y,i.y),s.z=ht(e.z,t.z,i.z),s.w=ht(e.w,t.w,i.w),s}static CheckExtends(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)}static get ZeroReadOnly(){return Pe._ZeroReadOnly}static Normalize(e){return Pe.NormalizeToRef(e,new Pe)}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Minimize(e,t){const i=new Pe;return i.copyFrom(e),i.minimizeInPlace(t),i}static Maximize(e,t){const i=new Pe;return i.copyFrom(e),i.maximizeInPlace(t),i}static Distance(e,t){return Math.sqrt(Pe.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y,n=e.z-t.z,r=e.w-t.w;return i*i+s*s+n*n+r*r}static Center(e,t){return Pe.CenterToRef(e,t,new Pe)}static CenterToRef(e,t,i){return i.x=(e.x+t.x)/2,i.y=(e.y+t.y)/2,i.z=(e.z+t.z)/2,i.w=(e.w+t.w)/2,i}static TransformCoordinates(e,t){return Pe.TransformCoordinatesToRef(e,t,new Pe)}static TransformCoordinatesToRef(e,t,i){return Pe.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformCoordinatesFromFloatsToRef(e,t,i,s,n){const r=s.m,o=e*r[0]+t*r[4]+i*r[8]+r[12],h=e*r[1]+t*r[5]+i*r[9]+r[13],l=e*r[2]+t*r[6]+i*r[10]+r[14],c=e*r[3]+t*r[7]+i*r[11]+r[15];return n.x=o,n.y=h,n.z=l,n.w=c,n}static TransformNormal(e,t){return Pe.TransformNormalToRef(e,t,new Pe)}static TransformNormalToRef(e,t,i){const s=t.m,n=e.x*s[0]+e.y*s[4]+e.z*s[8],r=e.x*s[1]+e.y*s[5]+e.z*s[9],o=e.x*s[2]+e.y*s[6]+e.z*s[10];return i.x=n,i.y=r,i.z=o,i.w=e.w,i}static TransformNormalFromFloatsToRef(e,t,i,s,n,r){const o=n.m;return r.x=e*o[0]+t*o[4]+i*o[8],r.y=e*o[1]+t*o[5]+i*o[9],r.z=e*o[2]+t*o[6]+i*o[10],r.w=s,r}static FromVector3(e,t=0){return new Pe(e._x,e._y,e._z,t)}static Dot(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w}}Pe._V8PerformanceHack=new Pe(.5,.5,.5,.5);Pe._ZeroReadOnly=Pe.Zero();Object.defineProperties(Pe.prototype,{dimension:{value:[4]},rank:{value:1}});class re{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}get w(){return this._w}set w(e){this._w=e,this._isDirty=!0}constructor(e=0,t=0,i=0,s=1){this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=s}toString(){return"{X: ".concat(this._x," Y: ").concat(this._y," Z: ").concat(this._z," W: ").concat(this._w,"}")}getClassName(){return"Quaternion"}getHashCode(){const e=$t(this._x),t=$t(this._y),i=$t(this._z),s=$t(this._w);let n=e;return n=n*397^t,n=n*397^i,n=n*397^s,n}asArray(){return[this._x,this._y,this._z,this._w]}toArray(e,t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,this}fromArray(e,t=0){return re.FromArrayToRef(e,t,this)}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w}equalsWithEpsilon(e,t=Le){return e&<(this._x,e._x,t)&<(this._y,e._y,t)&<(this._z,e._z,t)&<(this._w,e._w,t)}clone(){return new re(this._x,this._y,this._z,this._w)}copyFrom(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._w=e._w,this._isDirty=!0,this}copyFromFloats(e,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._isDirty=!0,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}setAll(e){return this.copyFromFloats(e,e,e,e)}add(e){return new re(this._x+e._x,this._y+e._y,this._z+e._z,this._w+e._w)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this._isDirty=!0,this}addToRef(e,t){return t._x=this._x+e._x,t._y=this._y+e._y,t._z=this._z+e._z,t._w=this._w+e._w,t._isDirty=!0,t}addInPlaceFromFloats(e,t,i,s){return this._x+=e,this._y+=t,this._z+=i,this._w+=s,this._isDirty=!0,this}subtractToRef(e,t){return t._x=this._x-e._x,t._y=this._y-e._y,t._z=this._z-e._z,t._w=this._w-e._w,t._isDirty=!0,t}subtractFromFloats(e,t,i,s){return this.subtractFromFloatsToRef(e,t,i,s,new re)}subtractFromFloatsToRef(e,t,i,s,n){return n._x=this._x-e,n._y=this._y-t,n._z=this._z-i,n._w=this._w-s,n._isDirty=!0,n}subtract(e){return new re(this._x-e._x,this._y-e._y,this._z-e._z,this._w-e._w)}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._w-=e._w,this._isDirty=!0,this}scale(e){return new re(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,t){return t._x=this._x*e,t._y=this._y*e,t._z=this._z*e,t._w=this._w*e,t._isDirty=!0,t}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._w*=e,this._isDirty=!0,this}scaleAndAddToRef(e,t){return t._x+=this._x*e,t._y+=this._y*e,t._z+=this._z*e,t._w+=this._w*e,t._isDirty=!0,t}multiply(e){const t=new re(0,0,0,1);return this.multiplyToRef(e,t),t}multiplyToRef(e,t){const i=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,s=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,n=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,r=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return t.copyFromFloats(i,s,n,r),t}multiplyInPlace(e){return this.multiplyToRef(e,this)}multiplyByFloats(e,t,i,s){return this._x*=e,this._y*=t,this._z*=i,this._w*=s,this._isDirty=!0,this}divide(e){throw new ReferenceError("Can not divide a quaternion")}divideToRef(e,t){throw new ReferenceError("Can not divide a quaternion")}divideInPlace(e){throw new ReferenceError("Can not divide a quaternion")}minimizeInPlace(){throw new ReferenceError("Can not minimize a quaternion")}minimizeInPlaceFromFloats(){throw new ReferenceError("Can not minimize a quaternion")}maximizeInPlace(){throw new ReferenceError("Can not maximize a quaternion")}maximizeInPlaceFromFloats(){throw new ReferenceError("Can not maximize a quaternion")}negate(){return this.negateToRef(new re)}negateInPlace(){return this._x=-this._x,this._y=-this._y,this._z=-this._z,this._w=-this._w,this._isDirty=!0,this}negateToRef(e){return e._x=-this._x,e._y=-this._y,e._z=-this._z,e._w=-this._w,e._isDirty=!0,e}equalsToFloats(e,t,i,s){return this._x===e&&this._y===t&&this._z===i&&this._w===s}floorToRef(e){throw new ReferenceError("Can not floor a quaternion")}floor(){throw new ReferenceError("Can not floor a quaternion")}fractToRef(e){throw new ReferenceError("Can not fract a quaternion")}fract(){throw new ReferenceError("Can not fract a quaternion")}conjugateToRef(e){return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),e}conjugateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}conjugate(){return new re(-this._x,-this._y,-this._z,this._w)}invert(){const e=this.conjugate(),t=this.lengthSquared();return t==0||t==1||e.scaleInPlace(1/t),e}invertInPlace(){this.conjugateInPlace();const e=this.lengthSquared();return e==0||e==1?this:(this.scaleInPlace(1/e),this)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this.lengthSquared())}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){const e=new re(0,0,0,1);return this.normalizeToRef(e),e}normalizeToRef(e){const t=this.length();return t===0||t===1?e.copyFromFloats(this._x,this._y,this._z,this._w):this.scaleToRef(1/t,e)}toEulerAngles(){const e=v.Zero();return this.toEulerAnglesToRef(e),e}toEulerAnglesToRef(e){const t=this._z,i=this._x,s=this._y,n=this._w,r=s*t-i*n,o=.4999999;if(r<-.4999999)e._y=2*Math.atan2(s,n),e._x=Math.PI/2,e._z=0,e._isDirty=!0;else if(r>o)e._y=2*Math.atan2(s,n),e._x=-Math.PI/2,e._z=0,e._isDirty=!0;else{const h=n*n,l=t*t,c=i*i,u=s*s;e._z=Math.atan2(2*(i*s+t*n),-l-c+u+h),e._x=Math.asin(-2*r),e._y=Math.atan2(2*(t*i+s*n),l-c-u+h),e._isDirty=!0}return e}toAlphaBetaGammaToRef(e){const t=this._z,i=this._x,s=this._y,n=this._w,r=Math.sqrt(i*i+s*s),o=Math.sqrt(t*t+n*n),h=2*Math.atan2(r,o),l=2*Math.atan2(t,n),c=2*Math.atan2(s,i),u=(l+c)/2,f=(l-c)/2;return e.set(f,h,u),e}toRotationMatrix(e){return O.FromQuaternionToRef(this,e),e}fromRotationMatrix(e){return re.FromRotationMatrixToRef(e,this),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}static FromRotationMatrix(e){const t=new re;return re.FromRotationMatrixToRef(e,t),t}static FromRotationMatrixToRef(e,t){const i=e.m,s=i[0],n=i[4],r=i[8],o=i[1],h=i[5],l=i[9],c=i[2],u=i[6],f=i[10],d=s+h+f;let _;return d>0?(_=.5/Math.sqrt(d+1),t._w=.25/_,t._x=(u-l)*_,t._y=(r-c)*_,t._z=(o-n)*_,t._isDirty=!0):s>h&&s>f?(_=2*Math.sqrt(1+s-h-f),t._w=(u-l)/_,t._x=.25*_,t._y=(n+o)/_,t._z=(r+c)/_,t._isDirty=!0):h>f?(_=2*Math.sqrt(1+h-s-f),t._w=(r-c)/_,t._x=(n+o)/_,t._y=.25*_,t._z=(l+u)/_,t._isDirty=!0):(_=2*Math.sqrt(1+f-s-h),t._w=(o-n)/_,t._x=(r+c)/_,t._y=(l+u)/_,t._z=.25*_,t._isDirty=!0),t}static Dot(e,t){return e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w}static AreClose(e,t,i=.1){const s=re.Dot(e,t);return 1-s*s<=i}static SmoothToRef(e,t,i,s,n){let r=s===0?1:i/s;return r=ht(r,0,1),re.SlerpToRef(e,t,r,n),n}static Zero(){return new re(0,0,0,0)}static Inverse(e){return new re(-e._x,-e._y,-e._z,e._w)}static InverseToRef(e,t){return t.set(-e._x,-e._y,-e._z,e._w),t}static Identity(){return new re(0,0,0,1)}static IsIdentity(e){return e&&e._x===0&&e._y===0&&e._z===0&&e._w===1}static RotationAxis(e,t){return re.RotationAxisToRef(e,t,new re)}static RotationAxisToRef(e,t,i){i._w=Math.cos(t/2);const s=Math.sin(t/2)/e.length();return i._x=e._x*s,i._y=e._y*s,i._z=e._z*s,i._isDirty=!0,i}static FromArray(e,t){return t||(t=0),new re(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,i){return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._w=e[t+3],i._isDirty=!0,i}static FromFloatsToRef(e,t,i,s,n){return n.copyFromFloats(e,t,i,s),n}static FromEulerAngles(e,t,i){const s=new re;return re.RotationYawPitchRollToRef(t,e,i,s),s}static FromEulerAnglesToRef(e,t,i,s){return re.RotationYawPitchRollToRef(t,e,i,s),s}static FromEulerVector(e){const t=new re;return re.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromEulerVectorToRef(e,t){return re.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromUnitVectorsToRef(e,t,i,s=Le){const n=v.Dot(e,t)+1;return nMath.abs(e.z)?i.set(-e.y,e.x,0,0):i.set(0,-e.z,e.y,0):(v.CrossToRef(e,t,N.Vector3[0]),i.set(N.Vector3[0].x,N.Vector3[0].y,N.Vector3[0].z,n)),i.normalize()}static RotationYawPitchRoll(e,t,i){const s=new re;return re.RotationYawPitchRollToRef(e,t,i,s),s}static RotationYawPitchRollToRef(e,t,i,s){const n=i*.5,r=t*.5,o=e*.5,h=Math.sin(n),l=Math.cos(n),c=Math.sin(r),u=Math.cos(r),f=Math.sin(o),d=Math.cos(o);return s._x=d*c*l+f*u*h,s._y=f*u*l-d*c*h,s._z=d*u*h-f*c*l,s._w=d*u*l+f*c*h,s._isDirty=!0,s}static RotationAlphaBetaGamma(e,t,i){const s=new re;return re.RotationAlphaBetaGammaToRef(e,t,i,s),s}static RotationAlphaBetaGammaToRef(e,t,i,s){const n=(i+e)*.5,r=(i-e)*.5,o=t*.5;return s._x=Math.cos(r)*Math.sin(o),s._y=Math.sin(r)*Math.sin(o),s._z=Math.sin(n)*Math.cos(o),s._w=Math.cos(n)*Math.cos(o),s._isDirty=!0,s}static RotationQuaternionFromAxis(e,t,i){const s=new re(0,0,0,0);return re.RotationQuaternionFromAxisToRef(e,t,i,s),s}static RotationQuaternionFromAxisToRef(e,t,i,s){const n=_e.Matrix[0];return e=e.normalizeToRef(_e.Vector3[0]),t=t.normalizeToRef(_e.Vector3[1]),i=i.normalizeToRef(_e.Vector3[2]),O.FromXYZAxesToRef(e,t,i,n),re.FromRotationMatrixToRef(n,s),s}static FromLookDirectionLH(e,t){const i=new re;return re.FromLookDirectionLHToRef(e,t,i),i}static FromLookDirectionLHToRef(e,t,i){const s=_e.Matrix[0];return O.LookDirectionLHToRef(e,t,s),re.FromRotationMatrixToRef(s,i),i}static FromLookDirectionRH(e,t){const i=new re;return re.FromLookDirectionRHToRef(e,t,i),i}static FromLookDirectionRHToRef(e,t,i){const s=_e.Matrix[0];return O.LookDirectionRHToRef(e,t,s),re.FromRotationMatrixToRef(s,i)}static Slerp(e,t,i){const s=re.Identity();return re.SlerpToRef(e,t,i,s),s}static SlerpToRef(e,t,i,s){let n,r,o=e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w,h=!1;if(o<0&&(h=!0,o=-o),o>.999999)r=1-i,n=h?-i:i;else{const l=Math.acos(o),c=1/Math.sin(l);r=Math.sin((1-i)*l)*c,n=h?-Math.sin(i*l)*c:Math.sin(i*l)*c}return s._x=r*e._x+n*t._x,s._y=r*e._y+n*t._y,s._z=r*e._z+n*t._z,s._w=r*e._w+n*t._w,s._isDirty=!0,s}static Hermite(e,t,i,s,n){const r=n*n,o=n*r,h=2*o-3*r+1,l=-2*o+3*r,c=o-2*r+n,u=o-r,f=e._x*h+i._x*l+t._x*c+s._x*u,d=e._y*h+i._y*l+t._y*c+s._y*u,_=e._z*h+i._z*l+t._z*c+s._z*u,p=e._w*h+i._w*l+t._w*c+s._w*u;return new re(f,d,_,p)}static Hermite1stDerivative(e,t,i,s,n){const r=new re;return this.Hermite1stDerivativeToRef(e,t,i,s,n,r),r}static Hermite1stDerivativeToRef(e,t,i,s,n,r){const o=n*n;return r._x=(o-n)*6*e._x+(3*o-4*n+1)*t._x+(-o+n)*6*i._x+(3*o-2*n)*s._x,r._y=(o-n)*6*e._y+(3*o-4*n+1)*t._y+(-o+n)*6*i._y+(3*o-2*n)*s._y,r._z=(o-n)*6*e._z+(3*o-4*n+1)*t._z+(-o+n)*6*i._z+(3*o-2*n)*s._z,r._w=(o-n)*6*e._w+(3*o-4*n+1)*t._w+(-o+n)*6*i._w+(3*o-2*n)*s._w,r._isDirty=!0,r}static Normalize(e){const t=re.Zero();return re.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Clamp(e,t,i){const s=new re;return re.ClampToRef(e,t,i,s),s}static ClampToRef(e,t,i,s){return s.copyFromFloats(ht(e.x,t.x,i.x),ht(e.y,t.y,i.y),ht(e.z,t.z,i.z),ht(e.w,t.w,i.w))}static Random(e=0,t=1){return new re(gt(e,t),gt(e,t),gt(e,t),gt(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(gt(e,t),gt(e,t),gt(e,t),gt(e,t))}static Minimize(){throw new ReferenceError("Quaternion.Minimize does not make sense")}static Maximize(){throw new ReferenceError("Quaternion.Maximize does not make sense")}static Distance(e,t){return Math.sqrt(re.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y,n=e.z-t.z,r=e.w-t.w;return i*i+s*s+n*n+r*r}static Center(e,t){return re.CenterToRef(e,t,re.Zero())}static CenterToRef(e,t,i){return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2,(e.w+t.w)/2)}}re._V8PerformanceHack=new re(.5,.5,.5,.5);Object.defineProperties(re.prototype,{dimension:{value:[4]},rank:{value:1}});class O{static get Use64Bits(){return Dt.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=O._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0}_updateIdentityStatus(e,t=!1,i=!1,s=!0){this._isIdentity=e,this._isIdentity3x2=e||i,this._isIdentityDirty=this._isIdentity?!1:t,this._isIdentity3x2Dirty=this._isIdentity3x2?!1:s}constructor(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,Dt.MatrixTrackPrecisionChange&&Dt.MatrixTrackedMatrices.push(this),this._m=new Dt.MatrixCurrentType(16),this.markAsUpdated()}isIdentity(){if(this._isIdentityDirty){this._isIdentityDirty=!1;const e=this._m;this._isIdentity=e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1}return this._isIdentity}isIdentityAs3x2(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,this._m[0]!==1||this._m[5]!==1||this._m[15]!==1?this._isIdentity3x2=!1:this._m[1]!==0||this._m[2]!==0||this._m[3]!==0||this._m[4]!==0||this._m[6]!==0||this._m[7]!==0||this._m[8]!==0||this._m[9]!==0||this._m[10]!==0||this._m[11]!==0||this._m[12]!==0||this._m[13]!==0||this._m[14]!==0?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2}determinant(){if(this._isIdentity===!0)return 1;const e=this._m,t=e[0],i=e[1],s=e[2],n=e[3],r=e[4],o=e[5],h=e[6],l=e[7],c=e[8],u=e[9],f=e[10],d=e[11],_=e[12],p=e[13],g=e[14],m=e[15],b=f*m-g*d,I=u*m-p*d,T=u*g-p*f,x=c*m-_*d,y=c*g-f*_,R=c*p-_*u,E=+(o*b-h*I+l*T),C=-(r*b-h*x+l*y),S=+(r*I-o*x+l*R),w=-(r*T-o*y+h*R);return t*E+i*C+s*S+n*w}toString(){return"{".concat(this.m[0],", ").concat(this.m[1],", ").concat(this.m[2],", ").concat(this.m[3],"\n").concat(this.m[4],", ").concat(this.m[5],", ").concat(this.m[6],", ").concat(this.m[7],"\n").concat(this.m[8],", ").concat(this.m[9],", ").concat(this.m[10],", ").concat(this.m[11],"\n").concat(this.m[12],", ").concat(this.m[13],", ").concat(this.m[14],", ").concat(this.m[15],"}")}toArray(e=null,t=0){if(!e)return this._m;const i=this._m;for(let s=0;s<16;s++)e[t+s]=i[s];return this}asArray(){return this._m}fromArray(e,t=0){return O.FromArrayToRef(e,t,this)}copyFromFloats(...e){return O.FromArrayToRef(e,0,this)}set(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=e[i];return this.markAsUpdated(),this}setAll(e){const t=this._m;for(let i=0;i<16;i++)t[i]=e;return this.markAsUpdated(),this}invert(){return this.invertToRef(this),this}reset(){return O.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this}add(e){const t=new O;return this.addToRef(e,t),t}addToRef(e,t){const i=this._m,s=t._m,n=e.m;for(let r=0;r<16;r++)s[r]=i[r]+n[r];return t.markAsUpdated(),t}addToSelf(e){const t=this._m,i=e.m;return t[0]+=i[0],t[1]+=i[1],t[2]+=i[2],t[3]+=i[3],t[4]+=i[4],t[5]+=i[5],t[6]+=i[6],t[7]+=i[7],t[8]+=i[8],t[9]+=i[9],t[10]+=i[10],t[11]+=i[11],t[12]+=i[12],t[13]+=i[13],t[14]+=i[14],t[15]+=i[15],this.markAsUpdated(),this}addInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]+=i[s];return this.markAsUpdated(),this}addInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]+=e[i];return this.markAsUpdated(),this}subtract(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]-=i[s];return this.markAsUpdated(),this}subtractToRef(e,t){const i=this._m,s=e.m,n=t._m;for(let r=0;r<16;r++)n[r]=i[r]-s[r];return t.markAsUpdated(),t}subtractInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]-=i[s];return this.markAsUpdated(),this}subtractFromFloats(...e){return this.subtractFromFloatsToRef(...e,new O)}subtractFromFloatsToRef(...e){const t=e.pop(),i=this._m,s=t._m,n=e;for(let r=0;r<16;r++)s[r]=i[r]-n[r];return t.markAsUpdated(),t}invertToRef(e){if(this._isIdentity===!0)return O.IdentityToRef(e),e;const t=this._m,i=t[0],s=t[1],n=t[2],r=t[3],o=t[4],h=t[5],l=t[6],c=t[7],u=t[8],f=t[9],d=t[10],_=t[11],p=t[12],g=t[13],m=t[14],b=t[15],I=d*b-m*_,T=f*b-g*_,x=f*m-g*d,y=u*b-p*_,R=u*m-d*p,E=u*g-p*f,C=+(h*I-l*T+c*x),S=-(o*I-l*y+c*R),w=+(o*T-h*y+c*E),P=-(o*x-h*R+l*E),G=i*C+s*S+n*w+r*P;if(G===0)return e.copyFrom(this),e;const L=1/G,W=l*b-m*c,K=h*b-g*c,ce=h*m-g*l,$=o*b-p*c,z=o*m-p*l,k=o*g-p*h,M=l*_-d*c,V=h*_-f*c,q=h*d-f*l,he=o*_-u*c,pe=o*d-u*l,se=o*f-u*h,ue=-(s*I-n*T+r*x),me=+(i*I-n*y+r*R),ne=-(i*T-s*y+r*E),Ie=+(i*x-s*R+n*E),Se=+(s*W-n*K+r*ce),Q=-(i*W-n*$+r*z),be=+(i*K-s*$+r*k),Be=-(i*ce-s*z+n*k),ze=-(s*M-n*V+r*q),Ke=+(i*M-n*he+r*pe),Rt=-(i*V-s*he+r*se),Ct=+(i*q-s*pe+n*se);return O.FromValuesToRef(C*L,ue*L,Se*L,ze*L,S*L,me*L,Q*L,Ke*L,w*L,ne*L,be*L,Rt*L,P*L,Ie*L,Be*L,Ct*L,e),e}addAtIndex(e,t){return this._m[e]+=t,this.markAsUpdated(),this}multiplyAtIndex(e,t){return this._m[e]*=t,this.markAsUpdated(),this}setTranslationFromFloats(e,t,i){return this._m[12]=e,this._m[13]=t,this._m[14]=i,this.markAsUpdated(),this}addTranslationFromFloats(e,t,i){return this._m[12]+=e,this._m[13]+=t,this._m[14]+=i,this.markAsUpdated(),this}setTranslation(e){return this.setTranslationFromFloats(e._x,e._y,e._z)}getTranslation(){return new v(this._m[12],this._m[13],this._m[14])}getTranslationToRef(e){return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],e}removeRotationAndScaling(){const e=this.m;return O.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e[12],e[13],e[14],e[15],this),this._updateIdentityStatus(e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1),this}copyFrom(e){e.copyToArray(this._m);const t=e;return this.updateFlag=t.updateFlag,this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this}copyToArray(e,t=0){const i=this._m;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],this}multiply(e){const t=new O;return this.multiplyToRef(e,t),t}multiplyInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]*=i[s];return this.markAsUpdated(),this}multiplyByFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]*=e[i];return this.markAsUpdated(),this}multiplyByFloatsToRef(...e){const t=e.pop(),i=this._m,s=t._m,n=e;for(let r=0;r<16;r++)s[r]=i[r]*n[r];return t.markAsUpdated(),t}multiplyToRef(e,t){return this._isIdentity?(t.copyFrom(e),t):e._isIdentity?(t.copyFrom(this),t):(this.multiplyToArray(e,t._m,0),t.markAsUpdated(),t)}multiplyToArray(e,t,i){const s=this._m,n=e.m,r=s[0],o=s[1],h=s[2],l=s[3],c=s[4],u=s[5],f=s[6],d=s[7],_=s[8],p=s[9],g=s[10],m=s[11],b=s[12],I=s[13],T=s[14],x=s[15],y=n[0],R=n[1],E=n[2],C=n[3],S=n[4],w=n[5],P=n[6],G=n[7],L=n[8],W=n[9],K=n[10],ce=n[11],$=n[12],z=n[13],k=n[14],M=n[15];return t[i]=r*y+o*S+h*L+l*$,t[i+1]=r*R+o*w+h*W+l*z,t[i+2]=r*E+o*P+h*K+l*k,t[i+3]=r*C+o*G+h*ce+l*M,t[i+4]=c*y+u*S+f*L+d*$,t[i+5]=c*R+u*w+f*W+d*z,t[i+6]=c*E+u*P+f*K+d*k,t[i+7]=c*C+u*G+f*ce+d*M,t[i+8]=_*y+p*S+g*L+m*$,t[i+9]=_*R+p*w+g*W+m*z,t[i+10]=_*E+p*P+g*K+m*k,t[i+11]=_*C+p*G+g*ce+m*M,t[i+12]=b*y+I*S+T*L+x*$,t[i+13]=b*R+I*w+T*W+x*z,t[i+14]=b*E+I*P+T*K+x*k,t[i+15]=b*C+I*G+T*ce+x*M,this}divide(e){return this.divideToRef(e,new O)}divideToRef(e,t){const i=this._m,s=e.m,n=t._m;for(let r=0;r<16;r++)n[r]=i[r]/s[r];return t.markAsUpdated(),t}divideInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]/=i[s];return this.markAsUpdated(),this}minimizeInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]=Math.min(t[s],i[s]);return this.markAsUpdated(),this}minimizeInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=Math.min(t[i],e[i]);return this.markAsUpdated(),this}maximizeInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]=Math.min(t[s],i[s]);return this.markAsUpdated(),this}maximizeInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=Math.min(t[i],e[i]);return this.markAsUpdated(),this}negate(){return this.negateToRef(new O)}negateInPlace(){const e=this._m;for(let t=0;t<16;t++)e[t]=-e[t];return this.markAsUpdated(),this}negateToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=-t[s];return e.markAsUpdated(),e}equals(e){const t=e;if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;const i=this.m,s=t.m;return i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]&&i[3]===s[3]&&i[4]===s[4]&&i[5]===s[5]&&i[6]===s[6]&&i[7]===s[7]&&i[8]===s[8]&&i[9]===s[9]&&i[10]===s[10]&&i[11]===s[11]&&i[12]===s[12]&&i[13]===s[13]&&i[14]===s[14]&&i[15]===s[15]}equalsWithEpsilon(e,t=0){const i=this._m,s=e.m;for(let n=0;n<16;n++)if(!lt(i[n],s[n],t))return!1;return!0}equalsToFloats(...e){const t=this._m;for(let i=0;i<16;i++)if(t[i]!=e[i])return!1;return!0}floor(){return this.floorToRef(new O)}floorToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=Math.floor(t[s]);return e.markAsUpdated(),e}fract(){return this.fractToRef(new O)}fractToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=t[s]-Math.floor(t[s]);return e.markAsUpdated(),e}clone(){const e=new O;return e.copyFrom(this),e}getClassName(){return"Matrix"}getHashCode(){let e=$t(this._m[0]);for(let t=1;t<16;t++)e=e*397^$t(this._m[t]);return e}decomposeToTransformNode(e){return e.rotationQuaternion=e.rotationQuaternion||new re,this.decompose(e.scaling,e.rotationQuaternion,e.position)}decompose(e,t,i,s,n=!0){if(this._isIdentity)return i&&i.setAll(0),e&&e.setAll(1),t&&t.copyFromFloats(0,0,0,1),!0;const r=this._m;if(i&&i.copyFromFloats(r[12],r[13],r[14]),e=e||_e.Vector3[0],e.x=Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]),e.y=Math.sqrt(r[4]*r[4]+r[5]*r[5]+r[6]*r[6]),e.z=Math.sqrt(r[8]*r[8]+r[9]*r[9]+r[10]*r[10]),s){const o=(n?s.absoluteScaling.x:s.scaling.x)<0?-1:1,h=(n?s.absoluteScaling.y:s.scaling.y)<0?-1:1,l=(n?s.absoluteScaling.z:s.scaling.z)<0?-1:1;e.x*=o,e.y*=h,e.z*=l}else this.determinant()<=0&&(e.y*=-1);if(e._x===0||e._y===0||e._z===0)return t&&t.copyFromFloats(0,0,0,1),!1;if(t){const o=1/e._x,h=1/e._y,l=1/e._z;O.FromValuesToRef(r[0]*o,r[1]*o,r[2]*o,0,r[4]*h,r[5]*h,r[6]*h,0,r[8]*l,r[9]*l,r[10]*l,0,0,0,0,1,_e.Matrix[0]),re.FromRotationMatrixToRef(_e.Matrix[0],t)}return!0}getRow(e){if(e<0||e>3)return null;const t=e*4;return new Pe(this._m[t+0],this._m[t+1],this._m[t+2],this._m[t+3])}getRowToRef(e,t){if(e>=0&&e<=3){const i=e*4;t.x=this._m[i+0],t.y=this._m[i+1],t.z=this._m[i+2],t.w=this._m[i+3]}return t}setRow(e,t){return this.setRowFromFloats(e,t.x,t.y,t.z,t.w)}transpose(){const e=new O;return O.TransposeToRef(this,e),e}transposeToRef(e){return O.TransposeToRef(this,e),e}setRowFromFloats(e,t,i,s,n){if(e<0||e>3)return this;const r=e*4;return this._m[r+0]=t,this._m[r+1]=i,this._m[r+2]=s,this._m[r+3]=n,this.markAsUpdated(),this}scale(e){const t=new O;return this.scaleToRef(e,t),t}scaleToRef(e,t){for(let i=0;i<16;i++)t._m[i]=this._m[i]*e;return t.markAsUpdated(),t}scaleAndAddToRef(e,t){for(let i=0;i<16;i++)t._m[i]+=this._m[i]*e;return t.markAsUpdated(),t}scaleInPlace(e){const t=this._m;for(let i=0;i<16;i++)t[i]*=e;return this.markAsUpdated(),this}toNormalMatrix(e){const t=_e.Matrix[0];this.invertToRef(t),t.transposeToRef(e);const i=e._m;return O.FromValuesToRef(i[0],i[1],i[2],0,i[4],i[5],i[6],0,i[8],i[9],i[10],0,0,0,0,1,e),e}getRotationMatrix(){const e=new O;return this.getRotationMatrixToRef(e),e}getRotationMatrixToRef(e){const t=_e.Vector3[0];if(!this.decompose(t))return O.IdentityToRef(e),e;const i=this._m,s=1/t._x,n=1/t._y,r=1/t._z;return O.FromValuesToRef(i[0]*s,i[1]*s,i[2]*s,0,i[4]*n,i[5]*n,i[6]*n,0,i[8]*r,i[9]*r,i[10]*r,0,0,0,0,1,e),e}toggleModelMatrixHandInPlace(){const e=this._m;return e[2]*=-1,e[6]*=-1,e[8]*=-1,e[9]*=-1,e[14]*=-1,this.markAsUpdated(),this}toggleProjectionMatrixHandInPlace(){const e=this._m;return e[8]*=-1,e[9]*=-1,e[10]*=-1,e[11]*=-1,this.markAsUpdated(),this}static FromArray(e,t=0){const i=new O;return O.FromArrayToRef(e,t,i),i}static FromArrayToRef(e,t,i){for(let s=0;s<16;s++)i._m[s]=e[s+t];return i.markAsUpdated(),i}static FromFloat32ArrayToRefScaled(e,t,i,s){return s._m[0]=e[0+t]*i,s._m[1]=e[1+t]*i,s._m[2]=e[2+t]*i,s._m[3]=e[3+t]*i,s._m[4]=e[4+t]*i,s._m[5]=e[5+t]*i,s._m[6]=e[6+t]*i,s._m[7]=e[7+t]*i,s._m[8]=e[8+t]*i,s._m[9]=e[9+t]*i,s._m[10]=e[10+t]*i,s._m[11]=e[11+t]*i,s._m[12]=e[12+t]*i,s._m[13]=e[13+t]*i,s._m[14]=e[14+t]*i,s._m[15]=e[15+t]*i,s.markAsUpdated(),s}static get IdentityReadOnly(){return O._IdentityReadOnly}static FromValuesToRef(e,t,i,s,n,r,o,h,l,c,u,f,d,_,p,g,m){const b=m._m;b[0]=e,b[1]=t,b[2]=i,b[3]=s,b[4]=n,b[5]=r,b[6]=o,b[7]=h,b[8]=l,b[9]=c,b[10]=u,b[11]=f,b[12]=d,b[13]=_,b[14]=p,b[15]=g,m.markAsUpdated()}static FromValues(e,t,i,s,n,r,o,h,l,c,u,f,d,_,p,g){const m=new O,b=m._m;return b[0]=e,b[1]=t,b[2]=i,b[3]=s,b[4]=n,b[5]=r,b[6]=o,b[7]=h,b[8]=l,b[9]=c,b[10]=u,b[11]=f,b[12]=d,b[13]=_,b[14]=p,b[15]=g,m.markAsUpdated(),m}static Compose(e,t,i){const s=new O;return O.ComposeToRef(e,t,i,s),s}static ComposeToRef(e,t,i,s){const n=s._m,r=t._x,o=t._y,h=t._z,l=t._w,c=r+r,u=o+o,f=h+h,d=r*c,_=r*u,p=r*f,g=o*u,m=o*f,b=h*f,I=l*c,T=l*u,x=l*f,y=e._x,R=e._y,E=e._z;return n[0]=(1-(g+b))*y,n[1]=(_+x)*y,n[2]=(p-T)*y,n[3]=0,n[4]=(_-x)*R,n[5]=(1-(d+b))*R,n[6]=(m+I)*R,n[7]=0,n[8]=(p+T)*E,n[9]=(m-I)*E,n[10]=(1-(d+g))*E,n[11]=0,n[12]=i._x,n[13]=i._y,n[14]=i._z,n[15]=1,s.markAsUpdated(),s}static Identity(){const e=O.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return e._updateIdentityStatus(!0),e}static IdentityToRef(e){return O.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(!0),e}static Zero(){const e=O.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return e._updateIdentityStatus(!1),e}static RotationX(e){const t=new O;return O.RotationXToRef(e,t),t}static Invert(e){const t=new O;return e.invertToRef(t),t}static RotationXToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return O.FromValuesToRef(1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationY(e){const t=new O;return O.RotationYToRef(e,t),t}static RotationYToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return O.FromValuesToRef(s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationZ(e){const t=new O;return O.RotationZToRef(e,t),t}static RotationZToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return O.FromValuesToRef(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationAxis(e,t){const i=new O;return O.RotationAxisToRef(e,t,i),i}static RotationAxisToRef(e,t,i){const s=Math.sin(-t),n=Math.cos(-t),r=1-n;e=e.normalizeToRef(_e.Vector3[0]);const o=i._m;return o[0]=e._x*e._x*r+n,o[1]=e._x*e._y*r-e._z*s,o[2]=e._x*e._z*r+e._y*s,o[3]=0,o[4]=e._y*e._x*r+e._z*s,o[5]=e._y*e._y*r+n,o[6]=e._y*e._z*r-e._x*s,o[7]=0,o[8]=e._z*e._x*r-e._y*s,o[9]=e._z*e._y*r+e._x*s,o[10]=e._z*e._z*r+n,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,i.markAsUpdated(),i}static RotationAlignToRef(e,t,i,s=!1){const n=v.Dot(t,e),r=i._m;if(n<-1+Le)r[0]=-1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s?1:-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=s?-1:1,r[11]=0;else{const o=v.Cross(t,e),h=1/(1+n);r[0]=o._x*o._x*h+n,r[1]=o._y*o._x*h-o._z,r[2]=o._z*o._x*h+o._y,r[3]=0,r[4]=o._x*o._y*h+o._z,r[5]=o._y*o._y*h+n,r[6]=o._z*o._y*h-o._x,r[7]=0,r[8]=o._x*o._z*h-o._y,r[9]=o._y*o._z*h+o._x,r[10]=o._z*o._z*h+n,r[11]=0}return r[12]=0,r[13]=0,r[14]=0,r[15]=1,i.markAsUpdated(),i}static RotationYawPitchRoll(e,t,i){const s=new O;return O.RotationYawPitchRollToRef(e,t,i,s),s}static RotationYawPitchRollToRef(e,t,i,s){return re.RotationYawPitchRollToRef(e,t,i,_e.Quaternion[0]),_e.Quaternion[0].toRotationMatrix(s),s}static Scaling(e,t,i){const s=new O;return O.ScalingToRef(e,t,i,s),s}static ScalingToRef(e,t,i,s){return O.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1,s),s._updateIdentityStatus(e===1&&t===1&&i===1),s}static Translation(e,t,i){const s=new O;return O.TranslationToRef(e,t,i,s),s}static TranslationToRef(e,t,i,s){return O.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1,s),s._updateIdentityStatus(e===0&&t===0&&i===0),s}static Lerp(e,t,i){const s=new O;return O.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){const n=s._m,r=e.m,o=t.m;for(let h=0;h<16;h++)n[h]=r[h]*(1-i)+o[h]*i;return s.markAsUpdated(),s}static DecomposeLerp(e,t,i){const s=new O;return O.DecomposeLerpToRef(e,t,i,s),s}static DecomposeLerpToRef(e,t,i,s){const n=_e.Vector3[0],r=_e.Quaternion[0],o=_e.Vector3[1];e.decompose(n,r,o);const h=_e.Vector3[2],l=_e.Quaternion[1],c=_e.Vector3[3];t.decompose(h,l,c);const u=_e.Vector3[4];v.LerpToRef(n,h,i,u);const f=_e.Quaternion[2];re.SlerpToRef(r,l,i,f);const d=_e.Vector3[5];return v.LerpToRef(o,c,i,d),O.ComposeToRef(u,f,d,s),s}static LookAtLH(e,t,i){const s=new O;return O.LookAtLHToRef(e,t,i,s),s}static LookAtLHToRef(e,t,i,s){const n=_e.Vector3[0],r=_e.Vector3[1],o=_e.Vector3[2];t.subtractToRef(e,o),o.normalize(),v.CrossToRef(i,o,n);const h=n.lengthSquared();h===0?n.x=1:n.normalizeFromLength(Math.sqrt(h)),v.CrossToRef(o,n,r),r.normalize();const l=-v.Dot(n,e),c=-v.Dot(r,e),u=-v.Dot(o,e);return O.FromValuesToRef(n._x,r._x,o._x,0,n._y,r._y,o._y,0,n._z,r._z,o._z,0,l,c,u,1,s),s}static LookAtRH(e,t,i){const s=new O;return O.LookAtRHToRef(e,t,i,s),s}static LookAtRHToRef(e,t,i,s){const n=_e.Vector3[0],r=_e.Vector3[1],o=_e.Vector3[2];e.subtractToRef(t,o),o.normalize(),v.CrossToRef(i,o,n);const h=n.lengthSquared();h===0?n.x=1:n.normalizeFromLength(Math.sqrt(h)),v.CrossToRef(o,n,r),r.normalize();const l=-v.Dot(n,e),c=-v.Dot(r,e),u=-v.Dot(o,e);return O.FromValuesToRef(n._x,r._x,o._x,0,n._y,r._y,o._y,0,n._z,r._z,o._z,0,l,c,u,1,s),s}static LookDirectionLH(e,t){const i=new O;return O.LookDirectionLHToRef(e,t,i),i}static LookDirectionLHToRef(e,t,i){const s=_e.Vector3[0];s.copyFrom(e),s.scaleInPlace(-1);const n=_e.Vector3[1];return v.CrossToRef(t,s,n),O.FromValuesToRef(n._x,n._y,n._z,0,t._x,t._y,t._z,0,s._x,s._y,s._z,0,0,0,0,1,i),i}static LookDirectionRH(e,t){const i=new O;return O.LookDirectionRHToRef(e,t,i),i}static LookDirectionRHToRef(e,t,i){const s=_e.Vector3[2];return v.CrossToRef(t,e,s),O.FromValuesToRef(s._x,s._y,s._z,0,t._x,t._y,t._z,0,e._x,e._y,e._z,0,0,0,0,1,i),i}static OrthoLH(e,t,i,s,n){const r=new O;return O.OrthoLHToRef(e,t,i,s,r,n),r}static OrthoLHToRef(e,t,i,s,n,r){const o=i,h=s,l=2/e,c=2/t,u=2/(h-o),f=-(h+o)/(h-o);return O.FromValuesToRef(l,0,0,0,0,c,0,0,0,0,u,0,0,0,f,1,n),r&&n.multiplyToRef(Cs,n),n._updateIdentityStatus(l===1&&c===1&&u===1&&f===0),n}static OrthoOffCenterLH(e,t,i,s,n,r,o){const h=new O;return O.OrthoOffCenterLHToRef(e,t,i,s,n,r,h,o),h}static OrthoOffCenterLHToRef(e,t,i,s,n,r,o,h){const l=n,c=r,u=2/(t-e),f=2/(s-i),d=2/(c-l),_=-(c+l)/(c-l),p=(e+t)/(e-t),g=(s+i)/(i-s);return O.FromValuesToRef(u,0,0,0,0,f,0,0,0,0,d,0,p,g,_,1,o),h&&o.multiplyToRef(Cs,o),o.markAsUpdated(),o}static ObliqueOffCenterLHToRef(e,t,i,s,n,r,o,h,l,c,u){const f=-o*Math.cos(h),d=-o*Math.sin(h);return O.TranslationToRef(0,0,-l,_e.Matrix[1]),O.FromValuesToRef(1,0,0,0,0,1,0,0,f,d,1,0,0,0,0,1,_e.Matrix[0]),_e.Matrix[1].multiplyToRef(_e.Matrix[0],_e.Matrix[0]),O.TranslationToRef(0,0,l,_e.Matrix[1]),_e.Matrix[0].multiplyToRef(_e.Matrix[1],_e.Matrix[0]),O.OrthoOffCenterLHToRef(e,t,i,s,n,r,c,u),_e.Matrix[0].multiplyToRef(c,c),c}static OrthoOffCenterRH(e,t,i,s,n,r,o){const h=new O;return O.OrthoOffCenterRHToRef(e,t,i,s,n,r,h,o),h}static OrthoOffCenterRHToRef(e,t,i,s,n,r,o,h){return O.OrthoOffCenterLHToRef(e,t,i,s,n,r,o,h),o._m[10]*=-1,o}static ObliqueOffCenterRHToRef(e,t,i,s,n,r,o,h,l,c,u){const f=o*Math.cos(h),d=o*Math.sin(h);return O.TranslationToRef(0,0,l,_e.Matrix[1]),O.FromValuesToRef(1,0,0,0,0,1,0,0,f,d,1,0,0,0,0,1,_e.Matrix[0]),_e.Matrix[1].multiplyToRef(_e.Matrix[0],_e.Matrix[0]),O.TranslationToRef(0,0,-l,_e.Matrix[1]),_e.Matrix[0].multiplyToRef(_e.Matrix[1],_e.Matrix[0]),O.OrthoOffCenterRHToRef(e,t,i,s,n,r,c,u),_e.Matrix[0].multiplyToRef(c,c),c}static PerspectiveLH(e,t,i,s,n,r=0){const o=new O,h=i,l=s,c=2*h/e,u=2*h/t,f=(l+h)/(l-h),d=-2*l*h/(l-h),_=Math.tan(r);return O.FromValuesToRef(c,0,0,0,0,u,0,_,0,0,f,1,0,0,d,0,o),n&&o.multiplyToRef(Cs,o),o._updateIdentityStatus(!1),o}static PerspectiveFovLH(e,t,i,s,n,r=0,o=!1){const h=new O;return O.PerspectiveFovLHToRef(e,t,i,s,h,!0,n,r,o),h}static PerspectiveFovLHToRef(e,t,i,s,n,r=!0,o,h=0,l=!1){const c=i,u=s,f=1/Math.tan(e*.5),d=r?f/t:f,_=r?f:f*t,p=l&&c===0?-1:u!==0?(u+c)/(u-c):1,g=l&&c===0?2*u:u!==0?-2*u*c/(u-c):-2*c,m=Math.tan(h);return O.FromValuesToRef(d,0,0,0,0,_,0,m,0,0,p,1,0,0,g,0,n),o&&n.multiplyToRef(Cs,n),n._updateIdentityStatus(!1),n}static PerspectiveFovReverseLHToRef(e,t,i,s,n,r=!0,o,h=0){const l=1/Math.tan(e*.5),c=r?l/t:l,u=r?l:l*t,f=Math.tan(h);return O.FromValuesToRef(c,0,0,0,0,u,0,f,0,0,-i,1,0,0,1,0,n),o&&n.multiplyToRef(Cs,n),n._updateIdentityStatus(!1),n}static PerspectiveFovRH(e,t,i,s,n,r=0,o=!1){const h=new O;return O.PerspectiveFovRHToRef(e,t,i,s,h,!0,n,r,o),h}static PerspectiveFovRHToRef(e,t,i,s,n,r=!0,o,h=0,l=!1){const c=i,u=s,f=1/Math.tan(e*.5),d=r?f/t:f,_=r?f:f*t,p=l&&c===0?1:u!==0?-(u+c)/(u-c):-1,g=l&&c===0?2*u:u!==0?-2*u*c/(u-c):-2*c,m=Math.tan(h);return O.FromValuesToRef(d,0,0,0,0,_,0,m,0,0,p,-1,0,0,g,0,n),o&&n.multiplyToRef(Cs,n),n._updateIdentityStatus(!1),n}static PerspectiveFovReverseRHToRef(e,t,i,s,n,r=!0,o,h=0){const l=1/Math.tan(e*.5),c=r?l/t:l,u=r?l:l*t,f=Math.tan(h);return O.FromValuesToRef(c,0,0,0,0,u,0,f,0,0,-i,-1,0,0,-1,0,n),o&&n.multiplyToRef(Cs,n),n._updateIdentityStatus(!1),n}static GetFinalMatrix(e,t,i,s,n,r){const o=e.width,h=e.height,l=e.x,c=e.y,u=O.FromValues(o/2,0,0,0,0,-h/2,0,0,0,0,r-n,0,l+o/2,h/2+c,n,1),f=new O;return t.multiplyToRef(i,f),f.multiplyToRef(s,f),f.multiplyToRef(u,f)}static GetAsMatrix2x2(e){const t=e.m,i=[t[0],t[1],t[4],t[5]];return Dt.MatrixUse64Bits?i:new Float32Array(i)}static GetAsMatrix3x3(e){const t=e.m,i=[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]];return Dt.MatrixUse64Bits?i:new Float32Array(i)}static Transpose(e){const t=new O;return O.TransposeToRef(e,t),t}static TransposeToRef(e,t){const i=e.m,s=i[0],n=i[4],r=i[8],o=i[12],h=i[1],l=i[5],c=i[9],u=i[13],f=i[2],d=i[6],_=i[10],p=i[14],g=i[3],m=i[7],b=i[11],I=i[15],T=t._m;return T[0]=s,T[1]=n,T[2]=r,T[3]=o,T[4]=h,T[5]=l,T[6]=c,T[7]=u,T[8]=f,T[9]=d,T[10]=_,T[11]=p,T[12]=g,T[13]=m,T[14]=b,T[15]=I,t.markAsUpdated(),t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty),t}static Reflection(e){const t=new O;return O.ReflectionToRef(e,t),t}static ReflectionToRef(e,t){e.normalize();const i=e.normal.x,s=e.normal.y,n=e.normal.z,r=-2*i,o=-2*s,h=-2*n;return O.FromValuesToRef(r*i+1,o*i,h*i,0,r*s,o*s+1,h*s,0,r*n,o*n,h*n+1,0,r*e.d,o*e.d,h*e.d,1,t),t}static FromXYZAxesToRef(e,t,i,s){return O.FromValuesToRef(e._x,e._y,e._z,0,t._x,t._y,t._z,0,i._x,i._y,i._z,0,0,0,0,1,s),s}static FromQuaternionToRef(e,t){const i=e._x*e._x,s=e._y*e._y,n=e._z*e._z,r=e._x*e._y,o=e._z*e._w,h=e._z*e._x,l=e._y*e._w,c=e._y*e._z,u=e._x*e._w;return t._m[0]=1-2*(s+n),t._m[1]=2*(r+o),t._m[2]=2*(h-l),t._m[3]=0,t._m[4]=2*(r-o),t._m[5]=1-2*(n+i),t._m[6]=2*(c+u),t._m[7]=0,t._m[8]=2*(h+l),t._m[9]=2*(c-u),t._m[10]=1-2*(s+i),t._m[11]=0,t._m[12]=0,t._m[13]=0,t._m[14]=0,t._m[15]=1,t.markAsUpdated(),t}}O._UpdateFlagSeed=0;O._IdentityReadOnly=O.Identity();Object.defineProperties(O.prototype,{dimension:{value:[4,4]},rank:{value:2}});class _e{}_e.Vector3=Rs(11,v.Zero);_e.Matrix=Rs(2,O.Identity);_e.Quaternion=Rs(3,re.Zero);class N{}N.Vector2=Rs(3,oe.Zero);N.Vector3=Rs(13,v.Zero);N.Vector4=Rs(3,Pe.Zero);N.Quaternion=Rs(3,re.Zero);N.Matrix=Rs(8,O.Identity);vt("BABYLON.Vector2",oe);vt("BABYLON.Vector3",v);vt("BABYLON.Vector4",Pe);vt("BABYLON.Matrix",O);const Cs=O.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1);var ci;(function(a){a[a.LOCAL=0]="LOCAL",a[a.WORLD=1]="WORLD",a[a.BONE=2]="BONE"})(ci||(ci={}));class Gt{}Gt.X=new v(1,0,0);Gt.Y=new v(0,1,0);Gt.Z=new v(0,0,1);var Bo;(function(a){a[a.X=0]="X",a[a.Y=1]="Y",a[a.Z=2]="Z"})(Bo||(Bo={}));function tn(a){return Math.pow(a,Wd)}function sn(a){return a<=.04045?.0773993808*a:Math.pow(.947867299*(a+.055),2.4)}function nn(a){return Math.pow(a,zd)}function rn(a){return a<=.0031308?12.92*a:1.055*Math.pow(a,.41666)-.055}class de{constructor(e=0,t=0,i=0){this.r=e,this.g=t,this.b=i}toString(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"}getClassName(){return"Color3"}getHashCode(){let e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e}toArray(e,t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,this}fromArray(e,t=0){return de.FromArrayToRef(e,t,this),this}toColor4(e=1){return new H(this.r,this.g,this.b,e)}asArray(){return[this.r,this.g,this.b]}toLuminance(){return this.r*.3+this.g*.59+this.b*.11}multiply(e){return new de(this.r*e.r,this.g*e.g,this.b*e.b)}multiplyToRef(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t}multiplyInPlace(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyByFloats(e,t,i){return new de(this.r*e,this.g*t,this.b*i)}divide(e){throw new ReferenceError("Can not divide a color")}divideToRef(e,t){throw new ReferenceError("Can not divide a color")}divideInPlace(e){throw new ReferenceError("Can not divide a color")}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e.r,e.g,e.b)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e.r,e.g,e.b)}minimizeInPlaceFromFloats(e,t,i){return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(i,this.b),this}maximizeInPlaceFromFloats(e,t,i){return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(i,this.b),this}floorToRef(e){throw new ReferenceError("Can not floor a color")}floor(){throw new ReferenceError("Can not floor a color")}fractToRef(e){throw new ReferenceError("Can not fract a color")}fract(){throw new ReferenceError("Can not fract a color")}equals(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b}equalsFloats(e,t,i){return this.equalsToFloats(e,t,i)}equalsToFloats(e,t,i){return this.r===e&&this.g===t&&this.b===i}equalsWithEpsilon(e,t=Le){return lt(this.r,e.r,t)&<(this.g,e.g,t)&<(this.b,e.b,t)}negate(){throw new ReferenceError("Can not negate a color")}negateInPlace(){throw new ReferenceError("Can not negate a color")}negateToRef(e){throw new ReferenceError("Can not negate a color")}scale(e){return new de(this.r*e,this.g*e,this.b*e)}scaleInPlace(e){return this.r*=e,this.g*=e,this.b*=e,this}scaleToRef(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t}scaleAndAddToRef(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t}clampToRef(e=0,t=1,i){return i.r=ht(this.r,e,t),i.g=ht(this.g,e,t),i.b=ht(this.b,e,t),i}add(e){return new de(this.r+e.r,this.g+e.g,this.b+e.b)}addInPlace(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addInPlaceFromFloats(e,t,i){return this.r+=e,this.g+=t,this.b+=i,this}addToRef(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,t}subtract(e){return new de(this.r-e.r,this.g-e.g,this.b-e.b)}subtractToRef(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t}subtractInPlace(e){return this.r-=e.r,this.g-=e.g,this.b-=e.b,this}subtractFromFloats(e,t,i){return new de(this.r-e,this.g-t,this.b-i)}subtractFromFloatsToRef(e,t,i,s){return s.r=this.r-e,s.g=this.g-t,s.b=this.b-i,s}clone(){return new de(this.r,this.g,this.b)}copyFrom(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyFromFloats(e,t,i){return this.r=e,this.g=t,this.b=i,this}set(e,t,i){return this.copyFromFloats(e,t,i)}setAll(e){return this.r=this.g=this.b=e,this}toHexString(){const e=Math.round(this.r*255),t=Math.round(this.g*255),i=Math.round(this.b*255);return"#"+Ui(e)+Ui(t)+Ui(i)}fromHexString(e){return e.substring(0,1)!=="#"||e.length!==7?this:(this.r=parseInt(e.substring(1,3),16)/255,this.g=parseInt(e.substring(3,5),16)/255,this.b=parseInt(e.substring(5,7),16)/255,this)}toHSV(){return this.toHSVToRef(new de)}toHSVToRef(e){const t=this.r,i=this.g,s=this.b,n=Math.max(t,i,s),r=Math.min(t,i,s);let o=0,h=0;const l=n,c=n-r;return n!==0&&(h=c/n),n!=r&&(n==t?(o=(i-s)/c,i=0&&r<=1?(h=n,l=o):r>=1&&r<=2?(h=o,l=n):r>=2&&r<=3?(l=n,c=o):r>=3&&r<=4?(l=o,c=n):r>=4&&r<=5?(h=o,c=n):r>=5&&r<=6&&(h=n,c=o);const u=i-n;return s.r=h+u,s.g=l+u,s.b=c+u,s}static FromHSV(e,t,i){const s=new de(0,0,0);return de.HSVtoRGBToRef(e,t,i,s),s}static FromHexString(e){return new de(0,0,0).fromHexString(e)}static FromArray(e,t=0){return new de(e[t],e[t+1],e[t+2])}static FromArrayToRef(e,t=0,i){i.r=e[t],i.g=e[t+1],i.b=e[t+2]}static FromInts(e,t,i){return new de(e/255,t/255,i/255)}static Lerp(e,t,i){const s=new de(0,0,0);return de.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){s.r=e.r+(t.r-e.r)*i,s.g=e.g+(t.g-e.g)*i,s.b=e.b+(t.b-e.b)*i}static Hermite(e,t,i,s,n){const r=n*n,o=n*r,h=2*o-3*r+1,l=-2*o+3*r,c=o-2*r+n,u=o-r,f=e.r*h+i.r*l+t.r*c+s.r*u,d=e.g*h+i.g*l+t.g*c+s.g*u,_=e.b*h+i.b*l+t.b*c+s.b*u;return new de(f,d,_)}static Hermite1stDerivative(e,t,i,s,n){const r=de.Black();return this.Hermite1stDerivativeToRef(e,t,i,s,n,r),r}static Hermite1stDerivativeToRef(e,t,i,s,n,r){const o=n*n;r.r=(o-n)*6*e.r+(3*o-4*n+1)*t.r+(-o+n)*6*i.r+(3*o-2*n)*s.r,r.g=(o-n)*6*e.g+(3*o-4*n+1)*t.g+(-o+n)*6*i.g+(3*o-2*n)*s.g,r.b=(o-n)*6*e.b+(3*o-4*n+1)*t.b+(-o+n)*6*i.b+(3*o-2*n)*s.b}static Red(){return new de(1,0,0)}static Green(){return new de(0,1,0)}static Blue(){return new de(0,0,1)}static Black(){return new de(0,0,0)}static get BlackReadOnly(){return de._BlackReadOnly}static White(){return new de(1,1,1)}static Purple(){return new de(.5,0,.5)}static Magenta(){return new de(1,0,1)}static Yellow(){return new de(1,1,0)}static Gray(){return new de(.5,.5,.5)}static Teal(){return new de(0,1,1)}static Random(){return new de(Math.random(),Math.random(),Math.random())}}de._V8PerformanceHack=new de(.5,.5,.5);de._BlackReadOnly=de.Black();Object.defineProperties(de.prototype,{dimension:{value:[3]},rank:{value:1}});class H{constructor(e=0,t=0,i=0,s=1){this.r=e,this.g=t,this.b=i,this.a=s}asArray(){return[this.r,this.g,this.b,this.a]}toArray(e,t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,this}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this.a=e[t+3],this}equals(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}add(e){return new H(this.r+e.r,this.g+e.g,this.b+e.b,this.a+e.a)}addToRef(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,t.a=this.a+e.a,t}addInPlace(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this.a+=e.a,this}addInPlaceFromFloats(e,t,i,s){return this.r+=e,this.g+=t,this.b+=i,this.a+=s,this}subtract(e){return new H(this.r-e.r,this.g-e.g,this.b-e.b,this.a-e.a)}subtractToRef(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t.a=this.a-e.a,t}subtractInPlace(e){return this.r-=e.r,this.g-=e.g,this.b-=e.b,this.a-=e.a,this}subtractFromFloats(e,t,i,s){return new H(this.r-e,this.g-t,this.b-i,this.a-s)}subtractFromFloatsToRef(e,t,i,s,n){return n.r=this.r-e,n.g=this.g-t,n.b=this.b-i,n.a=this.a-s,n}scale(e){return new H(this.r*e,this.g*e,this.b*e,this.a*e)}scaleInPlace(e){return this.r*=e,this.g*=e,this.b*=e,this.a*=e,this}scaleToRef(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t.a=this.a*e,t}scaleAndAddToRef(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t.a+=this.a*e,t}clampToRef(e=0,t=1,i){return i.r=ht(this.r,e,t),i.g=ht(this.g,e,t),i.b=ht(this.b,e,t),i.a=ht(this.a,e,t),i}multiply(e){return new H(this.r*e.r,this.g*e.g,this.b*e.b,this.a*e.a)}multiplyToRef(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t.a=this.a*e.a,t}multiplyInPlace(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this.a*=e.a,this}multiplyByFloats(e,t,i,s){return new H(this.r*e,this.g*t,this.b*i,this.a*s)}divide(e){throw new ReferenceError("Can not divide a color")}divideToRef(e,t){throw new ReferenceError("Can not divide a color")}divideInPlace(e){throw new ReferenceError("Can not divide a color")}minimizeInPlace(e){return this.r=Math.min(this.r,e.r),this.g=Math.min(this.g,e.g),this.b=Math.min(this.b,e.b),this.a=Math.min(this.a,e.a),this}maximizeInPlace(e){return this.r=Math.max(this.r,e.r),this.g=Math.max(this.g,e.g),this.b=Math.max(this.b,e.b),this.a=Math.max(this.a,e.a),this}minimizeInPlaceFromFloats(e,t,i,s){return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(i,this.b),this.a=Math.min(s,this.a),this}maximizeInPlaceFromFloats(e,t,i,s){return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(i,this.b),this.a=Math.max(s,this.a),this}floorToRef(e){throw new ReferenceError("Can not floor a color")}floor(){throw new ReferenceError("Can not floor a color")}fractToRef(e){throw new ReferenceError("Can not fract a color")}fract(){throw new ReferenceError("Can not fract a color")}negate(){throw new ReferenceError("Can not negate a color")}negateInPlace(){throw new ReferenceError("Can not negate a color")}negateToRef(e){throw new ReferenceError("Can not negate a color")}equalsWithEpsilon(e,t=Le){return lt(this.r,e.r,t)&<(this.g,e.g,t)&<(this.b,e.b,t)&<(this.a,e.a,t)}equalsToFloats(e,t,i,s){return this.r===e&&this.g===t&&this.b===i&&this.a===s}toString(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"}getClassName(){return"Color4"}getHashCode(){let e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e=e*397^(this.a*255|0),e}clone(){return new H().copyFrom(this)}copyFrom(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}copyFromFloats(e,t,i,s){return this.r=e,this.g=t,this.b=i,this.a=s,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}setAll(e){return this.r=this.g=this.b=this.a=e,this}toHexString(e=!1){const t=Math.round(this.r*255),i=Math.round(this.g*255),s=Math.round(this.b*255);if(e)return"#"+Ui(t)+Ui(i)+Ui(s);const n=Math.round(this.a*255);return"#"+Ui(t)+Ui(i)+Ui(s)+Ui(n)}fromHexString(e){return e.substring(0,1)!=="#"||e.length!==9&&e.length!==7?this:(this.r=parseInt(e.substring(1,3),16)/255,this.g=parseInt(e.substring(3,5),16)/255,this.b=parseInt(e.substring(5,7),16)/255,e.length===9&&(this.a=parseInt(e.substring(7,9),16)/255),this)}toLinearSpace(e=!1){const t=new H;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){return t?(e.r=sn(this.r),e.g=sn(this.g),e.b=sn(this.b)):(e.r=tn(this.r),e.g=tn(this.g),e.b=tn(this.b)),e.a=this.a,this}toGammaSpace(e=!1){const t=new H;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){return t?(e.r=rn(this.r),e.g=rn(this.g),e.b=rn(this.b)):(e.r=nn(this.r),e.g=nn(this.g),e.b=nn(this.b)),e.a=this.a,this}static FromHexString(e){return e.substring(0,1)!=="#"||e.length!==9&&e.length!==7?new H(0,0,0,0):new H(0,0,0,1).fromHexString(e)}static Lerp(e,t,i){return H.LerpToRef(e,t,i,new H)}static LerpToRef(e,t,i,s){return s.r=e.r+(t.r-e.r)*i,s.g=e.g+(t.g-e.g)*i,s.b=e.b+(t.b-e.b)*i,s.a=e.a+(t.a-e.a)*i,s}static Hermite(e,t,i,s,n){const r=n*n,o=n*r,h=2*o-3*r+1,l=-2*o+3*r,c=o-2*r+n,u=o-r,f=e.r*h+i.r*l+t.r*c+s.r*u,d=e.g*h+i.g*l+t.g*c+s.g*u,_=e.b*h+i.b*l+t.b*c+s.b*u,p=e.a*h+i.a*l+t.a*c+s.a*u;return new H(f,d,_,p)}static Hermite1stDerivative(e,t,i,s,n){const r=new H;return this.Hermite1stDerivativeToRef(e,t,i,s,n,r),r}static Hermite1stDerivativeToRef(e,t,i,s,n,r){const o=n*n;r.r=(o-n)*6*e.r+(3*o-4*n+1)*t.r+(-o+n)*6*i.r+(3*o-2*n)*s.r,r.g=(o-n)*6*e.g+(3*o-4*n+1)*t.g+(-o+n)*6*i.g+(3*o-2*n)*s.g,r.b=(o-n)*6*e.b+(3*o-4*n+1)*t.b+(-o+n)*6*i.b+(3*o-2*n)*s.b,r.a=(o-n)*6*e.a+(3*o-4*n+1)*t.a+(-o+n)*6*i.a+(3*o-2*n)*s.a}static FromColor3(e,t=1){return new H(e.r,e.g,e.b,t)}static FromArray(e,t=0){return new H(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t=0,i){i.r=e[t],i.g=e[t+1],i.b=e[t+2],i.a=e[t+3]}static FromInts(e,t,i,s){return new H(e/255,t/255,i/255,s/255)}static CheckColors4(e,t){if(e.length===t*3){const i=[];for(let s=0;snew H(0,0,0,0));vt("BABYLON.Color3",de);vt("BABYLON.Color4",H);class Xt{constructor(e,t,i,s){this.normal=new v(e,t,i),this.d=s}asArray(){return[this.normal.x,this.normal.y,this.normal.z,this.d]}clone(){return new Xt(this.normal.x,this.normal.y,this.normal.z,this.d)}getClassName(){return"Plane"}getHashCode(){let e=this.normal.getHashCode();return e=e*397^(this.d|0),e}normalize(){const e=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y+this.normal.z*this.normal.z);let t=0;return e!==0&&(t=1/e),this.normal.x*=t,this.normal.y*=t,this.normal.z*=t,this.d*=t,this}transform(e){const t=Xt._TmpMatrix;e.invertToRef(t);const i=t.m,s=this.normal.x,n=this.normal.y,r=this.normal.z,o=this.d,h=s*i[0]+n*i[1]+r*i[2]+o*i[3],l=s*i[4]+n*i[5]+r*i[6]+o*i[7],c=s*i[8]+n*i[9]+r*i[10]+o*i[11],u=s*i[12]+n*i[13]+r*i[14]+o*i[15];return new Xt(h,l,c,u)}dotCoordinate(e){return this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z+this.d}copyFromPoints(e,t,i){const s=t.x-e.x,n=t.y-e.y,r=t.z-e.z,o=i.x-e.x,h=i.y-e.y,l=i.z-e.z,c=n*l-r*h,u=r*o-s*l,f=s*h-n*o,d=Math.sqrt(c*c+u*u+f*f);let _;return d!==0?_=1/d:_=0,this.normal.x=c*_,this.normal.y=u*_,this.normal.z=f*_,this.d=-(this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z),this}isFrontFacingTo(e,t){return v.Dot(this.normal,e)<=t}signedDistanceTo(e){return v.Dot(e,this.normal)+this.d}static FromArray(e){return new Xt(e[0],e[1],e[2],e[3])}static FromPoints(e,t,i){const s=new Xt(0,0,0,0);return s.copyFromPoints(e,t,i),s}static FromPositionAndNormal(e,t){const i=new Xt(0,0,0,0);return this.FromPositionAndNormalToRef(e,t,i)}static FromPositionAndNormalToRef(e,t,i){return i.normal.copyFrom(t),i.normal.normalize(),i.d=-e.dot(i.normal),i}static SignedDistanceToPlaneFromPositionAndNormal(e,t,i){const s=-(t.x*e.x+t.y*e.y+t.z*e.z);return v.Dot(i,t)+s}}Xt._TmpMatrix=O.Identity();class mi{static GetPlanes(e){const t=[];for(let i=0;i<6;i++)t.push(new Xt(0,0,0,0));return mi.GetPlanesToRef(e,t),t}static GetNearPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[2],t.normal.y=i[7]+i[6],t.normal.z=i[11]+i[10],t.d=i[15]+i[14],t.normalize()}static GetFarPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[2],t.normal.y=i[7]-i[6],t.normal.z=i[11]-i[10],t.d=i[15]-i[14],t.normalize()}static GetLeftPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[0],t.normal.y=i[7]+i[4],t.normal.z=i[11]+i[8],t.d=i[15]+i[12],t.normalize()}static GetRightPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[0],t.normal.y=i[7]-i[4],t.normal.z=i[11]-i[8],t.d=i[15]-i[12],t.normalize()}static GetTopPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[1],t.normal.y=i[7]-i[5],t.normal.z=i[11]-i[9],t.d=i[15]-i[13],t.normalize()}static GetBottomPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[1],t.normal.y=i[7]+i[5],t.normal.z=i[11]+i[9],t.d=i[15]+i[13],t.normalize()}static GetPlanesToRef(e,t){mi.GetNearPlaneToRef(e,t[0]),mi.GetFarPlaneToRef(e,t[1]),mi.GetLeftPlaneToRef(e,t[2]),mi.GetRightPlaneToRef(e,t[3]),mi.GetTopPlaneToRef(e,t[4]),mi.GetBottomPlaneToRef(e,t[5])}static IsPointInFrustum(e,t){for(let i=0;i<6;i++)if(t[i].dotCoordinate(e)<0)return!1;return!0}}var Lo;(function(a){a[a.CW=0]="CW",a[a.CCW=1]="CCW"})(Lo||(Lo={}));class ki{constructor(e){this._radians=e,this._radians<0&&(this._radians+=2*Math.PI)}degrees(){return this._radians*180/Math.PI}radians(){return this._radians}static BetweenTwoPoints(e,t){const i=t.subtract(e),s=Math.atan2(i.y,i.x);return new ki(s)}static BetweenTwoVectors(e,t){let i=e.lengthSquared()*t.lengthSquared();if(i===0)return new ki(Math.PI/2);i=Math.sqrt(i);let s=e.dot(t)/i;s=ht(s,-1,1);const n=Math.acos(s);return new ki(n)}static FromRadians(e){return new ki(e)}static FromDegrees(e){return new ki(e*Math.PI/180)}}class qd{constructor(e,t,i){this.startPoint=e,this.midPoint=t,this.endPoint=i;const s=Math.pow(t.x,2)+Math.pow(t.y,2),n=(Math.pow(e.x,2)+Math.pow(e.y,2)-s)/2,r=(s-Math.pow(i.x,2)-Math.pow(i.y,2))/2,o=(e.x-t.x)*(t.y-i.y)-(t.x-i.x)*(e.y-t.y);this.centerPoint=new oe((n*(t.y-i.y)-r*(e.y-t.y))/o,((e.x-t.x)*r-(t.x-i.x)*n)/o),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=ki.BetweenTwoPoints(this.centerPoint,this.startPoint);const h=this.startAngle.degrees();let l=ki.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),c=ki.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();l-h>180&&(l-=360),l-h<-180&&(l+=360),c-l>180&&(c-=360),c-l<-180&&(c+=360),this.orientation=l-h<0?0:1,this.angle=ki.FromDegrees(this.orientation===0?h-c:c-h)}}class Gr{constructor(e,t){this._points=new Array,this._length=0,this.closed=!1,this._points.push(new oe(e,t))}addLineTo(e,t){if(this.closed)return this;const i=new oe(e,t),s=this._points[this._points.length-1];return this._points.push(i),this._length+=i.subtract(s).length(),this}addArcTo(e,t,i,s,n=36){if(this.closed)return this;const r=this._points[this._points.length-1],o=new oe(e,t),h=new oe(i,s),l=new qd(r,o,h);let c=l.angle.radians()/n;l.orientation===0&&(c*=-1);let u=l.startAngle.radians()+c;for(let f=0;f(1-h)*(1-h)*l+2*h*(1-h)*c+h*h*u,o=this._points[this._points.length-1];for(let h=0;h<=n;h++){const l=h/n,c=r(l,o.x,e,i),u=r(l,o.y,t,s);this.addLineTo(c,u)}return this}addBezierCurveTo(e,t,i,s,n,r,o=36){if(this.closed)return this;const h=(c,u,f,d,_)=>(1-c)*(1-c)*(1-c)*u+3*c*(1-c)*(1-c)*f+3*c*c*(1-c)*d+c*c*c*_,l=this._points[this._points.length-1];for(let c=0;c<=o;c++){const u=c/o,f=h(u,l.x,e,i,n),d=h(u,l.y,t,s,r);this.addLineTo(f,d)}return this}isPointInside(e){let t=!1;const i=this._points.length;for(let s=i-1,n=0;nNumber.EPSILON){if(l<0&&(r=this._points[n],h=-h,o=this._points[s],l=-l),e.yo.y)continue;if(e.y===r.y&&e.x===r.x)return!0;{const c=l*(e.x-r.x)-h*(e.y-r.y);if(c===0)return!0;if(c<0)continue;t=!t}}else{if(e.y!==r.y)continue;if(o.x<=e.x&&e.x<=r.x||r.x<=e.x&&e.x<=o.x)return!0}}return t}close(){return this.closed=!0,this}length(){let e=this._length;if(this.closed){const t=this._points[this._points.length-1],i=this._points[0];e+=i.subtract(t).length()}return e}area(){const e=this._points.length;let t=0;for(let i=e-1,s=0;s1)return oe.Zero();const t=e*this.length();let i=0;for(let s=0;s=i&&t<=l){const c=h.normalize(),u=t-i;return new oe(r.x+c.x*u,r.y+c.y*u)}i=l}return oe.Zero()}static StartingAt(e,t){return new Gr(e,t)}}class Fn{constructor(e,t=null,i,s=!1){this.path=e,this._curve=new Array,this._distances=new Array,this._tangents=new Array,this._normals=new Array,this._binormals=new Array,this._pointAtData={id:0,point:v.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:O.Identity()};for(let n=0;nt){const l=e;e=t,t=l}const i=this.getCurve(),s=this.getPointAt(e);let n=this.getPreviousPointIndexAt(e);const r=this.getPointAt(t),o=this.getPreviousPointIndexAt(t)+1,h=[];return e!==0&&(n++,h.push(s)),h.push(...i.slice(n,o)),(t!==1||e===1)&&h.push(r),new Fn(h,this.getNormalAt(e),this._raw,this._alignTangentsWithPath)}update(e,t=null,i=!1){for(let s=0;st+1;)t++,i=this._curve[e].subtract(this._curve[e-t]);return i}_normalVector(e,t){let i,s=e.length();if(s===0&&(s=1),t==null){let n;lt(Math.abs(e.y)/s,1,Le)?lt(Math.abs(e.x)/s,1,Le)?lt(Math.abs(e.z)/s,1,Le)?n=v.Zero():n=new v(0,0,1):n=new v(1,0,0):n=new v(0,-1,0),i=v.Cross(e,n)}else i=v.Cross(e,t),v.CrossToRef(i,e,i);return i.normalize(),i}_updatePointAtData(e,t=!1){if(this._pointAtData.id===e)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=e;const i=this.getPoints();if(e<=0)return this._setPointAtData(0,0,i[0],0,t);if(e>=1)return this._setPointAtData(1,1,i[i.length-1],i.length-1,t);let s=i[0],n,r=0;const o=e*this.length();for(let h=1;ho){const u=(r-o)/l,f=s.subtract(n),d=n.add(f.scaleInPlace(u));return this._setPointAtData(e,1-u,d,h-1,t)}s=n}return this._pointAtData}_setPointAtData(e,t,i,s,n){return this._pointAtData.point=i,this._pointAtData.position=e,this._pointAtData.subPosition=t,this._pointAtData.previousPointArrayIndex=s,this._pointAtData.interpolateReady=n,n&&this._updateInterpolationMatrix(),this._pointAtData}_updateInterpolationMatrix(){this._pointAtData.interpolationMatrix=O.Identity();const e=this._pointAtData.previousPointArrayIndex;if(e!==this._tangents.length-1){const t=e+1,i=this._tangents[e].clone(),s=this._normals[e].clone(),n=this._binormals[e].clone(),r=this._tangents[t].clone(),o=this._normals[t].clone(),h=this._binormals[t].clone(),l=re.RotationQuaternionFromAxis(s,n,i),c=re.RotationQuaternionFromAxis(o,h,r);re.Slerp(l,c,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}}}class hi{constructor(e,t){this.width=e,this.height=t}toString(){return"{W: ".concat(this.width,", H: ").concat(this.height,"}")}getClassName(){return"Size"}getHashCode(){let e=this.width|0;return e=e*397^(this.height|0),e}copyFrom(e){this.width=e.width,this.height=e.height}copyFromFloats(e,t){return this.width=e,this.height=t,this}set(e,t){return this.copyFromFloats(e,t)}multiplyByFloats(e,t){return new hi(this.width*e,this.height*t)}clone(){return new hi(this.width,this.height)}equals(e){return e?this.width===e.width&&this.height===e.height:!1}get surface(){return this.width*this.height}static Zero(){return new hi(0,0)}add(e){return new hi(this.width+e.width,this.height+e.height)}subtract(e){return new hi(this.width-e.width,this.height-e.height)}scale(e){return new hi(this.width*e,this.height*e)}static Lerp(e,t,i){const s=e.width+(t.width-e.width)*i,n=e.height+(t.height-e.height)*i;return new hi(s,n)}}class on{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s}toGlobal(e,t){return new on(this.x*e,this.y*t,this.width*e,this.height*t)}toGlobalToRef(e,t,i){return i.x=this.x*e,i.y=this.y*t,i.width=this.width*e,i.height=this.height*t,this}clone(){return new on(this.x,this.y,this.width,this.height)}}const Ni=[Math.sqrt(1/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(3/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(15/(4*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(5/(16*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(15/(16*Math.PI))],jd=[()=>1,a=>a.y,a=>a.z,a=>a.x,a=>a.x*a.y,a=>a.y*a.z,a=>3*a.z*a.z-1,a=>a.x*a.z,a=>a.x*a.x-a.y*a.y],Zi=(a,e)=>Ni[a]*jd[a](e),Qi=[Math.PI,2*Math.PI/3,2*Math.PI/3,2*Math.PI/3,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4];class Ir{constructor(){this.preScaled=!1,this.l00=v.Zero(),this.l1_1=v.Zero(),this.l10=v.Zero(),this.l11=v.Zero(),this.l2_2=v.Zero(),this.l2_1=v.Zero(),this.l20=v.Zero(),this.l21=v.Zero(),this.l22=v.Zero()}addLight(e,t,i){N.Vector3[0].set(t.r,t.g,t.b);const s=N.Vector3[0],n=N.Vector3[1];s.scaleToRef(i,n),n.scaleToRef(Zi(0,e),N.Vector3[2]),this.l00.addInPlace(N.Vector3[2]),n.scaleToRef(Zi(1,e),N.Vector3[2]),this.l1_1.addInPlace(N.Vector3[2]),n.scaleToRef(Zi(2,e),N.Vector3[2]),this.l10.addInPlace(N.Vector3[2]),n.scaleToRef(Zi(3,e),N.Vector3[2]),this.l11.addInPlace(N.Vector3[2]),n.scaleToRef(Zi(4,e),N.Vector3[2]),this.l2_2.addInPlace(N.Vector3[2]),n.scaleToRef(Zi(5,e),N.Vector3[2]),this.l2_1.addInPlace(N.Vector3[2]),n.scaleToRef(Zi(6,e),N.Vector3[2]),this.l20.addInPlace(N.Vector3[2]),n.scaleToRef(Zi(7,e),N.Vector3[2]),this.l21.addInPlace(N.Vector3[2]),n.scaleToRef(Zi(8,e),N.Vector3[2]),this.l22.addInPlace(N.Vector3[2])}scaleInPlace(e){this.l00.scaleInPlace(e),this.l1_1.scaleInPlace(e),this.l10.scaleInPlace(e),this.l11.scaleInPlace(e),this.l2_2.scaleInPlace(e),this.l2_1.scaleInPlace(e),this.l20.scaleInPlace(e),this.l21.scaleInPlace(e),this.l22.scaleInPlace(e)}convertIncidentRadianceToIrradiance(){this.l00.scaleInPlace(Qi[0]),this.l1_1.scaleInPlace(Qi[1]),this.l10.scaleInPlace(Qi[2]),this.l11.scaleInPlace(Qi[3]),this.l2_2.scaleInPlace(Qi[4]),this.l2_1.scaleInPlace(Qi[5]),this.l20.scaleInPlace(Qi[6]),this.l21.scaleInPlace(Qi[7]),this.l22.scaleInPlace(Qi[8])}convertIrradianceToLambertianRadiance(){this.scaleInPlace(1/Math.PI)}preScaleForRendering(){this.preScaled=!0,this.l00.scaleInPlace(Ni[0]),this.l1_1.scaleInPlace(Ni[1]),this.l10.scaleInPlace(Ni[2]),this.l11.scaleInPlace(Ni[3]),this.l2_2.scaleInPlace(Ni[4]),this.l2_1.scaleInPlace(Ni[5]),this.l20.scaleInPlace(Ni[6]),this.l21.scaleInPlace(Ni[7]),this.l22.scaleInPlace(Ni[8])}updateFromArray(e){return v.FromArrayToRef(e[0],0,this.l00),v.FromArrayToRef(e[1],0,this.l1_1),v.FromArrayToRef(e[2],0,this.l10),v.FromArrayToRef(e[3],0,this.l11),v.FromArrayToRef(e[4],0,this.l2_2),v.FromArrayToRef(e[5],0,this.l2_1),v.FromArrayToRef(e[6],0,this.l20),v.FromArrayToRef(e[7],0,this.l21),v.FromArrayToRef(e[8],0,this.l22),this}updateFromFloatsArray(e){return v.FromFloatsToRef(e[0],e[1],e[2],this.l00),v.FromFloatsToRef(e[3],e[4],e[5],this.l1_1),v.FromFloatsToRef(e[6],e[7],e[8],this.l10),v.FromFloatsToRef(e[9],e[10],e[11],this.l11),v.FromFloatsToRef(e[12],e[13],e[14],this.l2_2),v.FromFloatsToRef(e[15],e[16],e[17],this.l2_1),v.FromFloatsToRef(e[18],e[19],e[20],this.l20),v.FromFloatsToRef(e[21],e[22],e[23],this.l21),v.FromFloatsToRef(e[24],e[25],e[26],this.l22),this}static FromArray(e){return new Ir().updateFromArray(e)}static FromPolynomial(e){const t=new Ir;return t.l00=e.xx.scale(.376127).add(e.yy.scale(.376127)).add(e.zz.scale(.376126)),t.l1_1=e.y.scale(.977204),t.l10=e.z.scale(.977204),t.l11=e.x.scale(.977204),t.l2_2=e.xy.scale(1.16538),t.l2_1=e.yz.scale(1.16538),t.l20=e.zz.scale(1.34567).subtract(e.xx.scale(.672834)).subtract(e.yy.scale(.672834)),t.l21=e.zx.scale(1.16538),t.l22=e.xx.scale(1.16538).subtract(e.yy.scale(1.16538)),t.l1_1.scaleInPlace(-1),t.l11.scaleInPlace(-1),t.l2_1.scaleInPlace(-1),t.l21.scaleInPlace(-1),t.scaleInPlace(Math.PI),t}}class On{constructor(){this.x=v.Zero(),this.y=v.Zero(),this.z=v.Zero(),this.xx=v.Zero(),this.yy=v.Zero(),this.zz=v.Zero(),this.xy=v.Zero(),this.yz=v.Zero(),this.zx=v.Zero()}get preScaledHarmonics(){return this._harmonics||(this._harmonics=Ir.FromPolynomial(this)),this._harmonics.preScaled||this._harmonics.preScaleForRendering(),this._harmonics}addAmbient(e){N.Vector3[0].copyFromFloats(e.r,e.g,e.b);const t=N.Vector3[0];this.xx.addInPlace(t),this.yy.addInPlace(t),this.zz.addInPlace(t)}scaleInPlace(e){this.x.scaleInPlace(e),this.y.scaleInPlace(e),this.z.scaleInPlace(e),this.xx.scaleInPlace(e),this.yy.scaleInPlace(e),this.zz.scaleInPlace(e),this.yz.scaleInPlace(e),this.zx.scaleInPlace(e),this.xy.scaleInPlace(e)}updateFromHarmonics(e){return this._harmonics=e,this.x.copyFrom(e.l11),this.x.scaleInPlace(1.02333).scaleInPlace(-1),this.y.copyFrom(e.l1_1),this.y.scaleInPlace(1.02333).scaleInPlace(-1),this.z.copyFrom(e.l10),this.z.scaleInPlace(1.02333),this.xx.copyFrom(e.l00),N.Vector3[0].copyFrom(e.l20).scaleInPlace(.247708),N.Vector3[1].copyFrom(e.l22).scaleInPlace(.429043),this.xx.scaleInPlace(.886277).subtractInPlace(N.Vector3[0]).addInPlace(N.Vector3[1]),this.yy.copyFrom(e.l00),this.yy.scaleInPlace(.886277).subtractInPlace(N.Vector3[0]).subtractInPlace(N.Vector3[1]),this.zz.copyFrom(e.l00),N.Vector3[0].copyFrom(e.l20).scaleInPlace(.495417),this.zz.scaleInPlace(.886277).addInPlace(N.Vector3[0]),this.yz.copyFrom(e.l2_1),this.yz.scaleInPlace(.858086).scaleInPlace(-1),this.zx.copyFrom(e.l21),this.zx.scaleInPlace(.858086).scaleInPlace(-1),this.xy.copyFrom(e.l2_2),this.xy.scaleInPlace(.858086),this.scaleInPlace(1/Math.PI),this}static FromHarmonics(e){return new On().updateFromHarmonics(e)}static FromArray(e){const t=new On;return v.FromArrayToRef(e[0],0,t.x),v.FromArrayToRef(e[1],0,t.y),v.FromArrayToRef(e[2],0,t.z),v.FromArrayToRef(e[3],0,t.xx),v.FromArrayToRef(e[4],0,t.yy),v.FromArrayToRef(e[5],0,t.zz),v.FromArrayToRef(e[6],0,t.yz),v.FromArrayToRef(e[7],0,t.zx),v.FromArrayToRef(e[8],0,t.xy),t}}function D(a,e,t,i){var s=arguments.length,n=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(a,e,t,i);else for(var o=a.length-1;o>=0;o--)(r=a[o])&&(n=(s<3?r(n):s>3?r(e,t,n):r(e,t))||n);return s>3&&n&&Object.defineProperty(e,t,n),n}const rr={},_r={};function $d(a){const e=a.getClassName();return _r[e]||(_r[e]={}),_r[e]}function La(a){const e=a.getClassName();if(rr[e])return rr[e];rr[e]={};const t=rr[e];let i=a,s=e;for(;s;){const n=_r[s];for(const h in n)t[h]=n[h];let r,o=!1;do{if(r=Object.getPrototypeOf(i),!r.getClassName){o=!0;break}if(r.getClassName()!==s)break;i=r}while(r);if(o)break;s=r.getClassName(),i=r}return t}function Di(a,e){return(t,i)=>{const s=$d(t);s[i]||(s[i]={type:a,sourceName:e})}}function Zd(a,e=null){return(t,i)=>{const s=e||"_"+i;Object.defineProperty(t,i,{get:function(){return this[s]},set:function(n){typeof this.equals=="function"&&this.equals(n)||this[s]!==n&&(this[s]=n,t[a].apply(this))},enumerable:!0,configurable:!0})}}function je(a,e=null){return Zd(a,e)}function B(a){return Di(0,a)}function _i(a){return Di(1,a)}function ls(a){return Di(2,a)}function Kn(a){return Di(3,a)}function tc(a){return Di(4,a)}function yi(a){return Di(5,a)}function ic(a){return Di(6,a)}function Qd(a){return Di(7,a)}function p0(a){return Di(8,a)}function Jd(a){return Di(10,a)}function e_(a){return Di(11,a)}function rs(a,e,t,i){const s=t.value;t.value=(...n)=>{let r=s;if(typeof _native<"u"&&_native[e]){const o=_native[e];i?r=(...h)=>i(...h)?o(...h):s(...h):r=o}return a[e]=r,r(...n)}}rs.filter=function(a){return(e,t,i)=>rs(e,t,i,a)};function g0(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const e=Math.random()*16|0;return(a==="x"?e:e&3|8).toString(16)})}function t_(){return typeof _native<"u"&&_native.XMLHttpRequest?new _native.XMLHttpRequest:new XMLHttpRequest}class Ft{constructor(){this._xhr=t_(),this._requestURL=""}static get IsCustomRequestAvailable(){return Object.keys(Ft.CustomRequestHeaders).length>0||Ft.CustomRequestModifiers.length>0}get requestURL(){return this._requestURL}_injectCustomRequestHeaders(){if(!this._shouldSkipRequestModifications(this._requestURL))for(const e in Ft.CustomRequestHeaders){const t=Ft.CustomRequestHeaders[e];t&&this._xhr.setRequestHeader(e,t)}}_shouldSkipRequestModifications(e){return Ft.SkipRequestModificationForBabylonCDN&&(e.includes("preview.babylonjs.com")||e.includes("cdn.babylonjs.com"))}get onprogress(){return this._xhr.onprogress}set onprogress(e){this._xhr.onprogress=e}get readyState(){return this._xhr.readyState}get status(){return this._xhr.status}get statusText(){return this._xhr.statusText}get response(){return this._xhr.response}get responseURL(){return this._xhr.responseURL}get responseText(){return this._xhr.responseText}get responseType(){return this._xhr.responseType}set responseType(e){this._xhr.responseType=e}get timeout(){return this._xhr.timeout}set timeout(e){this._xhr.timeout=e}addEventListener(e,t,i){this._xhr.addEventListener(e,t,i)}removeEventListener(e,t,i){this._xhr.removeEventListener(e,t,i)}abort(){this._xhr.abort()}send(e){Ft.CustomRequestHeaders&&this._injectCustomRequestHeaders(),this._xhr.send(e)}open(e,t){for(const i of Ft.CustomRequestModifiers){if(this._shouldSkipRequestModifications(t))return;i(this._xhr,t)}t=t.replace("file:http:","http:"),t=t.replace("file:https:","https:"),this._requestURL=t,this._xhr.open(e,t,!0)}setRequestHeader(e,t){this._xhr.setRequestHeader(e,t)}getResponseHeader(e){return this._xhr.getResponseHeader(e)}}Ft.CustomRequestHeaders={};Ft.CustomRequestModifiers=new Array;Ft.SkipRequestModificationForBabylonCDN=!0;class Cn{}Cn.FilesToLoad={};class i_{static ExponentialBackoff(e=3,t=500){return(i,s,n)=>s.status!==0||n>=e||i.indexOf("file:")!==-1?-1:Math.pow(2,n)*t}}class hn extends Error{}hn._setPrototypeOf=Object.setPrototypeOf||((a,e)=>(a.__proto__=e,a));const Hs={MeshInvalidPositionsError:0,SceneLoaderError:3e3,LoadFileError:4e3,RequestFileError:4001,ReadFileError:4002};class cs extends hn{constructor(e,t,i){super(e),this.errorCode=t,this.innerError=i,this.name="RuntimeError",hn._setPrototypeOf(this,cs.prototype)}}const sc=a=>{const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let t="",i,s,n,r,o,h,l,c=0;const u=ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a);for(;c>2,o=(i&3)<<4|s>>4,h=(s&15)<<2|n>>6,l=n&63,isNaN(s)?h=l=64:isNaN(n)&&(l=64),t+=e.charAt(r)+e.charAt(o)+e.charAt(h)+e.charAt(l);return t},nc=a=>atob(a),s_=a=>{const e=nc(a),t=e.length,i=new Uint8Array(new ArrayBuffer(t));for(let s=0;s(a=a.replace(/#/gm,"%23"),a),ut={DefaultRetryStrategy:i_.ExponentialBackoff(),BaseUrl:"",CorsBehavior:"anonymous",PreprocessUrl:a=>a,ScriptBaseUrl:"",ScriptPreprocessUrl:a=>a,CleanUrl:n_},v0=(a,e)=>{if(!(a&&a.indexOf("data:")===0)&&ut.CorsBehavior)if(typeof ut.CorsBehavior=="string"||ut.CorsBehavior instanceof String)e.crossOrigin=ut.CorsBehavior;else{const t=ut.CorsBehavior(a);t&&(e.crossOrigin=t)}},b0=(a,e,t,i,s="",n)=>{const r=Ee.LastCreatedEngine;if(typeof HTMLImageElement>"u"&&!(r!=null&&r._features.forceBitmapOverHTMLImageElement))return t("LoadImage is only supported in web or BabylonNative environments."),null;let o,h=!1;a instanceof ArrayBuffer||ArrayBuffer.isView(a)?typeof Blob<"u"&&typeof URL<"u"?(o=URL.createObjectURL(new Blob([a],{type:s})),h=!0):o="data:".concat(s,";base64,")+sc(a):a instanceof Blob?(o=URL.createObjectURL(a),h=!0):(o=ut.CleanUrl(a),o=ut.PreprocessUrl(o));const l=x=>{if(t){const y=o||a.toString();t("Error while trying to load image: ".concat(y.indexOf("http")===0||y.length<=128?y:y.slice(0,128)+"..."),x)}};if(r!=null&&r._features.forceBitmapOverHTMLImageElement)return Ts(o,x=>{r.createImageBitmap(new Blob([x],{type:s}),{premultiplyAlpha:"none",...n}).then(y=>{e(y),h&&URL.revokeObjectURL(o)}).catch(y=>{t&&t("Error while trying to load image: "+a,y)})},void 0,i||void 0,!0,(x,y)=>{l(y)}),null;const c=new Image;v0(o,c);const u=[],f=()=>{u.forEach(x=>{x.target.addEventListener(x.name,x.handler)})},d=()=>{u.forEach(x=>{x.target.removeEventListener(x.name,x.handler)}),u.length=0},_=()=>{d(),e(c),h&&c.src&&URL.revokeObjectURL(c.src)},p=x=>{d(),l(x),h&&c.src&&URL.revokeObjectURL(c.src)},g=x=>{if(x.blockedURI!==c.src||x.disposition==="report")return;d();const y=new Error("CSP violation of policy ".concat(x.effectiveDirective," ").concat(x.blockedURI,". Current policy is ").concat(x.originalPolicy));Ee.UseFallbackTexture=!1,l(y),h&&c.src&&URL.revokeObjectURL(c.src),c.src=""};u.push({target:c,name:"load",handler:_}),u.push({target:c,name:"error",handler:p}),u.push({target:document,name:"securitypolicyviolation",handler:g}),f();const m=o.substring(0,5)==="blob:",b=o.substring(0,5)==="data:",I=()=>{m||b||!Ft.IsCustomRequestAvailable?c.src=o:Ts(o,(x,y,R)=>{const E=!s&&R?R:s,C=new Blob([x],{type:E}),S=URL.createObjectURL(C);h=!0,c.src=S},void 0,i||void 0,!0,(x,y)=>{l(y)})},T=()=>{i&&i.loadImage(o,c)};if(!m&&!b&&i&&i.enableTexturesOffline)i.open(T,I);else{if(o.indexOf("file:")!==-1){const x=decodeURIComponent(o.substring(5).toLowerCase());if(Cn.FilesToLoad[x]&&typeof URL<"u"){try{let y;try{y=URL.createObjectURL(Cn.FilesToLoad[x])}catch{y=URL.createObjectURL(Cn.FilesToLoad[x])}c.src=y,h=!0}catch{c.src=""}return c}}I()}return c},Ln=(a,e,t,i,s)=>{const n=new FileReader,r={onCompleteObservable:new Z,abort:()=>n.abort()};return n.onloadend=()=>r.onCompleteObservable.notifyObservers(r),s&&(n.onerror=()=>{s(new m0("Unable to read ".concat(a.name),a))}),n.onload=o=>{e(o.target.result)},t&&(n.onprogress=t),i?n.readAsArrayBuffer(a):n.readAsText(a),r},Ts=(a,e,t,i,s,n,r)=>{if(a.name)return Ln(a,e,t,s,n?c=>{n(void 0,c)}:void 0);const o=a;if(o.indexOf("file:")!==-1){let c=decodeURIComponent(o.substring(5).toLowerCase());c.indexOf("./")===0&&(c=c.substring(2));const u=Cn.FilesToLoad[c];if(u)return Ln(u,e,t,s,n?f=>n(void 0,new Er(f.message,f.file)):void 0)}const{match:h,type:l}=r_(o);if(h){const c={onCompleteObservable:new Z,abort:()=>()=>{}};try{const u=s?T0(o):oc(o);e(u,void 0,l)}catch(u){n?n(void 0,u):U.Error(u.message||"Failed to parse the Data URL")}return Bn.SetImmediate(()=>{c.onCompleteObservable.notifyObservers(c)}),c}return x0(o,(c,u)=>{e(c,u==null?void 0:u.responseURL,u==null?void 0:u.getResponseHeader("content-type"))},t,i,s,n?c=>{n(c.request,new Er(c.message,c.request))}:void 0,r)},x0=(a,e,t,i,s,n,r)=>{a=ut.CleanUrl(a),a=ut.PreprocessUrl(a);const o=ut.BaseUrl+a;let h=!1;const l={onCompleteObservable:new Z,abort:()=>h=!0},c=()=>{let u=new Ft,f=null,d;const _=()=>{u&&(t&&u.removeEventListener("progress",t),d&&u.removeEventListener("readystatechange",d),u.removeEventListener("loadend",p))};let p=()=>{_(),l.onCompleteObservable.notifyObservers(l),l.onCompleteObservable.clear(),t=void 0,d=null,p=null,n=void 0,r=void 0,e=void 0};l.abort=()=>{h=!0,p&&p(),u&&u.readyState!==(XMLHttpRequest.DONE||4)&&u.abort(),f!==null&&(clearTimeout(f),f=null),u=null};const g=b=>{const I=b.message||"Unknown error";n&&u?n(new Cr(I,u)):U.Error(I)},m=b=>{if(u){if(u.open("GET",o),r)try{r(u)}catch(I){g(I);return}s&&(u.responseType="arraybuffer"),t&&u.addEventListener("progress",t),p&&u.addEventListener("loadend",p),d=()=>{if(!(h||!u)&&u.readyState===(XMLHttpRequest.DONE||4)){if(d&&u.removeEventListener("readystatechange",d),u.status>=200&&u.status<300||u.status===0&&(!St()||ac())){try{e&&e(s?u.response:u.responseText,u)}catch(x){g(x)}return}const I=ut.DefaultRetryStrategy;if(I){const x=I(o,u,b);if(x!==-1){_(),u=new Ft,f=setTimeout(()=>m(b+1),x);return}}const T=new Cr("Error status: "+u.status+" "+u.statusText+" - Unable to load "+o,u);n&&n(T)}},u.addEventListener("readystatechange",d),u.send()}};m(0)};if(i&&i.enableSceneOffline){const u=d=>{d&&d.status>400?n&&n(d):c()},f=()=>{i&&i.loadFile(ut.BaseUrl+a,d=>{!h&&e&&e(d),l.onCompleteObservable.notifyObservers(l)},t?d=>{!h&&t&&t(d)}:void 0,u,s)};i.open(f,u)}else c();return l},ac=()=>typeof location<"u"&&location.protocol==="file:",y0=a=>rc.test(a),r_=a=>{const e=rc.exec(a);return e===null||e.length===0?{match:!1,type:""}:{match:!0,type:e[0].replace("data:","").replace("base64,","")}};function T0(a){return s_(a.split(",")[1])}const oc=a=>nc(a.split(",")[1]),a_=()=>{ae._FileToolsLoadImage=b0,xr.loadFile=Ts,zl.loadFile=Ts};a_();let bn;const o_=(a,e,t,i,s,n,r,o,h,l)=>{bn={DecodeBase64UrlToBinary:a,DecodeBase64UrlToString:e,DefaultRetryStrategy:t.DefaultRetryStrategy,BaseUrl:t.BaseUrl,CorsBehavior:t.CorsBehavior,PreprocessUrl:t.PreprocessUrl,IsBase64DataUrl:i,IsFileURL:s,LoadFile:n,LoadImage:r,ReadFile:o,RequestFile:h,SetCorsBehavior:l},Object.defineProperty(bn,"DefaultRetryStrategy",{get:function(){return t.DefaultRetryStrategy},set:function(c){t.DefaultRetryStrategy=c}}),Object.defineProperty(bn,"BaseUrl",{get:function(){return t.BaseUrl},set:function(c){t.BaseUrl=c}}),Object.defineProperty(bn,"PreprocessUrl",{get:function(){return t.PreprocessUrl},set:function(c){t.PreprocessUrl=c}}),Object.defineProperty(bn,"CorsBehavior",{get:function(){return t.CorsBehavior},set:function(c){t.CorsBehavior=c}})};o_(T0,oc,ut,y0,ac,Ts,b0,Ln,x0,v0);class A0{get wrapU(){return this._wrapU}set wrapU(e){this._wrapU=e}get wrapV(){return this._wrapV}set wrapV(e){this._wrapV=e}get coordinatesMode(){return 0}get isCube(){return this._texture?this._texture.isCube:!1}set isCube(e){this._texture&&(this._texture.isCube=e)}get is3D(){return this._texture?this._texture.is3D:!1}set is3D(e){this._texture&&(this._texture.is3D=e)}get is2DArray(){return this._texture?this._texture.is2DArray:!1}set is2DArray(e){this._texture&&(this._texture.is2DArray=e)}getClassName(){return"ThinTexture"}static _IsRenderTargetWrapper(e){return(e==null?void 0:e.shareDepth)!==void 0}constructor(e){this._wrapU=1,this._wrapV=1,this.wrapR=1,this.anisotropicFilteringLevel=4,this.delayLoadState=0,this._texture=null,this._engine=null,this._cachedSize=hi.Zero(),this._cachedBaseSize=hi.Zero(),this._initialSamplingMode=2,this._texture=A0._IsRenderTargetWrapper(e)?e.texture:e,this._texture&&(this._engine=this._texture.getEngine())}isReady(){return this.delayLoadState===4?(this.delayLoad(),!1):this._texture?this._texture.isReady:!1}delayLoad(){}getInternalTexture(){return this._texture}getSize(){if(this._texture){if(this._texture.width)return this._cachedSize.width=this._texture.width,this._cachedSize.height=this._texture.height,this._cachedSize;if(this._texture._size)return this._cachedSize.width=this._texture._size,this._cachedSize.height=this._texture._size,this._cachedSize}return this._cachedSize}getBaseSize(){return!this.isReady()||!this._texture?(this._cachedBaseSize.width=0,this._cachedBaseSize.height=0,this._cachedBaseSize):this._texture._size?(this._cachedBaseSize.width=this._texture._size,this._cachedBaseSize.height=this._texture._size,this._cachedBaseSize):(this._cachedBaseSize.width=this._texture.baseWidth,this._cachedBaseSize.height=this._texture.baseHeight,this._cachedBaseSize)}get samplingMode(){return this._texture?this._texture.samplingMode:this._initialSamplingMode}updateSamplingMode(e){this._texture&&this._engine&&this._engine.updateTextureSamplingMode(e,this._texture)}releaseInternalTexture(){this._texture&&(this._texture.dispose(),this._texture=null)}dispose(){this._texture&&(this.releaseInternalTexture(),this._engine=null)}}class ws{static Eval(e,t){return e.match(/\([^()]*\)/g)?e=e.replace(/\([^()]*\)/g,i=>(i=i.slice(1,i.length-1),ws._HandleParenthesisContent(i,t))):e=ws._HandleParenthesisContent(e,t),e==="true"?!0:e==="false"?!1:ws.Eval(e,t)}static _HandleParenthesisContent(e,t){t=t||(n=>n==="true");let i;const s=e.split("||");for(const n in s)if(Object.prototype.hasOwnProperty.call(s,n)){let r=ws._SimplifyNegation(s[n].trim());const o=r.split("&&");if(o.length>1)for(let h=0;h(t=t.replace(/[\s]/g,()=>""),t.length%2?"!":"")),e=e.trim(),e==="!true"?e="false":e==="!false"&&(e="true"),e}}class ke{static EnableFor(e){e._tags=e._tags||{},e.hasTags=()=>ke.HasTags(e),e.addTags=t=>ke.AddTagsTo(e,t),e.removeTags=t=>ke.RemoveTagsFrom(e,t),e.matchesTagsQuery=t=>ke.MatchesQuery(e,t)}static DisableFor(e){delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery}static HasTags(e){if(!e._tags)return!1;const t=e._tags;for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i))return!0;return!1}static GetTags(e,t=!0){if(!e._tags)return null;if(t){const i=[];for(const s in e._tags)Object.prototype.hasOwnProperty.call(e._tags,s)&&e._tags[s]===!0&&i.push(s);return i.join(" ")}else return e._tags}static AddTagsTo(e,t){if(!t||typeof t!="string")return;t.split(" ").forEach(function(s){ke._AddTagTo(e,s)})}static _AddTagTo(e,t){t=t.trim(),!(t===""||t==="true"||t==="false")&&(t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(ke.EnableFor(e),e._tags[t]=!0))}static RemoveTagsFrom(e,t){if(!ke.HasTags(e))return;const i=t.split(" ");for(const s in i)ke._RemoveTagFrom(e,i[s])}static _RemoveTagFrom(e,t){delete e._tags[t]}static MatchesQuery(e,t){return t===void 0?!0:t===""?ke.HasTags(e):ws.Eval(t,i=>ke.HasTags(e)&&e._tags[i])}}const No=function(a,e,t,i={}){const s=a();ke&&ke.HasTags(e)&&ke.AddTagsTo(s,ke.GetTags(e,!0));const n=La(s),r={};for(const o in n){const h=n[o],l=e[o],c=h.type;if(l!=null&&(o!=="uniqueId"||Ae.AllowLoadingUniqueId))switch(c){case 0:case 6:case 11:s[o]=l;break;case 1:i.cloneTexturesOnlyOnce&&r[l.uniqueId]?s[o]=r[l.uniqueId]:(s[o]=t||l.isRenderTarget?l:l.clone(),r[l.uniqueId]=s[o]);break;case 2:case 3:case 4:case 5:case 7:case 10:case 12:s[o]=t?l:l.clone();break}}return s};class Ae{static AppendSerializedAnimations(e,t){if(e.animations){t.animations=[];for(let i=0;i{throw ye("ImageProcessingConfiguration")};Ae._FresnelParametersParser=a=>{throw ye("FresnelParameters")};Ae._ColorCurvesParser=a=>{throw ye("ColorCurves")};Ae._TextureParser=(a,e,t)=>{throw ye("Texture")};class st extends A0{set hasAlpha(e){this._hasAlpha!==e&&(this._hasAlpha=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,t=>t.hasTexture(this)))}get hasAlpha(){return this._hasAlpha}set getAlphaFromRGB(e){this._getAlphaFromRGB!==e&&(this._getAlphaFromRGB=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,t=>t.hasTexture(this)))}get getAlphaFromRGB(){return this._getAlphaFromRGB}set coordinatesIndex(e){this._coordinatesIndex!==e&&(this._coordinatesIndex=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,t=>t.hasTexture(this)))}get coordinatesIndex(){return this._coordinatesIndex}set coordinatesMode(e){this._coordinatesMode!==e&&(this._coordinatesMode=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,t=>t.hasTexture(this)))}get coordinatesMode(){return this._coordinatesMode}get wrapU(){return this._wrapU}set wrapU(e){this._wrapU=e}get wrapV(){return this._wrapV}set wrapV(e){this._wrapV=e}get isCube(){return this._texture?this._texture.isCube:this._isCube}set isCube(e){this._texture?this._texture.isCube=e:this._isCube=e}get is3D(){return this._texture?this._texture.is3D:!1}set is3D(e){this._texture&&(this._texture.is3D=e)}get is2DArray(){return this._texture?this._texture.is2DArray:!1}set is2DArray(e){this._texture&&(this._texture.is2DArray=e)}get gammaSpace(){if(this._texture)this._texture._gammaSpace===null&&(this._texture._gammaSpace=this._gammaSpace);else return this._gammaSpace;return this._texture._gammaSpace&&!this._texture._useSRGBBuffer}set gammaSpace(e){var t;if(this._texture){if(this._texture._gammaSpace===e)return;this._texture._gammaSpace=e}else{if(this._gammaSpace===e)return;this._gammaSpace=e}(t=this.getScene())==null||t.markAllMaterialsAsDirty(1,i=>i.hasTexture(this))}get isRGBD(){return this._texture!=null&&this._texture._isRGBD}set isRGBD(e){var t;e!==this.isRGBD&&(this._texture&&(this._texture._isRGBD=e),(t=this.getScene())==null||t.markAllMaterialsAsDirty(1,i=>i.hasTexture(this)))}get noMipmap(){return!1}get lodGenerationOffset(){return this._texture?this._texture._lodGenerationOffset:0}set lodGenerationOffset(e){this._texture&&(this._texture._lodGenerationOffset=e)}get lodGenerationScale(){return this._texture?this._texture._lodGenerationScale:0}set lodGenerationScale(e){this._texture&&(this._texture._lodGenerationScale=e)}get linearSpecularLOD(){return this._texture?this._texture._linearSpecularLOD:!1}set linearSpecularLOD(e){this._texture&&(this._texture._linearSpecularLOD=e)}get irradianceTexture(){return this._texture?this._texture._irradianceTexture:null}set irradianceTexture(e){this._texture&&(this._texture._irradianceTexture=e)}get uid(){return this._uid||(this._uid=g0()),this._uid}toString(){return this.name}getClassName(){return"BaseTexture"}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get isBlocking(){return!0}get loadingError(){return this._loadingError}get errorObject(){return this._errorObject}constructor(e,t=null){super(null),this.metadata=null,this.reservedDataStore=null,this._hasAlpha=!1,this._getAlphaFromRGB=!1,this.level=1,this._coordinatesIndex=0,this.optimizeUVAllocation=!0,this._coordinatesMode=0,this.wrapR=1,this.anisotropicFilteringLevel=st.DEFAULT_ANISOTROPIC_FILTERING_LEVEL,this._isCube=!1,this._gammaSpace=!0,this.invertZ=!1,this.lodLevelInAlpha=!1,this.isRenderTarget=!1,this._prefiltered=!1,this._forceSerialize=!1,this.animations=[],this.onDisposeObservable=new Z,this._onDisposeObserver=null,this._scene=null,this._uid=null,this._parentContainer=null,this._loadingError=!1,e?st._IsScene(e)?this._scene=e:this._engine=e:this._scene=Ee.LastCreatedScene,this._scene&&(this.uniqueId=this._scene.getUniqueId(),this._scene.addTexture(this),this._engine=this._scene.getEngine()),this._texture=t,this._uid=null}getScene(){return this._scene}_getEngine(){return this._engine}getTextureMatrix(){return O.IdentityReadOnly}getReflectionTextureMatrix(){return O.IdentityReadOnly}getRefractionTextureMatrix(){return this.getReflectionTextureMatrix()}isReadyOrNotBlocking(){return!this.isBlocking||this.isReady()||this.loadingError}scale(e){}get canRescale(){return!1}_getFromCache(e,t,i,s,n,r){const o=this._getEngine();if(!o)return null;const h=o._getUseSRGBBuffer(!!n,t),l=o.getLoadedTexturesCache();for(let c=0;c=0&&this._scene.textures.splice(e,1),this._scene.onTextureRemovedObservable.notifyObservers(this),this._scene=null,this._parentContainer){const t=this._parentContainer.textures.indexOf(this);t>-1&&this._parentContainer.textures.splice(t,1),this._parentContainer=null}}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.metadata=null,super.dispose()}serialize(e=!1){if(!this.name&&!e)return null;const t=Ae.Serialize(this);return Ae.AppendSerializedAnimations(this,t),t}static WhenAllReady(e,t){let i=e.length;if(i===0){t();return}for(let s=0;s{--i===0&&t()}):--i===0&&t()}}}static _IsScene(e){return e.getClassName()==="Scene"}}st.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=4;D([B()],st.prototype,"uniqueId",void 0);D([B()],st.prototype,"name",void 0);D([B()],st.prototype,"displayName",void 0);D([B()],st.prototype,"metadata",void 0);D([B("hasAlpha")],st.prototype,"_hasAlpha",void 0);D([B("getAlphaFromRGB")],st.prototype,"_getAlphaFromRGB",void 0);D([B()],st.prototype,"level",void 0);D([B("coordinatesIndex")],st.prototype,"_coordinatesIndex",void 0);D([B()],st.prototype,"optimizeUVAllocation",void 0);D([B("coordinatesMode")],st.prototype,"_coordinatesMode",void 0);D([B()],st.prototype,"wrapU",null);D([B()],st.prototype,"wrapV",null);D([B()],st.prototype,"wrapR",void 0);D([B()],st.prototype,"anisotropicFilteringLevel",void 0);D([B()],st.prototype,"isCube",null);D([B()],st.prototype,"is3D",null);D([B()],st.prototype,"is2DArray",null);D([B()],st.prototype,"gammaSpace",null);D([B()],st.prototype,"invertZ",void 0);D([B()],st.prototype,"lodLevelInAlpha",void 0);D([B()],st.prototype,"lodGenerationOffset",null);D([B()],st.prototype,"lodGenerationScale",null);D([B()],st.prototype,"linearSpecularLOD",null);D([_i()],st.prototype,"irradianceTexture",null);D([B()],st.prototype,"isRenderTarget",void 0);we.prototype.createPrefilteredCubeTexture=function(a,e,t,i,s=null,n=null,r,o=null,h=!0){const l=async c=>{if(!c){s&&s(null);return}const u=c.texture;if(h?c.info.sphericalPolynomial&&(u._sphericalPolynomial=c.info.sphericalPolynomial):u._sphericalPolynomial=new On,u._source=9,this.getCaps().textureLOD){s&&s(u);return}const f=3,d=this._gl,_=c.width;if(!_)return;const{DDSTools:p}=await Oe(async()=>{const{DDSTools:m}=await import("./dds-C4nWUSlI.js");return{DDSTools:m}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10])),g=[];for(let m=0;m{a.onCanvasFocusObservable.notifyObservers(a)},a._onCanvasBlur=()=>{a.onCanvasBlurObservable.notifyObservers(a)},a._onCanvasContextMenu=s=>{a.disableContextMenu&&s.preventDefault()},e.addEventListener("focus",a._onCanvasFocus),e.addEventListener("blur",a._onCanvasBlur),e.addEventListener("contextmenu",a._onCanvasContextMenu),a._onBlur=()=>{a.disablePerformanceMonitorInBackground&&a.performanceMonitor.disable(),a._windowIsBackground=!0},a._onFocus=()=>{a.disablePerformanceMonitorInBackground&&a.performanceMonitor.enable(),a._windowIsBackground=!1},a._onCanvasPointerOut=s=>{document.elementFromPoint(s.clientX,s.clientY)!==e&&a.onCanvasPointerOutObservable.notifyObservers(s)};const i=a.getHostWindow();i&&typeof i.addEventListener=="function"&&(i.addEventListener("blur",a._onBlur),i.addEventListener("focus",a._onFocus)),e.addEventListener("pointerout",a._onCanvasPointerOut),t.doNotHandleTouchAction||h_(e),!ae.audioEngine&&t.audioEngine&&ae.AudioEngineFactory&&(ae.audioEngine=ae.AudioEngineFactory(a.getRenderingCanvas(),a.getAudioContext(),a.getAudioDestination())),En()&&(a._onFullscreenChange=()=>{a.isFullscreen=!!document.fullscreenElement,a.isFullscreen&&a._pointerLockRequested&&e&&R0(e)},document.addEventListener("fullscreenchange",a._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",a._onFullscreenChange,!1),a._onPointerLockChange=()=>{a.isPointerLock=document.pointerLockElement===e},document.addEventListener("pointerlockchange",a._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",a._onPointerLockChange,!1)),a.enableOfflineSupport=ae.OfflineProviderFactory!==void 0,a._deterministicLockstep=!!t.deterministicLockstep,a._lockstepMaxSteps=t.lockstepMaxSteps||0,a._timeStep=t.timeStep||1/60}function lc(a,e){Ee.Instances.length===1&&ae.audioEngine&&(ae.audioEngine.dispose(),ae.audioEngine=null);const t=a.getHostWindow();t&&typeof t.removeEventListener=="function"&&(t.removeEventListener("blur",a._onBlur),t.removeEventListener("focus",a._onFocus)),e&&(e.removeEventListener("focus",a._onCanvasFocus),e.removeEventListener("blur",a._onCanvasBlur),e.removeEventListener("pointerout",a._onCanvasPointerOut),e.removeEventListener("contextmenu",a._onCanvasContextMenu)),En()&&(document.removeEventListener("fullscreenchange",a._onFullscreenChange),document.removeEventListener("mozfullscreenchange",a._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",a._onFullscreenChange),document.removeEventListener("msfullscreenchange",a._onFullscreenChange),document.removeEventListener("pointerlockchange",a._onPointerLockChange),document.removeEventListener("mspointerlockchange",a._onPointerLockChange),document.removeEventListener("mozpointerlockchange",a._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",a._onPointerLockChange))}function cc(a){const e=document.createElement("span");e.textContent="Hg",e.style.font=a;const t=document.createElement("div");t.style.display="inline-block",t.style.width="1px",t.style.height="0px",t.style.verticalAlign="bottom";const i=document.createElement("div");i.style.whiteSpace="nowrap",i.appendChild(e),i.appendChild(t),document.body.appendChild(i);let s=0,n=0;try{n=t.getBoundingClientRect().top-e.getBoundingClientRect().top,t.style.verticalAlign="baseline",s=t.getBoundingClientRect().top-e.getBoundingClientRect().top}finally{document.body.removeChild(i)}return{ascent:s,height:n,descent:n-s}}function uc(a,e,t){return new Promise((s,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{a.createImageBitmap(r,t).then(o=>{s(o)})})},r.onerror=()=>{n("Error loading image ".concat(r.src))},r.src=e})}function fc(a,e,t,i){const n=a.createCanvas(t,i).getContext("2d");if(!n)throw new Error("Unable to get 2d context for resizeImageBitmap");return n.drawImage(e,0,0),n.getImageData(0,0,t,i).data}function dc(a){const e=a.requestFullscreen||a.webkitRequestFullscreen;e&&e.call(a)}function _c(){const a=document;document.exitFullscreen?document.exitFullscreen():a.webkitCancelFullScreen&&a.webkitCancelFullScreen()}function R0(a){if(a.requestPointerLock){const e=a.requestPointerLock();e instanceof Promise?e.then(()=>{a.focus()}).catch(()=>{}):a.focus()}}function pc(){document.exitPointerLock&&document.exitPointerLock()}class ui{get min(){return this._min}get max(){return this._max}get average(){return this._average}get lastSecAverage(){return this._lastSecAverage}get current(){return this._current}get total(){return this._totalAccumulated}get count(){return this._totalValueCount}constructor(){this._startMonitoringTime=0,this._min=0,this._max=0,this._average=0,this._lastSecAverage=0,this._current=0,this._totalValueCount=0,this._totalAccumulated=0,this._lastSecAccumulated=0,this._lastSecTime=0,this._lastSecValueCount=0}fetchNewFrame(){this._totalValueCount++,this._current=0,this._lastSecValueCount++}addCount(e,t){ui.Enabled&&(this._current+=e,t&&this._fetchResult())}beginMonitoring(){ui.Enabled&&(this._startMonitoringTime=bi.Now)}endMonitoring(e=!0){if(!ui.Enabled)return;e&&this.fetchNewFrame();const t=bi.Now;this._current=t-this._startMonitoringTime,e&&this._fetchResult()}endFrame(){this._fetchResult()}_fetchResult(){this._totalAccumulated+=this._current,this._lastSecAccumulated+=this._current,this._min=Math.min(this._min,this._current),this._max=Math.max(this._max,this._current),this._average=this._totalAccumulated/this._totalValueCount;const e=bi.Now;e-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)}}ui.Enabled=!0;ae.AudioEngineFactory=(a,e,t)=>new l_(a,e,t);class l_{get audioContext(){return this._audioContextInitialized||this._initializeAudioContext(),this._audioContext}constructor(e=null,t=null,i=null){if(this._audioContext=null,this._audioContextInitialized=!1,this._muteButton=null,this._audioDestination=null,this.canUseWebAudio=!1,this.WarnedWebAudioUnsupported=!1,this.isMP3supported=!1,this.isOGGsupported=!1,this.unlocked=!1,this.useCustomUnlockedButton=!1,this.onAudioUnlockedObservable=new Z,this.onAudioLockedObservable=new Z,this._tryToRun=!1,this._onResize=()=>{this._moveButtonToTopLeft()},!St())return;typeof window.AudioContext<"u"&&(this.canUseWebAudio=!0);const s=document.createElement("audio");this._hostElement=e,this._audioContext=t,this._audioDestination=i;try{s&&s.canPlayType&&(s.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/,"")||s.canPlayType("audio/mp3").replace(/^no$/,""))&&(this.isMP3supported=!0)}catch{}try{s&&s.canPlayType&&s.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(this.isOGGsupported=!0)}catch{}}lock(){this._triggerSuspendedState()}unlock(){var e,t;if(((e=this._audioContext)==null?void 0:e.state)==="running"){this._hideMuteButton(),this.unlocked||(this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this));return}this._tryToRun?(t=this._audioContext)==null||t.suspend().then(()=>{this._tryToRun=!1,this._triggerRunningState()}):this._triggerRunningState()}_resumeAudioContextOnStateChange(){var e;(e=this._audioContext)==null||e.addEventListener("statechange",()=>{var t;this.unlocked&&((t=this._audioContext)==null?void 0:t.state)!=="running"&&this._resumeAudioContext()},{once:!0,passive:!0,signal:AbortSignal.timeout(3e3)})}_resumeAudioContext(){var e;return(e=this._audioContext)!=null&&e.resume?this._audioContext.resume():Promise.resolve()}_initializeAudioContext(){try{this.canUseWebAudio&&(this._audioContext||(this._audioContext=new AudioContext),this.masterGain=this._audioContext.createGain(),this.masterGain.gain.value=1,this._audioDestination||(this._audioDestination=this._audioContext.destination),this.masterGain.connect(this._audioDestination),this._audioContextInitialized=!0,this._audioContext.state==="running"&&this._triggerRunningState())}catch(e){this.canUseWebAudio=!1,U.Error("Web Audio: "+e.message)}}_triggerRunningState(){this._tryToRun||(this._tryToRun=!0,this._resumeAudioContext().then(()=>{this._tryToRun=!1,this._muteButton&&this._hideMuteButton(),this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this)}).catch(()=>{this._tryToRun=!1,this.unlocked=!1}))}_triggerSuspendedState(){this.unlocked=!1,this.onAudioLockedObservable.notifyObservers(this),this._displayMuteButton()}_displayMuteButton(){if(this.useCustomUnlockedButton||this._muteButton)return;this._muteButton=document.createElement("BUTTON"),this._muteButton.className="babylonUnmuteIcon",this._muteButton.id="babylonUnmuteIconBtn",this._muteButton.title="Unmute";const t=".babylonUnmuteIcon { position: absolute; left: 20px; top: 20px; height: 40px; width: 60px; background-color: rgba(51,51,51,0.7); background-image: url("+(window.SVGSVGElement?"data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E":"https://cdn.babylonjs.com/Assets/audio.png")+"); background-size: 80%; background-repeat:no-repeat; background-position: center; background-position-y: 4px; border: none; outline: none; transition: transform 0.125s ease-out; cursor: pointer; z-index: 9999; } .babylonUnmuteIcon:hover { transform: scale(1.05) } .babylonUnmuteIcon:active { background-color: rgba(51,51,51,1) }",i=document.createElement("style");i.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(i),document.body.appendChild(this._muteButton),this._moveButtonToTopLeft(),this._muteButton.addEventListener("touchend",()=>{this._triggerRunningState()},!0),this._muteButton.addEventListener("click",()=>{this.unlock()},!0),window.addEventListener("resize",this._onResize)}_moveButtonToTopLeft(){this._hostElement&&this._muteButton&&(this._muteButton.style.top=this._hostElement.offsetTop+20+"px",this._muteButton.style.left=this._hostElement.offsetLeft+20+"px")}_hideMuteButton(){this._muteButton&&(document.body.removeChild(this._muteButton),this._muteButton=null)}dispose(){this.canUseWebAudio&&this._audioContextInitialized&&(this._connectedAnalyser&&this._audioContext&&(this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser.dispose(),this.masterGain.disconnect(),this.masterGain.connect(this._audioContext.destination),this._connectedAnalyser=null),this.masterGain.gain.value=1),this.WarnedWebAudioUnsupported=!1,this._hideMuteButton(),window.removeEventListener("resize",this._onResize),this.onAudioUnlockedObservable.clear(),this.onAudioLockedObservable.clear()}getGlobalVolume(){return this.canUseWebAudio&&this._audioContextInitialized?this.masterGain.gain.value:-1}setGlobalVolume(e){this.canUseWebAudio&&this._audioContextInitialized&&(this.masterGain.gain.value=e)}connectToAnalyser(e){this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this.canUseWebAudio&&this._audioContextInitialized&&this._audioContext&&(this._connectedAnalyser=e,this.masterGain.disconnect(),this._connectedAnalyser.connectAudioNodes(this.masterGain,this._audioContext.destination))}}class le extends we{static get NpmPackage(){return ae.NpmPackage}static get Version(){return ae.Version}static get Instances(){return Ee.Instances}static get LastCreatedEngine(){return Ee.LastCreatedEngine}static get LastCreatedScene(){return Ee.LastCreatedScene}static DefaultLoadingScreenFactory(e){return ae.DefaultLoadingScreenFactory(e)}get _supportsHardwareTextureRescaling(){return!!le._RescalePostProcessFactory}_measureFps(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0}get performanceMonitor(){return this._performanceMonitor}constructor(e,t,i,s=!1){if(super(e,t,i,s),this.customAnimationFrameRequester=null,this._performanceMonitor=new Yl,this._drawCalls=new ui,!!e&&(this._features.supportRenderPasses=!0,i=this._creationOptions,e.getContext)){const n=e;this._sharedInit(n)}}_initGLContext(){super._initGLContext(),this._rescalePostProcess=null}_sharedInit(e){super._sharedInit(e),hc(this,e,this._creationOptions)}resizeImageBitmap(e,t,i){return fc(this,e,t,i)}_createImageBitmapFromSource(e,t){return uc(this,e,t)}switchFullscreen(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&dc(this._renderingCanvas))}exitFullscreen(){this.isFullscreen&&_c()}setDitheringState(e){e?this._gl.enable(this._gl.DITHER):this._gl.disable(this._gl.DITHER)}setRasterizerState(e){e?this._gl.disable(this._gl.RASTERIZER_DISCARD):this._gl.enable(this._gl.RASTERIZER_DISCARD)}setDirectViewport(e,t,i,s){const n=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,i,s),n}scissorClear(e,t,i,s,n){this.enableScissor(e,t,i,s),this.clear(n,!0,!0,!0),this.disableScissor()}enableScissor(e,t,i,s){const n=this._gl;n.enable(n.SCISSOR_TEST),n.scissor(e,t,i,s)}disableScissor(){const e=this._gl;e.disable(e.SCISSOR_TEST)}_loadFileAsync(e,t,i){return new Promise((s,n)=>{this._loadFile(e,r=>{s(r)},void 0,t,i,(r,o)=>{n(o)})})}getVertexShaderSource(e){const t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[0]):null}getFragmentShaderSource(e){const t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[1]):null}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e,this._framebufferDimensionsObject&&this.onResizeObservable.notifyObservers(this)}_rebuildBuffers(){for(const e of this.scenes)e.resetCachedMaterial(),e._rebuildGeometries();for(const e of this._virtualScenes)e.resetCachedMaterial(),e._rebuildGeometries();super._rebuildBuffers()}getFontOffset(e){return cc(e)}_cancelFrame(){if(this.customAnimationFrameRequester){if(this._frameHandler!==0){this._frameHandler=0;const{cancelAnimationFrame:e}=this.customAnimationFrameRequester;e&&e(this.customAnimationFrameRequester.requestID)}}else super._cancelFrame()}_renderLoop(){if(this._frameHandler=0,!this._contextWasLost){let e=!0;(this.isDisposed||!this.renderEvenInBackground&&this._windowIsBackground)&&(e=!1),e&&(this.beginFrame(),this._renderViews()||this._renderFrame(),this.endFrame())}this._activeRenderLoops.length>0&&this._frameHandler===0&&(this.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=this._queueNewFrame(this.customAnimationFrameRequester.renderFunction||this._boundRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()))}enterPointerlock(){this._renderingCanvas&&R0(this._renderingCanvas)}exitPointerlock(){pc()}beginFrame(){this._measureFps(),super.beginFrame()}_deletePipelineContext(e){const t=e;t&&t.program&&t.transformFeedback&&(this.deleteTransformFeedback(t.transformFeedback),t.transformFeedback=null),super._deletePipelineContext(e)}createShaderProgram(e,t,i,s,n,r=null){n=n||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);const o=super.createShaderProgram(e,t,i,s,n,r);return this.onAfterShaderCompilationObservable.notifyObservers(this),o}_createShaderProgram(e,t,i,s,n=null){const r=s.createProgram();if(e.program=r,!r)throw new Error("Unable to create program");if(s.attachShader(r,t),s.attachShader(r,i),this.webGLVersion>1&&n){const o=this.createTransformFeedback();this.bindTransformFeedback(o),this.setTranformFeedbackVaryings(r,n),e.transformFeedback=o}return s.linkProgram(r),this.webGLVersion>1&&n&&this.bindTransformFeedback(null),e.context=s,e.vertexShader=t,e.fragmentShader=i,e.isParallelCompiled||this._finalizePipelineContext(e),r}_releaseTexture(e){super._releaseTexture(e)}_releaseRenderTargetWrapper(e){super._releaseRenderTargetWrapper(e),this.scenes.forEach(t=>{t.postProcesses.forEach(i=>{i._outputTexture===e&&(i._outputTexture=null)}),t.cameras.forEach(i=>{i._postProcesses.forEach(s=>{s&&s._outputTexture===e&&(s._outputTexture=null)})})})}_rescaleTexture(e,t,i,s,n){this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE);const r=this.createRenderTargetTexture({width:t.width,height:t.height},{generateMipMaps:!1,type:0,samplingMode:2,generateDepthBuffer:!1,generateStencilBuffer:!1});if(!this._rescalePostProcess&&le._RescalePostProcessFactory&&(this._rescalePostProcess=le._RescalePostProcessFactory(this)),this._rescalePostProcess){this._rescalePostProcess.externalTextureSamplerBinding=!0;const o=()=>{this._rescalePostProcess.onApply=function(c){c._bindTexture("textureSampler",e)};let l=i;l||(l=this.scenes[this.scenes.length-1]),l.postProcessManager.directRender([this._rescalePostProcess],r,!0),this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._gl.copyTexImage2D(this._gl.TEXTURE_2D,0,s,0,0,t.width,t.height,0),this.unBindFramebuffer(r),r.dispose(),n&&n()},h=this._rescalePostProcess.getEffect();h?h.executeWhenCompiled(o):this._rescalePostProcess.onEffectCreatedObservable.addOnce(l=>{l.executeWhenCompiled(o)})}}wrapWebGLTexture(e,t=!1,i=3,s=0,n=0){const r=new Xl(e,this._gl),o=new ft(this,0,!0);return o._hardwareTexture=r,o.baseWidth=s,o.baseHeight=n,o.width=s,o.height=n,o.isReady=!0,o.useMipMaps=t,this.updateTextureSamplingMode(i,o),o}_uploadImageToTexture(e,t,i=0,s=0){const n=this._gl,r=this._getWebGLTextureType(e.type),o=this._getInternalFormat(e.format),h=this._getRGBABufferInternalSizedFormat(e.type,o),l=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(l,e,!0),this._unpackFlipY(e.invertY);let c=n.TEXTURE_2D;e.isCube&&(c=n.TEXTURE_CUBE_MAP_POSITIVE_X+i),n.texImage2D(c,s,h,o,r,t),this._bindTextureDirectly(l,null,!0)}updateTextureComparisonFunction(e,t){if(this.webGLVersion===1){U.Error("WebGL 1 does not support texture comparison.");return}const i=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),t===0?(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),t===0?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),e._comparisonFunction=t}createInstancesBuffer(e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create instance buffer");const i=new Pn(t);return i.capacity=e,this.bindArrayBuffer(i),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),i.references=1,i}deleteInstancesBuffer(e){this._gl.deleteBuffer(e)}_clientWaitAsync(e,t=0,i=10){const s=this._gl;return new Promise((n,r)=>{const o=()=>{const h=s.clientWaitSync(e,t,0);if(h==s.WAIT_FAILED){r();return}if(h==s.TIMEOUT_EXPIRED){setTimeout(o,i);return}n()};o()})}_readPixelsAsync(e,t,i,s,n,r,o){if(this._webGLVersion<2)throw new Error("_readPixelsAsync only work on WebGL2+");const h=this._gl,l=h.createBuffer();h.bindBuffer(h.PIXEL_PACK_BUFFER,l),h.bufferData(h.PIXEL_PACK_BUFFER,o.byteLength,h.STREAM_READ),h.readPixels(e,t,i,s,n,r,0),h.bindBuffer(h.PIXEL_PACK_BUFFER,null);const c=h.fenceSync(h.SYNC_GPU_COMMANDS_COMPLETE,0);return c?(h.flush(),this._clientWaitAsync(c,0,10).then(()=>(h.deleteSync(c),h.bindBuffer(h.PIXEL_PACK_BUFFER,l),h.getBufferSubData(h.PIXEL_PACK_BUFFER,0,o),h.bindBuffer(h.PIXEL_PACK_BUFFER,null),h.deleteBuffer(l),o))):null}dispose(){this.hideLoadingUI(),this._rescalePostProcess&&this._rescalePostProcess.dispose(),lc(this,this._renderingCanvas),super.dispose()}}le.ALPHA_DISABLE=0;le.ALPHA_ADD=1;le.ALPHA_COMBINE=2;le.ALPHA_SUBTRACT=3;le.ALPHA_MULTIPLY=4;le.ALPHA_MAXIMIZED=5;le.ALPHA_ONEONE=6;le.ALPHA_PREMULTIPLIED=7;le.ALPHA_PREMULTIPLIED_PORTERDUFF=8;le.ALPHA_INTERPOLATE=9;le.ALPHA_SCREENMODE=10;le.DELAYLOADSTATE_NONE=0;le.DELAYLOADSTATE_LOADED=1;le.DELAYLOADSTATE_LOADING=2;le.DELAYLOADSTATE_NOTLOADED=4;le.NEVER=512;le.ALWAYS=519;le.LESS=513;le.EQUAL=514;le.LEQUAL=515;le.GREATER=516;le.GEQUAL=518;le.NOTEQUAL=517;le.KEEP=7680;le.REPLACE=7681;le.INCR=7682;le.DECR=7683;le.INVERT=5386;le.INCR_WRAP=34055;le.DECR_WRAP=34056;le.TEXTURE_CLAMP_ADDRESSMODE=0;le.TEXTURE_WRAP_ADDRESSMODE=1;le.TEXTURE_MIRROR_ADDRESSMODE=2;le.TEXTUREFORMAT_ALPHA=0;le.TEXTUREFORMAT_LUMINANCE=1;le.TEXTUREFORMAT_LUMINANCE_ALPHA=2;le.TEXTUREFORMAT_RGB=4;le.TEXTUREFORMAT_RGBA=5;le.TEXTUREFORMAT_RED=6;le.TEXTUREFORMAT_R=6;le.TEXTUREFORMAT_R16_UNORM=33322;le.TEXTUREFORMAT_RG16_UNORM=33324;le.TEXTUREFORMAT_RGB16_UNORM=32852;le.TEXTUREFORMAT_RGBA16_UNORM=32859;le.TEXTUREFORMAT_R16_SNORM=36760;le.TEXTUREFORMAT_RG16_SNORM=36761;le.TEXTUREFORMAT_RGB16_SNORM=36762;le.TEXTUREFORMAT_RGBA16_SNORM=36763;le.TEXTUREFORMAT_RG=7;le.TEXTUREFORMAT_RED_INTEGER=8;le.TEXTUREFORMAT_R_INTEGER=8;le.TEXTUREFORMAT_RG_INTEGER=9;le.TEXTUREFORMAT_RGB_INTEGER=10;le.TEXTUREFORMAT_RGBA_INTEGER=11;le.TEXTURETYPE_UNSIGNED_BYTE=0;le.TEXTURETYPE_UNSIGNED_INT=0;le.TEXTURETYPE_FLOAT=1;le.TEXTURETYPE_HALF_FLOAT=2;le.TEXTURETYPE_BYTE=3;le.TEXTURETYPE_SHORT=4;le.TEXTURETYPE_UNSIGNED_SHORT=5;le.TEXTURETYPE_INT=6;le.TEXTURETYPE_UNSIGNED_INTEGER=7;le.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8;le.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9;le.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10;le.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11;le.TEXTURETYPE_UNSIGNED_INT_24_8=12;le.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13;le.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14;le.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15;le.TEXTURE_NEAREST_SAMPLINGMODE=1;le.TEXTURE_BILINEAR_SAMPLINGMODE=2;le.TEXTURE_TRILINEAR_SAMPLINGMODE=3;le.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8;le.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11;le.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3;le.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4;le.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5;le.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6;le.TEXTURE_NEAREST_LINEAR=7;le.TEXTURE_NEAREST_NEAREST=1;le.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9;le.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10;le.TEXTURE_LINEAR_LINEAR=2;le.TEXTURE_LINEAR_NEAREST=12;le.TEXTURE_EXPLICIT_MODE=0;le.TEXTURE_SPHERICAL_MODE=1;le.TEXTURE_PLANAR_MODE=2;le.TEXTURE_CUBIC_MODE=3;le.TEXTURE_PROJECTION_MODE=4;le.TEXTURE_SKYBOX_MODE=5;le.TEXTURE_INVCUBIC_MODE=6;le.TEXTURE_EQUIRECTANGULAR_MODE=7;le.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8;le.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9;le.SCALEMODE_FLOOR=1;le.SCALEMODE_NEAREST=2;le.SCALEMODE_CEILING=3;class Ve{static ComputeNumMipmapLevels(e,t){return ec(Math.max(e,t))+1}static GetTextureTypeFromFormat(e){switch(e){case"r8unorm":case"r8uint":case"rg8unorm":case"rg8uint":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8uint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb10a2uint":case"rgb10a2unorm":case"rgb9e5ufloat":case"rg11b10ufloat":case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc5-rg-unorm":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc4-r-unorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"eac-r11unorm":case"eac-rg11unorm":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":case"stencil8":return 0;case"r8snorm":case"r8sint":case"rg8snorm":case"rg8sint":case"rgba8snorm":case"rgba8sint":case"bc6h-rgb-float":case"bc5-rg-snorm":case"bc4-r-snorm":case"eac-r11snorm":case"eac-rg11snorm":return 3;case"r16uint":case"r16unorm":case"rg16unorm":case"rgba16unorm":case"rg16uint":case"rgba16uint":case"depth16unorm":return 5;case"r16sint":case"r16snorm":case"rg16snorm":case"rgba16snorm":case"rg16sint":case"rgba16sint":return 4;case"r16float":case"rg16float":case"rgba16float":return 2;case"r32uint":case"rg32uint":case"rgba32uint":return 7;case"r32sint":case"rg32sint":case"rgba32sint":return 7;case"r32float":case"rg32float":case"rgba32float":case"depth32float":case"depth32float-stencil8":case"depth24plus":case"depth24plus-stencil8":return 1}return 0}static GetBlockInformationFromFormat(e){switch(e){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":return{width:1,height:1,length:1};case"r16uint":case"r16sint":case"r16unorm":case"rg16unorm":case"rgba16unorm":case"r16snorm":case"rg16snorm":case"rgba16snorm":case"r16float":case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":return{width:1,height:1,length:2};case"r32uint":case"r32sint":case"r32float":case"rg16uint":case"rg16sint":case"rg16float":case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgb9e5ufloat":case"rgb10a2uint":case"rgb10a2unorm":case"rg11b10ufloat":return{width:1,height:1,length:4};case"rg32uint":case"rg32sint":case"rg32float":case"rgba16uint":case"rgba16sint":case"rgba16float":return{width:1,height:1,length:8};case"rgba32uint":case"rgba32sint":case"rgba32float":return{width:1,height:1,length:16};case"stencil8":throw"No fixed size for Stencil8 format!";case"depth16unorm":return{width:1,height:1,length:2};case"depth24plus":throw"No fixed size for Depth24Plus format!";case"depth24plus-stencil8":throw"No fixed size for Depth24PlusStencil8 format!";case"depth32float":return{width:1,height:1,length:4};case"depth32float-stencil8":return{width:1,height:1,length:5};case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"bc5-rg-unorm":case"bc5-rg-snorm":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":return{width:4,height:4,length:16};case"bc4-r-unorm":case"bc4-r-snorm":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":return{width:4,height:4,length:8};case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"eac-r11unorm":case"eac-r11snorm":return{width:4,height:4,length:8};case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"eac-rg11unorm":case"eac-rg11snorm":return{width:4,height:4,length:16};case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":return{width:4,height:4,length:16};case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":return{width:5,height:4,length:16};case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":return{width:5,height:5,length:16};case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":return{width:6,height:5,length:16};case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":return{width:6,height:6,length:16};case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":return{width:8,height:5,length:16};case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":return{width:8,height:6,length:16};case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":return{width:8,height:8,length:16};case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":return{width:10,height:5,length:16};case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":return{width:10,height:6,length:16};case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":return{width:10,height:8,length:16};case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":return{width:10,height:10,length:16};case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":return{width:12,height:10,length:16};case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":return{width:12,height:12,length:16}}return{width:1,height:1,length:4}}static IsHardwareTexture(e){return!!e.release}static IsInternalTexture(e){return!!e.dispose}static IsImageBitmap(e){return e.close!==void 0}static IsImageBitmapArray(e){return Array.isArray(e)&&e[0].close!==void 0}static IsCompressedFormat(e){switch(e){case"bc7-rgba-unorm-srgb":case"bc7-rgba-unorm":case"bc6h-rgb-float":case"bc6h-rgb-ufloat":case"bc5-rg-snorm":case"bc5-rg-unorm":case"bc4-r-snorm":case"bc4-r-unorm":case"bc3-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc1-rgba-unorm-srgb":case"bc1-rgba-unorm":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"eac-r11unorm":case"eac-r11snorm":case"eac-rg11unorm":case"eac-rg11snorm":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":return!0}return!1}static GetWebGPUTextureFormat(e,t,i=!1){switch(t){case 15:return"depth16unorm";case 16:return"depth24plus";case 13:return"depth24plus-stencil8";case 14:return"depth32float";case 18:return"depth32float-stencil8";case 19:return"stencil8";case 36492:return i?"bc7-rgba-unorm-srgb":"bc7-rgba-unorm";case 36495:return"bc6h-rgb-ufloat";case 36494:return"bc6h-rgb-float";case 33779:return i?"bc3-rgba-unorm-srgb":"bc3-rgba-unorm";case 33778:return i?"bc2-rgba-unorm-srgb":"bc2-rgba-unorm";case 33777:case 33776:return i?"bc1-rgba-unorm-srgb":"bc1-rgba-unorm";case 37808:return i?"astc-4x4-unorm-srgb":"astc-4x4-unorm";case 36196:case 37492:return i?"etc2-rgb8unorm-srgb":"etc2-rgb8unorm";case 37496:return i?"etc2-rgba8unorm-srgb":"etc2-rgba8unorm"}switch(e){case 3:switch(t){case 6:return"r8snorm";case 7:return"rg8snorm";case 4:throw"RGB format not supported in WebGPU";case 8:return"r8sint";case 9:return"rg8sint";case 10:throw"RGB_INTEGER format not supported in WebGPU";case 11:return"rgba8sint";default:return"rgba8snorm"}case 0:switch(t){case 6:return"r8unorm";case 7:return"rg8unorm";case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return i?"rgba8unorm-srgb":"rgba8unorm";case 12:return i?"bgra8unorm-srgb":"bgra8unorm";case 8:return"r8uint";case 9:return"rg8uint";case 10:throw"RGB_INTEGER format not supported in WebGPU";case 11:return"rgba8uint";case 0:throw"TEXTUREFORMAT_ALPHA format not supported in WebGPU";case 1:throw"TEXTUREFORMAT_LUMINANCE format not supported in WebGPU";case 2:throw"TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU";default:return"rgba8unorm"}case 4:switch(t){case 8:return"r16sint";case 9:return"rg16sint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return"rgba16sint";default:return"rgba16sint"}case 5:switch(t){case 8:return"r16uint";case 9:return"rg16uint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return"rgba16uint";default:return"rgba16uint"}case 6:switch(t){case 8:return"r32sint";case 9:return"rg32sint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return"rgba32sint";default:return"rgba32sint"}case 7:switch(t){case 8:return"r32uint";case 9:return"rg32uint";case 10:throw"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU";case 11:return"rgba32uint";default:return"rgba32uint"}case 1:switch(t){case 6:return"r32float";case 7:return"rg32float";case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return"rgba32float";default:return"rgba32float"}case 2:switch(t){case 6:return"r16float";case 7:return"rg16float";case 4:throw"TEXTUREFORMAT_RGB format not supported in WebGPU";case 5:return"rgba16float";default:return"rgba16float"}case 10:throw"TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU";case 13:switch(t){case 5:return"rg11b10ufloat";case 11:throw"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV";default:return"rg11b10ufloat"}case 14:switch(t){case 5:return"rgb9e5ufloat";case 11:throw"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV";default:return"rgb9e5ufloat"}case 8:throw"TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 format not supported in WebGPU";case 9:throw"TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 format not supported in WebGPU";case 11:switch(t){case 5:return"rgb10a2unorm";case 11:return"rgb10a2uint";default:return"rgb10a2unorm"}}return i?"rgba8unorm-srgb":"rgba8unorm"}static GetNumChannelsFromWebGPUTextureFormat(e){switch(e){case"r8unorm":case"r8snorm":case"r8uint":case"r8sint":case"bc4-r-unorm":case"bc4-r-snorm":case"r16uint":case"r16sint":case"depth16unorm":case"r16float":case"r16unorm":case"r16snorm":case"r32uint":case"r32sint":case"r32float":case"depth32float":case"stencil8":case"depth24plus":case"eac-r11unorm":case"eac-r11snorm":return 1;case"rg8unorm":case"rg8snorm":case"rg8uint":case"rg8sint":case"depth32float-stencil8":case"bc5-rg-unorm":case"bc5-rg-snorm":case"rg16uint":case"rg16sint":case"rg16float":case"rg16unorm":case"rg16snorm":case"rg32uint":case"rg32sint":case"rg32float":case"depth24plus-stencil8":case"eac-rg11unorm":case"eac-rg11snorm":return 2;case"rgb9e5ufloat":case"rg11b10ufloat":case"bc6h-rgb-ufloat":case"bc6h-rgb-float":case"etc2-rgb8unorm":case"etc2-rgb8unorm-srgb":return 3;case"rgba8unorm":case"rgba8unorm-srgb":case"rgba8snorm":case"rgba8uint":case"rgba8sint":case"bgra8unorm":case"bgra8unorm-srgb":case"rgba16unorm":case"rgba16snorm":case"rgb10a2uint":case"rgb10a2unorm":case"bc7-rgba-unorm":case"bc7-rgba-unorm-srgb":case"bc3-rgba-unorm":case"bc3-rgba-unorm-srgb":case"bc2-rgba-unorm":case"bc2-rgba-unorm-srgb":case"bc1-rgba-unorm":case"bc1-rgba-unorm-srgb":case"rgba16uint":case"rgba16sint":case"rgba16float":case"rgba32uint":case"rgba32sint":case"rgba32float":case"etc2-rgb8a1unorm":case"etc2-rgb8a1unorm-srgb":case"etc2-rgba8unorm":case"etc2-rgba8unorm-srgb":case"astc-4x4-unorm":case"astc-4x4-unorm-srgb":case"astc-5x4-unorm":case"astc-5x4-unorm-srgb":case"astc-5x5-unorm":case"astc-5x5-unorm-srgb":case"astc-6x5-unorm":case"astc-6x5-unorm-srgb":case"astc-6x6-unorm":case"astc-6x6-unorm-srgb":case"astc-8x5-unorm":case"astc-8x5-unorm-srgb":case"astc-8x6-unorm":case"astc-8x6-unorm-srgb":case"astc-8x8-unorm":case"astc-8x8-unorm-srgb":case"astc-10x5-unorm":case"astc-10x5-unorm-srgb":case"astc-10x6-unorm":case"astc-10x6-unorm-srgb":case"astc-10x8-unorm":case"astc-10x8-unorm-srgb":case"astc-10x10-unorm":case"astc-10x10-unorm-srgb":case"astc-12x10-unorm":case"astc-12x10-unorm-srgb":case"astc-12x12-unorm":case"astc-12x12-unorm-srgb":return 4}throw"Unknown format ".concat(e,"!")}static HasStencilAspect(e){switch(e){case"stencil8":case"depth32float-stencil8":case"depth24plus-stencil8":return!0}return!1}static HasDepthAndStencilAspects(e){switch(e){case"depth32float-stencil8":case"depth24plus-stencil8":return!0}return!1}static GetDepthFormatOnly(e){switch(e){case"depth16unorm":return"depth16unorm";case"depth24plus":return"depth24plus";case"depth24plus-stencil8":return"depth24plus";case"depth32float":return"depth32float";case"depth32float-stencil8":return"depth32float"}return e}static GetSample(e){return e>1?4:1}}class gc{constructor(){this._gpuTimeInFrameId=-1,this.counter=new ui}_addDuration(e,t){e0){this._updatable?this._buffer=this._engine.createDynamicVertexBuffer(this._buffer.capacity,this._label):this._buffer=this._engine.createVertexBuffer(this._buffer.capacity,void 0,this._label);return}U.Warn('Missing data for buffer "'.concat(this._label,'" ').concat(this._buffer?"(uniqueId: "+this._buffer.uniqueId+")":"",". Buffer reconstruction failed.")),this._buffer=null}}update(e){this.create(e)}updateDirectly(e,t,i,s=!1){this._buffer&&this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e,s?t:t*Float32Array.BYTES_PER_ELEMENT,i?i*this.byteStride:void 0),t===0&&i===void 0?this._data=e:this._data=null)}_increaseReferences(){if(this._buffer){if(!this._isAlreadyOwned){this._isAlreadyOwned=!0;return}this._buffer.references++}}dispose(){this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._isDisposed=!0,this._data=null,this._buffer=null)}}class A{get isDisposed(){return this._isDisposed}get instanceDivisor(){return this._instanceDivisor}set instanceDivisor(e){const t=e!=0;this._instanceDivisor=e,t!==this._instanced&&(this._instanced=t,this._computeHashCode())}get _maxVerticesCount(){const e=this.getData();return e?Array.isArray(e)?e.length/(this.byteStride/4)-this.byteOffset/4:(e.byteLength-this.byteOffset)/this.byteStride:0}constructor(e,t,i,s,n,r,o,h,l,c,u=!1,f=!1,d=1,_=!1){var m,b,I,T,x;this._isDisposed=!1;let p=!1;if(this.engine=e,typeof s=="object"&&s!==null?(p=(m=s.updatable)!=null?m:!1,n=s.postponeInternalCreation,r=s.stride,o=s.instanced,h=s.offset,l=s.size,c=s.type,u=(b=s.normalized)!=null?b:!1,f=(I=s.useBytes)!=null?I:!1,d=(T=s.divisor)!=null?T:1,_=(x=s.takeBufferOwnership)!=null?x:!1,this._label=s.label):p=!!s,t instanceof ln?(this._buffer=t,this._ownsBuffer=_):(this._buffer=new ln(e,t,p,r,n,o,f,d,this._label),this._ownsBuffer=!0),this.uniqueId=A._Counter++,this._kind=i,c===void 0){const y=this.getData();this.type=y?A.GetDataType(y):A.FLOAT}else this.type=c;const g=A.GetTypeByteLength(this.type);f?(this._size=l||(r?r/g:A.DeduceStride(i)),this.byteStride=r||this._buffer.byteStride||this._size*g,this.byteOffset=h||0):(this._size=l||r||A.DeduceStride(i),this.byteStride=r?r*g:this._buffer.byteStride||this._size*g,this.byteOffset=(h||0)*g),this.normalized=u,this._instanced=o!==void 0?o:!1,this._instanceDivisor=o?d:0,this._alignBuffer(),this._computeHashCode()}_computeHashCode(){this.hashCode=(this.type-5120<<0)+((this.normalized?1:0)<<3)+(this._size<<4)+((this._instanced?1:0)<<6)+(this.byteStride<<12)}_rebuild(){var e;(e=this._buffer)==null||e._rebuild()}getKind(){return this._kind}isUpdatable(){return this._buffer.isUpdatable()}getData(){return this._buffer.getData()}getFloatData(e,t){const i=this.getData();return i?A.GetFloatData(i,this._size,this.type,this.byteOffset,this.byteStride,this.normalized,e,t):null}getBuffer(){return this._buffer.getBuffer()}getWrapperBuffer(){return this._buffer}getStrideSize(){return this.byteStride/A.GetTypeByteLength(this.type)}getOffset(){return this.byteOffset/A.GetTypeByteLength(this.type)}getSize(e=!1){return e?this._size*A.GetTypeByteLength(this.type):this._size}getIsInstanced(){return this._instanced}getInstanceDivisor(){return this._instanceDivisor}create(e){this._buffer.create(e),this._alignBuffer()}update(e){this._buffer.update(e),this._alignBuffer()}updateDirectly(e,t,i=!1){this._buffer.updateDirectly(e,t,void 0,i),this._alignBuffer()}dispose(){this._ownsBuffer&&this._buffer.dispose(),this._isDisposed=!0}forEach(e,t){A.ForEach(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,e,this.normalized,t)}_alignBuffer(){}static DeduceStride(e){switch(e){case A.UVKind:case A.UV2Kind:case A.UV3Kind:case A.UV4Kind:case A.UV5Kind:case A.UV6Kind:return 2;case A.NormalKind:case A.PositionKind:return 3;case A.ColorKind:case A.ColorInstanceKind:case A.MatricesIndicesKind:case A.MatricesIndicesExtraKind:case A.MatricesWeightsKind:case A.MatricesWeightsExtraKind:case A.TangentKind:return 4;default:throw new Error("Invalid kind '"+e+"'")}}static GetDataType(e){return e instanceof Int8Array?A.BYTE:e instanceof Uint8Array?A.UNSIGNED_BYTE:e instanceof Int16Array?A.SHORT:e instanceof Uint16Array?A.UNSIGNED_SHORT:e instanceof Int32Array?A.INT:e instanceof Uint32Array?A.UNSIGNED_INT:A.FLOAT}static GetTypeByteLength(e){switch(e){case A.BYTE:case A.UNSIGNED_BYTE:return 1;case A.SHORT:case A.UNSIGNED_SHORT:return 2;case A.INT:case A.UNSIGNED_INT:case A.FLOAT:return 4;default:throw new Error("Invalid type '".concat(e,"'"))}}static ForEach(e,t,i,s,n,r,o,h){if(e instanceof Array){let l=t/4;const c=i/4;for(let u=0;uu[d]=f),u}if(!(e instanceof Array||e instanceof Float32Array)||s!==0||e.length!==c)if(e instanceof Array){const u=s/4;return e.slice(u,u+c)}else{if(e instanceof ArrayBuffer)return new Float32Array(e,s,c);{const u=e.byteOffset+s;if(u&3&&(U.Warn("Float array must be aligned to 4-bytes border"),h=!0),h){const f=new Uint8Array(c*Float32Array.BYTES_PER_ELEMENT),d=new Uint8Array(e.buffer,u,f.length);return f.set(d),new Float32Array(f.buffer)}else return new Float32Array(e.buffer,u,c)}}return h?e.slice():e}}A._Counter=0;A.BYTE=5120;A.UNSIGNED_BYTE=5121;A.SHORT=5122;A.UNSIGNED_SHORT=5123;A.INT=5124;A.UNSIGNED_INT=5125;A.FLOAT=5126;A.PositionKind="position";A.NormalKind="normal";A.TangentKind="tangent";A.UVKind="uv";A.UV2Kind="uv2";A.UV3Kind="uv3";A.UV4Kind="uv4";A.UV5Kind="uv5";A.UV6Kind="uv6";A.ColorKind="color";A.ColorInstanceKind="instanceColor";A.MatricesIndicesKind="matricesIndices";A.MatricesWeightsKind="matricesWeights";A.MatricesIndicesExtraKind="matricesIndicesExtra";A.MatricesWeightsExtraKind="matricesWeightsExtra";const Rh=(a,e,t)=>!a||a.getClassName&&a.getClassName()==="Mesh"?null:a.getClassName&&(a.getClassName()==="SubMesh"||a.getClassName()==="PhysicsBody")?a.clone(e):a.clone?a.clone():Array.isArray(a)?a.slice():t&&typeof a=="object"?{...a}:null;function c_(a){const e=[];do Object.getOwnPropertyNames(a).forEach(function(t){e.indexOf(t)===-1&&e.push(t)});while(a=Object.getPrototypeOf(a));return e}class I0{static DeepCopy(e,t,i,s,n=!1){const r=c_(e);for(const o of r){if(o[0]==="_"&&(!s||s.indexOf(o)===-1)||o.endsWith("Observable")||i&&i.indexOf(o)!==-1)continue;const h=e[o],l=typeof h;if(l!=="function")try{if(l==="object")if(h instanceof Uint8Array)t[o]=Uint8Array.from(h);else if(h instanceof Array){if(t[o]=[],h.length>0)if(typeof h[0]=="object")for(let c=0;ce.indexOf("/")?!1:e.indexOf("://"){Ts(e,n=>{i(n)},void 0,void 0,t,(n,r)=>{s(r)})})}static GetBabylonScriptURL(e,t){if(!e)return"";if(J.ScriptBaseUrl&&e.startsWith(J._DefaultCdnUrl)){const i=J.ScriptBaseUrl[J.ScriptBaseUrl.length-1]==="/"?J.ScriptBaseUrl.substring(0,J.ScriptBaseUrl.length-1):J.ScriptBaseUrl;e=e.replace(J._DefaultCdnUrl,i)}return e=J.ScriptPreprocessUrl(e),t&&(e=J.GetAbsoluteUrl(e)),e}static LoadBabylonScript(e,t,i,s){e=J.GetBabylonScriptURL(e),J.LoadScript(e,t,i)}static LoadBabylonScriptAsync(e){return e=J.GetBabylonScriptURL(e),J.LoadScriptAsync(e)}static LoadScript(e,t,i,s,n=!1){if(typeof importScripts=="function"){try{importScripts(e),t&&t()}catch(h){i==null||i("Unable to load script '".concat(e,"' in worker"),h)}return}else if(!St()){i==null||i("Cannot load script '".concat(e,"' outside of a window or a worker"));return}const r=document.getElementsByTagName("head")[0],o=document.createElement("script");n?(o.setAttribute("type","module"),o.innerText=e):(o.setAttribute("type","text/javascript"),o.setAttribute("src",e)),s&&(o.id=s),o.onload=()=>{t&&t()},o.onerror=h=>{i&&i("Unable to load script '".concat(e,"'"),h)},r.appendChild(o)}static LoadScriptAsync(e,t){return new Promise((i,s)=>{this.LoadScript(e,()=>{i()},(n,r)=>{s(r||new Error(n))},t)})}static ReadFileAsDataURL(e,t,i){const s=new FileReader,n={onCompleteObservable:new Z,abort:()=>s.abort()};return s.onloadend=()=>{n.onCompleteObservable.notifyObservers(n)},s.onload=r=>{t(r.target.result)},s.onprogress=i,s.readAsDataURL(e),n}static ReadFile(e,t,i,s,n){return Ln(e,t,i,s,n)}static FileAsURL(e){const t=new Blob([e]);return window.URL.createObjectURL(t)}static Format(e,t=2){return e.toFixed(t)}static DeepCopy(e,t,i,s){I0.DeepCopy(e,t,i,s)}static IsEmpty(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}static RegisterTopRootEvents(e,t){for(let i=0;i{const h=atob(this.toDataURL(r,o).split(",")[1]),l=h.length,c=new Uint8Array(l);for(let u=0;ut(n)):e.toBlob(function(n){t(n)},i,s)}static DownloadBlob(e,t){if("download"in document.createElement("a")){if(!t){const i=new Date;t="screenshot_"+((i.getFullYear()+"-"+(i.getMonth()+1)).slice(2)+"-"+i.getDate()+"_"+i.getHours()+"-"+("0"+i.getMinutes()).slice(-2))+".png"}J.Download(e,t)}else if(e&&typeof URL<"u"){const i=URL.createObjectURL(e),s=window.open("");if(!s)return;const n=s.document.createElement("img");n.onload=function(){URL.revokeObjectURL(i)},n.src=i,s.document.body.appendChild(n)}}static EncodeScreenshotCanvasData(e,t,i="image/png",s,n){if(typeof s=="string"||!t)this.ToBlob(e,function(r){r&&J.DownloadBlob(r,s),t&&t("")},i,n);else if(t){if(J._IsOffScreenCanvas(e)){e.convertToBlob({type:i,quality:n}).then(o=>{const h=new FileReader;h.readAsDataURL(o),h.onloadend=()=>{const l=h.result;t(l)}});return}const r=e.toDataURL(i,n);t(r)}}static Download(e,t){if(typeof URL>"u")return;const i=window.URL.createObjectURL(e),s=document.createElement("a");document.body.appendChild(s),s.style.display="none",s.href=i,s.download=t,s.addEventListener("click",()=>{s.parentElement&&s.parentElement.removeChild(s)}),s.click(),window.URL.revokeObjectURL(i)}static BackCompatCameraNoPreventDefault(e){return typeof e[0]=="boolean"?e[0]:typeof e[1]=="boolean"?e[1]:!1}static CreateScreenshot(e,t,i,s,n="image/png",r=!1,o){throw ye("ScreenshotTools")}static CreateScreenshotAsync(e,t,i,s="image/png",n){throw ye("ScreenshotTools")}static CreateScreenshotUsingRenderTarget(e,t,i,s,n="image/png",r=1,o=!1,h,l=!1,c=!1,u=!0,f,d){throw ye("ScreenshotTools")}static CreateScreenshotUsingRenderTargetAsync(e,t,i,s="image/png",n=1,r=!1,o,h=!1,l=!1,c=!0,u,f){throw ye("ScreenshotTools")}static RandomId(){return g0()}static IsBase64(e){return y0(e)}static DecodeBase64(e){return T0(e)}static get errorsCount(){return U.errorsCount}static Log(e){U.Log(e)}static Warn(e){U.Warn(e)}static Error(e){U.Error(e)}static get LogCache(){return U.LogCache}static ClearLogCache(){U.ClearLogCache()}static set LogLevels(e){U.LogLevels=e}static set PerformanceLogLevel(e){if((e&J.PerformanceUserMarkLogLevel)===J.PerformanceUserMarkLogLevel){J.StartPerformanceCounter=J._StartUserMark,J.EndPerformanceCounter=J._EndUserMark;return}if((e&J.PerformanceConsoleLogLevel)===J.PerformanceConsoleLogLevel){J.StartPerformanceCounter=J._StartPerformanceConsole,J.EndPerformanceCounter=J._EndPerformanceConsole;return}J.StartPerformanceCounter=J._StartPerformanceCounterDisabled,J.EndPerformanceCounter=J._EndPerformanceCounterDisabled}static _StartPerformanceCounterDisabled(e,t){}static _EndPerformanceCounterDisabled(e,t){}static _StartUserMark(e,t=!0){if(!J._Performance){if(!St())return;J._Performance=window.performance}!t||!J._Performance.mark||J._Performance.mark(e+"-Begin")}static _EndUserMark(e,t=!0){!t||!J._Performance.mark||(J._Performance.mark(e+"-End"),J._Performance.measure(e,e+"-Begin",e+"-End"))}static _StartPerformanceConsole(e,t=!0){t&&(J._StartUserMark(e,t),console.time&&console.time(e))}static _EndPerformanceConsole(e,t=!0){t&&(J._EndUserMark(e,t),console.timeEnd(e))}static get Now(){return bi.Now}static GetClassName(e,t=!1){let i=null;return!t&&e.getClassName?i=e.getClassName():(e instanceof Object&&(i=(t?e:Object.getPrototypeOf(e)).constructor.__bjsclassName__),i||(i=typeof e)),i}static First(e,t){for(const i of e)if(t(i))return i;return null}static getFullClassName(e,t=!1){let i=null,s=null;if(!t&&e.getClassName)i=e.getClassName();else{if(e instanceof Object){const n=t?e:Object.getPrototypeOf(e);i=n.constructor.__bjsclassName__,s=n.constructor.__bjsmoduleName__}i||(i=typeof e)}return i?(s!=null?s+".":"")+i:null}static DelayAsync(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}static IsSafari(){return Qs()?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}}J.UseCustomRequestHeaders=!1;J.CustomRequestHeaders=Ft.CustomRequestHeaders;J.GetDOMTextContent=h0;J._DefaultCdnUrl="https://cdn.babylonjs.com";J.GetAbsoluteUrl=typeof document=="object"?a=>{const e=document.createElement("a");return e.href=a,e.href}:typeof URL=="function"&&typeof location=="object"?a=>new URL(a,location.origin).href:()=>{throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.")};J.NoneLogLevel=U.NoneLogLevel;J.MessageLogLevel=U.MessageLogLevel;J.WarningLogLevel=U.WarningLogLevel;J.ErrorLogLevel=U.ErrorLogLevel;J.AllLogLevel=U.AllLogLevel;J.IsWindowObjectExist=St;J.PerformanceNoneLogLevel=0;J.PerformanceUserMarkLogLevel=1;J.PerformanceConsoleLogLevel=2;J.StartPerformanceCounter=J._StartPerformanceCounterDisabled;J.EndPerformanceCounter=J._EndPerformanceCounterDisabled;class Sr{constructor(e,t,i,s=0){this.iterations=e,this.index=s-1,this._done=!1,this._fn=t,this._successCallback=i}executeNext(){this._done||(this.index+1{n&&n()?o.breakLoop():setTimeout(()=>{for(let h=0;h=e)break;if(i(l),n&&n()){o.breakLoop();break}}o.executeNext()},r)},s)}}J.Mix=Fa;J.IsExponentOfTwo=wn;Ee.FallbackTexture="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z";class fe{constructor(e,t,i,s,n=!1){this._valueCache={},this._engine=e,this._noUBO=!e.supportsUniformBuffers||n,this._dynamic=i,this._name=s!=null?s:"no-name",this._data=t||[],this._uniformLocations={},this._uniformSizes={},this._uniformArraySizes={},this._uniformLocationPointer=0,this._needSync=!1,this._engine._features.trackUbosInFrame&&(this._buffers=[],this._bufferIndex=-1,this._createBufferOnWrite=!1,this._currentFrameId=0),this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateFloatArray=this._updateFloatArrayForEffect,this.updateArray=this._updateArrayForEffect,this.updateIntArray=this._updateIntArrayForEffect,this.updateUIntArray=this._updateUIntArrayForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateMatrices=this._updateMatricesForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffect,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect,this.updateDirectColor4=this._updateDirectColor4ForEffect,this.updateInt=this._updateIntForEffect,this.updateInt2=this._updateInt2ForEffect,this.updateInt3=this._updateInt3ForEffect,this.updateInt4=this._updateInt4ForEffect,this.updateUInt=this._updateUIntForEffect,this.updateUInt2=this._updateUInt2ForEffect,this.updateUInt3=this._updateUInt3ForEffect,this.updateUInt4=this._updateUInt4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateFloatArray=this._updateFloatArrayForUniform,this.updateArray=this._updateArrayForUniform,this.updateIntArray=this._updateIntArrayForUniform,this.updateUIntArray=this._updateUIntArrayForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateMatrices=this._updateMatricesForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform,this.updateDirectColor4=this._updateDirectColor4ForUniform,this.updateInt=this._updateIntForUniform,this.updateInt2=this._updateInt2ForUniform,this.updateInt3=this._updateInt3ForUniform,this.updateInt4=this._updateInt4ForUniform,this.updateUInt=this._updateUIntForUniform,this.updateUInt2=this._updateUInt2ForUniform,this.updateUInt3=this._updateUInt3ForUniform,this.updateUInt4=this._updateUInt4ForUniform)}get useUbo(){return!this._noUBO}get isSync(){return!this._needSync}isDynamic(){return this._dynamic!==void 0}getData(){return this._bufferData}getBuffer(){return this._buffer}_fillAlignment(e){let t;if(e<=2?t=e:t=4,this._uniformLocationPointer%t!==0){const i=this._uniformLocationPointer;this._uniformLocationPointer+=t-this._uniformLocationPointer%t;const s=this._uniformLocationPointer-i;for(let n=0;n0){if(t instanceof Array)throw"addUniform should not be use with Array in UBO: "+e;if(this._fillAlignment(4),this._uniformArraySizes[e]={strideSize:t,arraySize:i},t==16)t=t*i;else{const r=(4-t)*i;t=t*i+r}s=[];for(let n=0;n1&&this._buffers[this._bufferIndex][1])if(this._buffersEqual(this._bufferData,this._buffers[this._bufferIndex][1])){this._needSync=!1,this._createBufferOnWrite=this._engine._features.trackUbosInFrame;return}else this._copyBuffer(this._bufferData,this._buffers[this._bufferIndex][1]);this._engine.updateUniformBuffer(this._buffer,this._bufferData),this._engine._features._collectUbosUpdatedInFrame&&(fe._UpdatedUbosInFrame[this._name]||(fe._UpdatedUbosInFrame[this._name]=0),fe._UpdatedUbosInFrame[this._name]++),this._needSync=!1,this._createBufferOnWrite=this._engine._features.trackUbosInFrame}}_createNewBuffer(){this._bufferIndex+10?(this._needSync=this._bufferIndex!==0,this._bufferIndex=0,this._buffer=this._buffers[this._bufferIndex][0]):this._bufferIndex=-1)}updateUniform(e,t,i){this._checkNewFrame();let s=this._uniformLocations[e];if(s===void 0){if(this._buffer){U.Error("Cannot add an uniform after UBO has been created. uniformName="+e);return}this.addUniform(e,i),s=this._uniformLocations[e]}if(this._buffer||this.create(),this._dynamic)for(let n=0;n=0&&(f.push(o[u]),d.push(_))}this.shaderProcessingContext.attributeNamesFromEffect=f,this.shaderProcessingContext.attributeLocationsFromEffect=d}buildUniformLayout(){var e;if(this.shaderProcessingContext.leftOverUniforms.length){(e=this.uniformBuffer)==null||e.dispose(),this.uniformBuffer=new fe(this.engine,void 0,void 0,"leftOver-"+this._name);for(const t of this.shaderProcessingContext.leftOverUniforms){const i=t.type.replace(/^(.*?)(<.*>)?$/,"$1"),s=At.UniformSizes[i];this.uniformBuffer.addUniform(t.name,s,t.length),this._leftOverUniformsByName[t.name]=t.type}this.uniformBuffer.create()}}setEngine(e){this.engine=e}dispose(){this.uniformBuffer&&this.uniformBuffer.dispose()}setInt(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateInt(e,t)}setInt2(e,t,i){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateInt2(e,t,i)}setInt3(e,t,i,s){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateInt3(e,t,i,s)}setInt4(e,t,i,s,n){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateInt4(e,t,i,s,n)}setIntArray(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateIntArray(e,t)}setIntArray2(e,t){this.setIntArray(e,t)}setIntArray3(e,t){this.setIntArray(e,t)}setIntArray4(e,t){this.setIntArray(e,t)}setUInt(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUInt(e,t)}setUInt2(e,t,i){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUInt2(e,t,i)}setUInt3(e,t,i,s){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUInt3(e,t,i,s)}setUInt4(e,t,i,s,n){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUInt4(e,t,i,s,n)}setUIntArray(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateUIntArray(e,t)}setUIntArray2(e,t){this.setUIntArray(e,t)}setUIntArray3(e,t){this.setUIntArray(e,t)}setUIntArray4(e,t){this.setUIntArray(e,t)}setArray(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateArray(e,t)}setArray2(e,t){this.setArray(e,t)}setArray3(e,t){this.setArray(e,t)}setArray4(e,t){this.setArray(e,t)}setMatrices(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateMatrices(e,t)}setMatrix(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateMatrix(e,t)}setMatrix3x3(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateMatrix3x3(e,t)}setMatrix2x2(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateMatrix2x2(e,t)}setFloat(e,t){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateFloat(e,t)}setVector2(e,t){this.setFloat2(e,t.x,t.y)}setFloat2(e,t,i){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateFloat2(e,t,i)}setVector3(e,t){this.setFloat3(e,t.x,t.y,t.z)}setFloat3(e,t,i,s){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateFloat3(e,t,i,s)}setVector4(e,t){this.setFloat4(e,t.x,t.y,t.z,t.w)}setQuaternion(e,t){this.setFloat4(e,t.x,t.y,t.z,t.w)}setFloat4(e,t,i,s,n){!this.uniformBuffer||!this._leftOverUniformsByName[e]||this.uniformBuffer.updateFloat4(e,t,i,s,n)}setColor3(e,t){this.setFloat3(e,t.r,t.g,t.b)}setColor4(e,t,i){this.setFloat4(e,t.r,t.g,t.b,i)}setDirectColor4(e,t){this.setFloat4(e,t.r,t.g,t.b,t.a)}_getVertexShaderCode(){var e;return(e=this.sources)==null?void 0:e.vertex}_getFragmentShaderCode(){var e;return(e=this.sources)==null?void 0:e.fragment}}const f_=4,d_=65536,Ih={mat2:2,mat3:3,mat4:4,mat2x2:2,mat3x3:3,mat4x4:4};class ni{static get KnownUBOs(){return ni._SimplifiedKnownBindings?ni._SimplifiedKnownUBOs:ni._KnownUBOs}constructor(e,t=!1){this.vertexBufferKindToNumberOfComponents={},this.shaderLanguage=e,this._attributeNextLocation=0,this._varyingNextLocation=0,this.freeGroupIndex=0,this.freeBindingIndex=0,this.availableVaryings={},this.availableAttributes={},this.availableBuffers={},this.availableTextures={},this.availableSamplers={},this.orderedAttributes=[],this.bindGroupLayoutEntries=[],this.bindGroupLayoutEntryInfo=[],this.bindGroupEntries=[],this.bufferNames=[],this.textureNames=[],this.samplerNames=[],this.leftOverUniforms=[],t||this._findStartingGroupBinding()}_findStartingGroupBinding(){const e=ni.KnownUBOs,t=[];for(const i in e){const s=e[i].binding;s.groupIndex!==-1&&(t[s.groupIndex]===void 0?t[s.groupIndex]=s.bindingIndex:t[s.groupIndex]=Math.max(t[s.groupIndex],s.bindingIndex))}this.freeGroupIndex=t.length-1,this.freeGroupIndex===0?(this.freeGroupIndex++,this.freeBindingIndex=0):this.freeBindingIndex=t[t.length-1]+1}getAttributeNextLocation(e,t=0){var s;const i=this._attributeNextLocation;return this._attributeNextLocation+=((s=Ih[e])!=null?s:1)*(t||1),i}getVaryingNextLocation(e,t=0){var s;const i=this._varyingNextLocation;return this._varyingNextLocation+=((s=Ih[e])!=null?s:1)*(t||1),i}getNextFreeUBOBinding(){return this._getNextFreeBinding(1)}_getNextFreeBinding(e){if(this.freeBindingIndex>d_-e&&(this.freeGroupIndex++,this.freeBindingIndex=0),this.freeGroupIndex===f_)throw"Too many textures or UBOs have been declared and it is not supported in WebGPU.";const t={groupIndex:this.freeGroupIndex,bindingIndex:this.freeBindingIndex};return this.freeBindingIndex+=e,t}}ni._SimplifiedKnownBindings=!0;ni._SimplifiedKnownUBOs={Scene:{binding:{groupIndex:0,bindingIndex:0}},Light0:{binding:{groupIndex:-1,bindingIndex:-1}},Light1:{binding:{groupIndex:-1,bindingIndex:-1}},Light2:{binding:{groupIndex:-1,bindingIndex:-1}},Light3:{binding:{groupIndex:-1,bindingIndex:-1}},Light4:{binding:{groupIndex:-1,bindingIndex:-1}},Light5:{binding:{groupIndex:-1,bindingIndex:-1}},Light6:{binding:{groupIndex:-1,bindingIndex:-1}},Light7:{binding:{groupIndex:-1,bindingIndex:-1}},Light8:{binding:{groupIndex:-1,bindingIndex:-1}},Light9:{binding:{groupIndex:-1,bindingIndex:-1}},Light10:{binding:{groupIndex:-1,bindingIndex:-1}},Light11:{binding:{groupIndex:-1,bindingIndex:-1}},Light12:{binding:{groupIndex:-1,bindingIndex:-1}},Light13:{binding:{groupIndex:-1,bindingIndex:-1}},Light14:{binding:{groupIndex:-1,bindingIndex:-1}},Light15:{binding:{groupIndex:-1,bindingIndex:-1}},Light16:{binding:{groupIndex:-1,bindingIndex:-1}},Light17:{binding:{groupIndex:-1,bindingIndex:-1}},Light18:{binding:{groupIndex:-1,bindingIndex:-1}},Light19:{binding:{groupIndex:-1,bindingIndex:-1}},Light20:{binding:{groupIndex:-1,bindingIndex:-1}},Light21:{binding:{groupIndex:-1,bindingIndex:-1}},Light22:{binding:{groupIndex:-1,bindingIndex:-1}},Light23:{binding:{groupIndex:-1,bindingIndex:-1}},Light24:{binding:{groupIndex:-1,bindingIndex:-1}},Light25:{binding:{groupIndex:-1,bindingIndex:-1}},Light26:{binding:{groupIndex:-1,bindingIndex:-1}},Light27:{binding:{groupIndex:-1,bindingIndex:-1}},Light28:{binding:{groupIndex:-1,bindingIndex:-1}},Light29:{binding:{groupIndex:-1,bindingIndex:-1}},Light30:{binding:{groupIndex:-1,bindingIndex:-1}},Light31:{binding:{groupIndex:-1,bindingIndex:-1}},Material:{binding:{groupIndex:-1,bindingIndex:-1}},Mesh:{binding:{groupIndex:-1,bindingIndex:-1}},Internals:{binding:{groupIndex:-1,bindingIndex:-1}}};ni._KnownUBOs={Scene:{binding:{groupIndex:0,bindingIndex:0}},Light0:{binding:{groupIndex:1,bindingIndex:0}},Light1:{binding:{groupIndex:1,bindingIndex:1}},Light2:{binding:{groupIndex:1,bindingIndex:2}},Light3:{binding:{groupIndex:1,bindingIndex:3}},Light4:{binding:{groupIndex:1,bindingIndex:4}},Light5:{binding:{groupIndex:1,bindingIndex:5}},Light6:{binding:{groupIndex:1,bindingIndex:6}},Light7:{binding:{groupIndex:1,bindingIndex:7}},Light8:{binding:{groupIndex:1,bindingIndex:8}},Light9:{binding:{groupIndex:1,bindingIndex:9}},Light10:{binding:{groupIndex:1,bindingIndex:10}},Light11:{binding:{groupIndex:1,bindingIndex:11}},Light12:{binding:{groupIndex:1,bindingIndex:12}},Light13:{binding:{groupIndex:1,bindingIndex:13}},Light14:{binding:{groupIndex:1,bindingIndex:14}},Light15:{binding:{groupIndex:1,bindingIndex:15}},Light16:{binding:{groupIndex:1,bindingIndex:16}},Light17:{binding:{groupIndex:1,bindingIndex:17}},Light18:{binding:{groupIndex:1,bindingIndex:18}},Light19:{binding:{groupIndex:1,bindingIndex:19}},Light20:{binding:{groupIndex:1,bindingIndex:20}},Light21:{binding:{groupIndex:1,bindingIndex:21}},Light22:{binding:{groupIndex:1,bindingIndex:22}},Light23:{binding:{groupIndex:1,bindingIndex:23}},Light24:{binding:{groupIndex:1,bindingIndex:24}},Light25:{binding:{groupIndex:1,bindingIndex:25}},Light26:{binding:{groupIndex:1,bindingIndex:26}},Light27:{binding:{groupIndex:1,bindingIndex:27}},Light28:{binding:{groupIndex:1,bindingIndex:28}},Light29:{binding:{groupIndex:1,bindingIndex:29}},Light30:{binding:{groupIndex:1,bindingIndex:30}},Light31:{binding:{groupIndex:1,bindingIndex:31}},Material:{binding:{groupIndex:2,bindingIndex:0}},Mesh:{binding:{groupIndex:2,bindingIndex:1}},Internals:{binding:{groupIndex:2,bindingIndex:2}}};function ar(a,e,t,i){let s=i,n=0,r="";for(;s=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e==95}function Na(a){let e=0,t="",i=!1;const s=[];for(;e=0&&a.charAt(e)!==t&&a.charAt(e)!==i;)e--;return e}function p_(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ua(a,e,t,i){let s=a.indexOf(e);if(s<0)return a;if(t){for(;s++0&&r>0){const o=e.substring(n+1,r);s=+o,isNaN(s)&&(s=+i[o.trim()]),e=e.substring(0,n)}return[e,t,s]}initializeShaders(e){this._webgpuProcessingContext=e,this._missingVaryings.length=0,this._textureArrayProcessing.length=0,this.attributeKeywordName=void 0,this.varyingVertexKeywordName=void 0,this.varyingFragmentKeywordName=void 0}preProcessShaderCode(e,t){const i="// Internals UBO\nuniform ".concat(At.InternalsUBOName," {\nfloat yFactor_;\nfloat textureOutputHeight_;\n};\n"),s=e.indexOf("// Internals UBO")!==-1;return t?(this._fragmentIsGLES3=e.indexOf("#version 3")!==-1,this._fragmentIsGLES3&&(this.varyingFragmentKeywordName="in"),s?e:i+"##INJECTCODE##\n"+e):(this._vertexIsGLES3=e.indexOf("#version 3")!==-1,this._vertexIsGLES3&&(this.attributeKeywordName="in",this.varyingVertexKeywordName="out"),s?e:i+e)}varyingCheck(e,t){const i=/(flat\s)?\s*\bout\b/,s=/(flat\s)?\s*\bin\b/,n=/(flat\s)?\s*\bvarying\b/;return(t&&this._fragmentIsGLES3?s:!t&&this._vertexIsGLES3?i:n).test(e)}varyingProcessor(e,t,i){var l;this._preProcessors=i;const s=/\s*(flat)?\s*out\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm,n=/\s*(flat)?\s*in\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm,r=/\s*(flat)?\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm,h=(t&&this._fragmentIsGLES3?n:!t&&this._vertexIsGLES3?s:r).exec(e);if(h!==null){const c=(l=h[1])!=null?l:"",u=h[2],f=h[3];let d;t?(d=this._webgpuProcessingContext.availableVaryings[f],this._missingVaryings[d]="",d===void 0&&U.Warn('Invalid fragment shader: The varying named "'.concat(f,'" is not declared in the vertex shader! This declaration will be ignored.'))):(d=this._webgpuProcessingContext.getVaryingNextLocation(u,this._getArraySize(f,u,i)[2]),this._webgpuProcessingContext.availableVaryings[f]=d,this._missingVaryings[d]="layout(location = ".concat(d,") ").concat(c," in ").concat(u," ").concat(f,";")),e=e.replace(h[0],d===void 0?"":"layout(location = ".concat(d,") ").concat(c," ").concat(t?"in":"out"," ").concat(u," ").concat(f,";"))}return e}attributeProcessor(e,t){this._preProcessors=t;const i=/\s*in\s+(\S+)\s+(\S+)\s*;/gm,s=/\s*attribute\s+(\S+)\s+(\S+)\s*;/gm,r=(this._vertexIsGLES3?i:s).exec(e);if(r!==null){const o=r[1],h=r[2],l=this._webgpuProcessingContext.getAttributeNextLocation(o,this._getArraySize(h,o,t)[2]);this._webgpuProcessingContext.availableAttributes[h]=l,this._webgpuProcessingContext.orderedAttributes[l]=h;const c=this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents[h];if(c!==void 0){const u=c<0?c===-1?"int":"ivec"+-c:c===1?"uint":"uvec"+c,f="_int_".concat(h,"_");e=e.replace(r[0],"layout(location = ".concat(l,") in ").concat(u," ").concat(f,"; ").concat(o," ").concat(h," = ").concat(o,"(").concat(f,");"))}else e=e.replace(r[0],"layout(location = ".concat(l,") in ").concat(o," ").concat(h,";"))}return e}uniformProcessor(e,t,i){var r;this._preProcessors=i;const n=/\s*uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm.exec(e);if(n!==null){let o=n[1],h=n[2];if(o.indexOf("sampler")===0||o.indexOf("sampler")===1){let l=0;[h,o,l]=this._getArraySize(h,o,i);let c=this._webgpuProcessingContext.availableTextures[h];if(!c){c={autoBindSampler:!0,isTextureArray:l>0,isStorageTexture:!1,textures:[],sampleType:"float"};for(let E=0;E<(l||1);++E)c.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding())}const u=(r=At._SamplerTypeByWebGLSamplerType[o])!=null?r:"sampler",f=!!At._IsComparisonSamplerByWebGPUSamplerType[u],d=f?"comparison":"filtering",_=h+"Sampler";let p=this._webgpuProcessingContext.availableSamplers[_];p||(p={binding:this._webgpuProcessingContext.getNextFreeUBOBinding(),type:d});const g=o.charAt(0)==="u"?"u":o.charAt(0)==="i"?"i":"";g&&(o=o.substring(1));const m=f?"depth":g==="u"?"uint":g==="i"?"sint":"float";c.sampleType=m;const b=l>0,I=p.binding.groupIndex,T=p.binding.bindingIndex,x=At._SamplerFunctionByWebGLSamplerType[o],y=At._TextureTypeByWebGLSamplerType[o],R=At._GpuTextureViewDimensionByWebGPUTextureType[y];if(!b)l=1,e="layout(set = ".concat(I,", binding = ").concat(T,") uniform ").concat(u," ").concat(_,";\n layout(set = ").concat(c.textures[0].groupIndex,", binding = ").concat(c.textures[0].bindingIndex,") uniform ").concat(g).concat(y," ").concat(h,"Texture;\n #define ").concat(h," ").concat(g).concat(x,"(").concat(h,"Texture, ").concat(_,")");else{const E=[];E.push("layout(set = ".concat(I,", binding = ").concat(T,") uniform ").concat(g).concat(u," ").concat(_,";")),e="\n";for(let C=0;C0?"\n":"","#define ").concat(h).concat(C," ").concat(g).concat(x,"(").concat(h,"Texture").concat(C,", ").concat(_,")")}e=E.join("\n")+e,this._textureArrayProcessing.push(h)}this._webgpuProcessingContext.availableTextures[h]=c,this._webgpuProcessingContext.availableSamplers[_]=p,this._addSamplerBindingDescription(_,p,!t);for(let E=0;E=0,l="\n glFragCoord_ = gl_FragCoord;\n if (yFactor_ == 1.) {\n glFragCoord_.y = textureOutputHeight_ - glFragCoord_.y;\n }\n ",c=h?"vec4 glFragCoord_;\n":"",u=e.search(/layout *\(location *= *0\) *out/g)!==-1;if(e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCubeLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCube\s*\(/g,"texture("),e=e.replace(/gl_FragDepthEXT/g,"gl_FragDepth"),e=e.replace(/gl_FragColor/g,"glFragColor"),e=e.replace(/gl_FragData/g,"glFragData"),e=e.replace(/gl_FragCoord/g,"glFragCoord_"),!this._fragmentIsGLES3)e=e.replace(/void\s+?main\s*\(/g,(r||u?"":"layout(location = 0) out vec4 glFragColor;\n")+"void main(");else{const f=/^\s*out\s+\S+\s+\S+\s*;/gm.exec(e);f!==null&&(e=e.substring(0,f.index)+"layout(location = 0) "+e.substring(f.index))}e=e.replace(/dFdy/g,"(-yFactor_)*dFdy"),e=e.replace("##INJECTCODE##",c),h&&(e=Ua(e,"void main",l))}else if(e=e.replace(/gl_InstanceID/g,"gl_InstanceIndex"),e=e.replace(/gl_VertexID/g,"gl_VertexIndex"),t.indexOf("#define MULTIVIEW")!==-1)return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e;if(!i){const h=e.lastIndexOf("}");e=e.substring(0,h),e+="gl_Position.y *= yFactor_;\n",e+="}"}return e}_applyTextureArrayProcessing(e,t){const i=new RegExp(t+"\\s*\\[(.+)?\\]","gm");let s=i.exec(e);for(;s!==null;){const n=s[1];let r=+n;this._preProcessors&&isNaN(r)&&(r=+this._preProcessors[n.trim()]),e=e.replace(s[0],t+r),s=i.exec(e)}return e}_generateLeftOverUBOCode(e,t){let i="layout(set = ".concat(t.binding.groupIndex,", binding = ").concat(t.binding.bindingIndex,") uniform ").concat(e," {\n ");for(const s of this._webgpuProcessingContext.leftOverUniforms)s.length>0?i+=" ".concat(s.type," ").concat(s.name,"[").concat(s.length,"];\n"):i+=" ".concat(s.type," ").concat(s.name,";\n");return i+="};\n\n",i}finalizeShaders(e,t){for(let s=0;s0&&(t=n+"\n"+t)}const i=this._buildLeftOverUBO();return e=i+e,t=i+t,this._collectBindingNames(),this._preCreateBindGroupEntries(),this._preProcessors=null,this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents={},{vertexCode:e,fragmentCode:t}}}const m_="bakedVertexAnimationDeclaration",v_="#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\nuniform bakedVertexAnimationTime: f32;uniform bakedVertexAnimationTextureSizeInverted: vec2;uniform bakedVertexAnimationSettings: vec4;var bakedVertexAnimationTexture : texture_2d;\n#ifdef INSTANCES\nattribute bakedVertexAnimationSettingsInstanced : vec4;\n#endif\nfn readMatrixFromRawSamplerVAT(smp : texture_2d,index : f32,frame : f32)->mat4x4\n{let offset=i32(index)*4;let frameUV=i32(frame);let m0=textureLoad(smp,vec2(offset+0,frameUV),0);let m1=textureLoad(smp,vec2(offset+1,frameUV),0);let m2=textureLoad(smp,vec2(offset+2,frameUV),0);let m3=textureLoad(smp,vec2(offset+3,frameUV),0);return mat4x4(m0,m1,m2,m3);}\n#endif\n";Me.IncludesShadersStoreWGSL[m_]=v_;const b_="bakedVertexAnimation",x_="#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\n{\n#ifdef INSTANCES\nlet VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;let VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;let VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;let VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w;\n#else\nlet VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;let VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;let VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;let VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;\n#endif\nlet totalFrames: f32=VATEndFrame-VATStartFrame+1.0;let time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;let frameCorrection: f32=select(1.0,0.0,time<1.0);let numOfFrames: f32=totalFrames-frameCorrection;var VATFrameNum: f32=fract(time)*numOfFrames;VATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;VATFrameNum=floor(VATFrameNum);VATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;var VATInfluence : mat4x4;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[0],VATFrameNum)*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[1],VATFrameNum)*vertexInputs.matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[2],VATFrameNum)*vertexInputs.matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[3],VATFrameNum)*vertexInputs.matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[0],VATFrameNum)*vertexInputs.matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[1],VATFrameNum)*vertexInputs.matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[2],VATFrameNum)*vertexInputs.matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[3],VATFrameNum)*vertexInputs.matricesWeightsExtra[3];\n#endif\nfinalWorld=finalWorld*VATInfluence;}\n#endif\n";Me.IncludesShadersStoreWGSL[b_]=x_;const y_="instancesDeclaration",T_="#ifdef INSTANCES\nattribute world0 : vec4;attribute world1 : vec4;attribute world2 : vec4;attribute world3 : vec4;\n#ifdef INSTANCESCOLOR\nattribute instanceColor : vec4;\n#endif\n#if defined(THIN_INSTANCES) && !defined(WORLD_UBO)\nuniform world : mat4x4;\n#endif\n#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nattribute previousWorld0 : vec4;attribute previousWorld1 : vec4;attribute previousWorld2 : vec4;attribute previousWorld3 : vec4;\n#ifdef THIN_INSTANCES\nuniform previousWorld : mat4x4;\n#endif\n#endif\n#else\n#if !defined(WORLD_UBO)\nuniform world : mat4x4;\n#endif\n#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nuniform previousWorld : mat4x4;\n#endif\n#endif\n";Me.IncludesShadersStoreWGSL[y_]=T_;const A_="instancesVertex",R_="#ifdef INSTANCES\nvar finalWorld=mat4x4(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3);\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nvar finalPreviousWorld=mat4x4(\nvertexInputs.previousWorld0,vertexInputs.previousWorld1,\nvertexInputs.previousWorld2,vertexInputs.previousWorld3);\n#endif\n#ifdef THIN_INSTANCES\n#if !defined(WORLD_UBO)\nfinalWorld=uniforms.world*finalWorld;\n#else\nfinalWorld=mesh.world*finalWorld;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nfinalPreviousWorld=uniforms.previousWorld*finalPreviousWorld;\n#endif\n#endif\n#else\n#if !defined(WORLD_UBO)\nvar finalWorld=uniforms.world;\n#else\nvar finalWorld=mesh.world;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR)\nvar finalPreviousWorld=uniforms.previousWorld;\n#endif\n#endif\n";Me.IncludesShadersStoreWGSL[A_]=R_;const I_="helperFunctions",E_="const PI: f32=3.1415926535897932384626433832795;const RECIPROCAL_PI: f32=0.3183098861837907;const RECIPROCAL_PI2: f32=0.15915494309189535;const HALF_MIN: f32=5.96046448e-08; \nconst LinearEncodePowerApprox: f32=2.2;const GammaEncodePowerApprox: f32=1.0/LinearEncodePowerApprox;const LuminanceEncodeApprox: vec3=vec3 (0.2126,0.7152,0.0722);const Epsilon:f32=0.0000001;fn square(x: f32)->f32 {return x*x;}\nfn saturate(x: f32)->f32 {return clamp(x,0.0,1.0);}\nfn saturateVec3(x: vec3f)->vec3f {return clamp(x,vec3f(0.0),vec3f(1.0));}\nfn saturateEps(x: f32)->f32 {return clamp(x,Epsilon,1.0);} \nfn maxEps(x: f32)->f32 {return max(x,Epsilon);}\nfn maxEpsVec3(x: vec3f)->vec3f {return max(x,vec3f(Epsilon));}\nfn absEps(x: f32)->f32 {return abs(x)+Epsilon;}\nfn transposeMat3(inMatrix: mat3x3f)->mat3x3f {let i0: vec3=inMatrix[0];let i1: vec3=inMatrix[1];let i2: vec3=inMatrix[2];let outMatrix:mat3x3f=mat3x3f(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);return outMatrix;}\nfn inverseMat3(inMatrix: mat3x3f)->mat3x3f {let a00: f32=inMatrix[0][0];let a01: f32=inMatrix[0][1];let a02: f32=inMatrix[0][2];let a10: f32=inMatrix[1][0];let a11: f32=inMatrix[1][1];let a12: f32=inMatrix[1][2];let a20: f32=inMatrix[2][0];let a21: f32=inMatrix[2][1];let a22: f32=inMatrix[2][2];let b01: f32=a22*a11-a12*a21;let b11: f32=-a22*a10+a12*a20;let b21: f32=a21*a10-a11*a20;let det: f32=a00*b01+a01*b11+a02*b21;return mat3x3f(b01/det,(-a22*a01+a02*a21)/det,(a12*a01-a02*a11)/det,\nb11/det,(a22*a00-a02*a20)/det,(-a12*a00+a02*a10)/det,\nb21/det,(-a21*a00+a01*a20)/det,(a11*a00-a01*a10)/det);}\n#if USE_EXACT_SRGB_CONVERSIONS\nfn toLinearSpaceExact(color: vec3)->vec3\n{let nearZeroSection: vec3=0.0773993808*color;let remainingSection: vec3=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));}\nfn toGammaSpaceExact(color: vec3)->vec3\n{let nearZeroSection: vec3=12.92*color;let remainingSection: vec3=1.055*pow(color,vec3(0.41666))-vec3(0.055);return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));}\n#endif\nfn toLinearSpace(color: f32)->f32\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nvar nearZeroSection=0.0773993808*color;var remainingSection=pow(0.947867299*(color+0.055),2.4);return select(remainingSection,nearZeroSection,color<=0.04045);\n#else\nreturn pow(color,LinearEncodePowerApprox);\n#endif\n}\nfn toLinearSpaceVec3(color: vec3)->vec3\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toLinearSpaceExact(color);\n#else\nreturn pow(color,vec3(LinearEncodePowerApprox));\n#endif\n}\nfn toLinearSpaceVec4(color: vec4)->vec4\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4f(toLinearSpaceExact(color.rgb),color.a);\n#else\nreturn vec4f(pow(color.rgb,vec3f(LinearEncodePowerApprox)),color.a);\n#endif\n}\nfn toGammaSpace(color: vec4)->vec4\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4(toGammaSpaceExact(color.rgb),color.a);\n#else\nreturn vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);\n#endif\n}\nfn toGammaSpaceVec3(color: vec3)->vec3\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toGammaSpaceExact(color);\n#else\nreturn pow(color,vec3(GammaEncodePowerApprox));\n#endif\n}\nfn squareVec3(value: vec3)->vec3\n{return value*value;}\nfn pow5(value: f32)->f32 {let sq: f32=value*value;return sq*sq*value;}\nfn getLuminance(color: vec3)->f32\n{return clamp(dot(color,LuminanceEncodeApprox),0.,1.);}\nfn getRand(seed: vec2)->f32 {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);}\nfn dither(seed: vec2,varianceAmount: f32)->f32 {let rand: f32=getRand(seed);let normVariance: f32=varianceAmount/255.0;let dither: f32=mix(-normVariance,normVariance,rand);return dither;}\nconst rgbdMaxRange: f32=255.0;fn toRGBD(color: vec3)->vec4 {let maxRGB: f32=max(max(color.r,max(color.g,color.b)),Epsilon);var D: f32 =max(rgbdMaxRange/maxRGB,1.);D =clamp(floor(D)/255.0,0.,1.);var rgb: vec3 =color.rgb*D;rgb=toGammaSpaceVec3(rgb);return vec4(clamp(rgb,vec3(0.,0.,0.),vec3(1.,1.,1.)),D); }\nfn fromRGBD(rgbd: vec4)->vec3 {let rgb=toLinearSpaceVec3(rgbd.rgb);return rgb/rgbd.a;}\nfn parallaxCorrectNormal(vertexPos: vec3,origVec: vec3,cubeSize: vec3,cubePos: vec3)->vec3 {let invOrigVec: vec3=vec3(1.0,1.0,1.0)/origVec;let halfSize: vec3=cubeSize*0.5;let intersecAtMaxPlane: vec3=(cubePos+halfSize-vertexPos)*invOrigVec;let intersecAtMinPlane: vec3=(cubePos-halfSize-vertexPos)*invOrigVec;let largestIntersec: vec3=max(intersecAtMaxPlane,intersecAtMinPlane);let distance: f32=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);let intersectPositionWS: vec3=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}\n";Me.IncludesShadersStoreWGSL[I_]=E_;const C_="fresnelFunction",S_="#ifdef FRESNEL\nfn computeFresnelTerm(viewDirection: vec3f,worldNormal: vec3f,bias: f32,power: f32)->f32\n{let fresnelTerm: f32=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);}\n#endif\n";Me.IncludesShadersStoreWGSL[C_]=S_;const M_="meshUboDeclaration",P_="struct Mesh {world : mat4x4,\nvisibility : f32,};var mesh : Mesh;\n#define WORLD_UBO\n";Me.IncludesShadersStoreWGSL[M_]=P_;const w_="sceneUboDeclaration",D_="struct Scene {viewProjection : mat4x4,\n#ifdef MULTIVIEW\nviewProjectionR : mat4x4,\n#endif \nview : mat4x4,\nprojection : mat4x4,\nvEyePosition : vec4,};var scene : Scene;\n";Me.IncludesShadersStoreWGSL[w_]=D_;const F_="decalFragment",O_="#ifdef DECAL\nvar decalTempColor=decalColor.rgb;var decalTempAlpha=decalColor.a;\n#ifdef GAMMADECAL\ndecalTempColor=toLinearSpaceVec3(decalColor.rgb);\n#endif\n#ifdef DECAL_SMOOTHALPHA\ndecalTempAlpha=decalColor.a*decalColor.a;\n#endif\nsurfaceAlbedo=mix(surfaceAlbedo.rgb,decalTempColor,decalTempAlpha);\n#endif\n";Me.IncludesShadersStoreWGSL[F_]=O_;const Ch="fragmentOutputs.fragDepth",B_="uniforms",L_="internals",N_={texture_1d:"1d",texture_2d:"2d",texture_2d_array:"2d-array",texture_3d:"3d",texture_cube:"cube",texture_cube_array:"cube-array",texture_multisampled_2d:"2d",texture_depth_2d:"2d",texture_depth_2d_array:"2d-array",texture_depth_cube:"cube",texture_depth_cube_array:"cube-array",texture_depth_multisampled_2d:"2d",texture_storage_1d:"1d",texture_storage_2d:"2d",texture_storage_2d_array:"2d-array",texture_storage_3d:"3d",texture_external:null};class U_ extends At{constructor(){super(...arguments),this.shaderLanguage=1,this.uniformRegexp=/uniform\s+(\w+)\s*:\s*(.+)\s*;/,this.textureRegexp=/var\s+(\w+)\s*:\s*((array<\s*)?(texture_\w+)\s*(<\s*(.+)\s*>)?\s*(,\s*\w+\s*>\s*)?);/,this.noPrecision=!0,this.pureMode=!1}preProcessor(e,t,i,s,n){for(const r in i){if(r==="__VERSION__")continue;const o=i[r];(!isNaN(parseInt(o))||!isNaN(parseFloat(o)))&&(e="const ".concat(r," = ").concat(o,";\n")+e)}return e}_getArraySize(e,t,i){let s=0;const n=t.lastIndexOf(">");if(t.indexOf("array")>=0&&n>0){let r=n;for(;r>0&&t.charAt(r)!==" "&&t.charAt(r)!==",";)r--;const o=t.substring(r+1,n);for(s=+o,isNaN(s)&&(s=+i[o.trim()]);r>0&&(t.charAt(r)===" "||t.charAt(r)===",");)r--;t=t.substring(t.indexOf("<")+1,r+1)}return[e,t,s]}initializeShaders(e){this._webgpuProcessingContext=e,this._attributesInputWGSL=[],this._attributesWGSL=[],this._attributesConversionCodeWGSL=[],this._hasNonFloatAttribute=!1,this._varyingsWGSL=[],this._varyingNamesWGSL=[],this._stridedUniformArrays=[]}preProcessShaderCode(e){const t=this.pureMode?"":"struct ".concat(At.InternalsUBOName," {\n yFactor_: f32,\n textureOutputHeight_: f32,\n};\nvar ").concat(L_," : ").concat(At.InternalsUBOName,";\n");return e.indexOf(t)!==-1?e:t+Na(e)}varyingCheck(e){return/(flat|linear|perspective)?\s*(center|centroid|sample)?\s*\bvarying\b/.test(e)}varyingProcessor(e,t,i){var r,o;const n=/\s*(flat|linear|perspective)?\s*(center|centroid|sample)?\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s*:\s*(.+)\s*;/gm.exec(e);if(n!==null){const h=(r=n[1])!=null?r:"perspective",l=(o=n[2])!=null?o:"center",c=n[4],u=n[3],f=h==="flat"?"@interpolate(".concat(h,")"):"@interpolate(".concat(h,", ").concat(l,")");let d;t?(d=this._webgpuProcessingContext.availableVaryings[u],d===void 0&&U.Warn('Invalid fragment shader: The varying named "'.concat(u,'" is not declared in the vertex shader! This declaration will be ignored.'))):(d=this._webgpuProcessingContext.getVaryingNextLocation(c,this._getArraySize(u,c,i)[2]),this._webgpuProcessingContext.availableVaryings[u]=d,this._varyingsWGSL.push(" @location(".concat(d,") ").concat(f," ").concat(u," : ").concat(c,",")),this._varyingNamesWGSL.push(u)),e=""}return e}attributeProcessor(e,t){const s=/\s*attribute\s+(\S+)\s*:\s*(.+)\s*;/gm.exec(e);if(s!==null){const n=s[2],r=s[1],o=this._webgpuProcessingContext.getAttributeNextLocation(n,this._getArraySize(r,n,t)[2]);this._webgpuProcessingContext.availableAttributes[r]=o,this._webgpuProcessingContext.orderedAttributes[o]=r;const h=this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents[r];if(h!==void 0){const l=h<0?h===-1?"i32":"vec"+-h+"":h===1?"u32":"vec"+h+"",c="_int_".concat(r,"_");this._attributesInputWGSL.push("@location(".concat(o,") ").concat(c," : ").concat(l,",")),this._attributesWGSL.push("".concat(r," : ").concat(n,",")),this._attributesConversionCodeWGSL.push("vertexInputs.".concat(r," = ").concat(n,"(vertexInputs_.").concat(c,");")),this._hasNonFloatAttribute=!0}else this._attributesInputWGSL.push("@location(".concat(o,") ").concat(r," : ").concat(n,",")),this._attributesWGSL.push("".concat(r," : ").concat(n,",")),this._attributesConversionCodeWGSL.push("vertexInputs.".concat(r," = vertexInputs_.").concat(r,";"));e=""}return e}uniformProcessor(e,t,i){const s=this.uniformRegexp.exec(e);if(s!==null){const n=s[2],r=s[1];this._addUniformToLeftOverUBO(r,n,i),e=""}return e}textureProcessor(e,t,i){const s=this.textureRegexp.exec(e);if(s!==null){const n=s[1],r=s[2],o=!!s[3],h=s[4],l=h.indexOf("storage")>0,c=s[6],u=l?c.substring(0,c.indexOf(",")).trim():null;let f=o?this._getArraySize(n,r,i)[2]:0,d=this._webgpuProcessingContext.availableTextures[n];if(d)f=d.textures.length;else{d={isTextureArray:f>0,isStorageTexture:l,textures:[],sampleType:"float"},f=f||1;for(let m=0;m0,p=N_[h],g=_?"depth":c==="u32"?"uint":c==="i32"?"sint":"float";if(d.sampleType=g,p===void 0)throw"Can't get the texture dimension corresponding to the texture function \"".concat(h,'"!');for(let m=0;m=0&&!this.pureMode?"\n if (internals.yFactor_ == 1.) {\n fragmentInputs.position.y = internals.textureOutputHeight_ - fragmentInputs.position.y;\n }\n ":"";e=this._processSamplers(e,!0),t=this._processSamplers(t,!1),e=this._processCustomBuffers(e,!0),t=this._processCustomBuffers(t,!1);const s=this._buildLeftOverUBO();e=s+e,t=s+t,e=e.replace(/#define (\w+)\s+(\d+\.?\d*)/g,"const $1 = $2;"),e=e.replace(/#define /g,"//#define "),e=this._processStridedUniformArrays(e);let n="struct VertexInputs {\n @builtin(vertex_index) vertexIndex : u32,\n @builtin(instance_index) instanceIndex : u32,\n";this._attributesInputWGSL.length>0&&(n+=this._attributesInputWGSL.join("\n")),n+="\n};\nvar vertexInputs"+(this._hasNonFloatAttribute?"_":"")+" : VertexInputs;\n",this._hasNonFloatAttribute&&(n+="struct VertexInputs_ {\n vertexIndex : u32, instanceIndex : u32,\n",n+=this._attributesWGSL.join("\n"),n+="\n};\nvar vertexInputs : VertexInputs_;\n");let r="struct FragmentInputs {\n @builtin(position) position : vec4,\n";this._varyingsWGSL.length>0&&(r+=this._varyingsWGSL.join("\n")),r+="\n};\nvar vertexOutputs : FragmentInputs;\n",e=n+r+e;let o="\n vertexInputs".concat(this._hasNonFloatAttribute?"_":""," = input;\n");this._hasNonFloatAttribute&&(o+="vertexInputs.vertexIndex = vertexInputs_.vertexIndex;\nvertexInputs.instanceIndex = vertexInputs_.instanceIndex;\n",o+=this._attributesConversionCodeWGSL.join("\n"),o+="\n");const h=this.pureMode?" return vertexOutputs;":" vertexOutputs.position.y = vertexOutputs.position.y * internals.yFactor_;\n return vertexOutputs;";let l=e.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")!==-1;e=(l?"diagnostic(off, derivative_uniformity);\n":"")+"diagnostic(off, chromium.unreachable_code);\n"+Ua(e,"fn main",o,h),t=t.replace(/#define (\w+)\s+(\d+\.?\d*)/g,"const $1 = $2;"),t=t.replace(/#define /g,"//#define "),t=this._processStridedUniformArrays(t),this.pureMode||(t=t.replace(/dpdy/g,"(-internals.yFactor_)*dpdy"));let c="struct FragmentInputs {\n @builtin(position) position : vec4,\n @builtin(front_facing) frontFacing : bool,\n";this._varyingsWGSL.length>0&&(c+=this._varyingsWGSL.join("\n")),c+="\n};\nvar fragmentInputs : FragmentInputs;\n";let u="struct FragmentOutputs {\n";const f="fragmentOutputs\\.fragData";let d=t.match(new RegExp(f+"0","g")),_=0;if(d){u+=" @location(".concat(_,") fragData0 : vec4,\n"),_++;for(let T=1;T<8;T++)d=t.match(new RegExp(f+T,"g")),d&&(u+=" @location(".concat(_,") fragData").concat(_," : vec4,\n"),_++);t.indexOf("MRT_AND_COLOR")!==-1&&(u+=" @location(".concat(_,") color : vec4,\n"),_++)}const p=/oitDepthSampler/;d=t.match(p),d&&(u+=" @location(".concat(_++,") depth : vec2,\n"),u+=" @location(".concat(_++,") frontColor : vec4,\n"),u+=" @location(".concat(_++,") backColor : vec4,\n")),_===0&&(u+=" @location(0) color : vec4,\n",_++);let g=!1,m=0;for(;!g&&(m=t.indexOf(Ch,m),!(m<0));){const T=m;for(g=!0;m>1&&t.charAt(m)!=="\n";){if(t.charAt(m)==="/"&&t.charAt(m-1)==="/"){g=!1;break}m--}m=T+Ch.length}g&&(u+=" @builtin(frag_depth) fragDepth: f32,\n"),u+="};\nvar fragmentOutputs : FragmentOutputs;\n",t=c+u+t;const b=" fragmentInputs = input;\n "+i,I=" return fragmentOutputs;";return l=t.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")!==-1,t=(l?"diagnostic(off, derivative_uniformity);\n":"")+"diagnostic(off, chromium.unreachable_code);\n"+Ua(t,"fn main",b,I),this._collectBindingNames(),this._preCreateBindGroupEntries(),this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents={},{vertexCode:e,fragmentCode:t}}_generateLeftOverUBOCode(e,t){let i="",s="struct ".concat(e," {\n");for(const n of this._webgpuProcessingContext.leftOverUniforms){const r=n.type.replace(/^(.*?)(<.*>)?$/,"$1"),o=At.UniformSizes[r];if(n.length>0)if(o<=2){const h="".concat(e,"_").concat(this._stridedUniformArrays.length,"_strided_arr");i+="struct ".concat(h," {\n @size(16)\n el: ").concat(r,",\n }"),this._stridedUniformArrays.push(n.name),s+=" @align(16) ".concat(n.name," : array<").concat(h,", ").concat(n.length,">,\n")}else s+=" ".concat(n.name," : array<").concat(n.type,", ").concat(n.length,">,\n");else s+=" ".concat(n.name," : ").concat(n.type,",\n")}return s+="};\n",s="".concat(i,"\n").concat(s),s+="@group(".concat(t.binding.groupIndex,") @binding(").concat(t.binding.bindingIndex,") var ").concat(B_," : ").concat(e,";\n"),s}_processSamplers(e,t){const i=/var\s+(\w+Sampler)\s*:\s*(sampler|sampler_comparison)\s*;/gm;for(;;){const s=i.exec(e);if(s===null)break;const n=s[1],r=s[2],o=n.length-7,h=n.lastIndexOf("Sampler")===o?n.substring(0,o):null,l=r==="sampler_comparison"?"comparison":"filtering";if(h){const _=this._webgpuProcessingContext.availableTextures[h];_&&(_.autoBindSampler=!0)}let c=this._webgpuProcessingContext.availableSamplers[n];c||(c={binding:this._webgpuProcessingContext.getNextFreeUBOBinding(),type:l},this._webgpuProcessingContext.availableSamplers[n]=c),this._addSamplerBindingDescription(n,c,t);const u=e.substring(0,s.index),f="@group(".concat(c.binding.groupIndex,") @binding(").concat(c.binding.bindingIndex,") "),d=e.substring(s.index);e=u+f+d,i.lastIndex+=f.length}return e}_processCustomBuffers(e,t){var s;const i=/var<\s*(uniform|storage)\s*(,\s*(read|read_write)\s*)?>\s+(\S+)\s*:\s*(\S+)\s*;/gm;for(;;){const n=i.exec(e);if(n===null)break;const r=n[1],o=n[3];let h=n[4];const l=n[5];let c=this._webgpuProcessingContext.availableBuffers[h];if(!c){const g=r==="uniform"?ni.KnownUBOs[l]:null;let m;g?(h=l,m=g.binding,m.groupIndex===-1&&(m=(s=this._webgpuProcessingContext.availableBuffers[h])==null?void 0:s.binding,m||(m=this._webgpuProcessingContext.getNextFreeUBOBinding()))):m=this._webgpuProcessingContext.getNextFreeUBOBinding(),c={binding:m},this._webgpuProcessingContext.availableBuffers[h]=c}this._addBufferBindingDescription(h,this._webgpuProcessingContext.availableBuffers[h],o==="read_write"?"storage":r==="storage"?"read-only-storage":"uniform",t);const u=c.binding.groupIndex,f=c.binding.bindingIndex,d=e.substring(0,n.index),_="@group(".concat(u,") @binding(").concat(f,") "),p=e.substring(n.index);e=d+_+p,i.lastIndex+=_.length}return e}_processStridedUniformArrays(e){for(const t of this._stridedUniformArrays)e=e.replace(new RegExp("".concat(t,"\\s*\\[(.*?)\\]"),"g"),"".concat(t,"[$1].el"));return e}}class pr{get underlyingResource(){return this._webgpuTexture}getMSAATexture(e){var t,i;return(i=(t=this._webgpuMSAATexture)==null?void 0:t[e])!=null?i:null}setMSAATexture(e,t){this._webgpuMSAATexture||(this._webgpuMSAATexture=[]),this._webgpuMSAATexture[t]=e}releaseMSAATexture(e){if(this._webgpuMSAATexture)if(e!==void 0)this._engine._textureHelper.releaseTexture(this._webgpuMSAATexture[e]),delete this._webgpuMSAATexture[e];else{for(const t of this._webgpuMSAATexture)this._engine._textureHelper.releaseTexture(t);this._webgpuMSAATexture=null}}constructor(e,t=null){this._engine=e,this._originalFormatIsRGB=!1,this.format="rgba8unorm",this.textureUsages=0,this.textureAdditionalUsages=0,this._webgpuTexture=t,this._webgpuMSAATexture=null,this.view=null,this.viewForWriting=null}set(e){this._webgpuTexture=e}setUsage(e,t,i,s,n,r,o,h){let l="2d",c=1;s?(l=i?"cube-array":"cube",c=6*(h||1)):n?(l="3d",c=1):i&&(l="2d-array",c=h);const u=Ve.GetDepthFormatOnly(this.format),f=Ve.HasDepthAndStencilAspects(this.format)?"depth-only":"all";this.createView({label:"TextureView".concat(n?"3D":s?"Cube":"2D").concat(i?"_Array"+c:"","_").concat(r,"x").concat(o,"_").concat(t?"wmips":"womips","_").concat(this.format,"_").concat(l),format:u,dimension:l,mipLevelCount:t?ec(Math.max(r,o))+1:1,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:c,aspect:f})}createView(e,t=!1){if(this.view=this._webgpuTexture.createView(e),t&&e){const i=e.mipLevelCount;e.mipLevelCount=1,this.viewForWriting=this._webgpuTexture.createView(e),e.mipLevelCount=i}}reset(){this._webgpuTexture=null,this._webgpuMSAATexture=null,this.view=null,this.viewForWriting=null}release(){var e,t;(e=this._webgpuTexture)==null||e.destroy(),this.releaseMSAATexture(),(t=this._copyInvertYTempTexture)==null||t.destroy(),this.reset()}}const k_="\n const pos = array, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f));\n const tex = array, 4>( vec2f(0.0f, 0.0f), vec2f(1.0f, 0.0f), vec2f(0.0f, 1.0f), vec2f(1.0f, 1.0f));\n\n varying vTex: vec2f;\n\n @vertex\n fn main(input : VertexInputs) -> FragmentInputs {\n vertexOutputs.vTex = tex[input.vertexIndex];\n vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0);\n }\n ",V_="\n var imgSampler: sampler;\n var img: texture_2d;\n\n varying vTex: vec2f;\n\n @fragment\n fn main(input: FragmentInputs) -> FragmentOutputs {\n fragmentOutputs.color = textureSample(img, imgSampler, input.vTex);\n }\n ",mc="\n const pos = array, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f));\n const tex = array, 4>( vec2f(0.0f, 0.0f), vec2f(1.0f, 0.0f), vec2f(0.0f, 1.0f), vec2f(1.0f, 1.0f));\n\n var img: texture_2d;\n\n #ifdef INVERTY\n varying vTextureSize: vec2f;\n #endif\n\n @vertex\n fn main(input : VertexInputs) -> FragmentInputs {\n #ifdef INVERTY\n vertexOutputs.vTextureSize = vec2f(textureDimensions(img, 0));\n #endif\n vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0);\n }\n ",G_="\n var img: texture_2d;\n\n #ifdef INVERTY\n varying vTextureSize: vec2f;\n #endif\n\n @fragment\n fn main(input: FragmentInputs) -> FragmentOutputs {\n #ifdef INVERTY\n var color: vec4f = textureLoad(img, vec2i(i32(input.position.x), i32(input.vTextureSize.y - input.position.y)), 0);\n #else\n var color: vec4f = textureLoad(img, vec2i(input.position.xy), 0);\n #endif\n #ifdef PREMULTIPLYALPHA\n fragmentOutputs.color = vec4f(color.rgb * color.a, color.a);\n #endif\n fragmentOutputs.color = color;\n }\n ",z_=mc,W_="\n var img: texture_2d;\n uniform ofstX: f32;\n uniform ofstY: f32;\n uniform width: f32;\n uniform height: f32;\n\n #ifdef INVERTY\n varying vTextureSize: vec2f;\n #endif\n\n @fragment\n fn main(input: FragmentInputs) -> FragmentOutputs {\n if (input.position.x < uniforms.ofstX || input.position.x >= uniforms.ofstX + uniforms.width) {\n discard;\n }\n if (input.position.y < uniforms.ofstY || input.position.y >= uniforms.ofstY + uniforms.height) {\n discard;\n }\n #ifdef INVERTY\n var color: vec4f = textureLoad(img, vec2i(i32(input.position.x), i32(uniforms.ofstY + uniforms.height - (input.position.y - uniforms.ofstY))), 0);\n #else\n var color: vec4f = textureLoad(img, vec2i(input.position.xy), 0);\n #endif\n #ifdef PREMULTIPLYALPHA\n color = vec4f(color.rgb * color.a, color.a);\n #endif\n fragmentOutputs.color = color;\n }\n ",H_="\n const pos = array, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f));\n\n @vertex\n fn main(input : VertexInputs) -> FragmentInputs {\n vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0);\n }\n ",K_="\n uniform color: vec4f;\n\n\n @fragment\n fn main(input: FragmentInputs) -> FragmentOutputs {\n fragmentOutputs.color = uniforms.color;\n }\n ",X_="\n struct VertexOutput {\n @builtin(position) Position : vec4,\n @location(0) fragUV : vec2\n }\n\n @vertex\n fn main(\n @builtin(vertex_index) VertexIndex : u32\n ) -> VertexOutput {\n var pos = array, 4>(\n vec2(-1.0, 1.0),\n vec2( 1.0, 1.0),\n vec2(-1.0, -1.0),\n vec2( 1.0, -1.0)\n );\n var tex = array, 4>(\n vec2(0.0, 0.0),\n vec2(1.0, 0.0),\n vec2(0.0, 1.0),\n vec2(1.0, 1.0)\n );\n\n var output: VertexOutput;\n\n output.Position = vec4(pos[VertexIndex], 0.0, 1.0);\n output.fragUV = tex[VertexIndex];\n\n return output;\n }\n ",Y_="\n @group(0) @binding(0) var videoSampler: sampler;\n @group(0) @binding(1) var videoTexture: texture_external;\n\n @fragment\n fn main(\n @location(0) fragUV: vec2\n ) -> @location(0) vec4 {\n return textureSampleBaseClampToEdge(videoTexture, videoSampler, fragUV);\n }\n ",q_="\n @group(0) @binding(0) var videoSampler: sampler;\n @group(0) @binding(1) var videoTexture: texture_external;\n\n @fragment\n fn main(\n @location(0) fragUV: vec2\n ) -> @location(0) vec4 {\n return textureSampleBaseClampToEdge(videoTexture, videoSampler, vec2(fragUV.x, 1.0 - fragUV.y));\n }\n ";var gi;(function(a){a[a.MipMap=0]="MipMap",a[a.InvertYPremultiplyAlpha=1]="InvertYPremultiplyAlpha",a[a.Clear=2]="Clear",a[a.InvertYPremultiplyAlphaWithOfst=3]="InvertYPremultiplyAlphaWithOfst"})(gi||(gi={}));var en;(function(a){a[a.DontInvertY=0]="DontInvertY",a[a.InvertY=1]="InvertY"})(en||(en={}));const Sh=[{vertex:k_,fragment:V_},{vertex:mc,fragment:G_},{vertex:H_,fragment:K_},{vertex:z_,fragment:W_}],Vi={"":0,r8unorm:1,r8uint:2,r8sint:3,r16uint:4,r16sint:5,r16float:6,rg8unorm:7,rg8uint:8,rg8sint:9,r32uint:10,r32sint:11,r32float:12,rg16uint:13,rg16sint:14,rg16float:15,rgba8unorm:16,"rgba8unorm-srgb":17,rgba8uint:18,rgba8sint:19,bgra8unorm:20,"bgra8unorm-srgb":21,rgb10a2uint:22,rgb10a2unorm:23,rg32uint:24,rg32sint:25,rg32float:26,rgba16uint:27,rgba16sint:28,rgba16float:29,rgba32uint:30,rgba32sint:31,rgba32float:32,stencil8:33,depth16unorm:34,depth24plus:35,"depth24plus-stencil8":36,depth32float:37,"depth32float-stencil8":38,r16unorm:39,rg16unorm:40,rgba16unorm:41,r16snorm:42,rg16snorm:43,rgba16snorm:44};class j_{constructor(e,t,i,s){if(this._pipelines={},this._compiledShaders=[],this._videoPipelines={},this._videoCompiledShaders=[],this._deferredReleaseTextures=[],this._engine=e,this._device=t,this._bufferManager=i,s.indexOf("rg11b10ufloat-renderable")!==-1){const n=Object.keys(Vi);Vi.rg11b10ufloat=Vi[n[n.length-1]]+1}this._mipmapSampler=t.createSampler({minFilter:"linear"}),this._videoSampler=t.createSampler({minFilter:"linear"}),this._ubCopyWithOfst=this._bufferManager.createBuffer(4*4,We.Uniform|We.CopyDst,"UBCopyWithOffset").underlyingResource,this._getPipeline("rgba8unorm"),this._getVideoPipeline("rgba8unorm")}_getPipeline(e,t=gi.MipMap,i){const s=t===gi.MipMap?1:t===gi.InvertYPremultiplyAlpha?((i.invertY?1:0)<<1)+((i.premultiplyAlpha?1:0)<<2):t===gi.Clear?8:t===gi.InvertYPremultiplyAlphaWithOfst?((i.invertY?1:0)<<4)+((i.premultiplyAlpha?1:0)<<5):0;this._pipelines[e]||(this._pipelines[e]=[]);let n=this._pipelines[e][s];if(!n){let r="";(t===gi.InvertYPremultiplyAlpha||t===gi.InvertYPremultiplyAlphaWithOfst)&&(i.invertY&&(r+="#define INVERTY\n"),i.premultiplyAlpha&&(r+="#define PREMULTIPLYALPHA\n"));let o=this._compiledShaders[s];if(!o){let l=Sh[t].vertex,c=Sh[t].fragment;const u={defines:r.split("\n"),indexParameters:null,isFragment:!1,shouldUseHighPrecisionShader:!0,processor:this._engine._getShaderProcessor(1),supportsUniformBuffers:!0,shadersRepository:"",includesShadersStore:{},version:(this._engine.version*100).toString(),platformName:this._engine.shaderPlatformName,processingContext:this._engine._getShaderProcessingContext(1,!0),isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer};f0(u),u.processor.pureMode=!0,Tr(l,u,p=>{l=p},this._engine),u.isFragment=!0,Tr(c,u,p=>{c=p},this._engine);const f=d0(l,c,u);u.processor.pureMode=!1;const d=this._device.createShaderModule({code:f.vertexCode}),_=this._device.createShaderModule({code:f.fragmentCode});o=this._compiledShaders[s]=[d,_]}const h=this._device.createRenderPipeline({layout:"auto",vertex:{module:o[0],entryPoint:"main"},fragment:{module:o[1],entryPoint:"main",targets:[{format:e}]},primitive:{topology:"triangle-strip",stripIndexFormat:"uint16"}});n=this._pipelines[e][s]=[h,h.getBindGroupLayout(0)]}return n}_getVideoPipeline(e,t=en.DontInvertY){const i=t===en.InvertY?1:0;this._videoPipelines[e]||(this._videoPipelines[e]=[]);let s=this._videoPipelines[e][i];if(!s){let n=this._videoCompiledShaders[i];if(!n){const o=this._device.createShaderModule({code:X_}),h=this._device.createShaderModule({code:i===0?Y_:q_});n=this._videoCompiledShaders[i]=[o,h]}const r=this._device.createRenderPipeline({label:"BabylonWebGPUDevice".concat(this._engine.uniqueId,"_CopyVideoToTexture_").concat(e,"_").concat(i===0?"DontInvertY":"InvertY"),layout:"auto",vertex:{module:n[0],entryPoint:"main"},fragment:{module:n[1],entryPoint:"main",targets:[{format:e}]},primitive:{topology:"triangle-strip",stripIndexFormat:"uint16"}});s=this._videoPipelines[e][i]=[r,r.getBindGroupLayout(0)]}return s}setCommandEncoder(e){this._commandEncoderForCreation=e}copyVideoToTexture(e,t,i,s=!1,n){var _,p;const r=n===void 0,[o,h]=this._getVideoPipeline(i,s?en.InvertY:en.DontInvertY);r&&(n=this._device.createCommandEncoder({})),(_=n.pushDebugGroup)==null||_.call(n,"copy video to texture - invertY=".concat(s));const l=t._hardwareTexture,c={label:"BabylonWebGPUDevice".concat(this._engine.uniqueId,"_copyVideoToTexture_").concat(i,"_").concat(s?"InvertY":"DontInvertY").concat(t.label?"_"+t.label:""),colorAttachments:[{view:l.underlyingResource.createView({format:i,dimension:"2d",mipLevelCount:1,baseArrayLayer:0,baseMipLevel:0,arrayLayerCount:1,aspect:"all"}),loadOp:"load",storeOp:"store"}]},u=n.beginRenderPass(c),f={layout:h,entries:[{binding:0,resource:this._videoSampler},{binding:1,resource:this._device.importExternalTexture({source:e.underlyingResource})}]},d=this._device.createBindGroup(f);u.setPipeline(o),u.setBindGroup(0,d),u.draw(4,1,0,0),u.end(),(p=n.popDebugGroup)==null||p.call(n),r&&(this._device.queue.submit([n.finish()]),n=null)}invertYPreMultiplyAlpha(e,t,i,s,n=!1,r=!1,o=0,h=0,l=1,c=0,u=0,f=0,d=0,_,p){var S,w,P,G;const g=f!==0,m=_===void 0,[b,I]=this._getPipeline(s,g?gi.InvertYPremultiplyAlphaWithOfst:gi.InvertYPremultiplyAlpha,{invertY:n,premultiplyAlpha:r});o=Math.max(o,0),m&&(_=this._device.createCommandEncoder({})),(S=_.pushDebugGroup)==null||S.call(_,"internal process texture - invertY=".concat(n," premultiplyAlpha=").concat(r));let T;if(Ve.IsHardwareTexture(e)?(T=e.underlyingResource,n&&!r&&l===1&&o===0||(e=void 0)):(T=e,e=void 0),!T)return;g&&this._bufferManager.setRawData(this._ubCopyWithOfst,0,new Float32Array([c,u,f,d]),0,4*4);const x=e,y=(w=x==null?void 0:x._copyInvertYTempTexture)!=null?w:this.createTexture({width:t,height:i,layers:1},!1,!1,!1,!1,!1,s,1,_,21,void 0,"TempTextureForCopyWithInvertY"),R=(P=x==null?void 0:x._copyInvertYRenderPassDescr)!=null?P:{label:"BabylonWebGPUDevice".concat(this._engine.uniqueId,"_invertYPreMultiplyAlpha_").concat(s,"_").concat(n?"InvertY":"DontInvertY","_").concat(r?"PremultiplyAlpha":"DontPremultiplyAlpha"),colorAttachments:[{view:y.createView({format:s,dimension:"2d",baseMipLevel:0,mipLevelCount:1,arrayLayerCount:1,baseArrayLayer:0}),loadOp:"load",storeOp:"store"}]},E=_.beginRenderPass(R);let C=g?x==null?void 0:x._copyInvertYBindGroupWithOfst:x==null?void 0:x._copyInvertYBindGroup;if(!C){const L={layout:I,entries:[{binding:0,resource:T.createView({format:s,dimension:"2d",baseMipLevel:h,mipLevelCount:1,arrayLayerCount:l,baseArrayLayer:o})}]};g&&L.entries.push({binding:1,resource:{buffer:this._ubCopyWithOfst}}),C=this._device.createBindGroup(L)}E.setPipeline(b),E.setBindGroup(0,C),E.draw(4,1,0,0),E.end(),_.copyTextureToTexture({texture:y},{texture:T,mipLevel:h,origin:{x:0,y:0,z:o}},{width:t,height:i,depthOrArrayLayers:1}),x?(x._copyInvertYTempTexture=y,x._copyInvertYRenderPassDescr=R,g?x._copyInvertYBindGroupWithOfst=C:x._copyInvertYBindGroup=C):this._deferredReleaseTextures.push([y,null]),(G=_.popDebugGroup)==null||G.call(_),m&&(this._device.queue.submit([_.finish()]),_=null)}copyWithInvertY(e,t,i,s){var c,u;const n=s===void 0,[r,o]=this._getPipeline(t,gi.InvertYPremultiplyAlpha,{invertY:!0,premultiplyAlpha:!1});n&&(s=this._device.createCommandEncoder({})),(c=s.pushDebugGroup)==null||c.call(s,"internal copy texture with invertY");const h=s.beginRenderPass(i),l=this._device.createBindGroup({layout:o,entries:[{binding:0,resource:e}]});h.setPipeline(r),h.setBindGroup(0,l),h.draw(4,1,0,0),h.end(),(u=s.popDebugGroup)==null||u.call(s),n&&(this._device.queue.submit([s.finish()]),s=null)}createTexture(e,t=!1,i=!1,s=!1,n=!1,r=!1,o="rgba8unorm",h=1,l,c=-1,u=0,f){h=Ve.GetSample(h);const d=e.layers||1,_={width:e.width,height:e.height,depthOrArrayLayers:d},p=Vi[o]?16:0,g=Ve.IsCompressedFormat(o),m=t?Ve.ComputeNumMipmapLevels(e.width,e.height):1,b=c>=0?c:7;u|=t&&!g?1|p:0,!g&&!r&&(u|=p|2);const I=this._device.createTexture({label:"BabylonWebGPUDevice".concat(this._engine.uniqueId,"_Texture").concat(r?"3D":"2D","_").concat(f?f+"_":"").concat(_.width,"x").concat(_.height,"x").concat(_.depthOrArrayLayers,"_").concat(t?"wmips":"womips","_").concat(o,"_samples").concat(h),size:_,dimension:r?"3d":"2d",format:o,usage:b|u,sampleCount:h,mipLevelCount:m});return Ve.IsImageBitmap(e)&&(this.updateTexture(e,I,e.width,e.height,d,o,0,0,s,n,0,0),t&&i&&this.generateMipmaps(I,o,m,0,r,l)),I}createCubeTexture(e,t=!1,i=!1,s=!1,n=!1,r="rgba8unorm",o=1,h,l=-1,c=0,u){o=Ve.GetSample(o);const f=Ve.IsImageBitmapArray(e)?e[0].width:e.width,d=Ve.IsImageBitmapArray(e)?e[0].height:e.height,_=Vi[r]?16:0,p=Ve.IsCompressedFormat(r),g=t?Ve.ComputeNumMipmapLevels(f,d):1,m=l>=0?l:7;c|=t&&!p?1|_:0,p||(c|=_|2);const b=this._device.createTexture({label:"BabylonWebGPUDevice".concat(this._engine.uniqueId,"_TextureCube_").concat(u?u+"_":"").concat(f,"x").concat(d,"x6_").concat(t?"wmips":"womips","_").concat(r,"_samples").concat(o),size:{width:f,height:d,depthOrArrayLayers:6},dimension:"2d",format:r,usage:m|c,sampleCount:o,mipLevelCount:g});return Ve.IsImageBitmapArray(e)&&(this.updateCubeTextures(e,b,f,d,r,s,n,0,0),t&&i&&this.generateCubeMipmaps(b,r,g,h)),b}generateCubeMipmaps(e,t,i,s){var r,o;const n=s===void 0;n&&(s=this._device.createCommandEncoder({})),(r=s.pushDebugGroup)==null||r.call(s,"create cube mipmaps - ".concat(i," levels"));for(let h=0;h<6;++h)this.generateMipmaps(e,t,i,h,!1,s);(o=s.popDebugGroup)==null||o.call(s),n&&(this._device.queue.submit([s.finish()]),s=null)}generateMipmaps(e,t,i,s=0,n=!1,r){var f,d,_,p,g,m;const o=r===void 0,[h,l]=this._getPipeline(t);s=Math.max(s,0),o&&(r=this._device.createCommandEncoder({})),(f=r.pushDebugGroup)==null||f.call(r,"create mipmaps for face #".concat(s," - ").concat(i," levels"));let c;if(Ve.IsHardwareTexture(e)?(c=e.underlyingResource,e._mipmapGenRenderPassDescr=e._mipmapGenRenderPassDescr||[],e._mipmapGenBindGroup=e._mipmapGenBindGroup||[]):(c=e,e=void 0),!c)return;const u=e;for(let b=1;b=0;){let u=a[l];u<0?u=0:u>1&&(u=1),c[l]=u*255}a=c}const n=document.createElement("canvas");n.width=i,n.height=s;const r=n.getContext("2d");if(!r)return null;const o=r.createImageData(i,s);if(o.data.set(a),r.putImageData(o,0,0),t){const l=document.createElement("canvas");l.width=i,l.height=s;const c=l.getContext("2d");return c?(c.translate(0,s),c.scale(1,-1),c.drawImage(n,0,0),l.toDataURL("image/png")):null}return n.toDataURL("image/png")}function Z_(a,e=0,t=0){const i=a.getInternalTexture();if(!i)return null;const s=a._readPixelsSync(e,t);return s?vc(s,a.getSize(),i.invertY):null}async function Q_(a,e=0,t=0){const i=a.getInternalTexture();if(!i)return null;const s=await a.readPixels(e,t);return s?vc(s,a.getSize(),i.invertY):null}class ie extends st{static _CreateVideoTexture(e,t,i,s=!1,n=!1,r=ie.TRILINEAR_SAMPLINGMODE,o={},h,l=5){throw ye("VideoTexture")}get noMipmap(){return this._noMipmap}get mimeType(){return this._mimeType}set isBlocking(e){this._isBlocking=e}get isBlocking(){return this._isBlocking}get invertY(){return this._invertY}constructor(e,t,i,s,n=ie.TRILINEAR_SAMPLINGMODE,r=null,o=null,h=null,l=!1,c,u,f,d,_){var R,E,C,S,w,P,G,L,W,K,ce;super(t),this.url=null,this.uOffset=0,this.vOffset=0,this.uScale=1,this.vScale=1,this.uAng=0,this.vAng=0,this.wAng=0,this.uRotationCenter=.5,this.vRotationCenter=.5,this.wRotationCenter=.5,this.homogeneousRotationInUVTransform=!1,this.inspectableCustomProperties=null,this._noMipmap=!1,this._invertY=!1,this._rowGenerationMatrix=null,this._cachedTextureMatrix=null,this._projectionModeMatrix=null,this._t0=null,this._t1=null,this._t2=null,this._cachedUOffset=-1,this._cachedVOffset=-1,this._cachedUScale=0,this._cachedVScale=0,this._cachedUAng=-1,this._cachedVAng=-1,this._cachedWAng=-1,this._cachedReflectionProjectionMatrixId=-1,this._cachedURotationCenter=-1,this._cachedVRotationCenter=-1,this._cachedWRotationCenter=-1,this._cachedHomogeneousRotationInUVTransform=!1,this._cachedIdentity3x2=!0,this._cachedReflectionTextureMatrix=null,this._cachedReflectionUOffset=-1,this._cachedReflectionVOffset=-1,this._cachedReflectionUScale=0,this._cachedReflectionVScale=0,this._cachedReflectionCoordinatesMode=-1,this._buffer=null,this._deleteBuffer=!1,this._format=null,this._delayedOnLoad=null,this._delayedOnError=null,this.onLoadObservable=new Z,this._isBlocking=!0,this.name=e||"",this.url=e;let p,g=!1,m=null,b=!0;typeof i=="object"&&i!==null?(p=(R=i.noMipmap)!=null?R:!1,s=(E=i.invertY)!=null?E:!0,n=(C=i.samplingMode)!=null?C:ie.TRILINEAR_SAMPLINGMODE,r=(S=i.onLoad)!=null?S:null,o=(w=i.onError)!=null?w:null,h=(P=i.buffer)!=null?P:null,l=(G=i.deleteBuffer)!=null?G:!1,c=i.format,u=i.mimeType,f=i.loaderOptions,d=i.creationFlags,g=(L=i.useSRGBBuffer)!=null?L:!1,m=(W=i.internalTexture)!=null?W:null,b=(K=i.gammaSpace)!=null?K:b,_=(ce=i.forcedExtension)!=null?ce:_):p=!!i,this._gammaSpace=b,this._noMipmap=p,this._invertY=s===void 0?!0:s,this._initialSamplingMode=n,this._buffer=h,this._deleteBuffer=l,this._mimeType=u,this._loaderOptions=f,this._creationFlags=d,this._useSRGBBuffer=g,this._forcedExtension=_,c&&(this._format=c);const I=this.getScene(),T=this._getEngine();if(!T)return;T.onBeforeTextureInitObservable.notifyObservers(this);const x=()=>{this._texture&&(this._texture._invertVScale&&(this.vScale*=-1,this.vOffset+=1),this._texture._cachedWrapU!==null&&(this.wrapU=this._texture._cachedWrapU,this._texture._cachedWrapU=null),this._texture._cachedWrapV!==null&&(this.wrapV=this._texture._cachedWrapV,this._texture._cachedWrapV=null),this._texture._cachedWrapR!==null&&(this.wrapR=this._texture._cachedWrapR,this._texture._cachedWrapR=null)),this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),r&&r(),!this.isBlocking&&I&&I.resetCachedMaterial()},y=($,z)=>{this._loadingError=!0,this._errorObject={message:$,exception:z},o&&o($,z),ie.OnTextureLoadErrorObservable.notifyObservers(this)};if(!this.url&&!m){this._delayedOnLoad=x,this._delayedOnError=y;return}if(this._texture=m!=null?m:this._getFromCache(this.url,p,n,this._invertY,g,this.isCube),this._texture)if(this._texture.isReady)Bn.SetImmediate(()=>x());else{const $=this._texture.onLoadedObservable.add(x);this._texture.onErrorObservable.add(z=>{var k;y(z.message,z.exception),(k=this._texture)==null||k.onLoadedObservable.remove($)})}else if(!I||!I.useDelayedTextureLoading){try{this._texture=T.createTexture(this.url,p,this._invertY,I,n,x,y,this._buffer,void 0,this._format,this._forcedExtension,u,f,d,g)}catch($){throw y("error loading",$),$}l&&(this._buffer=null)}else this.delayLoadState=4,this._delayedOnLoad=x,this._delayedOnError=y}updateURL(e,t=null,i,s){this.url&&(this.releaseInternalTexture(),this.getScene().markAllMaterialsAsDirty(1,n=>n.hasTexture(this))),(!this.name||this.name.startsWith("data:"))&&(this.name=e),this.url=e,this._buffer=t,this._forcedExtension=s,this.delayLoadState=4,i&&(this._delayedOnLoad=i),this.delayLoad()}delayLoad(){if(this.delayLoadState!==4)return;const e=this.getScene();e&&(this.delayLoadState=1,this._texture=this._getFromCache(this.url,this._noMipmap,this.samplingMode,this._invertY,this._useSRGBBuffer,this.isCube),this._texture?this._delayedOnLoad&&(this._texture.isReady?Bn.SetImmediate(this._delayedOnLoad):this._texture.onLoadedObservable.add(this._delayedOnLoad)):(this._texture=e.getEngine().createTexture(this.url,this._noMipmap,this._invertY,e,this.samplingMode,this._delayedOnLoad,this._delayedOnError,this._buffer,null,this._format,this._forcedExtension,this._mimeType,this._loaderOptions,this._creationFlags,this._useSRGBBuffer),this._deleteBuffer&&(this._buffer=null)),this._delayedOnLoad=null,this._delayedOnError=null)}_prepareRowForTextureGeneration(e,t,i,s){e*=this._cachedUScale,t*=this._cachedVScale,e-=this.uRotationCenter*this._cachedUScale,t-=this.vRotationCenter*this._cachedVScale,i-=this.wRotationCenter,v.TransformCoordinatesFromFloatsToRef(e,t,i,this._rowGenerationMatrix,s),s.x+=this.uRotationCenter*this._cachedUScale+this._cachedUOffset,s.y+=this.vRotationCenter*this._cachedVScale+this._cachedVOffset,s.z+=this.wRotationCenter}getTextureMatrix(e=1){if(this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale*e===this._cachedUScale&&this.vScale===this._cachedVScale&&this.uAng===this._cachedUAng&&this.vAng===this._cachedVAng&&this.wAng===this._cachedWAng&&this.uRotationCenter===this._cachedURotationCenter&&this.vRotationCenter===this._cachedVRotationCenter&&this.wRotationCenter===this._cachedWRotationCenter&&this.homogeneousRotationInUVTransform===this._cachedHomogeneousRotationInUVTransform)return this._cachedTextureMatrix;this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale*e,this._cachedVScale=this.vScale,this._cachedUAng=this.uAng,this._cachedVAng=this.vAng,this._cachedWAng=this.wAng,this._cachedURotationCenter=this.uRotationCenter,this._cachedVRotationCenter=this.vRotationCenter,this._cachedWRotationCenter=this.wRotationCenter,this._cachedHomogeneousRotationInUVTransform=this.homogeneousRotationInUVTransform,(!this._cachedTextureMatrix||!this._rowGenerationMatrix)&&(this._cachedTextureMatrix=O.Zero(),this._rowGenerationMatrix=new O,this._t0=v.Zero(),this._t1=v.Zero(),this._t2=v.Zero()),O.RotationYawPitchRollToRef(this.vAng,this.uAng,this.wAng,this._rowGenerationMatrix),this.homogeneousRotationInUVTransform?(O.TranslationToRef(-this._cachedURotationCenter,-this._cachedVRotationCenter,-this._cachedWRotationCenter,N.Matrix[0]),O.TranslationToRef(this._cachedURotationCenter,this._cachedVRotationCenter,this._cachedWRotationCenter,N.Matrix[1]),O.ScalingToRef(this._cachedUScale,this._cachedVScale,0,N.Matrix[2]),O.TranslationToRef(this._cachedUOffset,this._cachedVOffset,0,N.Matrix[3]),N.Matrix[0].multiplyToRef(this._rowGenerationMatrix,this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(N.Matrix[1],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(N.Matrix[2],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(N.Matrix[3],this._cachedTextureMatrix),this._cachedTextureMatrix.setRowFromFloats(2,this._cachedTextureMatrix.m[12],this._cachedTextureMatrix.m[13],this._cachedTextureMatrix.m[14],1)):(this._prepareRowForTextureGeneration(0,0,0,this._t0),this._prepareRowForTextureGeneration(1,0,0,this._t1),this._prepareRowForTextureGeneration(0,1,0,this._t2),this._t1.subtractInPlace(this._t0),this._t2.subtractInPlace(this._t0),O.FromValuesToRef(this._t1.x,this._t1.y,this._t1.z,0,this._t2.x,this._t2.y,this._t2.z,0,this._t0.x,this._t0.y,this._t0.z,0,0,0,0,1,this._cachedTextureMatrix));const t=this.getScene();if(!t)return this._cachedTextureMatrix;const i=this._cachedIdentity3x2;return this._cachedIdentity3x2=this._cachedTextureMatrix.isIdentityAs3x2(),this.optimizeUVAllocation&&i!==this._cachedIdentity3x2&&t.markAllMaterialsAsDirty(1,s=>s.hasTexture(this)),this._cachedTextureMatrix}getReflectionTextureMatrix(){const e=this.getScene();if(!e)return this._cachedReflectionTextureMatrix;if(this.uOffset===this._cachedReflectionUOffset&&this.vOffset===this._cachedReflectionVOffset&&this.uScale===this._cachedReflectionUScale&&this.vScale===this._cachedReflectionVScale&&this.coordinatesMode===this._cachedReflectionCoordinatesMode)if(this.coordinatesMode===ie.PROJECTION_MODE){if(this._cachedReflectionProjectionMatrixId===e.getProjectionMatrix().updateFlag)return this._cachedReflectionTextureMatrix}else return this._cachedReflectionTextureMatrix;this._cachedReflectionTextureMatrix||(this._cachedReflectionTextureMatrix=O.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=O.Zero());const t=this._cachedReflectionCoordinatesMode!==this.coordinatesMode;switch(this._cachedReflectionUOffset=this.uOffset,this._cachedReflectionVOffset=this.vOffset,this._cachedReflectionUScale=this.uScale,this._cachedReflectionVScale=this.vScale,this._cachedReflectionCoordinatesMode=this.coordinatesMode,this.coordinatesMode){case ie.PLANAR_MODE:{O.IdentityToRef(this._cachedReflectionTextureMatrix),this._cachedReflectionTextureMatrix[0]=this.uScale,this._cachedReflectionTextureMatrix[5]=this.vScale,this._cachedReflectionTextureMatrix[12]=this.uOffset,this._cachedReflectionTextureMatrix[13]=this.vOffset;break}case ie.PROJECTION_MODE:{O.FromValuesToRef(.5,0,0,0,0,-.5,0,0,0,0,0,0,.5,.5,1,1,this._projectionModeMatrix);const i=e.getProjectionMatrix();this._cachedReflectionProjectionMatrixId=i.updateFlag,i.multiplyToRef(this._projectionModeMatrix,this._cachedReflectionTextureMatrix);break}default:O.IdentityToRef(this._cachedReflectionTextureMatrix);break}return t&&e.markAllMaterialsAsDirty(1,i=>i.hasTexture(this)),this._cachedReflectionTextureMatrix}clone(){const e={noMipmap:this._noMipmap,invertY:this._invertY,samplingMode:this.samplingMode,onLoad:void 0,onError:void 0,buffer:this._texture?this._texture._buffer:void 0,deleteBuffer:this._deleteBuffer,format:this.textureFormat,mimeType:this.mimeType,loaderOptions:this._loaderOptions,creationFlags:this._creationFlags,useSRGBBuffer:this._useSRGBBuffer};return Ae.Clone(()=>new ie(this._texture?this._texture.url:null,this.getScene(),e),this)}serialize(){var i,s;const e=this.name;ie.SerializeBuffers||this.name.startsWith("data:")&&(this.name=""),this.name.startsWith("data:")&&this.url===this.name&&(this.url="");const t=super.serialize(ie._SerializeInternalTextureUniqueId);return t?((ie.SerializeBuffers||ie.ForceSerializeBuffers)&&(typeof this._buffer=="string"&&this._buffer.substring(0,5)==="data:"?(t.base64String=this._buffer,t.name=t.name.replace("data:","")):this.url&&this.url.startsWith("data:")&&this._buffer instanceof Uint8Array?t.base64String="data:image/png;base64,"+sc(this._buffer):(ie.ForceSerializeBuffers||this.url&&this.url.startsWith("blob:")||this._forceSerialize)&&(t.base64String=!this._engine||this._engine._features.supportSyncTextureRead?Z_(this):Q_(this))),t.invertY=this._invertY,t.samplingMode=this.samplingMode,t._creationFlags=this._creationFlags,t._useSRGBBuffer=this._useSRGBBuffer,ie._SerializeInternalTextureUniqueId&&(t.internalTextureUniqueId=(i=this._texture)==null?void 0:i.uniqueId),t.internalTextureLabel=(s=this._texture)==null?void 0:s.label,t.noMipmap=this._noMipmap,this.name=e,t):null}getClassName(){return"Texture"}dispose(){super.dispose(),this.onLoadObservable.clear(),this._delayedOnLoad=null,this._delayedOnError=null,this._buffer=null}static Parse(e,t,i){if(e.customType){const l=Sn.Instantiate(e.customType).Parse(e,t,i);return e.samplingMode&&l.updateSamplingMode&&l._samplingMode&&l._samplingMode!==e.samplingMode&&l.updateSamplingMode(e.samplingMode),l}if(e.isCube&&!e.isRenderTarget)return ie._CubeTextureParser(e,t,i);const s=e.internalTextureUniqueId!==void 0;if(!e.name&&!e.isRenderTarget&&!s)return null;let n;if(s){const h=t.getEngine().getLoadedTexturesCache();for(const l of h)if(l.uniqueId===e.internalTextureUniqueId){n=l;break}}const r=h=>{if(h&&h._texture&&(h._texture._cachedWrapU=null,h._texture._cachedWrapV=null,h._texture._cachedWrapR=null),e.samplingMode){const l=e.samplingMode;h&&h.samplingMode!==l&&h.updateSamplingMode(l)}if(h&&e.animations)for(let l=0;l{var l,c,u;let h=!0;if(e.noMipmap&&(h=!1),e.mirrorPlane){const f=ie._CreateMirror(e.name,e.renderTargetSize,t,h);return f._waitingRenderList=e.renderList,f.mirrorPlane=Xt.FromArray(e.mirrorPlane),r(f),f}else if(e.isRenderTarget){let f=null;if(e.isCube){if(t.reflectionProbes)for(let d=0;d{r(f)},(c=e._creationFlags)!=null?c:0,(u=e._useSRGBBuffer)!=null?u:!1),f.name=e.name;else{let d;e.name&&(e.name.indexOf("://")>0||e.name.startsWith("data:"))?d=e.name:d=i+e.name,e.url&&(e.url.startsWith("data:")||ie.UseSerializedUrlIfAny)&&(d=e.url);const _={noMipmap:!h,invertY:e.invertY,samplingMode:e.samplingMode,onLoad:()=>{r(f)},internalTexture:n};f=new ie(d,t,_)}return f}},e,t)}static CreateFromBase64String(e,t,i,s,n,r=ie.TRILINEAR_SAMPLINGMODE,o=null,h=null,l=5,c,u){return new ie("data:"+t,i,s,n,r,o,h,e,!1,l,void 0,void 0,c,u)}static LoadFromDataString(e,t,i,s=!1,n,r=!0,o=ie.TRILINEAR_SAMPLINGMODE,h=null,l=null,c=5,u,f){return e.substring(0,5)!=="data:"&&(e="data:"+e),new ie(e,i,n,r,o,h,l,t,s,c,void 0,void 0,u,f)}}ie.SerializeBuffers=!0;ie.ForceSerializeBuffers=!1;ie.OnTextureLoadErrorObservable=new Z;ie._SerializeInternalTextureUniqueId=!1;ie._CubeTextureParser=(a,e,t)=>{throw ye("CubeTexture")};ie._CreateMirror=(a,e,t,i)=>{throw ye("MirrorTexture")};ie._CreateRenderTargetTexture=(a,e,t,i,s)=>{throw ye("RenderTargetTexture")};ie.NEAREST_SAMPLINGMODE=1;ie.NEAREST_NEAREST_MIPLINEAR=8;ie.BILINEAR_SAMPLINGMODE=2;ie.LINEAR_LINEAR_MIPNEAREST=11;ie.TRILINEAR_SAMPLINGMODE=3;ie.LINEAR_LINEAR_MIPLINEAR=3;ie.NEAREST_NEAREST_MIPNEAREST=4;ie.NEAREST_LINEAR_MIPNEAREST=5;ie.NEAREST_LINEAR_MIPLINEAR=6;ie.NEAREST_LINEAR=7;ie.NEAREST_NEAREST=1;ie.LINEAR_NEAREST_MIPNEAREST=9;ie.LINEAR_NEAREST_MIPLINEAR=10;ie.LINEAR_LINEAR=2;ie.LINEAR_NEAREST=12;ie.EXPLICIT_MODE=0;ie.SPHERICAL_MODE=1;ie.PLANAR_MODE=2;ie.CUBIC_MODE=3;ie.PROJECTION_MODE=4;ie.SKYBOX_MODE=5;ie.INVCUBIC_MODE=6;ie.EQUIRECTANGULAR_MODE=7;ie.FIXED_EQUIRECTANGULAR_MODE=8;ie.FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9;ie.CLAMP_ADDRESSMODE=0;ie.WRAP_ADDRESSMODE=1;ie.MIRROR_ADDRESSMODE=2;ie.UseSerializedUrlIfAny=!1;D([B()],ie.prototype,"url",void 0);D([B()],ie.prototype,"uOffset",void 0);D([B()],ie.prototype,"vOffset",void 0);D([B()],ie.prototype,"uScale",void 0);D([B()],ie.prototype,"vScale",void 0);D([B()],ie.prototype,"uAng",void 0);D([B()],ie.prototype,"vAng",void 0);D([B()],ie.prototype,"wAng",void 0);D([B()],ie.prototype,"uRotationCenter",void 0);D([B()],ie.prototype,"vRotationCenter",void 0);D([B()],ie.prototype,"wRotationCenter",void 0);D([B()],ie.prototype,"homogeneousRotationInUVTransform",void 0);D([B()],ie.prototype,"isBlocking",null);vt("BABYLON.Texture",ie);Ae._TextureParser=ie.Parse;class ka{constructor(e){this._vertexBuffers={},this.onBeforeRenderObservable=new Z,this._scene=e}_prepareBuffers(){if(this._vertexBuffers[A.PositionKind])return;const e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1),this._vertexBuffers[A.PositionKind]=new A(this._scene.getEngine(),e,A.PositionKind,!1,!1,2),this._buildIndexBuffer()}_buildIndexBuffer(){const e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._scene.getEngine().createIndexBuffer(e)}_rebuild(){const e=this._vertexBuffers[A.PositionKind];e&&(e._rebuild(),this._buildIndexBuffer())}_prepareFrame(e=null,t=null){const i=this._scene.activeCamera;return!i||(t=t||i._postProcesses.filter(s=>s!=null),!t||t.length===0||!this._scene.postProcessesEnabled)?!1:(t[0].activate(i,e,t!=null),!0)}directRender(e,t=null,i=!1,s=0,n=0,r=!1){var h;const o=this._scene.getEngine();for(let l=0;ll!=null),s.length===0||!this._scene.postProcessesEnabled))return;const o=this._scene.getEngine();for(let l=0,c=s.length;lthis.data.length&&(this.data.length*=2)}forEach(e){for(let t=0;tthis.data.length&&(this.data.length=(this.length+e.length)*2);for(let t=0;t=this.length?-1:t}contains(e){return this.indexOf(e)!==-1}}Ut._GlobalId=0;class Ms extends Ut{constructor(){super(...arguments),this._duplicateId=0}push(e){super.push(e),e.__smartArrayFlags||(e.__smartArrayFlags={}),e.__smartArrayFlags[this._id]=this._duplicateId}pushNoDuplicate(e){return e.__smartArrayFlags&&e.__smartArrayFlags[this._id]===this._duplicateId?!1:(this.push(e),!0)}reset(){super.reset(),this._duplicateId++}concatWithNoDuplicate(e){if(e.length!==0){this.length+e.length>this.data.length&&(this.data.length=(this.length+e.length)*2);for(let t=0;tt._alphaIndex?1:e._alphaIndext._distanceToCamera?-1:0}static frontToBackSortCompare(e,t){return e._distanceToCamerat._distanceToCamera?1:0}static PainterSortCompare(e,t){const i=e.getMesh(),s=t.getMesh();return i.material&&s.material?i.material.uniqueId-s.material.uniqueId:i.uniqueId-s.uniqueId}prepare(){this._opaqueSubMeshes.reset(),this._transparentSubMeshes.reset(),this._alphaTestSubMeshes.reset(),this._depthOnlySubMeshes.reset(),this._particleSystems.reset(),this.prepareSprites(),this._edgesRenderers.reset(),this._empty=!0}prepareSprites(){this._spriteManagers.reset()}dispose(){this._opaqueSubMeshes.dispose(),this._transparentSubMeshes.dispose(),this._alphaTestSubMeshes.dispose(),this._depthOnlySubMeshes.dispose(),this._particleSystems.dispose(),this._spriteManagers.dispose(),this._edgesRenderers.dispose()}dispatch(e,t,i){t===void 0&&(t=e.getMesh()),i===void 0&&(i=e.getMaterial()),i!=null&&(i.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):i.needAlphaTesting()?(i.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(i.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._renderingGroup=this,t._edgesRenderer&&t.isEnabled()&&t.isVisible&&t._edgesRenderer.isEnabled&&this._edgesRenderers.pushNoDuplicate(t._edgesRenderer),this._empty=!1)}dispatchSprites(e){this._spriteManagers.push(e),this._empty=!1}dispatchParticles(e){this._particleSystems.push(e),this._empty=!1}_renderParticles(e){if(this._particleSystems.length===0)return;const t=this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for(let i=0;i{const r=this._renderList?this._renderList.length:0;(n===0&&r>0||r===0)&&this._scene.meshes.forEach(o=>{o._markSubMeshesAsLightDirty()})},this.particleSystemList=null,this.getCustomRenderList=null,this.renderParticles=!0,this.renderSprites=!1,this.forceLayerMaskCheck=!1,this.onBeforeRenderObservable=new Z,this.onAfterRenderObservable=new Z,this.onBeforeRenderingManagerRenderObservable=new Z,this.onAfterRenderingManagerRenderObservable=new Z,this.onFastPathRenderObservable=new Z,this._currentRefreshId=-1,this._refreshRate=1,this._currentSceneCamera=null,this.name=e,this._scene=t,this.renderList=[],this._renderPassIds=[],this.options={numPasses:1,doNotChangeAspectRatio:!0,...i},this._createRenderPassId(),this.renderPassId=this._renderPassIds[0],this._renderingManager=new Lt(t),this._renderingManager._useSceneAutoClearSetup=!0}_releaseRenderPassId(){const e=this._scene.getEngine();for(let t=0;t1&&(e.incrementRenderId(),e.resetCachedMaterial())}const r=this.particleSystemList||e.particleSystems;for(const o of r)o.isReady()||(s=!1);return t.currentRenderPassId=i,s}_prepareRenderingManager(e,t,i){const s=this._scene,n=s.activeCamera;this._renderingManager.reset();const r=s.getRenderId();for(let h=0;h{for(const P of this._scene._beforeRenderTargetClearStage)P.action(this,this._currentFaceIndex,this._currentLayer);this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(T):this.skipInitialClear||T.clear(this.clearColor||this._scene.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||this._scene.updateTransformMatrix(!0);for(const P of this._scene._beforeRenderTargetDrawStage)P.action(this,this._currentFaceIndex,this._currentLayer)}),this._objectRenderer.onAfterRenderingManagerRenderObservable.add(()=>{var G,L,W,K;for(const ce of this._scene._afterRenderTargetDrawStage)ce.action(this,this._currentFaceIndex,this._currentLayer);const P=(L=(G=this._texture)==null?void 0:G.generateMipMaps)!=null?L:!1;this._texture&&(this._texture.generateMipMaps=!1),this._postProcessManager?this._postProcessManager._finalizeFrame(!1,(W=this._renderTarget)!=null?W:void 0,this._currentFaceIndex,this._postProcesses,this.ignoreCameraViewport):this._currentUseCameraPostProcess&&this._scene.postProcessManager._finalizeFrame(!1,(K=this._renderTarget)!=null?K:void 0,this._currentFaceIndex);for(const ce of this._scene._afterRenderTargetPostProcessStage)ce.action(this,this._currentFaceIndex,this._currentLayer);this._texture&&(this._texture.generateMipMaps=P),this._doNotChangeAspectRatio||this._scene.updateTransformMatrix(!0),this._currentDumpForDebug&&(this._dumpTools?this._dumpTools.DumpFramebuffer(this.getRenderWidth(),this.getRenderHeight(),T):U.Error("dumpTools module is still being loaded. To speed up the process import dump tools directly in your project"))}),this._objectRenderer.onFastPathRenderObservable.add(()=>{this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(T):this.skipInitialClear||T.clear(this.clearColor||this._scene.clearColor,!0,!0,!0)}),this._resizeObserver=T.onResizeObservable.add(()=>{}),this._generateMipMaps=!!s,this._doNotChangeAspectRatio=n,!u&&(this._renderTargetOptions={generateMipMaps:s,type:r,format:(w=this._format)!=null?w:void 0,samplingMode:this.samplingMode,generateDepthBuffer:l,generateStencilBuffer:c,samples:_,creationFlags:p,noColorAttachment:g,useSRGBBuffer:m,colorAttachment:b,label:this.name},this.samplingMode===ie.NEAREST_SAMPLINGMODE&&(this.wrapU=ie.CLAMP_ADDRESSMODE,this.wrapV=ie.CLAMP_ADDRESSMODE),d||(o?(this._renderTarget=i.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions),this.coordinatesMode=ie.INVCUBIC_MODE,this._textureMatrix=O.Identity()):this._renderTarget=i.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,_!==void 0&&(this.samples=_)))}createDepthStencilTexture(e=0,t=!0,i=!1,s=1,n=14,r){var o;(o=this._renderTarget)==null||o.createDepthStencilTexture(e,t,i,s,n,r)}_processSizeParameter(e){if(e.ratio){this._sizeRatio=e.ratio;const t=this._getEngine();this._size={width:this._bestReflectionRenderTargetDimension(t.getRenderWidth(),this._sizeRatio),height:this._bestReflectionRenderTargetDimension(t.getRenderHeight(),this._sizeRatio)}}else this._size=e}get samples(){var e,t;return(t=(e=this._renderTarget)==null?void 0:e.samples)!=null?t:this._samples}set samples(e){this._renderTarget&&(this._samples=this._renderTarget.setSamples(e))}addPostProcess(e){if(!this._postProcessManager){const t=this.getScene();if(!t)return;this._postProcessManager=new ka(t),this._postProcesses=new Array}this._postProcesses.push(e),this._postProcesses[0].autoClear=!1}clearPostProcesses(e=!1){if(this._postProcesses){if(e)for(const t of this._postProcesses)t.dispose();this._postProcesses=[]}}removePostProcess(e){if(!this._postProcesses)return;const t=this._postProcesses.indexOf(e);t!==-1&&(this._postProcesses.splice(t,1),this._postProcesses.length>0&&(this._postProcesses[0].autoClear=!1))}resetRefreshCounter(){this._objectRenderer.resetRefreshCounter()}get refreshRate(){return this._objectRenderer.refreshRate}set refreshRate(e){this._objectRenderer.refreshRate=e}_shouldRender(){return this._objectRenderer.shouldRender()}getRenderSize(){return this.getRenderWidth()}getRenderWidth(){return this._size.width?this._size.width:this._size}getRenderHeight(){return this._size.width?this._size.height:this._size}getRenderLayers(){const e=this._size.layers;if(e)return e;const t=this._size.depth;return t||0}disableRescaling(){this._canRescale=!1}get canRescale(){return this._canRescale}scale(e){const t=Math.max(1,this.getRenderSize()*e);this.resize(t)}getReflectionTextureMatrix(){return this.isCube?this._textureMatrix:super.getReflectionTextureMatrix()}resize(e){var s;const t=this.isCube;(s=this._renderTarget)==null||s.dispose(),this._renderTarget=null;const i=this.getScene();i&&(this._processSizeParameter(e),t?this._renderTarget=i.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):this._renderTarget=i.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,this._renderTargetOptions.samples!==void 0&&(this.samples=this._renderTargetOptions.samples),this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this))}render(e=!1,t=!1){this._render(e,t)}isReadyForRendering(){this._dumpToolsLoading||(this._dumpToolsLoading=!0,Oe(()=>Promise.resolve().then(()=>qg),void 0).then(t=>this._dumpTools=t)),this._objectRenderer.prepareRenderList(),this.onBeforeBindObservable.notifyObservers(this),this._objectRenderer.initRender(this.getRenderWidth(),this.getRenderHeight());const e=this._objectRenderer._checkReadiness();return this.onAfterUnbindObservable.notifyObservers(this),this._objectRenderer.finishRender(),e}_render(e=!1,t=!1){const i=this.getScene();if(i){if(this.useCameraPostProcesses!==void 0&&(e=this.useCameraPostProcesses),this._objectRenderer.prepareRenderList(),this.onBeforeBindObservable.notifyObservers(this),this._objectRenderer.initRender(this.getRenderWidth(),this.getRenderHeight()),(this.is2DArray||this.is3D)&&!this.isMulti)for(let s=0;s{this.onAfterRenderObservable.notifyObservers(t)})}_prepareFrame(e,t,i,s){this._postProcessManager?this._prePassEnabled||this._postProcessManager._prepareFrame(this._texture,this._postProcesses):(!s||!e.postProcessManager._prepareFrame(this._texture))&&this._bindFrameBuffer(t,i)}_renderToTarget(e,t,i,s=0){var o,h;const n=this.getScene();if(!n)return;const r=n.getEngine();this._currentFaceIndex=e,this._currentLayer=s,this._currentUseCameraPostProcess=t,this._currentDumpForDebug=i,this._prepareFrame(n,e,s,t),(o=r._debugPushGroup)==null||o.call(r,"render to face #".concat(e," layer #").concat(s),2),this._objectRenderer.render(e+s,!0),(h=r._debugPopGroup)==null||h.call(r,2),this._unbindFrameBuffer(r,e),this._texture&&this.isCube&&e===5&&r.generateMipMapsForCubemap(this._texture,!0)}setRenderingOrder(e,t=null,i=null,s=null){this._objectRenderer.setRenderingOrder(e,t,i,s)}setRenderingAutoClearDepthStencil(e,t){this._objectRenderer.setRenderingAutoClearDepthStencil(e,t)}clone(){const e=this.getSize(),t=new us(this.name,e,this.getScene(),this._renderTargetOptions.generateMipMaps,this._doNotChangeAspectRatio,this._renderTargetOptions.type,this.isCube,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer,this._renderTargetOptions.generateStencilBuffer,void 0,this._renderTargetOptions.format,void 0,this._renderTargetOptions.samples);return t.hasAlpha=this.hasAlpha,t.level=this.level,t.coordinatesMode=this.coordinatesMode,this.renderList&&(t.renderList=this.renderList.slice(0)),t}serialize(){if(!this.name)return null;const e=super.serialize();if(e.renderTargetSize=this.getRenderSize(),e.renderList=[],this.renderList)for(let t=0;t=0&&e.customRenderTargets.splice(t,1);for(const s of e.cameras)t=s.customRenderTargets.indexOf(this),t>=0&&s.customRenderTargets.splice(t,1);(i=this._renderTarget)==null||i.dispose(),this._renderTarget=null,this._texture=null,super.dispose()}_rebuild(){this._objectRenderer._rebuild(),this._postProcessManager&&this._postProcessManager._rebuild()}freeRenderingGroups(){this._objectRenderer.freeRenderingGroups()}getViewCount(){return 1}}us.REFRESHRATE_RENDER_ONCE=Pi.REFRESHRATE_RENDER_ONCE;us.REFRESHRATE_RENDER_ONEVERYFRAME=Pi.REFRESHRATE_RENDER_ONEVERYFRAME;us.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=Pi.REFRESHRATE_RENDER_ONEVERYTWOFRAMES;ie._CreateRenderTargetTexture=(a,e,t,i,s)=>new us(a,e,t,i);class Xn{static GetEffect(e){return e.getPipelineContext===void 0?e.effect:e}constructor(e,t=!0){this._wasPreviouslyReady=!1,this._forceRebindOnNextCall=!0,this._wasPreviouslyUsingInstances=null,this.effect=null,this.defines=null,this.drawContext=e.createDrawContext(),t&&(this.materialContext=e.createMaterialContext())}setEffect(e,t,i=!0){var s;this.effect=e,t!==void 0&&(this.defines=t),i&&((s=this.drawContext)==null||s.reset())}dispose(e=!1){var t;if(this.effect){const i=this.effect;e?i.dispose():Bn.SetImmediate(()=>{i.getEngine().onEndFrameObservable.addOnce(()=>{i.dispose()})}),this.effect=null}(t=this.drawContext)==null||t.dispose()}}const bc="postprocessVertexShader",xc="attribute vec2 position;uniform vec2 scale;varying vec2 vUV;const vec2 madd=vec2(0.5,0.5);\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvUV=(position*madd+madd)*scale;gl_Position=vec4(position,0.0,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}";Me.ShadersStore[bc]=xc;const ep={name:bc,shader:xc},yc=Object.freeze(Object.defineProperty({__proto__:null,postprocessVertexShader:ep},Symbol.toStringTag,{value:"Module"})),ba={positions:[1,1,-1,1,-1,-1,1,-1],indices:[0,1,2,0,2,3]};class tp{constructor(e,t=ba){var n,r;this._fullscreenViewport=new on(0,0,1,1);const i=(n=t.positions)!=null?n:ba.positions,s=(r=t.indices)!=null?r:ba.indices;this.engine=e,this._vertexBuffers={[A.PositionKind]:new A(e,i,A.PositionKind,!1,!1,2)},this._indexBuffer=e.createIndexBuffer(s),this._onContextRestoredObserver=e.onContextRestoredObservable.add(()=>{this._indexBuffer=e.createIndexBuffer(s);for(const o in this._vertexBuffers)this._vertexBuffers[o]._rebuild()})}setViewport(e=this._fullscreenViewport){this.engine.setViewport(e)}bindBuffers(e){this.engine.bindBuffers(this._vertexBuffers,this._indexBuffer,e)}applyEffectWrapper(e){this.engine.setState(!0),this.engine.depthCullingState.depthTest=!1,this.engine.stencilState.stencilTest=!1,this.engine.enableEffect(e.drawWrapper),this.bindBuffers(e.effect),e.onApplyObservable.notifyObservers({})}saveStates(){this._savedStateDepthTest=this.engine.depthCullingState.depthTest,this._savedStateStencilTest=this.engine.stencilState.stencilTest}restoreStates(){this.engine.depthCullingState.depthTest=this._savedStateDepthTest,this.engine.stencilState.stencilTest=this._savedStateStencilTest}draw(){this.engine.drawElementsType(0,0,6)}_isRenderTargetTexture(e){return e.renderTarget!==void 0}render(e,t=null){if(!e.effect.isReady())return;this.saveStates(),this.setViewport();const i=t===null?null:this._isRenderTargetTexture(t)?t.renderTarget:t;i&&this.engine.bindFramebuffer(i),this.applyEffectWrapper(e),this.draw(),i&&this.engine.unBindFramebuffer(i),this.restoreStates()}dispose(){const e=this._vertexBuffers[A.PositionKind];e&&(e.dispose(),delete this._vertexBuffers[A.PositionKind]),this._indexBuffer&&this.engine._releaseBuffer(this._indexBuffer),this._onContextRestoredObserver&&(this.engine.onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null)}}class Kt{static RegisterShaderCodeProcessing(e,t){if(!t){delete Kt._CustomShaderCodeProcessing[e!=null?e:""];return}Kt._CustomShaderCodeProcessing[e!=null?e:""]=t}static _GetShaderCodeProcessing(e){var t;return(t=Kt._CustomShaderCodeProcessing[e])!=null?t:Kt._CustomShaderCodeProcessing[""]}get name(){return this.options.name}set name(e){this.options.name=e}isReady(){var e,t;return(t=(e=this._drawWrapper.effect)==null?void 0:e.isReady())!=null?t:!1}get drawWrapper(){return this._drawWrapper}get effect(){return this._drawWrapper.effect}set effect(e){this._drawWrapper.effect=e}constructor(e){var i;this.alphaMode=0,this.onEffectCreatedObservable=new Z(void 0,!0),this.onApplyObservable=new Z,this._shadersLoaded=!1,this._webGPUReady=!1,this._importPromises=[],this.options={...e,name:e.name||"effectWrapper",engine:e.engine,uniforms:e.uniforms||e.uniformNames||[],uniformNames:void 0,samplers:e.samplers||e.samplerNames||[],samplerNames:void 0,attributeNames:e.attributeNames||["position"],uniformBuffers:e.uniformBuffers||[],defines:e.defines||"",useShaderStore:e.useShaderStore||!1,vertexUrl:e.vertexUrl||e.vertexShader||"postprocess",vertexShader:void 0,fragmentShader:e.fragmentShader||"pass",indexParameters:e.indexParameters,blockCompilation:e.blockCompilation||!1,shaderLanguage:e.shaderLanguage||0,onCompiled:e.onCompiled||void 0,extraInitializations:e.extraInitializations||void 0,extraInitializationsAsync:e.extraInitializationsAsync||void 0,useAsPostProcess:(i=e.useAsPostProcess)!=null?i:!1},this.options.uniformNames=this.options.uniforms,this.options.samplerNames=this.options.samplers,this.options.vertexShader=this.options.vertexUrl,this.options.useAsPostProcess&&(this.options.samplers.indexOf("textureSampler")===-1&&this.options.samplers.push("textureSampler"),this.options.uniforms.indexOf("scale")===-1&&this.options.uniforms.push("scale")),e.vertexUrl||e.vertexShader?this._shaderPath={vertexSource:this.options.vertexShader}:(this.options.useAsPostProcess||(this.options.uniforms.push("scale"),this.onApplyObservable.add(()=>{this.effect.setFloat2("scale",1,1)})),this._shaderPath={vertex:this.options.vertexShader}),this._shaderPath.fragmentSource=this.options.fragmentShader,this._shaderPath.spectorName=this.options.name,this.options.useShaderStore&&(this._shaderPath.fragment=this._shaderPath.fragmentSource,this._shaderPath.vertex||(this._shaderPath.vertex=this._shaderPath.vertexSource),delete this._shaderPath.fragmentSource,delete this._shaderPath.vertexSource),this.onApplyObservable.add(()=>{this.bind()}),this.options.useShaderStore||(this._onContextRestoredObserver=this.options.engine.onContextRestoredObservable.add(()=>{this.effect._pipelineContext=null,this.effect._prepareEffect()})),this._drawWrapper=new Xn(this.options.engine),this._webGPUReady=this.options.shaderLanguage===1;const t=Array.isArray(this.options.defines)?this.options.defines.join("\n"):this.options.defines;this._postConstructor(this.options.blockCompilation,t,this.options.extraInitializations)}_gatherImports(e=!1,t){this.options.useAsPostProcess&&(e&&this._webGPUReady?t.push(Promise.all([Oe(()=>import("./postprocess.vertex-DvFhjUjz.js"),__vite__mapDeps([17,3,4,5,6,7,8,9,10]))])):t.push(Promise.all([Oe(()=>Promise.resolve().then(()=>yc),void 0)])))}_postConstructor(e,t=null,i,s){this._importPromises.length=0,s&&this._importPromises.push(...s);const n=this.options.engine.isWebGPU&&!Kt.ForceGLSL;this._gatherImports(n,this._importPromises),i!==void 0&&i(n,this._importPromises),n&&this._webGPUReady&&(this.options.shaderLanguage=1),e||this.updateEffect(t)}updateEffect(e=null,t=null,i=null,s,n,r,o,h){var f,d;const l=Kt._GetShaderCodeProcessing(this.name);if(l!=null&&l.defineCustomBindings){const _=(f=t==null?void 0:t.slice())!=null?f:[];_.push(...this.options.uniforms);const p=(d=i==null?void 0:i.slice())!=null?d:[];p.push(...this.options.samplers),e=l.defineCustomBindings(this.name,e,_,p),t=_,i=p}this.options.defines=e||"";const c=this._shadersLoaded||this._importPromises.length===0?void 0:async()=>{await Promise.all(this._importPromises),this._shadersLoaded=!0};let u;this.options.extraInitializationsAsync?u=async()=>{c==null||c(),await this.options.extraInitializationsAsync}:u=c,this.options.useShaderStore?this._drawWrapper.effect=this.options.engine.createEffect({vertex:o!=null?o:this._shaderPath.vertex,fragment:h!=null?h:this._shaderPath.fragment},{attributes:this.options.attributeNames,uniformsNames:t||this.options.uniforms,uniformBuffersNames:this.options.uniformBuffers,samplers:i||this.options.samplers,defines:e!==null?e:"",fallbacks:null,onCompiled:n!=null?n:this.options.onCompiled,onError:r!=null?r:null,indexParameters:s||this.options.indexParameters,processCodeAfterIncludes:l!=null&&l.processCodeAfterIncludes?(_,p)=>l.processCodeAfterIncludes(this.name,_,p):null,processFinalCode:l!=null&&l.processFinalCode?(_,p)=>l.processFinalCode(this.name,_,p):null,shaderLanguage:this.options.shaderLanguage,extraInitializationsAsync:u},this.options.engine):this._drawWrapper.effect=new Et(this._shaderPath,this.options.attributeNames,t||this.options.uniforms,i||this.options.samplerNames,this.options.engine,e,void 0,n||this.options.onCompiled,void 0,void 0,void 0,this.options.shaderLanguage,u),this.onEffectCreatedObservable.notifyObservers(this._drawWrapper.effect)}bind(){var e,t;this.options.useAsPostProcess&&(this.options.engine.setAlphaMode(this.alphaMode),this.drawWrapper.effect.setFloat2("scale",1,1)),(t=(e=Kt._GetShaderCodeProcessing(this.name))==null?void 0:e.bindCustomBindings)==null||t.call(e,this.name,this._drawWrapper.effect)}dispose(e=!1){this._onContextRestoredObserver&&(this.effect.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null),this.onEffectCreatedObservable.clear(),this.effect.dispose()}}Kt.ForceGLSL=!1;Kt._CustomShaderCodeProcessing={};ae.prototype.setTextureFromPostProcess=function(a,e,t){var s;let i=null;e&&(e._forcedOutputTexture?i=e._forcedOutputTexture:e._textures.data[e._currentRenderTextureInd]&&(i=e._textures.data[e._currentRenderTextureInd])),this._bindTexture(a,(s=i==null?void 0:i.texture)!=null?s:null,t)};ae.prototype.setTextureFromPostProcessOutput=function(a,e,t){var i,s;this._bindTexture(a,(s=(i=e==null?void 0:e._outputTexture)==null?void 0:i.texture)!=null?s:null,t)};Et.prototype.setTextureFromPostProcess=function(a,e){this._engine.setTextureFromPostProcess(this._samplers[a],e,a)};Et.prototype.setTextureFromPostProcessOutput=function(a,e){this._engine.setTextureFromPostProcessOutput(this._samplers[a],e,a)};class mt{static get ForceGLSL(){return Kt.ForceGLSL}static set ForceGLSL(e){Kt.ForceGLSL=e}static RegisterShaderCodeProcessing(e,t){Kt.RegisterShaderCodeProcessing(e,t)}get name(){return this._effectWrapper.name}set name(e){this._effectWrapper.name=e}get alphaMode(){return this._effectWrapper.alphaMode}set alphaMode(e){this._effectWrapper.alphaMode=e}get samples(){return this._samples}set samples(e){this._samples=Math.min(e,this._engine.getCaps().maxMSAASamples),this._textures.forEach(t=>{t.setSamples(this._samples)})}get shaderLanguage(){return this._shaderLanguage}getEffectName(){return this._fragmentUrl}set onActivate(e){this._onActivateObserver&&this.onActivateObservable.remove(this._onActivateObserver),e&&(this._onActivateObserver=this.onActivateObservable.add(e))}set onSizeChanged(e){this._onSizeChangedObserver&&this.onSizeChangedObservable.remove(this._onSizeChangedObserver),this._onSizeChangedObserver=this.onSizeChangedObservable.add(e)}set onApply(e){this._onApplyObserver&&this.onApplyObservable.remove(this._onApplyObserver),this._onApplyObserver=this.onApplyObservable.add(e)}set onBeforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)}set onAfterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)}get inputTexture(){return this._textures.data[this._currentRenderTextureInd]}set inputTexture(e){this._forcedOutputTexture=e}restoreDefaultInputTexture(){this._forcedOutputTexture&&(this._forcedOutputTexture=null,this.markTextureDirty())}getCamera(){return this._camera}get texelSize(){return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.texelSize:(this._forcedOutputTexture&&this._texelSize.copyFromFloats(1/this._forcedOutputTexture.width,1/this._forcedOutputTexture.height),this._texelSize)}constructor(e,t,i,s,n,r,o=1,h,l,c=null,u=0,f="postprocess",d,_=!1,p=5,g,m){var y,R,E,C,S,w,P,G,L,W,K,ce;this._parentContainer=null,this.width=-1,this.height=-1,this.nodeMaterialSource=null,this._outputTexture=null,this.autoClear=!0,this.forceAutoClearInAlphaMode=!1,this.animations=[],this.enablePixelPerfectMode=!1,this.forceFullscreenViewport=!0,this.scaleMode=1,this.alwaysForcePOT=!1,this._samples=1,this.adaptScaleToCurrentViewport=!1,this._webGPUReady=!1,this._reusable=!1,this._renderId=0,this.externalTextureSamplerBinding=!1,this._textures=new Ut(2),this._textureCache=[],this._currentRenderTextureInd=0,this._scaleRatio=new oe(1,1),this._texelSize=oe.Zero(),this.onActivateObservable=new Z,this.onSizeChangedObservable=new Z,this.onApplyObservable=new Z,this.onBeforeRenderObservable=new Z,this.onAfterRenderObservable=new Z;let b=1,I=null,T;if(i&&!Array.isArray(i)){const $=i;i=(y=$.uniforms)!=null?y:null,s=(R=$.samplers)!=null?R:null,b=(E=$.size)!=null?E:1,r=(C=$.camera)!=null?C:null,o=(S=$.samplingMode)!=null?S:1,h=$.engine,l=$.reusable,c=Array.isArray($.defines)?$.defines.join("\n"):(w=$.defines)!=null?w:null,u=(P=$.textureType)!=null?P:0,f=(G=$.vertexUrl)!=null?G:"postprocess",d=$.indexParameters,_=(L=$.blockCompilation)!=null?L:!1,p=(W=$.textureFormat)!=null?W:5,g=(K=$.shaderLanguage)!=null?K:0,I=(ce=$.uniformBuffers)!=null?ce:null,m=$.extraInitializations,T=$.effectWrapper}else n&&(typeof n=="number"?b=n:b={width:n.width,height:n.height});const x=!!T;if(this._effectWrapper=T!=null?T:new Kt({name:e,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:t,engine:h||(r==null?void 0:r.getScene().getEngine()),uniforms:i,samplers:s,uniformBuffers:I,defines:c,vertexUrl:f,indexParameters:d,blockCompilation:!0,shaderLanguage:g,extraInitializations:void 0}),this.name=e,this.onEffectCreatedObservable=this._effectWrapper.onEffectCreatedObservable,r!=null?(this._camera=r,this._scene=r.getScene(),r.attachPostProcess(this),this._engine=this._scene.getEngine(),this._scene.postProcesses.push(this),this.uniqueId=this._scene.getUniqueId()):h&&(this._engine=h,this._engine.postProcesses.push(this)),this._options=b,this.renderTargetSamplingMode=o||1,this._reusable=l||!1,this._textureType=u,this._textureFormat=p,this._shaderLanguage=g||0,this._samplers=s||[],this._samplers.indexOf("textureSampler")===-1&&this._samplers.push("textureSampler"),this._fragmentUrl=t,this._vertexUrl=f,this._parameters=i||[],this._parameters.indexOf("scale")===-1&&this._parameters.push("scale"),this._uniformBuffers=I||[],this._indexParameters=d,!x){this._webGPUReady=this._shaderLanguage===1;const $=[];this._gatherImports(this._engine.isWebGPU&&!mt.ForceGLSL,$),this._effectWrapper._webGPUReady=this._webGPUReady,this._effectWrapper._postConstructor(_,c,m,$)}}_gatherImports(e=!1,t){e&&this._webGPUReady?t.push(Promise.all([Oe(()=>import("./postprocess.vertex-DvFhjUjz.js"),__vite__mapDeps([17,3,4,5,6,7,8,9,10]))])):t.push(Promise.all([Oe(()=>Promise.resolve().then(()=>yc),void 0)]))}getClassName(){return"PostProcess"}getEngine(){return this._engine}getEffect(){return this._effectWrapper.drawWrapper.effect}shareOutputWith(e){return this._disposeTextures(),this._shareOutputWithPostProcess=e,this}useOwnOutput(){this._textures.length==0&&(this._textures=new Ut(2)),this._shareOutputWithPostProcess=null}updateEffect(e=null,t=null,i=null,s,n,r,o,h){this._effectWrapper.updateEffect(e,t,i,s,n,r,o,h),this._postProcessDefines=Array.isArray(this._effectWrapper.options.defines)?this._effectWrapper.options.defines.join("\n"):this._effectWrapper.options.defines}isReusable(){return this._reusable}markTextureDirty(){this.width=-1}_createRenderTargetTexture(e,t,i=0){for(let n=0;n=0;t--)if(e-this._textureCache[t].lastUsedRenderId>100){let i=!1;for(let s=0;s0&&this._textures.reset(),this.width=e,this.height=t;let r=null;if(i){for(let l=0;l{p.samples!==this.samples&&this._engine.updateRenderTargetTextureSampleCount(p,this.samples)}),this._flushTextureCache(),this._renderId++}return f||(f=this._getTarget()),this.enablePixelPerfectMode?(this._scaleRatio.copyFromFloats(o/l,h/c),this._engine.bindFramebuffer(f,0,o,h,this.forceFullscreenViewport)):(this._scaleRatio.copyFromFloats(1,1),this._engine.bindFramebuffer(f,0,void 0,void 0,this.forceFullscreenViewport)),(_=(d=this._engine)._debugInsertMarker)==null||_.call(d,"post process ".concat(this.name," input")),this.onActivateObservable.notifyObservers(e),this.autoClear&&(this.alphaMode===0||this.forceAutoClearInAlphaMode)&&this._engine.clear(this.clearColor?this.clearColor:s.clearColor,s._allowPostProcessClearColor,!0,!0),this._reusable&&(this._currentRenderTextureInd=(this._currentRenderTextureInd+1)%2),f}get isSupported(){return this._effectWrapper.drawWrapper.effect.isSupported}get aspectRatio(){return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.aspectRatio:this._forcedOutputTexture?this._forcedOutputTexture.width/this._forcedOutputTexture.height:this.width/this.height}isReady(){return this._effectWrapper.isReady()}apply(){if(!this._effectWrapper.isReady())return null;this._engine.enableEffect(this._effectWrapper.drawWrapper),this._engine.setState(!1),this._engine.setDepthBuffer(!1),this._engine.setDepthWrite(!1),this.alphaConstants&&this.getEngine().setAlphaConstants(this.alphaConstants.r,this.alphaConstants.g,this.alphaConstants.b,this.alphaConstants.a);let e;return this._shareOutputWithPostProcess?e=this._shareOutputWithPostProcess.inputTexture:this._forcedOutputTexture?e=this._forcedOutputTexture:e=this.inputTexture,this.externalTextureSamplerBinding||this._effectWrapper.drawWrapper.effect._bindTexture("textureSampler",e==null?void 0:e.texture),this._effectWrapper.drawWrapper.effect.setVector2("scale",this._scaleRatio),this.onApplyObservable.notifyObservers(this._effectWrapper.drawWrapper.effect),this._effectWrapper.bind(),this._effectWrapper.drawWrapper.effect}_disposeTextures(){if(this._shareOutputWithPostProcess||this._forcedOutputTexture){this._disposeTextureCache();return}this._disposeTextureCache(),this._textures.dispose()}_disposeTextureCache(){for(let e=this._textureCache.length-1;e>=0;e--)this._textureCache[e].texture.dispose();this._textureCache.length=0}setPrePassRenderer(e){return this._prePassEffectConfiguration?(this._prePassEffectConfiguration=e.addEffectConfiguration(this._prePassEffectConfiguration),this._prePassEffectConfiguration.enabled=!0,!0):!1}dispose(e){e=e||this._camera,this._disposeTextures();let t;if(this._scene&&(t=this._scene.postProcesses.indexOf(this),t!==-1&&this._scene.postProcesses.splice(t,1)),this._parentContainer){const i=this._parentContainer.postProcesses.indexOf(this);i>-1&&this._parentContainer.postProcesses.splice(i,1),this._parentContainer=null}if(t=this._engine.postProcesses.indexOf(this),t!==-1&&this._engine.postProcesses.splice(t,1),!!e){if(e.detachPostProcess(this),t=e._postProcesses.indexOf(this),t===0&&e._postProcesses.length>0){const i=this._camera._getFirstPostProcess();i&&i.markTextureDirty()}this.onActivateObservable.clear(),this.onAfterRenderObservable.clear(),this.onApplyObservable.clear(),this.onBeforeRenderObservable.clear(),this.onSizeChangedObservable.clear(),this.onEffectCreatedObservable.clear()}}serialize(){const e=Ae.Serialize(this),t=this.getCamera()||this._scene&&this._scene.activeCamera;return e.customType="BABYLON."+this.getClassName(),e.cameraId=t?t.id:null,e.reusable=this._reusable,e.textureType=this._textureType,e.fragmentUrl=this._fragmentUrl,e.parameters=this._parameters,e.samplers=this._samplers,e.uniformBuffers=this._uniformBuffers,e.options=this._options,e.defines=this._postProcessDefines,e.textureFormat=this._textureFormat,e.vertexUrl=this._vertexUrl,e.indexParameters=this._indexParameters,e}clone(){const e=this.serialize();e._engine=this._engine,e.cameraId=null;const t=mt.Parse(e,this._scene,"");return t?(t.onActivateObservable=this.onActivateObservable.clone(),t.onSizeChangedObservable=this.onSizeChangedObservable.clone(),t.onApplyObservable=this.onApplyObservable.clone(),t.onBeforeRenderObservable=this.onBeforeRenderObservable.clone(),t.onAfterRenderObservable=this.onAfterRenderObservable.clone(),t._prePassEffectConfiguration=this._prePassEffectConfiguration,t):null}static Parse(e,t,i){const s=ys(e.customType);if(!s||!s._Parse)return null;const n=t?t.getCameraById(e.cameraId):null;return s._Parse(e,n,t,i)}static _Parse(e,t,i,s){return Ae.Parse(()=>new mt(e.name,e.fragmentUrl,e.parameters,e.samplers,e.options,t,e.renderTargetSamplingMode,e._engine,e.reusable,e.defines,e.textureType,e.vertexUrl,e.indexParameters,!1,e.textureFormat),e,i,s)}}D([B()],mt.prototype,"uniqueId",void 0);D([B()],mt.prototype,"name",null);D([B()],mt.prototype,"width",void 0);D([B()],mt.prototype,"height",void 0);D([B()],mt.prototype,"renderTargetSamplingMode",void 0);D([p0()],mt.prototype,"clearColor",void 0);D([B()],mt.prototype,"autoClear",void 0);D([B()],mt.prototype,"forceAutoClearInAlphaMode",void 0);D([B()],mt.prototype,"alphaMode",null);D([B()],mt.prototype,"alphaConstants",void 0);D([B()],mt.prototype,"enablePixelPerfectMode",void 0);D([B()],mt.prototype,"forceFullscreenViewport",void 0);D([B()],mt.prototype,"scaleMode",void 0);D([B()],mt.prototype,"alwaysForcePOT",void 0);D([B("samples")],mt.prototype,"_samples",void 0);D([B()],mt.prototype,"adaptScaleToCurrentViewport",void 0);vt("BABYLON.PostProcess",mt);class Yn extends mt{getClassName(){return"PassPostProcess"}constructor(e,t,i=null,s,n,r,o=0,h=!1){super(e,"pass",null,null,t,i,s,n,r,void 0,o,void 0,null,h)}_gatherImports(e,t){e?(this._webGPUReady=!0,t.push(Promise.all([Oe(()=>import("./pass.fragment-CM2j9WLA.js"),__vite__mapDeps([18,3,4,5,6,7,8,9,10]))]))):t.push(Promise.all([Oe(()=>import("./pass.fragment-BkcfUm5b.js"),__vite__mapDeps([19,3,4,5,6,7,8,9,10]))])),super._gatherImports(e,t)}static _Parse(e,t,i,s){return Ae.Parse(()=>new Yn(e.name,e.options,t,e.renderTargetSamplingMode,e._engine,e.reusable),e,i,s)}}vt("BABYLON.PassPostProcess",Yn);ae._RescalePostProcessFactory=a=>new Yn("rescale",1,null,2,a,!1,0);function ip(a,e,t,i,s,n,r,o){const h=e.getEngine();return e.isReady=!1,s=s!=null?s:e.samplingMode,i=i!=null?i:e.type,n=n!=null?n:e.format,r=r!=null?r:e.width,o=o!=null?o:e.height,i===-1&&(i=0),new Promise(l=>{const c=new mt("postprocess",a,null,null,1,null,s,h,!1,void 0,i,void 0,null,!1,n);c.externalTextureSamplerBinding=!0;const u=h.createRenderTargetTexture({width:r,height:o},{generateDepthBuffer:!1,generateMipMaps:!1,generateStencilBuffer:!1,samplingMode:s,type:i,format:n});c.onEffectCreatedObservable.addOnce(f=>{f.executeWhenCompiled(()=>{c.onApply=d=>{d._bindTexture("textureSampler",e),d.setFloat2("scale",1,1)},t.postProcessManager.directRender([c],u,!0),h.restoreDefaultFramebuffer(),h._releaseTexture(e),c&&c.dispose(),u._swapAndDie(e),e.type=i,e.format=5,e.isReady=!0,l(e)})})})}let or,Mh;function rx(a){or||(or=new Float32Array(1),Mh=new Int32Array(or.buffer)),or[0]=a;const e=Mh[0];let t=e>>16&32768,i=e>>12&2047;const s=e>>23&255;return s<103?t:s>142?(t|=31744,t|=(s==255?0:1)&&e&8388607,t):s<113?(i|=2048,t|=(i>>114-s)+(i>>113-s&1),t):(t|=s-112<<10|i>>1,t+=i&1,t)}function sp(a){const e=(a&32768)>>15,t=(a&31744)>>10,i=a&1023;return t===0?(e?-1:1)*Math.pow(2,-14)*(i/Math.pow(2,10)):t==31?i?NaN:(e?-1:1)*(1/0):(e?-1:1)*Math.pow(2,t-15)*(1+i/Math.pow(2,10))}class Mr{static _IsGPUBuffer(e){return e.underlyingResource===void 0}static _FlagsToString(e,t=""){let i=t;for(let s=0;s<=9;++s)e&1<c;)this._device.queue.writeBuffer(r,t+u,i.buffer,o+u,c),u+=c;this._device.queue.writeBuffer(r,t+u,i.buffer,o+u,n-u)}_getHalfFloatAsFloatRGBAArrayBuffer(e,t,i){i||(i=new Float32Array(e));const s=new Uint16Array(t);for(;e--;)i[e]=sp(s[e]);return i}readDataFromBuffer(e,t,i,s,n,r,o=0,h=0,l=null,c=!0,u=!1){const f=o===1?2:o===2?1:0,d=this._engine.uniqueId;return new Promise((_,p)=>{e.mapAsync(1,h,t).then(()=>{const g=e.getMappedRange(h,t);let m=l;if(u)m===null?m=Pa(o,t,!0,g):m=Pa(o,m.buffer,void 0,g);else if(m===null)switch(f){case 0:m=new Uint8Array(t),m.set(new Uint8Array(g));break;case 1:m=this._getHalfFloatAsFloatRGBAArrayBuffer(t/2,g);break;case 2:m=new Float32Array(t/4),m.set(new Float32Array(g));break}else switch(f){case 0:m=new Uint8Array(m.buffer),m.set(new Uint8Array(g));break;case 1:m=this._getHalfFloatAsFloatRGBAArrayBuffer(t/2,g,l);break;case 2:m=new Float32Array(m.buffer),m.set(new Float32Array(g));break}if(n!==r){f===1&&!u&&(n*=2,r*=2);const b=new Uint8Array(m.buffer);let I=n,T=0;for(let x=1;x{this._engine.isDisposed||this._engine.uniqueId!==d?_(new Uint8Array):p(g)})})}releaseBuffer(e){return Mr._IsGPUBuffer(e)?(this._deferredReleaseBuffers.push(e),!0):(e.references--,e.references===0?(this._deferredReleaseBuffers.push(e.underlyingResource),!0):!1)}destroyDeferredBuffers(){for(let e=0;e1&&(r!==0||o!==0)&&n!=="nearest"?{magFilter:"linear",minFilter:"linear",mipmapFilter:"linear",anisotropyEnabled:!0}:{magFilter:i,minFilter:s,mipmapFilter:n,lodMinClamp:r,lodMaxClamp:o}}static _GetWrappingMode(e){switch(e){case 1:return"repeat";case 0:return"clamp-to-edge";case 2:return"mirror-repeat"}return"repeat"}static _GetSamplerWrappingDescriptor(e){return{addressModeU:this._GetWrappingMode(e._cachedWrapU),addressModeV:this._GetWrappingMode(e._cachedWrapV),addressModeW:this._GetWrappingMode(e._cachedWrapR)}}static _GetSamplerDescriptor(e,t){const i=e.useMipMaps&&e._cachedAnisotropicFilteringLevel?e._cachedAnisotropicFilteringLevel:1,s=this._GetSamplerFilterDescriptor(e,i);return{label:t,...s,...this._GetSamplerWrappingDescriptor(e),compare:e._comparisonFunction?Fs.GetCompareFunction(e._comparisonFunction):void 0,maxAnisotropy:s.anisotropyEnabled?i:1}}static GetCompareFunction(e){switch(e){case 519:return"always";case 514:return"equal";case 516:return"greater";case 518:return"greater-equal";case 513:return"less";case 515:return"less-equal";case 512:return"never";case 517:return"not-equal";default:return"less"}}getSampler(e,t=!1,i=0,s){if(this.disabled)return this._device.createSampler(Fs._GetSamplerDescriptor(e,s));t?i=0:i===0&&(i=Fs.GetSamplerHashCode(e));let n=t?void 0:this._samplers[i];return n||(n=this._device.createSampler(Fs._GetSamplerDescriptor(e,s)),t||(this._samplers[i]=n)),n}}const op={[A.PositionKind]:!0,[A.NormalKind]:!0,[A.TangentKind]:!0,[A.UVKind]:!0,[A.UV2Kind]:!0,[A.UV3Kind]:!0,[A.UV4Kind]:!0,[A.UV5Kind]:!0,[A.UV6Kind]:!0,[A.ColorKind]:!0,[A.ColorInstanceKind]:!0,[A.MatricesIndicesKind]:!0,[A.MatricesWeightsKind]:!0,[A.MatricesIndicesExtraKind]:!0,[A.MatricesWeightsExtraKind]:!0};function hp(a){switch(a){case A.BYTE:case A.SHORT:case A.INT:case A.FLOAT:return!0;case A.UNSIGNED_BYTE:case A.UNSIGNED_SHORT:case A.UNSIGNED_INT:return!1;default:throw new Error("Invalid type '".concat(a,"'"))}}function lp(a,e){const t=e.getEngine(),i=e._pipelineContext;if(!(i!=null&&i.vertexBufferKindToType))return;let s=null;for(const n in a){const r=a[n];if(!r||!op[n])continue;const o=r.normalized?A.FLOAT:r.type,h=i.vertexBufferKindToType[n];(o!==A.FLOAT&&h===void 0||h!==void 0&&h!==o)&&(s||(s=t._getShaderProcessingContext(e.shaderLanguage,!1)),i.vertexBufferKindToType[n]=o,o!==A.FLOAT&&(s.vertexBufferKindToNumberOfComponents[n]=A.DeduceStride(n),hp(o)&&(s.vertexBufferKindToNumberOfComponents[n]*=-1)))}if(s){const n=t._caps.parallelShaderCompile;t._caps.parallelShaderCompile=void 0,e._processShaderCodeAsync(null,t._features._checkNonFloatVertexBuffersDontRecreatePipelineContext,s),t._caps.parallelShaderCompile=n}}var dt;(function(a){a[a.StencilReadMask=0]="StencilReadMask",a[a.StencilWriteMask=1]="StencilWriteMask",a[a.DepthBias=2]="DepthBias",a[a.DepthBiasSlopeScale=3]="DepthBiasSlopeScale",a[a.DepthStencilState=4]="DepthStencilState",a[a.MRTAttachments1=5]="MRTAttachments1",a[a.MRTAttachments2=6]="MRTAttachments2",a[a.RasterizationState=7]="RasterizationState",a[a.ColorStates=8]="ColorStates",a[a.ShaderStage=9]="ShaderStage",a[a.TextureStage=10]="TextureStage",a[a.VertexState=11]="VertexState",a[a.NumStates=12]="NumStates"})(dt||(dt={}));const hr={0:1,1:2,768:3,769:4,770:5,771:6,772:7,773:8,774:9,775:10,776:11,32769:12,32770:13,32771:12,32772:13},Ys={0:0,7680:1,7681:2,7682:3,7683:4,5386:5,34055:6,34056:7};class rt{constructor(e,t){this.mrtTextureCount=0,this._device=e,this._useTextureStage=!0,this._states=new Array(30),this._statesLength=0,this._stateDirtyLowestIndex=0,this._emptyVertexBuffer=t,this._mrtFormats=[],this._parameter={token:void 0,pipeline:null},this.disabled=!1,this.vertexBuffers=[],this._kMaxVertexBufferStride=e.limits.maxVertexBufferArrayStride||2048,this.reset()}reset(){this._isDirty=!0,this.vertexBuffers.length=0,this.setAlphaToCoverage(!1),this.resetDepthCullingState(),this.setClampDepth(!1),this.setDepthBias(0),this._webgpuColorFormat=["bgra8unorm"],this.setColorFormat("bgra8unorm"),this.setMRT([]),this.setAlphaBlendEnabled(!1),this.setAlphaBlendFactors([null,null,null,null],[null,null]),this.setWriteMask(15),this.setDepthStencilFormat("depth24plus-stencil8"),this.setStencilEnabled(!1),this.resetStencilState(),this.setBuffers(null,null,null),this._setTextureState(0)}get colorFormats(){return this._mrtAttachments1>0?this._mrtFormats:this._webgpuColorFormat}getRenderPipeline(e,t,i,s=0){if(i=Ve.GetSample(i),this.disabled){const r=rt._GetTopology(e);return this._setVertexState(t),this._setTextureState(s),this._parameter.pipeline=this._createRenderPipeline(t,r,i),rt.NumCacheMiss++,rt._NumPipelineCreationCurrentFrame++,this._parameter.pipeline}if(this._setShaderStage(t.uniqueId),this._setRasterizationState(e,i),this._setColorStates(),this._setDepthStencilState(),this._setVertexState(t),this._setTextureState(s),this.lastStateDirtyLowestIndex=this._stateDirtyLowestIndex,!this._isDirty&&this._parameter.pipeline)return this._stateDirtyLowestIndex=this._statesLength,rt.NumCacheHitWithoutHash++,this._parameter.pipeline;if(this._getRenderPipeline(this._parameter),this._isDirty=!1,this._stateDirtyLowestIndex=this._statesLength,this._parameter.pipeline)return rt.NumCacheHitWithHash++,this._parameter.pipeline;const n=rt._GetTopology(e);return this._parameter.pipeline=this._createRenderPipeline(t,n,i),this._setRenderPipeline(this._parameter),rt.NumCacheMiss++,rt._NumPipelineCreationCurrentFrame++,this._parameter.pipeline}endFrame(){rt.NumPipelineCreationLastFrame=rt._NumPipelineCreationCurrentFrame,rt._NumPipelineCreationCurrentFrame=0}setAlphaToCoverage(e){this._alphaToCoverageEnabled=e}setFrontFace(e){this._frontFace=e}setCullEnabled(e){this._cullEnabled=e}setCullFace(e){this._cullFace=e}setClampDepth(e){this._clampDepth=e}resetDepthCullingState(){this.setDepthCullingState(!1,2,1,0,0,!0,!0,519)}setDepthCullingState(e,t,i,s,n,r,o,h){this._depthWriteEnabled=o,this._depthTestEnabled=r,this._depthCompare=(h!=null?h:519)-512,this._cullFace=i,this._cullEnabled=e,this._frontFace=t,this.setDepthBiasSlopeScale(s),this.setDepthBias(n)}setDepthBias(e){this._depthBias!==e&&(this._depthBias=e,this._states[dt.DepthBias]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.DepthBias))}setDepthBiasSlopeScale(e){this._depthBiasSlopeScale!==e&&(this._depthBiasSlopeScale=e,this._states[dt.DepthBiasSlopeScale]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.DepthBiasSlopeScale))}setColorFormat(e){this._webgpuColorFormat[0]=e,this._colorFormat=Vi[e!=null?e:""]}setMRTAttachments(e){this.mrtAttachments=e;let t=0;for(let i=0;i10)throw"Can't handle more than 10 attachments for a MRT in cache render pipeline!";this.mrtTextureArray=e,this.mrtTextureCount=t,this._mrtEnabledMask=65535;const i=[0,0];let s=0,n=0,r=0;for(let l=0;l=32&&(n=0,s++)}this._mrtFormats.length=r,(this._mrtAttachments1!==i[0]||this._mrtAttachments2!==i[1])&&(this._mrtAttachments1=i[0],this._mrtAttachments2=i[1],this._states[dt.MRTAttachments1]=i[0],this._states[dt.MRTAttachments2]=i[1],this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.MRTAttachments1))}setAlphaBlendEnabled(e){this._alphaBlendEnabled=e}setAlphaBlendFactors(e,t){this._alphaBlendFuncParams=e,this._alphaBlendEqParams=t}setWriteMask(e){this._writeMask=e}setDepthStencilFormat(e){this._webgpuDepthStencilFormat=e,this._depthStencilFormat=e===void 0?0:Vi[e]}setDepthTestEnabled(e){this._depthTestEnabled=e}setDepthWriteEnabled(e){this._depthWriteEnabled=e}setDepthCompare(e){this._depthCompare=(e!=null?e:519)-512}setStencilEnabled(e){this._stencilEnabled=e}setStencilCompare(e){this._stencilFrontCompare=(e!=null?e:519)-512}setStencilDepthFailOp(e){this._stencilFrontDepthFailOp=e===null?1:Ys[e]}setStencilPassOp(e){this._stencilFrontPassOp=e===null?2:Ys[e]}setStencilFailOp(e){this._stencilFrontFailOp=e===null?1:Ys[e]}setStencilReadMask(e){this._stencilReadMask!==e&&(this._stencilReadMask=e,this._states[dt.StencilReadMask]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.StencilReadMask))}setStencilWriteMask(e){this._stencilWriteMask!==e&&(this._stencilWriteMask=e,this._states[dt.StencilWriteMask]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.StencilWriteMask))}resetStencilState(){this.setStencilState(!1,519,7680,7681,7680,255,255)}setStencilState(e,t,i,s,n,r,o){this._stencilEnabled=e,this._stencilFrontCompare=(t!=null?t:519)-512,this._stencilFrontDepthFailOp=i===null?1:Ys[i],this._stencilFrontPassOp=s===null?2:Ys[s],this._stencilFrontFailOp=n===null?1:Ys[n],this.setStencilReadMask(r),this.setStencilWriteMask(o)}setBuffers(e,t,i){this._vertexBuffers=e,this._overrideVertexBuffers=i,this._indexBuffer=t}static _GetTopology(e){switch(e){case 0:return"triangle-list";case 2:return"point-list";case 1:return"line-list";case 3:return"point-list";case 4:return"line-list";case 5:throw"LineLoop is an unsupported fillmode in WebGPU";case 6:return"line-strip";case 7:return"triangle-strip";case 8:throw"TriangleFan is an unsupported fillmode in WebGPU";default:return"triangle-list"}}static _GetAphaBlendOperation(e){switch(e){case 32774:return"add";case 32778:return"subtract";case 32779:return"reverse-subtract";case 32775:return"min";case 32776:return"max";default:return"add"}}static _GetAphaBlendFactor(e){switch(e){case 0:return"zero";case 1:return"one";case 768:return"src";case 769:return"one-minus-src";case 770:return"src-alpha";case 771:return"one-minus-src-alpha";case 772:return"dst-alpha";case 773:return"one-minus-dst-alpha";case 774:return"dst";case 775:return"one-minus-dst";case 776:return"src-alpha-saturated";case 32769:return"constant";case 32770:return"one-minus-constant";case 32771:return"constant";case 32772:return"one-minus-constant";case 35065:return"src1";case 35066:return"one-minus-src1";case 34185:return"src1-alpha";case 35067:return"one-minus-src1-alpha";default:return"one"}}static _GetCompareFunction(e){switch(e){case 0:return"never";case 1:return"less";case 2:return"equal";case 3:return"less-equal";case 4:return"greater";case 5:return"not-equal";case 6:return"greater-equal";case 7:return"always"}return"never"}static _GetStencilOpFunction(e){switch(e){case 0:return"zero";case 1:return"keep";case 2:return"replace";case 3:return"increment-clamp";case 4:return"decrement-clamp";case 5:return"invert";case 6:return"increment-wrap";case 7:return"decrement-wrap"}return"keep"}static _GetVertexInputDescriptorFormat(e){const t=e.type,i=e.normalized,s=e.getSize();switch(t){case A.BYTE:switch(s){case 1:case 2:return i?"snorm8x2":"sint8x2";case 3:case 4:return i?"snorm8x4":"sint8x4"}break;case A.UNSIGNED_BYTE:switch(s){case 1:case 2:return i?"unorm8x2":"uint8x2";case 3:case 4:return i?"unorm8x4":"uint8x4"}break;case A.SHORT:switch(s){case 1:case 2:return i?"snorm16x2":"sint16x2";case 3:case 4:return i?"snorm16x4":"sint16x4"}break;case A.UNSIGNED_SHORT:switch(s){case 1:case 2:return i?"unorm16x2":"uint16x2";case 3:case 4:return i?"unorm16x4":"uint16x4"}break;case A.INT:switch(s){case 1:return"sint32";case 2:return"sint32x2";case 3:return"sint32x3";case 4:return"sint32x4"}break;case A.UNSIGNED_INT:switch(s){case 1:return"uint32";case 2:return"uint32x2";case 3:return"uint32x3";case 4:return"uint32x4"}break;case A.FLOAT:switch(s){case 1:return"float32";case 2:return"float32x2";case 3:return"float32x3";case 4:return"float32x4"}break}throw new Error("Invalid Format '".concat(e.getKind(),"' - type=").concat(t,", normalized=").concat(i,", size=").concat(s))}_getAphaBlendState(){return this._alphaBlendEnabled?{srcFactor:rt._GetAphaBlendFactor(this._alphaBlendFuncParams[2]),dstFactor:rt._GetAphaBlendFactor(this._alphaBlendFuncParams[3]),operation:rt._GetAphaBlendOperation(this._alphaBlendEqParams[1])}:null}_getColorBlendState(){return this._alphaBlendEnabled?{srcFactor:rt._GetAphaBlendFactor(this._alphaBlendFuncParams[0]),dstFactor:rt._GetAphaBlendFactor(this._alphaBlendFuncParams[1]),operation:rt._GetAphaBlendOperation(this._alphaBlendEqParams[0])}:null}_setShaderStage(e){this._shaderId!==e&&(this._shaderId=e,this._states[dt.ShaderStage]=e,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.ShaderStage))}_setRasterizationState(e,t){const i=this._frontFace,s=this._cullEnabled?this._cullFace:0,n=this._clampDepth?1:0,r=this._alphaToCoverageEnabled?1:0,o=i-1+(s<<1)+(n<<3)+(r<<4)+(e<<5)+(t<<8);this._rasterizationState!==o&&(this._rasterizationState=o,this._states[dt.RasterizationState]=this._rasterizationState,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.RasterizationState))}_setColorStates(){let e=((this._writeMask?1:0)<<22)+(this._colorFormat<<23)+((this._depthWriteEnabled?1:0)<<29);this._alphaBlendEnabled&&(e+=((this._alphaBlendFuncParams[0]===null?2:hr[this._alphaBlendFuncParams[0]])<<0)+((this._alphaBlendFuncParams[1]===null?2:hr[this._alphaBlendFuncParams[1]])<<4)+((this._alphaBlendFuncParams[2]===null?2:hr[this._alphaBlendFuncParams[2]])<<8)+((this._alphaBlendFuncParams[3]===null?2:hr[this._alphaBlendFuncParams[3]])<<12)+((this._alphaBlendEqParams[0]===null?1:this._alphaBlendEqParams[0]-32773)<<16)+((this._alphaBlendEqParams[1]===null?1:this._alphaBlendEqParams[1]-32773)<<19)),e!==this._colorStates&&(this._colorStates=e,this._states[dt.ColorStates]=this._colorStates,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.ColorStates))}_setDepthStencilState(){const e=this._stencilEnabled?this._stencilFrontCompare+(this._stencilFrontDepthFailOp<<3)+(this._stencilFrontPassOp<<6)+(this._stencilFrontFailOp<<9):591,t=this._depthStencilFormat+((this._depthTestEnabled?this._depthCompare:7)<<6)+(e<<10);this._depthStencilState!==t&&(this._depthStencilState=t,this._states[dt.DepthStencilState]=this._depthStencilState,this._isDirty=!0,this._stateDirtyLowestIndex=Math.min(this._stateDirtyLowestIndex,dt.DepthStencilState))}_setVertexState(e){var l,c;const t=this._statesLength;let i=dt.VertexState;const s=e._pipelineContext,n=s.shaderProcessingContext.attributeNamesFromEffect,r=s.shaderProcessingContext.attributeLocationsFromEffect;let o,h=0;for(let u=0;u0)for(let m=0;m=this._video.HAVE_CURRENT_DATA}dispose(){}}class zr{get forceBindGroupCreation(){return this._numExternalTextures>0}get hasFloatOrDepthTextures(){return this._numFloatOrDepthTextures>0}constructor(){this.uniqueId=zr._Counter++,this.updateId=0,this.textureState=0,this.reset()}reset(){this.samplers={},this.textures={},this.isDirty=!0,this._numFloatOrDepthTextures=0,this._numExternalTextures=0}setSampler(e,t){let i=this.samplers[e],s=-1;i?s=i.hashCode:this.samplers[e]=i={sampler:t,hashCode:0},i.sampler=t,i.hashCode=t?Fs.GetSamplerHashCode(t):0;const n=s!==i.hashCode;n&&this.updateId++,this.isDirty||(this.isDirty=n)}setTexture(e,t){var r,o,h;let i=this.textures[e],s=-1;i?s=(o=(r=i.texture)==null?void 0:r.uniqueId)!=null?o:-1:this.textures[e]=i={texture:t,isFloatOrDepthTexture:!1,isExternalTexture:!1},i.isExternalTexture&&this._numExternalTextures--,i.isFloatOrDepthTexture&&this._numFloatOrDepthTextures--,t?(i.isFloatOrDepthTexture=t.type===1||t.format>=13&&t.format<=18,i.isExternalTexture=Tc.IsExternalTexture(t),i.isFloatOrDepthTexture&&this._numFloatOrDepthTextures++,i.isExternalTexture&&this._numExternalTextures++):(i.isFloatOrDepthTexture=!1,i.isExternalTexture=!1),i.texture=t;const n=s!==((h=t==null?void 0:t.uniqueId)!=null?h:-1);n&&this.updateId++,this.isDirty||(this.isDirty=n)}}zr._Counter=0;class Wr{isDirty(e){return this._isDirty||this._materialContextUpdateId!==e}resetIsDirty(e){this._isDirty=!1,this._materialContextUpdateId=e}get useInstancing(){return this._useInstancing}set useInstancing(e){this._useInstancing!==e&&(e?(this.indirectDrawBuffer=this._bufferManager.createRawBuffer(20,We.CopyDst|We.Indirect|We.Storage,void 0,"IndirectDrawBuffer"),this._indirectDrawData=new Uint32Array(5),this._indirectDrawData[3]=0,this._indirectDrawData[4]=0):(this.indirectDrawBuffer&&this._bufferManager.releaseBuffer(this.indirectDrawBuffer),this.indirectDrawBuffer=void 0,this._indirectDrawData=void 0),this._useInstancing=e,this._currentInstanceCount=-1)}constructor(e){this._bufferManager=e,this.uniqueId=Wr._Counter++,this._useInstancing=!1,this._currentInstanceCount=0,this.reset()}reset(){this.buffers={},this._isDirty=!0,this._materialContextUpdateId=0,this.fastBundle=void 0,this.bindGroups=void 0}setBuffer(e,t){var i;this._isDirty||(this._isDirty=(t==null?void 0:t.uniqueId)!==((i=this.buffers[e])==null?void 0:i.uniqueId)),this.buffers[e]=t}setIndirectData(e,t,i){t===this._currentInstanceCount||!this.indirectDrawBuffer||!this._indirectDrawData||(this._currentInstanceCount=t,this._indirectDrawData[0]=e,this._indirectDrawData[1]=t,this._indirectDrawData[2]=i,this._bufferManager.setRawData(this.indirectDrawBuffer,0,this._indirectDrawData,0,20))}dispose(){this.indirectDrawBuffer&&(this._bufferManager.releaseBuffer(this.indirectDrawBuffer),this.indirectDrawBuffer=void 0,this._indirectDrawData=void 0),this.fastBundle=void 0,this.bindGroups=void 0,this.buffers=void 0}}Wr._Counter=0;const fp=1<<20,dp=2**35;class Tn{constructor(){this.values={}}}class qe{static get Statistics(){return{totalCreated:qe.NumBindGroupsCreatedTotal,lastFrameCreated:qe.NumBindGroupsCreatedLastFrame,lookupLastFrame:qe.NumBindGroupsLookupLastFrame,noLookupLastFrame:qe.NumBindGroupsNoLookupLastFrame}}static ResetCache(){qe._Cache=new Tn,qe.NumBindGroupsCreatedTotal=0,qe.NumBindGroupsCreatedLastFrame=0,qe.NumBindGroupsLookupLastFrame=0,qe.NumBindGroupsNoLookupLastFrame=0,qe._NumBindGroupsCreatedCurrentFrame=0,qe._NumBindGroupsLookupCurrentFrame=0,qe._NumBindGroupsNoLookupCurrentFrame=0}constructor(e,t,i){this.disabled=!1,this._device=e,this._cacheSampler=t,this._engine=i}endFrame(){qe.NumBindGroupsCreatedLastFrame=qe._NumBindGroupsCreatedCurrentFrame,qe.NumBindGroupsLookupLastFrame=qe._NumBindGroupsLookupCurrentFrame,qe.NumBindGroupsNoLookupLastFrame=qe._NumBindGroupsNoLookupCurrentFrame,qe._NumBindGroupsCreatedCurrentFrame=0,qe._NumBindGroupsLookupCurrentFrame=0,qe._NumBindGroupsNoLookupCurrentFrame=0}getBindGroups(e,t,i){var h,l,c,u,f,d,_,p,g,m;let s,n=qe._Cache;const r=this.disabled||i.forceBindGroupCreation;if(!r){if(!t.isDirty(i.updateId)&&!i.isDirty)return qe._NumBindGroupsNoLookupCurrentFrame++,t.bindGroups;for(const b of e.shaderProcessingContext.bufferNames){const I=((l=(h=t.buffers[b])==null?void 0:h.uniqueId)!=null?l:0)+fp;let T=n.values[I];T||(T=new Tn,n.values[I]=T),n=T}for(const b of e.shaderProcessingContext.samplerNames){const I=(u=(c=i.samplers[b])==null?void 0:c.hashCode)!=null?u:0;let T=n.values[I];T||(T=new Tn,n.values[I]=T),n=T}for(const b of e.shaderProcessingContext.textureNames){const I=((_=(d=(f=i.textures[b])==null?void 0:f.texture)==null?void 0:d.uniqueId)!=null?_:0)+dp;let T=n.values[I];T||(T=new Tn,n.values[I]=T),n=T}s=n.bindGroups}if(t.resetIsDirty(i.updateId),i.isDirty=!1,s)return t.bindGroups=s,qe._NumBindGroupsLookupCurrentFrame++,s;s=[],t.bindGroups=s,r||(n.bindGroups=s),qe.NumBindGroupsCreatedTotal++,qe._NumBindGroupsCreatedCurrentFrame++;const o=e.bindGroupLayouts[i.textureState];for(let b=0;b":G),", materialContext.uniqueId=").concat(i.uniqueId),50);continue}T[y].resource=this._cacheSampler.getSampler(w,!1,S.hashCode,w.label)}else U.Error('Sampler "'.concat(C,'" could not be bound. entry=').concat(JSON.stringify(R),", materialContext=").concat(JSON.stringify(i,(w,P)=>w==="texture"||w==="sampler"?"":P)),50)}else if(R.texture||R.storageTexture){const S=i.textures[C];if(S){if(this._engine.dbgSanityChecks&&S.texture===null){U.Error("Trying to bind a null texture! entry=".concat(JSON.stringify(R),", bindingInfo=").concat(JSON.stringify(S,(P,G)=>P==="texture"?"":G),", materialContext.uniqueId=").concat(i.uniqueId),50);continue}const w=S.texture._hardwareTexture;if(this._engine.dbgSanityChecks&&(!w||R.texture&&!w.view||R.storageTexture&&!w.viewForWriting)){U.Error("Trying to bind a null gpu texture or view! entry=".concat(JSON.stringify(R),", name=").concat(C,", bindingInfo=").concat(JSON.stringify(S,(P,G)=>P==="texture"?"":G),", isReady=").concat((g=S.texture)==null?void 0:g.isReady,", materialContext.uniqueId=").concat(i.uniqueId),50);continue}T[y].resource=R.storageTexture?w.viewForWriting:w.view}else U.Error('Texture "'.concat(C,'" could not be bound. entry=').concat(JSON.stringify(R),", materialContext=").concat(JSON.stringify(i,(w,P)=>w==="texture"||w==="sampler"?"":P)),50)}else if(R.externalTexture){const S=i.textures[C];if(S){if(this._engine.dbgSanityChecks&&S.texture===null){U.Error("Trying to bind a null external texture! entry=".concat(JSON.stringify(R),", name=").concat(C,", bindingInfo=").concat(JSON.stringify(S,(P,G)=>P==="texture"?"":G),", materialContext.uniqueId=").concat(i.uniqueId),50);continue}const w=S.texture.underlyingResource;if(this._engine.dbgSanityChecks&&!w){U.Error("Trying to bind a null gpu external texture! entry=".concat(JSON.stringify(R),", name=").concat(C,", bindingInfo=").concat(JSON.stringify(S,(P,G)=>P==="texture"?"":G),", isReady=").concat((m=S.texture)==null?void 0:m.isReady,", materialContext.uniqueId=").concat(i.uniqueId),50);continue}T[y].resource=this._device.importExternalTexture({source:w})}else U.Error('Texture "'.concat(C,'" could not be bound. entry=').concat(JSON.stringify(R),", materialContext=").concat(JSON.stringify(i,(w,P)=>w==="texture"||w==="sampler"?"":P)),50)}else if(R.buffer){const S=t.buffers[C];if(S){const w=S.underlyingResource;T[y].resource.buffer=w,T[y].resource.size=S.capacity}else U.Error("Can't find buffer \"".concat(C,'". entry=').concat(JSON.stringify(R),", buffers=").concat(JSON.stringify(t.buffers),", drawContext.uniqueId=").concat(t.uniqueId),50)}}const x=o[b];s[b]=this._device.createBindGroup({layout:x,entries:T})}return s}}qe.NumBindGroupsCreatedTotal=0;qe.NumBindGroupsCreatedLastFrame=0;qe.NumBindGroupsLookupLastFrame=0;qe.NumBindGroupsNoLookupLastFrame=0;qe._Cache=new Tn;qe._NumBindGroupsCreatedCurrentFrame=0;qe._NumBindGroupsLookupCurrentFrame=0;qe._NumBindGroupsNoLookupCurrentFrame=0;const _p="clearQuadVertexShader",pp="uniform depthValue: f32;const pos=array(\nvec2f(-1.0,1.0),\nvec2f(1.0,1.0),\nvec2f(-1.0,-1.0),\nvec2f(1.0,-1.0)\n);\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.position=vec4f(pos[input.vertexIndex],uniforms.depthValue,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}\n";Me.ShadersStoreWGSL[_p]=pp;const gp="clearQuadPixelShader",mp="uniform color: vec4f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=uniforms.color;}\n";Me.ShadersStoreWGSL[gp]=mp;class vp{setDepthStencilFormat(e){this._depthTextureFormat=e,this._cacheRenderPipeline.setDepthStencilFormat(e)}setColorFormat(e){this._cacheRenderPipeline.setColorFormat(e)}setMRTAttachments(e,t,i){this._cacheRenderPipeline.setMRT(t,i),this._cacheRenderPipeline.setMRTAttachments(e)}constructor(e,t,i){this._bindGroups={},this._bundleCache={},this._keyTemp=[],this._device=e,this._engine=t,this._cacheRenderPipeline=new Ci(this._device,i),this._cacheRenderPipeline.setDepthTestEnabled(!1),this._cacheRenderPipeline.setStencilReadMask(255),this._effect=t.createEffect("clearQuad",[],["color","depthValue"],void 0,void 0,void 0,void 0,void 0,void 0,1)}clear(e,t,i,s,n=1){var g,m;let r,o=null,h;const l=!!this._engine._currentRenderTarget;if(e)r=e;else{let b=0;this._keyTemp.length=0;for(let T=0;T1?2**36:0)+I*2**37,h=this._keyTemp.join("_"),o=this._bundleCache[h],o)return o;r=this._device.createRenderBundleEncoder({label:"clearQuadRenderBundle",colorFormats:this._cacheRenderPipeline.colorFormats,depthStencilFormat:this._depthTextureFormat,sampleCount:Ve.GetSample(n)})}this._cacheRenderPipeline.setDepthWriteEnabled(!!i),this._cacheRenderPipeline.setStencilEnabled(!!s&&!!this._depthTextureFormat&&Ve.HasStencilAspect(this._depthTextureFormat)),this._cacheRenderPipeline.setStencilWriteMask(s?255:0),this._cacheRenderPipeline.setStencilCompare(s?519:512),this._cacheRenderPipeline.setStencilPassOp(s?7681:7680),this._cacheRenderPipeline.setWriteMask(t?15:0);const c=this._cacheRenderPipeline.getRenderPipeline(7,this._effect,n),u=this._effect._pipelineContext;t&&this._effect.setDirectColor4("color",t),this._effect.setFloat("depthValue",this._engine.useReverseDepthBuffer?this._engine._clearReverseDepthValue:this._engine._clearDepthValue),u.uniformBuffer.update();const f=l?this._engine._ubInvertY:this._engine._ubDontInvertY,d=u.uniformBuffer.getBuffer(),_=d.uniqueId+"-"+f.uniqueId;let p=this._bindGroups[_];if(!p){const b=u.bindGroupLayouts[0];p=this._bindGroups[_]=[],p.push(this._device.createBindGroup({label:"clearQuadBindGroup0-".concat(_),layout:b[0],entries:[]})),ni._SimplifiedKnownBindings||p.push(this._device.createBindGroup({label:"clearQuadBindGroup1-".concat(_),layout:b[1],entries:[]})),p.push(this._device.createBindGroup({label:"clearQuadBindGroup".concat(ni._SimplifiedKnownBindings?1:2,"-").concat(_),layout:b[ni._SimplifiedKnownBindings?1:2],entries:[{binding:0,resource:{buffer:f.underlyingResource,size:f.capacity}},{binding:1,resource:{buffer:d.underlyingResource,size:d.capacity}}]}))}r.setPipeline(c);for(let b=0;b{const n=new BigUint64Array(i.getMappedRange()).slice();return i.unmap(),this._dstBuffers[this._dstBuffers.length]=i,n},n=>{if(this._engine.isDisposed||this._engine.uniqueId!==s)return null;throw n})}async readValue(e=0){const t=this._getBuffer(e,1);if(t===null)return null;const i=this._engine.uniqueId;return t.mapAsync(1).then(()=>{const s=new BigUint64Array(t.getMappedRange()),n=Number(s[0]);return t.unmap(),this._dstBuffers[this._dstBuffers.length]=t,n},s=>{if(this._engine.isDisposed||this._engine.uniqueId!==i)return 0;throw s})}async readTwoValuesAndSubtract(e=0){const t=this._getBuffer(e,2);if(t===null)return null;const i=this._engine.uniqueId;return t.mapAsync(1).then(()=>{const s=new BigUint64Array(t.getMappedRange()),n=Number(s[1]-s[0]);return t.unmap(),this._dstBuffers[this._dstBuffers.length]=t,n},s=>{if(this._engine.isDisposed||this._engine.uniqueId!==i)return 0;throw s})}dispose(){this._querySet.destroy(),this._bufferManager.releaseBuffer(this._queryBuffer);for(let e=0;e{t!==null&&t>=0&&(this._gpuFrameTimeCounter.fetchNewFrame(),this._gpuFrameTimeCounter.addCount(t,!0)),this._measureDurationState=0}))}startPass(e,t){this._enabled?this._measureDuration.startPass(e,t):e.timestampWrites=void 0}endPass(e,t){if(!this._enabled||!t)return;const i=this._engine.frameId;this._measureDuration.stopPass(e).then(s=>{t._addDuration(i,s!==null&&s>0?s:0)})}dispose(){var e;(e=this._measureDuration)==null||e.dispose()}}class xp{constructor(e,t,i,s=2,n){this._count=s,this._querySet=new Ac(e,s,"timestamp",t,i,!0,n)}start(e){var t;(t=e.writeTimestamp)==null||t.call(e,this._querySet.querySet,0)}async stop(e){var t;return(t=e.writeTimestamp)==null||t.call(e,this._querySet.querySet,1),e.writeTimestamp?this._querySet.readTwoValuesAndSubtract(0):0}startPass(e,t){if(t+3>this._count)throw new Error("WebGPUDurationMeasure: index out of range ("+t+")");e.timestampWrites={querySet:this._querySet.querySet,beginningOfPassWriteIndex:t+2,endOfPassWriteIndex:t+3}}async stopPass(e){return this._querySet.readTwoValuesAndSubtract(e+2)}dispose(){this._querySet.dispose()}}class yp{get querySet(){return this._querySet.querySet}get hasQueries(){return this._currentTotalIndices!==this._availableIndices.length}canBeginQuery(e){if(this._frameQuerySetIsDirty===this._engine.frameId||this._queryFrameId[e]===this._engine.frameId)return!1;const t=this._engine._getCurrentRenderPassWrapper().renderPassDescriptor.occlusionQuerySet!==void 0;return t&&(this._queryFrameId[e]=this._engine.frameId),t}constructor(e,t,i,s=50,n=100){this._availableIndices=[],this._frameQuerySetIsDirty=-1,this._queryFrameId=[],this._engine=e,this._device=t,this._bufferManager=i,this._frameLastBuffer=-1,this._currentTotalIndices=0,this._countIncrement=n,this._allocateNewIndices(s)}createQuery(){this._availableIndices.length===0&&this._allocateNewIndices();const e=this._availableIndices[this._availableIndices.length-1];return this._availableIndices.length--,e}deleteQuery(e){this._availableIndices[this._availableIndices.length]=e}isQueryResultAvailable(e){return this._retrieveQueryBuffer(),!!this._lastBuffer&&e{this._lastBuffer=e}))}_allocateNewIndices(e){e=e!=null?e:this._countIncrement,this._delayQuerySetDispose();for(let t=0;te.dispose,1e3)}dispose(){var e;(e=this._querySet)==null||e.dispose(),this._availableIndices.length=0}}class Hr{get code(){return this._sourceCode}constructor(e,t=20){this.debug=!1,this._sourceCode=e,this._numMaxIterations=t,this._functionDescr=[],this.inlineToken="#define inline"}processCode(){this.debug&&U.Log("Start inlining process (code size=".concat(this._sourceCode.length,")...")),this._collectFunctions(),this._processInlining(this._numMaxIterations),this.debug&&U.Log("End of inlining process.")}_collectFunctions(){let e=0;for(;e=0&&d.push(m.substring(b+1))}n!=="void"&&d.push("return"),this._functionDescr.push({name:r,type:n,parameters:d,body:u,callIndex:0}),e=c+1;const _=t>0?this._sourceCode.substring(0,t):"",p=c+1=0}_replaceFunctionCallsByCode(){let e=!1;for(const t of this._functionDescr){const{name:i,type:s,parameters:n,body:r}=t;let o=0;for(;o{const c=l[0];return va(e.charAt(c-1))||va(e.charAt(c+r))?t[s]:o})}return e}}Hr._RegexpFindFunctionNameAndType=/((\s+?)(\w+)\s+(\w+)\s*?)$/;class ei{async initTwgsl(e){if(!ei._Twgsl)return e=e||{},e={...ei._TWgslDefaultOptions,...e},e.twgsl?(ei._Twgsl=e.twgsl,Promise.resolve()):(e.jsPath&&e.wasmPath&&await J.LoadBabylonScriptAsync(e.jsPath),self.twgsl?(ei._Twgsl=await self.twgsl(J.GetBabylonScriptURL(e.wasmPath)),Promise.resolve()):Promise.reject("twgsl is not available."))}convertSpirV2WGSL(e,t=!1){const i=ei._Twgsl.convertSpirV2WGSL(e,ei.DisableUniformityAnalysis||t);return ei.ShowWGSLShaderCode&&(U.Log(i),U.Log("***********************************************")),ei.DisableUniformityAnalysis||t?"diagnostic(off, derivative_uniformity);\n"+i:i}}ei._TWgslDefaultOptions={jsPath:"".concat(J._DefaultCdnUrl,"/twgsl/twgsl.js"),wasmPath:"".concat(J._DefaultCdnUrl,"/twgsl/twgsl.wasm")};ei.ShowWGSLShaderCode=!1;ei.DisableUniformityAnalysis=!1;ei._Twgsl=null;class Tp{constructor(e,t,i){this._record=!1,this._play=!1,this._playBundleListIndex=0,this._allBundleLists=[],this._enabled=!1,this._engine=e,this._mode=t,this._bundleList=i}get enabled(){return this._enabled}get play(){return this._play}get record(){return this._record}set enabled(e){this._allBundleLists.length=0,this._record=this._enabled=e,this._play=!1,e&&(this._modeSaved=this._mode,this._mode=0)}get mode(){return this._mode}set mode(e){this._record?this._modeSaved=e:this._mode=e}endRenderPass(e){if(!this._record&&!this._play)return!1;let t;if(this._record)t=this._bundleList.clone(),this._allBundleLists.push(t),this._bundleList.reset();else{if(this._playBundleListIndex>=this._allBundleLists.length)throw new Error("Invalid playBundleListIndex! Your snapshot is no longer valid for the current frame, you should recreate a new one. playBundleListIndex=".concat(this._playBundleListIndex,", allBundleLists.length=").concat(this._allBundleLists.length,"}"));t=this._allBundleLists[this._playBundleListIndex++]}return t.run(e),this._mode===1&&this._engine._reportDrawCall(t.numDrawCalls),!0}endFrame(){this._record&&(this._record=!1,this._play=!0,this._mode=this._modeSaved),this._playBundleListIndex=0}reset(){this._record&&(this._mode=this._modeSaved),this.enabled=!1,this.enabled=!0}}const xn=(()=>{const a=new Uint8Array(4),e=new Uint32Array(a.buffer);return!!((e[0]=1)&a[0])})();Object.defineProperty(A.prototype,"effectiveByteStride",{get:function(){return this._alignedBuffer&&this._alignedBuffer.byteStride||this.byteStride},enumerable:!0,configurable:!0});Object.defineProperty(A.prototype,"effectiveByteOffset",{get:function(){return this._alignedBuffer?0:this.byteOffset},enumerable:!0,configurable:!0});Object.defineProperty(A.prototype,"effectiveBuffer",{get:function(){return this._alignedBuffer&&this._alignedBuffer.getBuffer()||this._buffer.getBuffer()},enumerable:!0,configurable:!0});A.prototype._rebuild=function(){var a,e;(a=this._buffer)==null||a._rebuild(),(e=this._alignedBuffer)==null||e._rebuild()};A.prototype.dispose=function(){var a;this._ownsBuffer&&this._buffer.dispose(),(a=this._alignedBuffer)==null||a.dispose(),this._alignedBuffer=void 0,this._isDisposed=!0};A.prototype.getWrapperBuffer=function(){return this._alignedBuffer||this._buffer};A.prototype._alignBuffer=function(){var u,f;const a=this._buffer.getData();if(!this.engine._features.forceVertexBufferStrideAndOffsetMultiple4Bytes||this.byteStride%4===0&&this.byteOffset%4===0||!a)return;const e=A.GetTypeByteLength(this.type),t=this.byteStride+3&-4,i=t/e,s=this._maxVerticesCount,r=s*t/e;let o;if(Array.isArray(a)){const d=new Float32Array(a);o=new DataView(d.buffer,d.byteOffset,d.byteLength)}else a instanceof ArrayBuffer?o=new DataView(a,0,a.byteLength):o=new DataView(a.buffer,a.byteOffset,a.byteLength);let h;this.type===A.BYTE?h=new Int8Array(r):this.type===A.UNSIGNED_BYTE?h=new Uint8Array(r):this.type===A.SHORT?h=new Int16Array(r):this.type===A.UNSIGNED_SHORT?h=new Uint16Array(r):this.type===A.INT?h=new Int32Array(r):this.type===A.UNSIGNED_INT?h=new Uint32Array(r):h=new Float32Array(r);const l=this.getSize();let c=this.byteOffset;for(let d=0;d{e==null||e.removePendingData(f),l&&p&&l(p.status+" "+p.statusText,g)},_=p=>{const g=f.width,m=r(p);if(m){if(o){const b=i===4,I=o(m),T=f._hardwareTexture,x=[0,1,2,3,4,5];for(let y=0;y>y,E=[];for(let C=0;C<6;C++){let S=I[y][x[C]];b&&(S=qn(S,R,R,s)),E.push(new Uint8Array(S.buffer,S.byteOffset,S.byteLength))}this._textureHelper.updateCubeTextures(E,T.underlyingResource,R,R,T.format,u,!1,0,0)}}else this.updateRawCubeTexture(f,m,i,s,u);f.isReady=!0,e==null||e.removePendingData(f),h&&h()}};return this._loadFile(a,p=>{_(p)},void 0,e==null?void 0:e.offlineProvider,!0,d),f};et.prototype.createRawTexture3D=function(a,e,t,i,s,n,r,o,h=null,l=0,c=0){const f=new ft(this,10);return f.baseWidth=e,f.baseHeight=t,f.baseDepth=i,f.width=e,f.height=t,f.depth=i,f.format=s,f.type=l,f.generateMipMaps=n,f.samplingMode=o,f.is3D=!0,f._creationFlags=c,this._doNotHandleContextLost||(f._bufferView=a),this._textureHelper.createGPUTextureForInternalTexture(f,e,t,void 0,c),this.updateRawTexture3D(f,a,s,r,h,l),this._internalTexturesCache.push(f),f};et.prototype.updateRawTexture3D=function(a,e,t,i,s=null,n=0){if(this._doNotHandleContextLost||(a._bufferView=e,a.format=t,a.invertY=i,a._compression=s),e){const r=a._hardwareTexture;t===4&&(e=qn(e,a.width,a.height,n));const h=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this._textureHelper.updateTexture(h,a,a.width,a.height,a.depth,r.format,0,0,i,!1,0,0),a.generateMipMaps&&this._generateMipmaps(a,this._uploadEncoder)}a.isReady=!0};et.prototype.createRawTexture2DArray=function(a,e,t,i,s,n,r,o,h=null,l=0,c=0){const f=new ft(this,11);return f.baseWidth=e,f.baseHeight=t,f.baseDepth=i,f.width=e,f.height=t,f.depth=i,f.format=s,f.type=l,f.generateMipMaps=n,f.samplingMode=o,f.is2DArray=!0,f._creationFlags=c,this._doNotHandleContextLost||(f._bufferView=a),this._textureHelper.createGPUTextureForInternalTexture(f,e,t,i,c),this.updateRawTexture2DArray(f,a,s,r,h,l),this._internalTexturesCache.push(f),f};et.prototype.updateRawTexture2DArray=function(a,e,t,i,s=null,n=0){if(this._doNotHandleContextLost||(a._bufferView=e,a.format=t,a.invertY=i,a._compression=s),e){const r=a._hardwareTexture;t===4&&(e=qn(e,a.width,a.height,n));const h=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this._textureHelper.updateTexture(h,a,a.width,a.height,a.depth,r.format,0,0,i,!1,0,0),a.generateMipMaps&&this._generateMipmaps(a,this._uploadEncoder)}a.isReady=!0};function qn(a,e,t,i){let s,n=1;i===1?s=new Float32Array(e*t*4):i===2?(s=new Uint16Array(e*t*4),n=15360):i===7?s=new Uint32Array(e*t*4):s=new Uint8Array(e*t*4);for(let r=0;r{const m=g,b=m[0].width,I=b;this._setCubeMapTextureParams(p,!i),p.format=r!=null?r:-1;const T=this._textureHelper.createGPUTextureForInternalTexture(p,b,I);this._textureHelper.updateCubeTextures(m,T.underlyingResource,b,I,T.format,!1,!1,0,0),i||this._generateMipmaps(p,this._uploadEncoder),p.isReady=!0,p.onLoadedObservable.notifyObservers(p),p.onLoadedObservable.clear(),s&&s()},!!d,_)};et.prototype._setCubeMapTextureParams=function(a,e,t){a.samplingMode=e?3:2,a._cachedWrapU=0,a._cachedWrapV=0,t&&(a._maxLodLevel=t)};et.prototype.generateMipMapsForCubemap=function(a){var e;a.generateMipMaps&&((e=a._hardwareTexture)!=null&&e.underlyingResource||this._textureHelper.createGPUTextureForInternalTexture(a),this._generateMipmaps(a))};class Rp extends Zl{constructor(e,t,i,s,n){super(e,t,i,s,n),s.enableGPUTimingMeasurements&&(this.gpuTimeInFrame=new gc)}}et.prototype._createHardwareRenderTargetWrapper=function(a,e,t){const i=new Rp(a,e,t,this);return this._renderTargetWrapperCache.push(i),i};et.prototype.createRenderTargetTexture=function(a,e){var n,r,o,h,l;const t=this._createHardwareRenderTargetWrapper(!1,!1,a),i={};e!==void 0&&typeof e=="object"?(i.generateMipMaps=e.generateMipMaps,i.generateDepthBuffer=e.generateDepthBuffer===void 0?!0:e.generateDepthBuffer,i.generateStencilBuffer=i.generateDepthBuffer&&e.generateStencilBuffer,i.samplingMode=e.samplingMode===void 0?3:e.samplingMode,i.creationFlags=(n=e.creationFlags)!=null?n:0,i.noColorAttachment=!!e.noColorAttachment,i.colorAttachment=e.colorAttachment,i.samples=e.samples,i.label=e.label,i.format=e.format,i.type=e.type):(i.generateMipMaps=e,i.generateDepthBuffer=!0,i.generateStencilBuffer=!1,i.samplingMode=3,i.creationFlags=0,i.noColorAttachment=!1);const s=i.colorAttachment||(i.noColorAttachment?null:this._createInternalTexture(a,i,!0,5));return t.label=(r=i.label)!=null?r:"RenderTargetWrapper",t._samples=(l=(h=(o=i.colorAttachment)==null?void 0:o.samples)!=null?h:i.samples)!=null?l:1,t._generateDepthBuffer=i.generateDepthBuffer,t._generateStencilBuffer=!!i.generateStencilBuffer,t.setTextures(s),(t._generateDepthBuffer||t._generateStencilBuffer)&&t.createDepthStencilTexture(0,!1,t._generateStencilBuffer,t.samples,i.generateStencilBuffer?13:14,i.label?i.label+"-DepthStencil":void 0),s&&!i.colorAttachment&&(e!==void 0&&typeof e=="object"&&e.createMipMaps&&!i.generateMipMaps&&(s.generateMipMaps=!0),this._textureHelper.createGPUTextureForInternalTexture(s,void 0,void 0,void 0,i.creationFlags),e!==void 0&&typeof e=="object"&&e.createMipMaps&&!i.generateMipMaps&&(s.generateMipMaps=!1)),t};et.prototype._createDepthStencilTexture=function(a,e,t){const i={bilinearFiltering:!1,comparisonFunction:0,samples:1,depthTextureFormat:e.generateStencil?13:14,...e},s=i.depthTextureFormat===17||i.depthTextureFormat===13||i.depthTextureFormat===18;t._depthStencilTextureWithStencil=s;const n=new ft(this,s?12:14);return n.label=e.label,n.format=i.depthTextureFormat,n.type=id(n.format),this._setupDepthStencilTexture(n,a,i.bilinearFiltering,i.comparisonFunction,i.samples),this._textureHelper.createGPUTextureForInternalTexture(n),this._internalTexturesCache.push(n),n};et.prototype._setupDepthStencilTexture=function(a,e,t,i,s=1){var l,c;const n=(l=e.width)!=null?l:e,r=(c=e.height)!=null?c:e,o=e.layers||0,h=e.depth||0;a.baseWidth=n,a.baseHeight=r,a.width=n,a.height=r,a.is2DArray=o>0,a.is3D=h>0,a.depth=o||h,a.isReady=!0,a.samples=s,a.generateMipMaps=!1,a.samplingMode=t?2:1,a.type=1,a._comparisonFunction=i,a._cachedWrapU=0,a._cachedWrapV=0};et.prototype.updateRenderTargetTextureSampleCount=function(a,e){return!a||!a.texture||a.samples===e||(e=Math.min(e,this.getCaps().maxMSAASamples),this._textureHelper.createMSAATexture(a.texture,e),a._depthStencilTexture&&(this._textureHelper.createMSAATexture(a._depthStencilTexture,e),a._depthStencilTexture.samples=e),a._samples=e,a.texture.samples=e),e};et.prototype.setDepthStencilTexture=function(a,e,t,i){!t||!t.depthStencilTexture?this._setTexture(a,null,void 0,void 0,i):this._setTexture(a,t,!1,!0,i)};et.prototype.createRenderTargetCubeTexture=function(a,e){var n;const t=this._createHardwareRenderTargetWrapper(!1,!0,a),i={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,samples:1,...e};i.generateStencilBuffer=i.generateDepthBuffer&&i.generateStencilBuffer,t.label=(n=i.label)!=null?n:"RenderTargetWrapper",t._generateDepthBuffer=i.generateDepthBuffer,t._generateStencilBuffer=i.generateStencilBuffer;const s=new ft(this,5);return s.width=a,s.height=a,s.depth=0,s.isReady=!0,s.isCube=!0,s.samples=i.samples,s.generateMipMaps=i.generateMipMaps,s.samplingMode=i.samplingMode,s.type=i.type,s.format=i.format,this._internalTexturesCache.push(s),t.setTextures(s),(t._generateDepthBuffer||t._generateStencilBuffer)&&t.createDepthStencilTexture(0,i.samplingMode===void 0||i.samplingMode===2||i.samplingMode===2||i.samplingMode===3||i.samplingMode===3||i.samplingMode===5||i.samplingMode===6||i.samplingMode===7||i.samplingMode===11,t._generateStencilBuffer,t.samples),e&&e.createMipMaps&&!i.generateMipMaps&&(s.generateMipMaps=!0),this._textureHelper.createGPUTextureForInternalTexture(s),e&&e.createMipMaps&&!i.generateMipMaps&&(s.generateMipMaps=!1),t};function Ga(a,e,t){try{const i=a.next();i.done?e(i):i.value?i.value.then(()=>{i.value=void 0,e(i)},t):e(i)}catch(i){t(i)}}function Ip(a=25){let e;return(t,i,s)=>{const n=performance.now();e===void 0||n-e>a?(e=n,setTimeout(()=>{Ga(t,i,s)},0)):Ga(t,i,s)}}function Rc(a,e,t,i,s){const n=()=>{let r;const o=h=>{h.done?t(h.value):r===void 0?r=!0:n()};do r=void 0,e(a,o,i),r===void 0&&(r=!1);while(r)};n()}function F0(a,e){let t;return Rc(a,Ga,i=>t=i,i=>{throw i}),t}function Ep(a,e,t){return new Promise((i,s)=>{Rc(a,e,i,s)})}function Cp(a,e){return(...t)=>F0(a(...t))}class za{constructor(e,t,i){this.bu=e,this.bv=t,this.distance=i,this.faceId=0,this.subMeshId=0}}class is{constructor(e,t,i){this.vectors=zi(8,v.Zero),this.center=v.Zero(),this.centerWorld=v.Zero(),this.extendSize=v.Zero(),this.extendSizeWorld=v.Zero(),this.directions=zi(3,v.Zero),this.vectorsWorld=zi(8,v.Zero),this.minimumWorld=v.Zero(),this.maximumWorld=v.Zero(),this.minimum=v.Zero(),this.maximum=v.Zero(),this._drawWrapperFront=null,this._drawWrapperBack=null,this.reConstruct(e,t,i)}reConstruct(e,t,i){const s=e.x,n=e.y,r=e.z,o=t.x,h=t.y,l=t.z,c=this.vectors;this.minimum.copyFromFloats(s,n,r),this.maximum.copyFromFloats(o,h,l),c[0].copyFromFloats(s,n,r),c[1].copyFromFloats(o,h,l),c[2].copyFromFloats(o,n,r),c[3].copyFromFloats(s,h,r),c[4].copyFromFloats(s,n,l),c[5].copyFromFloats(o,h,r),c[6].copyFromFloats(s,h,l),c[7].copyFromFloats(o,n,l),t.addToRef(e,this.center).scaleInPlace(.5),t.subtractToRef(e,this.extendSize).scaleInPlace(.5),this._worldMatrix=i||O.IdentityReadOnly,this._update(this._worldMatrix)}scale(e){const t=is._TmpVector3,i=this.maximum.subtractToRef(this.minimum,t[0]),s=i.length();i.normalizeFromLength(s);const n=s*e,r=i.scaleInPlace(n*.5),o=this.center.subtractToRef(r,t[1]),h=this.center.addToRef(r,t[2]);return this.reConstruct(o,h,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){const t=this.minimumWorld,i=this.maximumWorld,s=this.directions,n=this.vectorsWorld,r=this.vectors;if(e.isIdentity()){t.copyFrom(this.minimum),i.copyFrom(this.maximum);for(let o=0;o<8;++o)n[o].copyFrom(r[o]);this.extendSizeWorld.copyFrom(this.extendSize),this.centerWorld.copyFrom(this.center)}else{t.setAll(Number.MAX_VALUE),i.setAll(-Number.MAX_VALUE);for(let o=0;o<8;++o){const h=n[o];v.TransformCoordinatesToRef(r[o],e,h),t.minimizeInPlace(h),i.maximizeInPlace(h)}i.subtractToRef(t,this.extendSizeWorld).scaleInPlace(.5),i.addToRef(t,this.centerWorld).scaleInPlace(.5)}v.FromArrayToRef(e.m,0,s[0]),v.FromArrayToRef(e.m,4,s[1]),v.FromArrayToRef(e.m,8,s[2]),this._worldMatrix=e}isInFrustum(e){return is.IsInFrustum(this.vectorsWorld,e)}isCompletelyInFrustum(e){return is.IsCompletelyInFrustum(this.vectorsWorld,e)}intersectsPoint(e){const t=this.minimumWorld,i=this.maximumWorld,s=t.x,n=t.y,r=t.z,o=i.x,h=i.y,l=i.z,c=e.x,u=e.y,f=e.z,d=-.001;return!(o-cc-s||h-uu-n||l-ff-r)}intersectsSphere(e){return is.IntersectsSphere(this.minimumWorld,this.maximumWorld,e.centerWorld,e.radiusWorld)}intersectsMinMax(e,t){const i=this.minimumWorld,s=this.maximumWorld,n=i.x,r=i.y,o=i.z,h=s.x,l=s.y,c=s.z,u=e.x,f=e.y,d=e.z,_=t.x,p=t.y,g=t.z;return!(h_||lp||cg)}dispose(){var e,t;(e=this._drawWrapperFront)==null||e.dispose(),(t=this._drawWrapperBack)==null||t.dispose()}static Intersects(e,t){return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)}static IntersectsSphere(e,t,i,s){const n=is._TmpVector3[0];return v.ClampToRef(i,e,t,n),v.DistanceSquared(i,n)<=s*s}static IsCompletelyInFrustum(e,t){for(let i=0;i<6;++i){const s=t[i];for(let n=0;n<8;++n)if(s.dotCoordinate(e[n])<0)return!1}return!0}static IsInFrustum(e,t){for(let i=0;i<6;++i){let s=!0;const n=t[i];for(let r=0;r<8;++r)if(n.dotCoordinate(e[r])>=0){s=!1;break}if(s)return!1}return!0}}is._TmpVector3=zi(3,v.Zero);class Ls{constructor(e,t,i){this.center=v.Zero(),this.centerWorld=v.Zero(),this.minimum=v.Zero(),this.maximum=v.Zero(),this.reConstruct(e,t,i)}reConstruct(e,t,i){this.minimum.copyFrom(e),this.maximum.copyFrom(t);const s=v.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=s*.5,this._update(i||O.IdentityReadOnly)}scale(e){const t=this.radius*e,i=Ls._TmpVector3,s=i[0].setAll(t),n=this.center.subtractToRef(s,i[1]),r=this.center.addToRef(s,i[2]);return this.reConstruct(n,r,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){if(e.isIdentity())this.centerWorld.copyFrom(this.center),this.radiusWorld=this.radius;else{v.TransformCoordinatesToRef(this.center,e,this.centerWorld);const t=Ls._TmpVector3[0];v.TransformNormalFromFloatsToRef(1,1,1,e,t),this.radiusWorld=Math.max(Math.abs(t.x),Math.abs(t.y),Math.abs(t.z))*this.radius}}isInFrustum(e){const t=this.centerWorld,i=this.radiusWorld;for(let s=0;s<6;s++)if(e[s].dotCoordinate(t)<=-i)return!1;return!0}isCenterInFrustum(e){const t=this.centerWorld;for(let i=0;i<6;i++)if(e[i].dotCoordinate(t)<0)return!1;return!0}intersectsPoint(e){const t=v.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorld{const i=v.Dot(e.centerWorld,a),s=Math.abs(v.Dot(e.directions[0],a))*e.extendSize.x,n=Math.abs(v.Dot(e.directions[1],a))*e.extendSize.y,r=Math.abs(v.Dot(e.directions[2],a))*e.extendSize.z,o=s+n+r;t.min=i-o,t.max=i+o},qt=(a,e,t)=>(Ph(a,e,xa),Ph(a,t,ya),!(xa.min>ya.max||ya.min>xa.max));class ri{constructor(e,t,i){this._isLocked=!1,this.boundingBox=new is(e,t,i),this.boundingSphere=new Ls(e,t,i)}reConstruct(e,t,i){this.boundingBox.reConstruct(e,t,i),this.boundingSphere.reConstruct(e,t,i)}get minimum(){return this.boundingBox.minimum}get maximum(){return this.boundingBox.maximum}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked=e}update(e){this._isLocked||(this.boundingBox._update(e),this.boundingSphere._update(e))}centerOn(e,t){const i=ri._TmpVector3[0].copyFrom(e).subtractInPlace(t),s=ri._TmpVector3[1].copyFrom(e).addInPlace(t);return this.boundingBox.reConstruct(i,s,this.boundingBox.getWorldMatrix()),this.boundingSphere.reConstruct(i,s,this.boundingBox.getWorldMatrix()),this}encapsulate(e){const t=v.Minimize(this.minimum,e),i=v.Maximize(this.maximum,e);return this.reConstruct(t,i,this.boundingBox.getWorldMatrix()),this}encapsulateBoundingInfo(e){const t=N.Matrix[0];this.boundingBox.getWorldMatrix().invertToRef(t);const i=N.Vector3[0];return v.TransformCoordinatesToRef(e.boundingBox.minimumWorld,t,i),this.encapsulate(i),v.TransformCoordinatesToRef(e.boundingBox.maximumWorld,t,i),this.encapsulate(i),this}scale(e){return this.boundingBox.scale(e),this.boundingSphere.scale(e),this}isInFrustum(e,t=0){return(t===2||t===3)&&this.boundingSphere.isCenterInFrustum(e)?!0:this.boundingSphere.isInFrustum(e)?t===1||t===3?!0:this.boundingBox.isInFrustum(e):!1}get diagonalLength(){const e=this.boundingBox;return e.maximumWorld.subtractToRef(e.minimumWorld,ri._TmpVector3[0]).length()}isCompletelyInFrustum(e){return this.boundingBox.isCompletelyInFrustum(e)}_checkCollision(e){return e._canDoCollision(this.boundingSphere.centerWorld,this.boundingSphere.radiusWorld,this.boundingBox.minimumWorld,this.boundingBox.maximumWorld)}intersectsPoint(e){return!(!this.boundingSphere.centerWorld||!this.boundingSphere.intersectsPoint(e)||!this.boundingBox.intersectsPoint(e))}intersects(e,t){if(!Ls.Intersects(this.boundingSphere,e.boundingSphere)||!is.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;const i=this.boundingBox,s=e.boundingBox;return!(!qt(i.directions[0],i,s)||!qt(i.directions[1],i,s)||!qt(i.directions[2],i,s)||!qt(s.directions[0],i,s)||!qt(s.directions[1],i,s)||!qt(s.directions[2],i,s)||!qt(v.Cross(i.directions[0],s.directions[0]),i,s)||!qt(v.Cross(i.directions[0],s.directions[1]),i,s)||!qt(v.Cross(i.directions[0],s.directions[2]),i,s)||!qt(v.Cross(i.directions[1],s.directions[0]),i,s)||!qt(v.Cross(i.directions[1],s.directions[1]),i,s)||!qt(v.Cross(i.directions[1],s.directions[2]),i,s)||!qt(v.Cross(i.directions[2],s.directions[0]),i,s)||!qt(v.Cross(i.directions[2],s.directions[1]),i,s)||!qt(v.Cross(i.directions[2],s.directions[2]),i,s))}}ri._TmpVector3=zi(2,v.Zero);class Kr{static extractMinAndMaxIndexed(e,t,i,s,n,r){for(let o=i;o!Array.isArray(a)&&!Array.isArray(e))],Kr,"extractMinAndMaxIndexed",null);D([rs.filter((...[a])=>!Array.isArray(a))],Kr,"extractMinAndMax",null);function Sp(a,e,t,i,s=null){const n=new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new v(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return Kr.extractMinAndMaxIndexed(a,e,t,i,n,r),s&&(n.x-=n.x*s.x+s.y,n.y-=n.y*s.x+s.y,n.z-=n.z*s.x+s.y,r.x+=r.x*s.x+s.y,r.y+=r.y*s.x+s.y,r.z+=r.z*s.x+s.y),{minimum:n,maximum:r}}function Ic(a,e,t,i=null,s){const n=new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new v(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return s||(s=3),Kr.extractMinAndMax(a,e,t,s,n,r),i&&(n.x-=n.x*i.x+i.y,n.y-=n.y*i.x+i.y,n.z-=n.z*i.x+i.y,r.x+=r.x*i.x+i.y,r.y+=r.y*i.x+i.y,r.z+=r.z*i.x+i.y),{minimum:n,maximum:r}}class vi{get materialDefines(){var e;return this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.defines:(e=this._getDrawWrapper())==null?void 0:e.defines}set materialDefines(e){var i;const t=(i=this._mainDrawWrapperOverride)!=null?i:this._getDrawWrapper(void 0,!0);t.defines=e}_getDrawWrapper(e,t=!1){e=e!=null?e:this._engine.currentRenderPassId;let i=this._drawWrappers[e];return!i&&t&&(this._drawWrappers[e]=i=new Xn(this._mesh.getScene().getEngine())),i}_removeDrawWrapper(e,t=!0,i=!1){var s;t&&((s=this._drawWrappers[e])==null||s.dispose(i)),this._drawWrappers[e]=void 0}get effect(){var e,t;return this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.effect:(t=(e=this._getDrawWrapper())==null?void 0:e.effect)!=null?t:null}get _drawWrapper(){var e;return(e=this._mainDrawWrapperOverride)!=null?e:this._getDrawWrapper(void 0,!0)}get _drawWrapperOverride(){return this._mainDrawWrapperOverride}_setMainDrawWrapperOverride(e){this._mainDrawWrapperOverride=e}setEffect(e,t=null,i,s=!0){const n=this._drawWrapper;n.setEffect(e,t,s),i!==void 0&&(n.materialContext=i),e||(n.defines=null,n.materialContext=void 0)}resetDrawCache(e,t=!1){if(this._drawWrappers)if(e!==void 0){this._removeDrawWrapper(e,!0,t);return}else for(const i of this._drawWrappers)i==null||i.dispose(t);this._drawWrappers=[]}static AddToMesh(e,t,i,s,n,r,o,h=!0){return new vi(e,t,i,s,n,r,o,h)}constructor(e,t,i,s,n,r,o,h=!0,l=!0){this.materialIndex=e,this.verticesStart=t,this.verticesCount=i,this.indexStart=s,this.indexCount=n,this._mainDrawWrapperOverride=null,this._linesIndexCount=0,this._linesIndexBuffer=null,this._lastColliderWorldVertices=null,this._lastColliderTransformMatrix=null,this._wasDispatched=!1,this._renderId=0,this._alphaIndex=0,this._distanceToCamera=0,this._currentMaterial=null,this._mesh=r,this._renderingMesh=o||r,l&&r.subMeshes.push(this),this._engine=this._mesh.getScene().getEngine(),this.resetDrawCache(),this._trianglePlanes=[],this._id=r.subMeshes.length-1,h&&(this.refreshBoundingInfo(),r.computeWorldMatrix(!0))}get IsGlobal(){return this.verticesStart===0&&this.verticesCount===this._mesh.getTotalVertices()&&this.indexStart===0&&this.indexCount===this._mesh.getTotalIndices()}getBoundingInfo(){return this.IsGlobal||this._mesh.hasThinInstances?this._mesh.getBoundingInfo():this._boundingInfo}setBoundingInfo(e){return this._boundingInfo=e,this}getMesh(){return this._mesh}getRenderingMesh(){return this._renderingMesh}getReplacementMesh(){return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null}getEffectiveMesh(){const e=this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null;return e||this._renderingMesh}getMaterial(e=!0){var i;const t=(i=this._renderingMesh.getMaterialForRenderPass(this._engine.currentRenderPassId))!=null?i:this._renderingMesh.material;if(t){if(this._isMultiMaterial(t)){const s=t.getSubMaterial(this.materialIndex);return this._currentMaterial!==s&&(this._currentMaterial=s,this.resetDrawCache()),s}}else return e?this._mesh.getScene().defaultMaterial:null;return t}_isMultiMaterial(e){return e.getSubMaterial!==void 0}refreshBoundingInfo(e=null){if(this._lastColliderWorldVertices=null,this.IsGlobal||!this._renderingMesh||!this._renderingMesh.geometry)return this;if(e||(e=this._renderingMesh.getVerticesData(A.PositionKind)),!e)return this._boundingInfo=this._mesh.getBoundingInfo(),this;const t=this._renderingMesh.getIndices();let i;if(this.indexStart===0&&this.indexCount===t.length){const s=this._renderingMesh.getBoundingInfo();i={minimum:s.minimum.clone(),maximum:s.maximum.clone()}}else i=Sp(e,t,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new ri(i.minimum,i.maximum),this}_checkCollision(e){return this.getBoundingInfo()._checkCollision(e)}updateBoundingInfo(e){let t=this.getBoundingInfo();return t||(this.refreshBoundingInfo(),t=this.getBoundingInfo()),t&&t.update(e),this}isInFrustum(e){const t=this.getBoundingInfo();return t?t.isInFrustum(e,this._mesh.cullingStrategy):!1}isCompletelyInFrustum(e){const t=this.getBoundingInfo();return t?t.isCompletelyInFrustum(e):!1}render(e){return this._renderingMesh.render(this,e,this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:void 0),this}_getLinesIndexBuffer(e,t){if(!this._linesIndexBuffer){const i=[];for(let s=this.indexStart;sh&&(h=f)}return new vi(e,o,h-o+1,t,i,s,n,r)}}class Ta{}class j{constructor(){this.uniqueId=0,this.metadata={},this._applyTo=Cp(this._applyToCoroutine.bind(this)),this.uniqueId=j._UniqueIDGenerator,j._UniqueIDGenerator++}set(e,t){switch(e.length||U.Warn("Setting vertex data kind '".concat(t,"' with an empty array")),t){case A.PositionKind:this.positions=e;break;case A.NormalKind:this.normals=e;break;case A.TangentKind:this.tangents=e;break;case A.UVKind:this.uvs=e;break;case A.UV2Kind:this.uvs2=e;break;case A.UV3Kind:this.uvs3=e;break;case A.UV4Kind:this.uvs4=e;break;case A.UV5Kind:this.uvs5=e;break;case A.UV6Kind:this.uvs6=e;break;case A.ColorKind:this.colors=e;break;case A.MatricesIndicesKind:this.matricesIndices=e;break;case A.MatricesWeightsKind:this.matricesWeights=e;break;case A.MatricesIndicesExtraKind:this.matricesIndicesExtra=e;break;case A.MatricesWeightsExtraKind:this.matricesWeightsExtra=e;break}}applyToMesh(e,t){return this._applyTo(e,t,!1),this}applyToGeometry(e,t){return this._applyTo(e,t,!1),this}updateMesh(e){return this._update(e),this}updateGeometry(e){return this._update(e),this}*_applyToCoroutine(e,t=!1,i){if(this.positions&&(e.setVerticesData(A.PositionKind,this.positions,t),i&&(yield)),this.normals&&(e.setVerticesData(A.NormalKind,this.normals,t),i&&(yield)),this.tangents&&(e.setVerticesData(A.TangentKind,this.tangents,t),i&&(yield)),this.uvs&&(e.setVerticesData(A.UVKind,this.uvs,t),i&&(yield)),this.uvs2&&(e.setVerticesData(A.UV2Kind,this.uvs2,t),i&&(yield)),this.uvs3&&(e.setVerticesData(A.UV3Kind,this.uvs3,t),i&&(yield)),this.uvs4&&(e.setVerticesData(A.UV4Kind,this.uvs4,t),i&&(yield)),this.uvs5&&(e.setVerticesData(A.UV5Kind,this.uvs5,t),i&&(yield)),this.uvs6&&(e.setVerticesData(A.UV6Kind,this.uvs6,t),i&&(yield)),this.colors&&(e.setVerticesData(A.ColorKind,this.colors,t),this.hasVertexAlpha&&e.hasVertexAlpha!==void 0&&(e.hasVertexAlpha=!0),i&&(yield)),this.matricesIndices&&(e.setVerticesData(A.MatricesIndicesKind,this.matricesIndices,t),i&&(yield)),this.matricesWeights&&(e.setVerticesData(A.MatricesWeightsKind,this.matricesWeights,t),i&&(yield)),this.matricesIndicesExtra&&(e.setVerticesData(A.MatricesIndicesExtraKind,this.matricesIndicesExtra,t),i&&(yield)),this.matricesWeightsExtra&&(e.setVerticesData(A.MatricesWeightsExtraKind,this.matricesWeightsExtra,t),i&&(yield)),this.indices?(e.setIndices(this.indices,null,t),i&&(yield)):e.setIndices([],null),e.subMeshes&&this.materialInfos&&this.materialInfos.length>1){const s=e;s.subMeshes=[];for(const n of this.materialInfos)new vi(n.materialIndex,n.verticesStart,n.verticesCount,n.indexStart,n.indexCount,s)}return this}_update(e,t,i){return this.positions&&e.updateVerticesData(A.PositionKind,this.positions,t,i),this.normals&&e.updateVerticesData(A.NormalKind,this.normals,t,i),this.tangents&&e.updateVerticesData(A.TangentKind,this.tangents,t,i),this.uvs&&e.updateVerticesData(A.UVKind,this.uvs,t,i),this.uvs2&&e.updateVerticesData(A.UV2Kind,this.uvs2,t,i),this.uvs3&&e.updateVerticesData(A.UV3Kind,this.uvs3,t,i),this.uvs4&&e.updateVerticesData(A.UV4Kind,this.uvs4,t,i),this.uvs5&&e.updateVerticesData(A.UV5Kind,this.uvs5,t,i),this.uvs6&&e.updateVerticesData(A.UV6Kind,this.uvs6,t,i),this.colors&&e.updateVerticesData(A.ColorKind,this.colors,t,i),this.matricesIndices&&e.updateVerticesData(A.MatricesIndicesKind,this.matricesIndices,t,i),this.matricesWeights&&e.updateVerticesData(A.MatricesWeightsKind,this.matricesWeights,t,i),this.matricesIndicesExtra&&e.updateVerticesData(A.MatricesIndicesExtraKind,this.matricesIndicesExtra,t,i),this.matricesWeightsExtra&&e.updateVerticesData(A.MatricesWeightsExtraKind,this.matricesWeightsExtra,t,i),this.indices&&e.setIndices(this.indices,null),this}static _TransformVector3Coordinates(e,t,i=0,s=e.length){const n=N.Vector3[0],r=N.Vector3[1];for(let o=i;o({vertexData:o})):[{vertexData:e}];return F0(this._mergeCoroutine(void 0,r,t,!1,i,s,n))}*_mergeCoroutine(e,t,i=!1,s,n,r=!1,o=!1){var d,_,p,g;this._validate();let h=t.map(m=>m.vertexData),l=this;if(o)for(const m of h)m&&(m._validate(),!this.normals&&m.normals&&(this.normals=new Float32Array(this.positions.length)),!this.tangents&&m.tangents&&(this.tangents=new Float32Array(this.positions.length/3*4)),!this.uvs&&m.uvs&&(this.uvs=new Float32Array(this.positions.length/3*2)),!this.uvs2&&m.uvs2&&(this.uvs2=new Float32Array(this.positions.length/3*2)),!this.uvs3&&m.uvs3&&(this.uvs3=new Float32Array(this.positions.length/3*2)),!this.uvs4&&m.uvs4&&(this.uvs4=new Float32Array(this.positions.length/3*2)),!this.uvs5&&m.uvs5&&(this.uvs5=new Float32Array(this.positions.length/3*2)),!this.uvs6&&m.uvs6&&(this.uvs6=new Float32Array(this.positions.length/3*2)),!this.colors&&m.colors&&(this.colors=new Float32Array(this.positions.length/3*4),this.colors.fill(1)),!this.matricesIndices&&m.matricesIndices&&(this.matricesIndices=new Float32Array(this.positions.length/3*4)),!this.matricesWeights&&m.matricesWeights&&(this.matricesWeights=new Float32Array(this.positions.length/3*4)),!this.matricesIndicesExtra&&m.matricesIndicesExtra&&(this.matricesIndicesExtra=new Float32Array(this.positions.length/3*4)),!this.matricesWeightsExtra&&m.matricesWeightsExtra&&(this.matricesWeightsExtra=new Float32Array(this.positions.length/3*4)));for(const m of h)if(m){if(o)this.normals&&!m.normals&&(m.normals=new Float32Array(m.positions.length)),this.tangents&&!m.tangents&&(m.tangents=new Float32Array(m.positions.length/3*4)),this.uvs&&!m.uvs&&(m.uvs=new Float32Array(m.positions.length/3*2)),this.uvs2&&!m.uvs2&&(m.uvs2=new Float32Array(m.positions.length/3*2)),this.uvs3&&!m.uvs3&&(m.uvs3=new Float32Array(m.positions.length/3*2)),this.uvs4&&!m.uvs4&&(m.uvs4=new Float32Array(m.positions.length/3*2)),this.uvs5&&!m.uvs5&&(m.uvs5=new Float32Array(m.positions.length/3*2)),this.uvs6&&!m.uvs6&&(m.uvs6=new Float32Array(m.positions.length/3*2)),this.colors&&!m.colors&&(m.colors=new Float32Array(m.positions.length/3*4),m.colors.fill(1)),this.matricesIndices&&!m.matricesIndices&&(m.matricesIndices=new Float32Array(m.positions.length/3*4)),this.matricesWeights&&!m.matricesWeights&&(m.matricesWeights=new Float32Array(m.positions.length/3*4)),this.matricesIndicesExtra&&!m.matricesIndicesExtra&&(m.matricesIndicesExtra=new Float32Array(m.positions.length/3*4)),this.matricesWeightsExtra&&!m.matricesWeightsExtra&&(m.matricesWeightsExtra=new Float32Array(m.positions.length/3*4));else if(m._validate(),!this.normals!=!m.normals||!this.tangents!=!m.tangents||!this.uvs!=!m.uvs||!this.uvs2!=!m.uvs2||!this.uvs3!=!m.uvs3||!this.uvs4!=!m.uvs4||!this.uvs5!=!m.uvs5||!this.uvs6!=!m.uvs6||!this.colors!=!m.colors||!this.matricesIndices!=!m.matricesIndices||!this.matricesWeights!=!m.matricesWeights||!this.matricesIndicesExtra!=!m.matricesIndicesExtra||!this.matricesWeightsExtra!=!m.matricesWeightsExtra)throw new Error("Cannot merge vertex data that do not have the same set of attributes")}if(r){let m=0,b=0,I=0;const T=[];let x=null;const y=[];for(const E of this.splitBasedOnMaterialID())y.push({vertexData:E,transform:e});for(const E of t)if(E.vertexData)for(const C of E.vertexData.splitBasedOnMaterialID())y.push({vertexData:C,transform:E.transform});y.sort((E,C)=>{const S=E.vertexData.materialInfos?E.vertexData.materialInfos[0].materialIndex:0,w=C.vertexData.materialInfos?C.vertexData.materialInfos[0].materialIndex:0;return S>w?1:S===w?0:-1});for(const E of y){const C=E.vertexData;if(C.materialInfos?m=C.materialInfos[0].materialIndex:m=0,x&&x.materialIndex===m)x.indexCount+=C.indices.length,x.verticesCount+=C.positions.length/3;else{const S=new Ta;S.materialIndex=m,S.indexStart=b,S.indexCount=C.indices.length,S.verticesStart=I,S.verticesCount=C.positions.length/3,T.push(S),x=S}b+=C.indices.length,I+=C.positions.length/3}const R=y.splice(0,1)[0];l=R.vertexData,e=R.transform,h=y.map(E=>E.vertexData),t=y,this.materialInfos=T}const c=h.reduce((m,b)=>{var I,T;return m+((T=(I=b.indices)==null?void 0:I.length)!=null?T:0)},(_=(d=l.indices)==null?void 0:d.length)!=null?_:0);let f=n||h.some(m=>m.indices===l.indices)?(p=l.indices)==null?void 0:p.slice():l.indices;if(c>0){let m=(g=f==null?void 0:f.length)!=null?g:0;if(f||(f=new Array(c)),f.length!==c){if(Array.isArray(f))f.length=c;else{const I=i||f instanceof Uint32Array?new Uint32Array(c):new Uint16Array(c);I.set(f),f=I}e&&e.determinant()<0&&j._FlipFaces(f,0,m)}let b=l.positions?l.positions.length/3:0;for(const{vertexData:I,transform:T}of t)if(I.indices){for(let x=0;x[m.vertexData.positions,m.transform])),s&&(yield),l.normals&&(this.normals=j._MergeElement(A.NormalKind,l.normals,e,t.map(m=>[m.vertexData.normals,m.transform])),s&&(yield)),l.tangents&&(this.tangents=j._MergeElement(A.TangentKind,l.tangents,e,t.map(m=>[m.vertexData.tangents,m.transform])),s&&(yield)),l.uvs&&(this.uvs=j._MergeElement(A.UVKind,l.uvs,e,t.map(m=>[m.vertexData.uvs,m.transform])),s&&(yield)),l.uvs2&&(this.uvs2=j._MergeElement(A.UV2Kind,l.uvs2,e,t.map(m=>[m.vertexData.uvs2,m.transform])),s&&(yield)),l.uvs3&&(this.uvs3=j._MergeElement(A.UV3Kind,l.uvs3,e,t.map(m=>[m.vertexData.uvs3,m.transform])),s&&(yield)),l.uvs4&&(this.uvs4=j._MergeElement(A.UV4Kind,l.uvs4,e,t.map(m=>[m.vertexData.uvs4,m.transform])),s&&(yield)),l.uvs5&&(this.uvs5=j._MergeElement(A.UV5Kind,l.uvs5,e,t.map(m=>[m.vertexData.uvs5,m.transform])),s&&(yield)),l.uvs6&&(this.uvs6=j._MergeElement(A.UV6Kind,l.uvs6,e,t.map(m=>[m.vertexData.uvs6,m.transform])),s&&(yield)),l.colors&&(this.colors=j._MergeElement(A.ColorKind,l.colors,e,t.map(m=>[m.vertexData.colors,m.transform])),(l.hasVertexAlpha!==void 0||t.some(m=>m.vertexData.hasVertexAlpha!==void 0))&&(this.hasVertexAlpha=l.hasVertexAlpha||t.some(m=>m.vertexData.hasVertexAlpha)),s&&(yield)),l.matricesIndices&&(this.matricesIndices=j._MergeElement(A.MatricesIndicesKind,l.matricesIndices,e,t.map(m=>[m.vertexData.matricesIndices,m.transform])),s&&(yield)),l.matricesWeights&&(this.matricesWeights=j._MergeElement(A.MatricesWeightsKind,l.matricesWeights,e,t.map(m=>[m.vertexData.matricesWeights,m.transform])),s&&(yield)),l.matricesIndicesExtra&&(this.matricesIndicesExtra=j._MergeElement(A.MatricesIndicesExtraKind,l.matricesIndicesExtra,e,t.map(m=>[m.vertexData.matricesIndicesExtra,m.transform])),s&&(yield)),l.matricesWeightsExtra&&(this.matricesWeightsExtra=j._MergeElement(A.MatricesWeightsExtraKind,l.matricesWeightsExtra,e,t.map(m=>[m.vertexData.matricesWeightsExtra,m.transform]))),this}static _MergeElement(e,t,i,s){const n=s.filter(h=>h[0]!==null&&h[0]!==void 0);if(!t&&n.length==0)return t;if(!t)return this._MergeElement(e,n[0][0],n[0][1],n.slice(1));const r=n.reduce((h,l)=>h+l[0].length,t.length),o=e===A.PositionKind?j._TransformVector3Coordinates:e===A.NormalKind?j._TransformVector3Normals:e===A.TangentKind?j._TransformVector4Normals:()=>{};if(t instanceof Float32Array){const h=new Float32Array(r);h.set(t),i&&o(h,i,0,t.length);let l=t.length;for(const[c,u]of n)h.set(c,l),u&&o(h,u,l,c.length),l+=c.length;return h}else{const h=new Array(r);for(let c=0;c{const r=A.DeduceStride(s);if(n.length%r!==0)throw new Error("The "+s+"s array count must be a multiple of "+r);return n.length/r},t=e(A.PositionKind,this.positions),i=(s,n)=>{const r=e(s,n);if(r!==t)throw new Error("The "+s+"s element count ("+r+") does not match the positions count ("+t+")")};this.normals&&i(A.NormalKind,this.normals),this.tangents&&i(A.TangentKind,this.tangents),this.uvs&&i(A.UVKind,this.uvs),this.uvs2&&i(A.UV2Kind,this.uvs2),this.uvs3&&i(A.UV3Kind,this.uvs3),this.uvs4&&i(A.UV4Kind,this.uvs4),this.uvs5&&i(A.UV5Kind,this.uvs5),this.uvs6&&i(A.UV6Kind,this.uvs6),this.colors&&i(A.ColorKind,this.colors),this.matricesIndices&&i(A.MatricesIndicesKind,this.matricesIndices),this.matricesWeights&&i(A.MatricesWeightsKind,this.matricesWeights),this.matricesIndicesExtra&&i(A.MatricesIndicesExtraKind,this.matricesIndicesExtra),this.matricesWeightsExtra&&i(A.MatricesWeightsExtraKind,this.matricesWeightsExtra)}clone(){const e=this.serialize();return j.Parse(e)}serialize(){const e={};if(this.positions&&(e.positions=Array.from(this.positions)),this.normals&&(e.normals=Array.from(this.normals)),this.tangents&&(e.tangents=Array.from(this.tangents)),this.uvs&&(e.uvs=Array.from(this.uvs)),this.uvs2&&(e.uvs2=Array.from(this.uvs2)),this.uvs3&&(e.uvs3=Array.from(this.uvs3)),this.uvs4&&(e.uvs4=Array.from(this.uvs4)),this.uvs5&&(e.uvs5=Array.from(this.uvs5)),this.uvs6&&(e.uvs6=Array.from(this.uvs6)),this.colors&&(e.colors=Array.from(this.colors),e.hasVertexAlpha=this.hasVertexAlpha),this.matricesIndices&&(e.matricesIndices=Array.from(this.matricesIndices),e.matricesIndices._isExpanded=!0),this.matricesWeights&&(e.matricesWeights=Array.from(this.matricesWeights)),this.matricesIndicesExtra&&(e.matricesIndicesExtra=Array.from(this.matricesIndicesExtra),e.matricesIndicesExtra._isExpanded=!0),this.matricesWeightsExtra&&(e.matricesWeightsExtra=Array.from(this.matricesWeightsExtra)),e.indices=Array.from(this.indices),this.materialInfos){e.materialInfos=[];for(const t of this.materialInfos){const i={indexStart:t.indexStart,indexCount:t.indexCount,materialIndex:t.materialIndex,verticesStart:t.verticesStart,verticesCount:t.verticesCount};e.materialInfos.push(i)}}return e}static ExtractFromMesh(e,t,i){return j._ExtractFrom(e,t,i)}static ExtractFromGeometry(e,t,i){return j._ExtractFrom(e,t,i)}static _ExtractFrom(e,t,i){const s=new j;if(e.isVerticesDataPresent(A.PositionKind)&&(s.positions=e.getVerticesData(A.PositionKind,t,i)),e.isVerticesDataPresent(A.NormalKind)&&(s.normals=e.getVerticesData(A.NormalKind,t,i)),e.isVerticesDataPresent(A.TangentKind)&&(s.tangents=e.getVerticesData(A.TangentKind,t,i)),e.isVerticesDataPresent(A.UVKind)&&(s.uvs=e.getVerticesData(A.UVKind,t,i)),e.isVerticesDataPresent(A.UV2Kind)&&(s.uvs2=e.getVerticesData(A.UV2Kind,t,i)),e.isVerticesDataPresent(A.UV3Kind)&&(s.uvs3=e.getVerticesData(A.UV3Kind,t,i)),e.isVerticesDataPresent(A.UV4Kind)&&(s.uvs4=e.getVerticesData(A.UV4Kind,t,i)),e.isVerticesDataPresent(A.UV5Kind)&&(s.uvs5=e.getVerticesData(A.UV5Kind,t,i)),e.isVerticesDataPresent(A.UV6Kind)&&(s.uvs6=e.getVerticesData(A.UV6Kind,t,i)),e.isVerticesDataPresent(A.ColorKind)){const n=e.geometry||e,r=n.getVertexBuffer(A.ColorKind),o=n.getVerticesData(A.ColorKind,t,i);if(r.getSize()===3){const h=new Float32Array(o.length*4/3);for(let l=0,c=0;l!Array.isArray(a))],j,"_TransformVector3Coordinates",null);D([rs.filter((...[a])=>!Array.isArray(a))],j,"_TransformVector3Normals",null);D([rs.filter((...[a])=>!Array.isArray(a))],j,"_TransformVector4Normals",null);D([rs.filter((...[a])=>!Array.isArray(a))],j,"_FlipFaces",null);class Mp{constructor(){this._doNotSerialize=!1,this._isDisposed=!1,this._sceneRootNodesIndex=-1,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._onEnabledStateChangedObservable=new Z,this._onClonedObservable=new Z}}class bt{static AddNodeConstructor(e,t){this._NodeConstructors[e]=t}static Construct(e,t,i,s){const n=this._NodeConstructors[e];return n?n(t,i,s):null}set accessibilityTag(e){this._accessibilityTag=e,this.onAccessibilityTagChangedObservable.notifyObservers(e)}get accessibilityTag(){return this._accessibilityTag}get doNotSerialize(){return this._nodeDataStorage._doNotSerialize?!0:this._parentNode?this._parentNode.doNotSerialize:!1}set doNotSerialize(e){this._nodeDataStorage._doNotSerialize=e}isDisposed(){return this._nodeDataStorage._isDisposed}set parent(e){if(this._parentNode===e)return;const t=this._parentNode;if(this._parentNode&&this._parentNode._children!==void 0&&this._parentNode._children!==null){const i=this._parentNode._children.indexOf(this);i!==-1&&this._parentNode._children.splice(i,1),!e&&!this._nodeDataStorage._isDisposed&&this._addToSceneRootNodes()}this._parentNode=e,this._isDirty=!0,this._parentNode&&((this._parentNode._children===void 0||this._parentNode._children===null)&&(this._parentNode._children=new Array),this._parentNode._children.push(this),t||this._removeFromSceneRootNodes()),this._syncParentEnabledState()}get parent(){return this._parentNode}_serializeAsParent(e){e.parentId=this.uniqueId}_addToSceneRootNodes(){this._nodeDataStorage._sceneRootNodesIndex===-1&&(this._nodeDataStorage._sceneRootNodesIndex=this._scene.rootNodes.length,this._scene.rootNodes.push(this))}_removeFromSceneRootNodes(){if(this._nodeDataStorage._sceneRootNodesIndex!==-1){const e=this._scene.rootNodes,t=e.length-1;e[this._nodeDataStorage._sceneRootNodesIndex]=e[t],e[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex=this._nodeDataStorage._sceneRootNodesIndex,this._scene.rootNodes.pop(),this._nodeDataStorage._sceneRootNodesIndex=-1}}get animationPropertiesOverride(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}getClassName(){return"Node"}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get onEnabledStateChangedObservable(){return this._nodeDataStorage._onEnabledStateChangedObservable}get onClonedObservable(){return this._nodeDataStorage._onClonedObservable}constructor(e,t=null,i=!0){this._isDirty=!1,this._nodeDataStorage=new Mp,this.state="",this.metadata=null,this.reservedDataStore=null,this._accessibilityTag=null,this.onAccessibilityTagChangedObservable=new Z,this._parentContainer=null,this.animations=[],this._ranges={},this.onReady=null,this._currentRenderId=-1,this._parentUpdateId=-1,this._childUpdateId=-1,this._waitingParentId=null,this._waitingParentInstanceIndex=null,this._waitingParsedUniqueId=null,this._cache={},this._parentNode=null,this._children=null,this._worldMatrix=O.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new Z,this._onDisposeObserver=null,this._behaviors=new Array,this.name=e,this.id=e,this._scene=t||Ee.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache(),i&&this._addToSceneRootNodes()}getScene(){return this._scene}getEngine(){return this._scene.getEngine()}addBehavior(e,t=!1){return this._behaviors.indexOf(e)!==-1?this:(e.init(),this._scene.isLoading&&!t?this._scene.onDataLoadedObservable.addOnce(()=>{e.attach(this)}):e.attach(this),this._behaviors.push(e),this)}removeBehavior(e){const t=this._behaviors.indexOf(e);return t===-1?this:(this._behaviors[t].detach(),this._behaviors.splice(t,1),this)}get behaviors(){return this._behaviors}getBehaviorByName(e){for(const t of this._behaviors)if(t.name===e)return t;return null}getWorldMatrix(){return this._currentRenderId!==this._scene.getRenderId()&&this.computeWorldMatrix(),this._worldMatrix}_getWorldMatrixDeterminant(){return this._worldMatrixDeterminantIsDirty&&(this._worldMatrixDeterminantIsDirty=!1,this._worldMatrixDeterminant=this._worldMatrix.determinant()),this._worldMatrixDeterminant}get worldMatrixFromCache(){return this._worldMatrix}_initCache(){this._cache={}}updateCache(e){!e&&this.isSynchronized()||this._updateCache()}_getActionManagerForTrigger(e,t=!0){return this.parent?this.parent._getActionManagerForTrigger(e,!1):null}_updateCache(e){}_isSynchronized(){return!0}_markSyncedWithParent(){this._parentNode&&(this._parentUpdateId=this._parentNode._childUpdateId)}isSynchronizedWithParent(){return this._parentNode?this._parentNode._isDirty||this._parentUpdateId!==this._parentNode._childUpdateId?!1:this._parentNode.isSynchronized():!0}isSynchronized(){return this._parentNode&&!this.isSynchronizedWithParent()?!1:this._isSynchronized()}isReady(e=!1){return this._nodeDataStorage._isReady}markAsDirty(e){return this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this}isEnabled(e=!0){return e===!1?this._nodeDataStorage._isEnabled:this._nodeDataStorage._isEnabled?this._nodeDataStorage._isParentEnabled:!1}_syncParentEnabledState(){this._nodeDataStorage._isParentEnabled=this._parentNode?this._parentNode.isEnabled():!0,this._children&&this._children.forEach(e=>{e._syncParentEnabledState()})}setEnabled(e){this._nodeDataStorage._isEnabled!==e&&(this._nodeDataStorage._isEnabled=e,this._syncParentEnabledState(),this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(e))}isDescendantOf(e){return this.parent?this.parent===e?!0:this.parent.isDescendantOf(e):!1}_getDescendants(e,t=!1,i){if(this._children)for(let s=0;s(!t||t(s))&&s.cullingStrategy!==void 0),i}getChildren(e,t=!0){return this.getDescendants(t,e)}_setReady(e){if(e!==this._nodeDataStorage._isReady){if(!e){this._nodeDataStorage._isReady=!1;return}this.onReady&&this.onReady(this),this._nodeDataStorage._isReady=!0}}getAnimationByName(e){for(let t=0;tnew bt(e,this.getScene()),this);if(t&&(s.parent=t),!i){const n=this.getDescendants(!0);for(let r=0;r{throw ye("AnimationRange")};bt._NodeConstructors={};D([B()],bt.prototype,"name",void 0);D([B()],bt.prototype,"id",void 0);D([B()],bt.prototype,"uniqueId",void 0);D([B()],bt.prototype,"state",void 0);D([B()],bt.prototype,"metadata",void 0);const Pp=O.Compose(v.One(),re.FromEulerAngles(0,Math.PI,0),v.Zero());class Te extends bt{get billboardMode(){return this._billboardMode}set billboardMode(e){this._billboardMode!==e&&(this._billboardMode=e,this._cache.useBillboardPosition=(this._billboardMode&Te.BILLBOARDMODE_USE_POSITION)!==0,this._computeUseBillboardPath())}get preserveParentRotationForBillboard(){return this._preserveParentRotationForBillboard}set preserveParentRotationForBillboard(e){e!==this._preserveParentRotationForBillboard&&(this._preserveParentRotationForBillboard=e,this._computeUseBillboardPath())}_computeUseBillboardPath(){this._cache.useBillboardPath=this._billboardMode!==Te.BILLBOARDMODE_NONE&&!this.preserveParentRotationForBillboard}get infiniteDistance(){return this._infiniteDistance}set infiniteDistance(e){this._infiniteDistance!==e&&(this._infiniteDistance=e)}constructor(e,t=null,i=!0){super(e,t,!1),this._forward=new v(0,0,1),this._up=new v(0,1,0),this._right=new v(1,0,0),this._position=v.Zero(),this._rotation=v.Zero(),this._rotationQuaternion=null,this._scaling=v.One(),this._transformToBoneReferal=null,this._isAbsoluteSynced=!1,this._billboardMode=Te.BILLBOARDMODE_NONE,this._preserveParentRotationForBillboard=!1,this.scalingDeterminant=1,this._infiniteDistance=!1,this.ignoreNonUniformScaling=!1,this.reIntegrateRotationIntoRotationQuaternion=!1,this._poseMatrix=null,this._localMatrix=O.Zero(),this._usePivotMatrix=!1,this._absolutePosition=v.Zero(),this._absoluteScaling=v.Zero(),this._absoluteRotationQuaternion=re.Identity(),this._pivotMatrix=O.Identity(),this._postMultiplyPivotMatrix=!1,this._isWorldMatrixFrozen=!1,this._indexInSceneTransformNodesArray=-1,this.onAfterWorldMatrixUpdateObservable=new Z,this._nonUniformScaling=!1,i&&this.getScene().addTransformNode(this)}getClassName(){return"TransformNode"}get position(){return this._position}set position(e){this._position=e,this._markAsDirtyInternal()}isUsingPivotMatrix(){return this._usePivotMatrix}isUsingPostMultiplyPivotMatrix(){return this._postMultiplyPivotMatrix}get rotation(){return this._rotation}set rotation(e){this._rotation=e,this._rotationQuaternion=null,this._markAsDirtyInternal()}get scaling(){return this._scaling}set scaling(e){this._scaling=e,this._markAsDirtyInternal()}get rotationQuaternion(){return this._rotationQuaternion}set rotationQuaternion(e){this._rotationQuaternion=e,e&&this._rotation.setAll(0),this._markAsDirtyInternal()}_markAsDirtyInternal(){this._isDirty||(this._isDirty=!0,this.customMarkAsDirty&&this.customMarkAsDirty())}get forward(){return v.TransformNormalFromFloatsToRef(0,0,this.getScene().useRightHandedSystem?-1:1,this.getWorldMatrix(),this._forward),this._forward.normalize()}get up(){return v.TransformNormalFromFloatsToRef(0,1,0,this.getWorldMatrix(),this._up),this._up.normalize()}get right(){return v.TransformNormalFromFloatsToRef(this.getScene().useRightHandedSystem?-1:1,0,0,this.getWorldMatrix(),this._right),this._right.normalize()}updatePoseMatrix(e){return this._poseMatrix?(this._poseMatrix.copyFrom(e),this):(this._poseMatrix=e.clone(),this)}getPoseMatrix(){return this._poseMatrix||(this._poseMatrix=O.Identity()),this._poseMatrix}_isSynchronized(){const e=this._cache;return!(this._billboardMode!==e.billboardMode||this._billboardMode!==Te.BILLBOARDMODE_NONE||e.pivotMatrixUpdated||this._infiniteDistance||this._position._isDirty||this._scaling._isDirty||this._rotationQuaternion&&this._rotationQuaternion._isDirty||this._rotation._isDirty)}_initCache(){super._initCache();const e=this._cache;e.localMatrixUpdated=!1,e.billboardMode=-1,e.infiniteDistance=!1,e.useBillboardPosition=!1,e.useBillboardPath=!1}get absolutePosition(){return this.getAbsolutePosition()}get absoluteScaling(){return this._syncAbsoluteScalingAndRotation(),this._absoluteScaling}get absoluteRotationQuaternion(){return this._syncAbsoluteScalingAndRotation(),this._absoluteRotationQuaternion}setPreTransformMatrix(e){return this.setPivotMatrix(e,!1)}setPivotMatrix(e,t=!0){return this._pivotMatrix.copyFrom(e),this._usePivotMatrix=!this._pivotMatrix.isIdentity(),this._cache.pivotMatrixUpdated=!0,this._postMultiplyPivotMatrix=t,this._postMultiplyPivotMatrix&&(this._pivotMatrixInverse?this._pivotMatrix.invertToRef(this._pivotMatrixInverse):this._pivotMatrixInverse=O.Invert(this._pivotMatrix)),this}getPivotMatrix(){return this._pivotMatrix}instantiateHierarchy(e=null,t,i){const s=this.clone("Clone of "+(this.name||this.id),e||this.parent,!0);s&&i&&i(this,s);for(const n of this.getChildTransformNodes(!0))n.instantiateHierarchy(s,t,i);return s}freezeWorldMatrix(e=null,t=!1){return e?t?(this._rotation.setAll(0),this._rotationQuaternion=this._rotationQuaternion||re.Identity(),e.decompose(this._scaling,this._rotationQuaternion,this._position),this.computeWorldMatrix(!0)):(this._worldMatrix=e,this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._afterComputeWorldMatrix()):(this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0)),this._isDirty=!1,this._isWorldMatrixFrozen=!0,this}unfreezeWorldMatrix(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this}get isWorldMatrixFrozen(){return this._isWorldMatrixFrozen}getAbsolutePosition(){return this.computeWorldMatrix(),this._absolutePosition}setAbsolutePosition(e){if(!e)return this;let t,i,s;if(e.x===void 0){if(arguments.length<3)return this;t=arguments[0],i=arguments[1],s=arguments[2]}else t=e.x,i=e.y,s=e.z;if(this.parent){const n=N.Matrix[0];this.parent.getWorldMatrix().invertToRef(n),v.TransformCoordinatesFromFloatsToRef(t,i,s,n,this.position)}else this.position.x=t,this.position.y=i,this.position.z=s;return this._absolutePosition.copyFrom(e),this}setPositionWithLocalVector(e){return this.computeWorldMatrix(),this.position=v.TransformNormal(e,this._localMatrix),this}getPositionExpressedInLocalSpace(){this.computeWorldMatrix();const e=N.Matrix[0];return this._localMatrix.invertToRef(e),v.TransformNormal(this.position,e)}locallyTranslate(e){return this.computeWorldMatrix(!0),this.position=v.TransformCoordinates(e,this._localMatrix),this}lookAt(e,t=0,i=0,s=0,n=0){const r=Te._LookAtVectorCache,o=n===0?this.position:this.getAbsolutePosition();if(e.subtractToRef(o,r),this.setDirection(r,t,i,s),n===1&&this.parent)if(this.rotationQuaternion){const h=N.Matrix[0];this.rotationQuaternion.toRotationMatrix(h);const l=N.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(l),l.invert(),h.multiplyToRef(l,h),this.rotationQuaternion.fromRotationMatrix(h)}else{const h=N.Quaternion[0];re.FromEulerVectorToRef(this.rotation,h);const l=N.Matrix[0];h.toRotationMatrix(l);const c=N.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(c),c.invert(),l.multiplyToRef(c,l),h.fromRotationMatrix(l),h.toEulerAnglesToRef(this.rotation)}return this}getDirection(e){const t=v.Zero();return this.getDirectionToRef(e,t),t}getDirectionToRef(e,t){return v.TransformNormalToRef(e,this.getWorldMatrix(),t),this}setDirection(e,t=0,i=0,s=0){const n=-Math.atan2(e.z,e.x)+Math.PI/2,r=Math.sqrt(e.x*e.x+e.z*e.z),o=-Math.atan2(e.y,r);return this.rotationQuaternion?re.RotationYawPitchRollToRef(n+t,o+i,s,this.rotationQuaternion):(this.rotation.x=o+i,this.rotation.y=n+t,this.rotation.z=s),this}setPivotPoint(e,t=0){this.getScene().getRenderId()==0&&this.computeWorldMatrix(!0);const i=this.getWorldMatrix();if(t==1){const s=N.Matrix[0];i.invertToRef(s),e=v.TransformCoordinates(e,s)}return this.setPivotMatrix(O.Translation(-e.x,-e.y,-e.z),!0)}getPivotPoint(){const e=v.Zero();return this.getPivotPointToRef(e),e}getPivotPointToRef(e){return e.x=-this._pivotMatrix.m[12],e.y=-this._pivotMatrix.m[13],e.z=-this._pivotMatrix.m[14],this}getAbsolutePivotPoint(){const e=v.Zero();return this.getAbsolutePivotPointToRef(e),e}getAbsolutePivotPointToRef(e){return this.getPivotPointToRef(e),v.TransformCoordinatesToRef(e,this.getWorldMatrix(),e),this}markAsDirty(e){if(this._isDirty)return this;if(this._children)for(const t of this._children)t.markAsDirty(e);return super.markAsDirty(e)}setParent(e,t=!1,i=!1){if(!e&&!this.parent)return this;const s=N.Quaternion[0],n=N.Vector3[0],r=N.Vector3[1],o=N.Matrix[1];O.IdentityToRef(o);const h=N.Matrix[0];this.computeWorldMatrix(!0);let l=this.rotationQuaternion;return l||(l=Te._TmpRotation,re.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,l)),O.ComposeToRef(this.scaling,l,this.position,h),this.parent&&h.multiplyToRef(this.parent.computeWorldMatrix(!0),h),e&&(e.computeWorldMatrix(!0).invertToRef(o),h.multiplyToRef(o,h)),h.decompose(r,s,n,t?this:void 0),this.rotationQuaternion?this.rotationQuaternion.copyFrom(s):s.toEulerAnglesToRef(this.rotation),this.scaling.copyFrom(r),this.position.copyFrom(n),this.parent=e,i&&this.setPivotMatrix(O.Identity()),this}addChild(e,t=!1){return e.setParent(this,t),this}removeChild(e,t=!1){return e.setParent(null,t),this}get nonUniformScaling(){return this._nonUniformScaling}_updateNonUniformScalingState(e){return this._nonUniformScaling===e?!1:(this._nonUniformScaling=e,!0)}attachToBone(e,t){return this._currentParentWhenAttachingToBone=this.parent,this._transformToBoneReferal=t,this.parent=e,e.getSkeleton().prepare(!0),e.getFinalMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this}detachFromBone(e=!1){return this.parent?(this.parent.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this._transformToBoneReferal=null,e?this.parent=this._currentParentWhenAttachingToBone:this.parent=null,this):(e&&(this.parent=this._currentParentWhenAttachingToBone),this)}rotate(e,t,i){e.normalize(),this.rotationQuaternion||(this.rotationQuaternion=this.rotation.toQuaternion(),this.rotation.setAll(0));let s;if(!i||i===0)s=re.RotationAxisToRef(e,t,Te._RotationAxisCache),this.rotationQuaternion.multiplyToRef(s,this.rotationQuaternion);else{if(this.parent){const n=this.parent.getWorldMatrix(),r=N.Matrix[0];n.invertToRef(r),e=v.TransformNormal(e,r),n.determinant()<0&&(t*=-1)}s=re.RotationAxisToRef(e,t,Te._RotationAxisCache),s.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}return this}rotateAround(e,t,i){t.normalize(),this.rotationQuaternion||(this.rotationQuaternion=re.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));const s=N.Vector3[0],n=N.Vector3[1],r=N.Vector3[2],o=N.Quaternion[0],h=N.Matrix[0],l=N.Matrix[1],c=N.Matrix[2],u=N.Matrix[3];return e.subtractToRef(this.position,s),O.TranslationToRef(s.x,s.y,s.z,h),O.TranslationToRef(-s.x,-s.y,-s.z,l),O.RotationAxisToRef(t,i,c),l.multiplyToRef(c,u),u.multiplyToRef(h,u),u.decompose(n,o,r),this.position.addInPlace(r),o.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion),this}translate(e,t,i){const s=e.scale(t);if(!i||i===0){const n=this.getPositionExpressedInLocalSpace().add(s);this.setPositionWithLocalVector(n)}else this.setAbsolutePosition(this.getAbsolutePosition().add(s));return this}addRotation(e,t,i){let s;this.rotationQuaternion?s=this.rotationQuaternion:(s=N.Quaternion[1],re.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,s));const n=N.Quaternion[0];return re.RotationYawPitchRollToRef(t,e,i,n),s.multiplyInPlace(n),this.rotationQuaternion||s.toEulerAnglesToRef(this.rotation),this}_getEffectiveParent(){return this.parent}isWorldMatrixCameraDependent(){return this._infiniteDistance&&!this.parent||this._billboardMode!==Te.BILLBOARDMODE_NONE&&!this.preserveParentRotationForBillboard}computeWorldMatrix(e=!1,t=null){if(this._isWorldMatrixFrozen&&!this._isDirty)return this._worldMatrix;const i=this.getScene().getRenderId();if(!this._isDirty&&!e&&(this._currentRenderId===i||this.isSynchronized()))return this._currentRenderId=i,this._worldMatrix;t=t||this.getScene().activeCamera,this._updateCache();const s=this._cache;s.pivotMatrixUpdated=!1,s.billboardMode=this.billboardMode,s.infiniteDistance=this.infiniteDistance,s.parent=this._parentNode,this._currentRenderId=i,this._childUpdateId+=1,this._isDirty=!1,this._position._isDirty=!1,this._rotation._isDirty=!1,this._scaling._isDirty=!1;const n=this._getEffectiveParent(),r=Te._TmpScaling;let o=this._position;if(this._infiniteDistance&&!this.parent&&t){const l=t.getWorldMatrix(),c=new v(l.m[12],l.m[13],l.m[14]);o=Te._TmpTranslation,o.copyFromFloats(this._position.x+c.x,this._position.y+c.y,this._position.z+c.z)}r.copyFromFloats(this._scaling.x*this.scalingDeterminant,this._scaling.y*this.scalingDeterminant,this._scaling.z*this.scalingDeterminant);let h;if(this._rotationQuaternion?(this._rotationQuaternion._isDirty=!1,h=this._rotationQuaternion,this.reIntegrateRotationIntoRotationQuaternion&&this.rotation.lengthSquared()&&(this._rotationQuaternion.multiplyInPlace(re.RotationYawPitchRoll(this._rotation.y,this._rotation.x,this._rotation.z)),this._rotation.copyFromFloats(0,0,0))):(h=Te._TmpRotation,re.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,h)),this._usePivotMatrix){const l=N.Matrix[1];O.ScalingToRef(r.x,r.y,r.z,l);const c=N.Matrix[0];h.toRotationMatrix(c),this._pivotMatrix.multiplyToRef(l,N.Matrix[4]),N.Matrix[4].multiplyToRef(c,this._localMatrix),this._postMultiplyPivotMatrix&&this._localMatrix.multiplyToRef(this._pivotMatrixInverse,this._localMatrix),this._localMatrix.addTranslationFromFloats(o.x,o.y,o.z)}else O.ComposeToRef(r,h,o,this._localMatrix);if(n&&n.getWorldMatrix){if(e&&n.computeWorldMatrix(e),s.useBillboardPath){if(this._transformToBoneReferal){const f=this.parent;f.getSkeleton().prepare(),f.getFinalMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),N.Matrix[7])}else N.Matrix[7].copyFrom(n.getWorldMatrix());const l=N.Vector3[5],c=N.Vector3[6],u=N.Quaternion[0];N.Matrix[7].decompose(c,u,l),O.ScalingToRef(c.x,c.y,c.z,N.Matrix[7]),N.Matrix[7].setTranslation(l),Te.BillboardUseParentOrientation&&(this._position.applyRotationQuaternionToRef(u,l),this._localMatrix.setTranslation(l)),this._localMatrix.multiplyToRef(N.Matrix[7],this._worldMatrix)}else if(this._transformToBoneReferal){const l=this.parent;l.getSkeleton().prepare(),this._localMatrix.multiplyToRef(l.getFinalMatrix(),N.Matrix[6]),N.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)}else this._localMatrix.multiplyToRef(n.getWorldMatrix(),this._worldMatrix);this._markSyncedWithParent()}else this._worldMatrix.copyFrom(this._localMatrix);if(s.useBillboardPath&&t&&this.billboardMode&&!s.useBillboardPosition){const l=N.Vector3[0];if(this._worldMatrix.getTranslationToRef(l),N.Matrix[1].copyFrom(t.getViewMatrix()),this._scene.useRightHandedSystem&&N.Matrix[1].multiplyToRef(Pp,N.Matrix[1]),N.Matrix[1].setTranslationFromFloats(0,0,0),N.Matrix[1].invertToRef(N.Matrix[0]),(this.billboardMode&Te.BILLBOARDMODE_ALL)!==Te.BILLBOARDMODE_ALL){N.Matrix[0].decompose(void 0,N.Quaternion[0],void 0);const c=N.Vector3[1];N.Quaternion[0].toEulerAnglesToRef(c),(this.billboardMode&Te.BILLBOARDMODE_X)!==Te.BILLBOARDMODE_X&&(c.x=0),(this.billboardMode&Te.BILLBOARDMODE_Y)!==Te.BILLBOARDMODE_Y&&(c.y=0),(this.billboardMode&Te.BILLBOARDMODE_Z)!==Te.BILLBOARDMODE_Z&&(c.z=0),O.RotationYawPitchRollToRef(c.y,c.x,c.z,N.Matrix[0])}this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(N.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(N.Vector3[0])}else if(s.useBillboardPath&&t&&s.useBillboardPosition){const l=N.Vector3[0];this._worldMatrix.getTranslationToRef(l);const c=t.globalPosition;this._worldMatrix.invertToRef(N.Matrix[1]);const u=N.Vector3[1];v.TransformCoordinatesToRef(c,N.Matrix[1],u),u.normalize();const f=-Math.atan2(u.z,u.x)+Math.PI/2,d=Math.sqrt(u.x*u.x+u.z*u.z),_=-Math.atan2(u.y,d);if(re.RotationYawPitchRollToRef(f,_,0,N.Quaternion[0]),(this.billboardMode&Te.BILLBOARDMODE_ALL)!==Te.BILLBOARDMODE_ALL){const p=N.Vector3[1];N.Quaternion[0].toEulerAnglesToRef(p),(this.billboardMode&Te.BILLBOARDMODE_X)!==Te.BILLBOARDMODE_X&&(p.x=0),(this.billboardMode&Te.BILLBOARDMODE_Y)!==Te.BILLBOARDMODE_Y&&(p.y=0),(this.billboardMode&Te.BILLBOARDMODE_Z)!==Te.BILLBOARDMODE_Z&&(p.z=0),O.RotationYawPitchRollToRef(p.y,p.x,p.z,N.Matrix[0])}else O.FromQuaternionToRef(N.Quaternion[0],N.Matrix[0]);this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(N.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(N.Vector3[0])}return this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this._scaling.isNonUniformWithinEpsilon(1e-6)?this._updateNonUniformScalingState(!0):n&&n._nonUniformScaling?this._updateNonUniformScalingState(n._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._isAbsoluteSynced=!1,this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=O.Invert(this._worldMatrix)),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix}resetLocalMatrix(e=!0){if(this.computeWorldMatrix(),e){const t=this.getChildren();for(let i=0;inew Te(e,this.getScene()),this);if(s.name=e,s.id=e,t&&(s.parent=t),!i){const n=this.getDescendants(!0);for(let r=0;rnew Te(e.name,t),e,t,i);if(e.localMatrix?s.setPreTransformMatrix(O.FromArray(e.localMatrix)):e.pivotMatrix&&s.setPivotMatrix(O.FromArray(e.pivotMatrix)),s.setEnabled(e.isEnabled),s._waitingParsedUniqueId=e.uniqueId,e.parentId!==void 0&&(s._waitingParentId=e.parentId),e.parentInstanceIndex!==void 0&&(s._waitingParentInstanceIndex=e.parentInstanceIndex),e.animations){for(let n=0;n(!t||t(s))&&s instanceof Te),i}dispose(e,t=!1){if(this.getScene().stopAnimation(this),this.getScene().removeTransformNode(this),this._parentContainer){const i=this._parentContainer.transformNodes.indexOf(this);i>-1&&this._parentContainer.transformNodes.splice(i,1),this._parentContainer=null}if(this.onAfterWorldMatrixUpdateObservable.clear(),e){const i=this.getChildTransformNodes(!0);for(const s of i)s.parent=null,s.computeWorldMatrix(!0)}super.dispose(e,t)}normalizeToUnitCube(e=!0,t=!1,i){let s=null,n=null;t&&(this.rotationQuaternion?(n=this.rotationQuaternion.clone(),this.rotationQuaternion.copyFromFloats(0,0,0,1)):this.rotation&&(s=this.rotation.clone(),this.rotation.copyFromFloats(0,0,0)));const r=this.getHierarchyBoundingVectors(e,i),o=r.max.subtract(r.min),h=Math.max(o.x,o.y,o.z);if(h===0)return this;const l=1/h;return this.scaling.scaleInPlace(l),t&&(this.rotationQuaternion&&n?this.rotationQuaternion.copyFrom(n):this.rotation&&s&&this.rotation.copyFrom(s)),this}_syncAbsoluteScalingAndRotation(){this._isAbsoluteSynced||(this._worldMatrix.decompose(this._absoluteScaling,this._absoluteRotationQuaternion),this._isAbsoluteSynced=!0)}}Te.BILLBOARDMODE_NONE=0;Te.BILLBOARDMODE_X=1;Te.BILLBOARDMODE_Y=2;Te.BILLBOARDMODE_Z=4;Te.BILLBOARDMODE_ALL=7;Te.BILLBOARDMODE_USE_POSITION=128;Te.BillboardUseParentOrientation=!1;Te._TmpRotation=re.Zero();Te._TmpScaling=v.Zero();Te._TmpTranslation=v.Zero();Te._LookAtVectorCache=new v(0,0,0);Te._RotationAxisCache=new re;D([yi("position")],Te.prototype,"_position",void 0);D([yi("rotation")],Te.prototype,"_rotation",void 0);D([Jd("rotationQuaternion")],Te.prototype,"_rotationQuaternion",void 0);D([yi("scaling")],Te.prototype,"_scaling",void 0);D([B("billboardMode")],Te.prototype,"_billboardMode",void 0);D([B()],Te.prototype,"scalingDeterminant",void 0);D([B("infiniteDistance")],Te.prototype,"_infiniteDistance",void 0);D([B()],Te.prototype,"ignoreNonUniformScaling",void 0);D([B()],Te.prototype,"reIntegrateRotationIntoRotationQuaternion",void 0);class as{constructor(){this.hit=!1,this.distance=0,this.pickedPoint=null,this.pickedMesh=null,this.bu=0,this.bv=0,this.faceId=-1,this.subMeshFaceId=-1,this.subMeshId=0,this.pickedSprite=null,this.thinInstanceIndex=-1,this.ray=null,this.originMesh=null,this.aimTransform=null,this.gripTransform=null}getNormal(e=!1,t=!0){if(!this.pickedMesh||t&&!this.pickedMesh.isVerticesDataPresent(A.NormalKind))return null;let i=this.pickedMesh.getIndices();(i==null?void 0:i.length)===0&&(i=null);let s;const n=N.Vector3[0],r=N.Vector3[1],o=N.Vector3[2];if(t){const l=this.pickedMesh.getVerticesData(A.NormalKind);let c=i?v.FromArrayToRef(l,i[this.faceId*3]*3,n):n.copyFromFloats(l[this.faceId*3*3],l[this.faceId*3*3+1],l[this.faceId*3*3+2]),u=i?v.FromArrayToRef(l,i[this.faceId*3+1]*3,r):r.copyFromFloats(l[(this.faceId*3+1)*3],l[(this.faceId*3+1)*3+1],l[(this.faceId*3+1)*3+2]),f=i?v.FromArrayToRef(l,i[this.faceId*3+2]*3,o):o.copyFromFloats(l[(this.faceId*3+2)*3],l[(this.faceId*3+2)*3+1],l[(this.faceId*3+2)*3+2]);c=c.scale(this.bu),u=u.scale(this.bv),f=f.scale(1-this.bu-this.bv),s=new v(c.x+u.x+f.x,c.y+u.y+f.y,c.z+u.z+f.z)}else{const l=this.pickedMesh.getVerticesData(A.PositionKind),c=i?v.FromArrayToRef(l,i[this.faceId*3]*3,n):n.copyFromFloats(l[this.faceId*3*3],l[this.faceId*3*3+1],l[this.faceId*3*3+2]),u=i?v.FromArrayToRef(l,i[this.faceId*3+1]*3,r):r.copyFromFloats(l[(this.faceId*3+1)*3],l[(this.faceId*3+1)*3+1],l[(this.faceId*3+1)*3+2]),f=i?v.FromArrayToRef(l,i[this.faceId*3+2]*3,o):o.copyFromFloats(l[(this.faceId*3+2)*3],l[(this.faceId*3+2)*3+1],l[(this.faceId*3+2)*3+2]),d=c.subtract(u),_=f.subtract(u);s=v.Cross(d,_)}const h=(l,c)=>{let u=l.getWorldMatrix();l.nonUniformScaling&&(N.Matrix[0].copyFrom(u),u=N.Matrix[0],u.setTranslationFromFloats(0,0,0),u.invert(),u.transposeToRef(N.Matrix[1]),u=N.Matrix[1]),v.TransformNormalToRef(c,u,c)};if(e&&h(this.pickedMesh,s),this.ray){const l=N.Vector3[0].copyFrom(s);e||h(this.pickedMesh,l),v.Dot(l,this.ray.direction)>0&&s.negateInPlace()}return s.normalize(),s}getTextureCoordinates(e=A.UVKind){if(!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(e))return null;const t=this.pickedMesh.getIndices();if(!t)return null;const i=this.pickedMesh.getVerticesData(e);if(!i)return null;let s=oe.FromArray(i,t[this.faceId*3]*2),n=oe.FromArray(i,t[this.faceId*3+1]*2),r=oe.FromArray(i,t[this.faceId*3+2]*2);return s=s.scale(this.bu),n=n.scale(this.bv),r=r.scale(1-this.bu-this.bv),new oe(s.x+n.x+r.x,s.y+n.y+r.y)}}class wp{constructor(){this._checkCollisions=!1,this._collisionMask=-1,this._collisionGroup=-1,this._surroundingMeshes=null,this._collider=null,this._oldPositionForCollisions=new v(0,0,0),this._diffPositionForCollisions=new v(0,0,0),this._collisionResponse=!0}}function Dp(a,e,t){let i=null;switch(e){case A.PositionKind:i=s=>s.getPositions();break;case A.NormalKind:i=s=>s.getNormals();break;case A.TangentKind:i=s=>s.getTangents();break;case A.UVKind:i=s=>s.getUVs();break;default:return}for(let s=0;s0&&(O.FromFloat32ArrayToRefScaled(t,Math.floor(i[f+d]*16),_,l),h.addToSelf(l));if(n&&r)for(d=0;d<4;d++)_=r[f+d],_>0&&(O.FromFloat32ArrayToRefScaled(t,Math.floor(n[f+d]*16),_,l),h.addToSelf(l));c(a[u],a[u+1],a[u+2],h,o),o.toArray(a,u)}}class Op{constructor(){this.facetNb=0,this.partitioningSubdivisions=10,this.partitioningBBoxRatio=1.01,this.facetDataEnabled=!1,this.facetParameters={},this.bbSize=v.Zero(),this.subDiv={max:1,X:1,Y:1,Z:1},this.facetDepthSort=!1,this.facetDepthSortEnabled=!1}}class Bp{constructor(){this._hasVertexAlpha=!1,this._useVertexColors=!0,this._numBoneInfluencers=4,this._applyFog=!0,this._receiveShadows=!1,this._facetData=new Op,this._visibility=1,this._skeleton=null,this._layerMask=268435455,this._computeBonesUsingShaders=!0,this._isActive=!1,this._onlyForInstances=!1,this._isActiveIntermediate=!1,this._onlyForInstancesIntermediate=!1,this._actAsRegularMesh=!1,this._currentLOD=null,this._currentLODIsUpToDate=!1,this._collisionRetryCount=3,this._morphTargetManager=null,this._renderingGroupId=0,this._bakedVertexAnimationManager=null,this._material=null,this._positions=null,this._pointerOverDisableMeshTesting=!1,this._meshCollisionData=new wp,this._enableDistantPicking=!1,this._rawBoundingInfo=null,this._sideOrientationHint=!1,this._inheritVisibility=!1}}class Qe extends Te{static get BILLBOARDMODE_NONE(){return Te.BILLBOARDMODE_NONE}static get BILLBOARDMODE_X(){return Te.BILLBOARDMODE_X}static get BILLBOARDMODE_Y(){return Te.BILLBOARDMODE_Y}static get BILLBOARDMODE_Z(){return Te.BILLBOARDMODE_Z}static get BILLBOARDMODE_ALL(){return Te.BILLBOARDMODE_ALL}static get BILLBOARDMODE_USE_POSITION(){return Te.BILLBOARDMODE_USE_POSITION}get facetNb(){return this._internalAbstractMeshDataInfo._facetData.facetNb}get partitioningSubdivisions(){return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions}set partitioningSubdivisions(e){this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions=e}get partitioningBBoxRatio(){return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio}set partitioningBBoxRatio(e){this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio=e}get mustDepthSortFacets(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSort}set mustDepthSortFacets(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSort=e}get facetDepthSortFrom(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom}set facetDepthSortFrom(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom=e}get collisionRetryCount(){return this._internalAbstractMeshDataInfo._collisionRetryCount}set collisionRetryCount(e){this._internalAbstractMeshDataInfo._collisionRetryCount=e}get isFacetDataEnabled(){return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled}get morphTargetManager(){return this._internalAbstractMeshDataInfo._morphTargetManager}set morphTargetManager(e){this._internalAbstractMeshDataInfo._morphTargetManager!==e&&(this._internalAbstractMeshDataInfo._morphTargetManager=e,this._syncGeometryWithMorphTargetManager())}get bakedVertexAnimationManager(){return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager}set bakedVertexAnimationManager(e){this._internalAbstractMeshDataInfo._bakedVertexAnimationManager!==e&&(this._internalAbstractMeshDataInfo._bakedVertexAnimationManager=e,this._markSubMeshesAsAttributesDirty())}_syncGeometryWithMorphTargetManager(){}_updateNonUniformScalingState(e){return super._updateNonUniformScalingState(e)?(this._markSubMeshesAsMiscDirty(),!0):!1}get rawBoundingInfo(){return this._internalAbstractMeshDataInfo._rawBoundingInfo}set rawBoundingInfo(e){this._internalAbstractMeshDataInfo._rawBoundingInfo=e}set onCollide(e){this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver&&this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver=this.onCollideObservable.add(e)}set onCollisionPositionChange(e){this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(e)}get visibility(){return this._internalAbstractMeshDataInfo._visibility}set visibility(e){if(this._internalAbstractMeshDataInfo._visibility===e)return;const t=this._internalAbstractMeshDataInfo._visibility;this._internalAbstractMeshDataInfo._visibility=e,(t===1&&e!==1||t!==1&&e===1)&&this._markSubMeshesAsDirty(i=>{i.markAsMiscDirty(),i.markAsPrePassDirty()})}get inheritVisibility(){return this._internalAbstractMeshDataInfo._inheritVisibility}set inheritVisibility(e){this._internalAbstractMeshDataInfo._inheritVisibility=e}get isVisible(){if(!this._isVisible||!this.inheritVisibility||!this._parentNode)return this._isVisible;if(this._isVisible){let e=this._parentNode;for(;e;){const t=e.isVisible;if(typeof t<"u")return t;e=e.parent}}return this._isVisible}set isVisible(e){this._isVisible=e}get pointerOverDisableMeshTesting(){return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting}set pointerOverDisableMeshTesting(e){this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting=e}get renderingGroupId(){return this._internalAbstractMeshDataInfo._renderingGroupId}set renderingGroupId(e){this._internalAbstractMeshDataInfo._renderingGroupId=e}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){this._setMaterial(e)}_setMaterial(e){this._internalAbstractMeshDataInfo._material!==e&&(this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._material=e,e&&e.meshMap&&(e.meshMap[this.uniqueId]=this),this.onMaterialChangedObservable.hasObservers()&&this.onMaterialChangedObservable.notifyObservers(this),this.subMeshes&&(this.resetDrawCache(void 0,e==null),this._unBindEffect()))}getMaterialForRenderPass(e){var t;return(t=this._internalAbstractMeshDataInfo._materialForRenderPass)==null?void 0:t[e]}setMaterialForRenderPass(e,t){this.resetDrawCache(e),this._internalAbstractMeshDataInfo._materialForRenderPass||(this._internalAbstractMeshDataInfo._materialForRenderPass=[]),this._internalAbstractMeshDataInfo._materialForRenderPass[e]=t}get receiveShadows(){return this._internalAbstractMeshDataInfo._receiveShadows}set receiveShadows(e){this._internalAbstractMeshDataInfo._receiveShadows!==e&&(this._internalAbstractMeshDataInfo._receiveShadows=e,this._markSubMeshesAsLightDirty())}get hasVertexAlpha(){return this._internalAbstractMeshDataInfo._hasVertexAlpha}set hasVertexAlpha(e){this._internalAbstractMeshDataInfo._hasVertexAlpha!==e&&(this._internalAbstractMeshDataInfo._hasVertexAlpha=e,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())}get useVertexColors(){return this._internalAbstractMeshDataInfo._useVertexColors}set useVertexColors(e){this._internalAbstractMeshDataInfo._useVertexColors!==e&&(this._internalAbstractMeshDataInfo._useVertexColors=e,this._markSubMeshesAsAttributesDirty())}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get numBoneInfluencers(){return this._internalAbstractMeshDataInfo._numBoneInfluencers}set numBoneInfluencers(e){this._internalAbstractMeshDataInfo._numBoneInfluencers!==e&&(this._internalAbstractMeshDataInfo._numBoneInfluencers=e,this._markSubMeshesAsAttributesDirty())}get applyFog(){return this._internalAbstractMeshDataInfo._applyFog}set applyFog(e){this._internalAbstractMeshDataInfo._applyFog!==e&&(this._internalAbstractMeshDataInfo._applyFog=e,this._markSubMeshesAsMiscDirty())}get enableDistantPicking(){return this._internalAbstractMeshDataInfo._enableDistantPicking}set enableDistantPicking(e){this._internalAbstractMeshDataInfo._enableDistantPicking=e}get layerMask(){return this._internalAbstractMeshDataInfo._layerMask}set layerMask(e){e!==this._internalAbstractMeshDataInfo._layerMask&&(this._internalAbstractMeshDataInfo._layerMask=e,this._resyncLightSources())}get collisionMask(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask}set collisionMask(e){this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask=isNaN(e)?-1:e}get collisionResponse(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse}set collisionResponse(e){this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse=e}get collisionGroup(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup}set collisionGroup(e){this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup=isNaN(e)?-1:e}get surroundingMeshes(){return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes}set surroundingMeshes(e){this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes=e}get lightSources(){return this._lightSources}set skeleton(e){const t=this._internalAbstractMeshDataInfo._skeleton;t&&t.needInitialSkinMatrix&&t._unregisterMeshWithPoseMatrix(this),e&&e.needInitialSkinMatrix&&e._registerMeshWithPoseMatrix(this),this._internalAbstractMeshDataInfo._skeleton=e,this._internalAbstractMeshDataInfo._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()}get skeleton(){return this._internalAbstractMeshDataInfo._skeleton}constructor(e,t=null){switch(super(e,t,!1),this._internalAbstractMeshDataInfo=new Bp,this._waitingMaterialId=null,this._waitingMorphTargetManagerId=null,this.cullingStrategy=Qe.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this.onCollideObservable=new Z,this.onCollisionPositionChangeObservable=new Z,this.onMaterialChangedObservable=new Z,this.definedFacingForward=!0,this._occlusionQuery=null,this._renderingGroup=null,this.alphaIndex=Number.MAX_VALUE,this._isVisible=!0,this.isPickable=!0,this.isNearPickable=!1,this.isNearGrabbable=!1,this.showSubMeshesBoundingBox=!1,this.isBlocker=!1,this.enablePointerMoveEvents=!1,this.outlineColor=de.Red(),this.outlineWidth=.02,this.overlayColor=de.Red(),this.overlayAlpha=.5,this.useOctreeForRenderingSelection=!0,this.useOctreeForPicking=!0,this.useOctreeForCollisions=!0,this.alwaysSelectAsActiveMesh=!1,this.doNotSyncBoundingInfo=!1,this.actionManager=null,this.ellipsoid=new v(.5,1,.5),this.ellipsoidOffset=new v(0,0,0),this.edgesWidth=1,this.edgesColor=new H(1,0,0,1),this._edgesRenderer=null,this._masterMesh=null,this._boundingInfo=null,this._boundingInfoIsDirty=!0,this._renderId=0,this._intersectionsInProgress=new Array,this._unIndexed=!1,this._lightSources=new Array,this._waitingData={lods:null,actions:null,freezeWorldMatrix:null},this._bonesTransformMatrices=null,this._transformMatrixTexture=null,this.onRebuildObservable=new Z,this._onCollisionPositionChange=(i,s,n=null)=>{s.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length()>ae.CollisionsEpsilon&&this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),n&&this.onCollideObservable.notifyObservers(n),this.onCollisionPositionChangeObservable.notifyObservers(this.position)},t=this.getScene(),t.addMesh(this),this._resyncLightSources(),this._uniformBuffer=new fe(this.getScene().getEngine(),void 0,void 0,e,!this.getScene().getEngine().isWebGPU),this._buildUniformLayout(),t.performancePriority){case 2:this.doNotSyncBoundingInfo=!0;case 1:this.alwaysSelectAsActiveMesh=!0,this.isPickable=!1;break}}_buildUniformLayout(){this._uniformBuffer.addUniform("world",16),this._uniformBuffer.addUniform("visibility",1),this._uniformBuffer.create()}transferToEffect(e){const t=this._uniformBuffer;t.updateMatrix("world",e),t.updateFloat("visibility",this._internalAbstractMeshDataInfo._visibility),t.update()}getMeshUniformBuffer(){return this._uniformBuffer}getClassName(){return"AbstractMesh"}toString(e){let t="Name: "+this.name+", isInstance: "+(this.getClassName()!=="InstancedMesh"?"YES":"NO");t+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0);const i=this._internalAbstractMeshDataInfo._skeleton;return i&&(t+=", skeleton: "+i.name),e&&(t+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode],t+=", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingData.freezeWorldMatrix?"YES":"NO")),t}_getEffectiveParent(){return this._masterMesh&&this.billboardMode!==Te.BILLBOARDMODE_NONE?this._masterMesh:super._getEffectiveParent()}_getActionManagerForTrigger(e,t=!0){if(this.actionManager&&(t||this.actionManager.isRecursive))if(e){if(this.actionManager.hasSpecificTrigger(e))return this.actionManager}else return this.actionManager;return this.parent?this.parent._getActionManagerForTrigger(e,!1):null}_rebuild(e=!1){if(this.onRebuildObservable.notifyObservers(this),this._occlusionQuery!==null&&(this._occlusionQuery=null),!!this.subMeshes){for(const t of this.subMeshes)t._rebuild();this.resetDrawCache()}}_resyncLightSources(){this._lightSources.length=0;for(const e of this.getScene().lights)e.isEnabled()&&e.canAffectMesh(this)&&this._lightSources.push(e);this._markSubMeshesAsLightDirty()}_resyncLightSource(e){const t=e.isEnabled()&&e.canAffectMesh(this),i=this._lightSources.indexOf(e);let s=!1;if(i===-1){if(!t)return;this._lightSources.push(e)}else{if(t)return;s=!0,this._lightSources.splice(i,1)}this._markSubMeshesAsLightDirty(s)}_unBindEffect(){for(const e of this.subMeshes)e.setEffect(null)}_removeLightSource(e,t){const i=this._lightSources.indexOf(e);i!==-1&&(this._lightSources.splice(i,1),this._markSubMeshesAsLightDirty(t))}_markSubMeshesAsDirty(e){if(this.subMeshes)for(const t of this.subMeshes)for(let i=0;it.markAsLightDirty(e))}_markSubMeshesAsAttributesDirty(){this._markSubMeshesAsDirty(e=>e.markAsAttributesDirty())}_markSubMeshesAsMiscDirty(){this._markSubMeshesAsDirty(e=>e.markAsMiscDirty())}markAsDirty(e){return this._currentRenderId=Number.MAX_VALUE,super.markAsDirty(e),this._isDirty=!0,this}resetDrawCache(e,t=!1){if(this.subMeshes)for(const i of this.subMeshes)i.resetDrawCache(e,t)}get isBlocked(){return!1}getLOD(e){return this}getTotalVertices(){return 0}getTotalIndices(){return 0}getIndices(){return null}getVerticesData(e){return null}setVerticesData(e,t,i,s){return this}updateVerticesData(e,t,i,s){return this}setIndices(e,t){return this}isVerticesDataPresent(e){return!1}getBoundingInfo(){return this._masterMesh?this._masterMesh.getBoundingInfo():(this._boundingInfoIsDirty&&(this._boundingInfoIsDirty=!1,this._updateBoundingInfo()),this._boundingInfo)}getRawBoundingInfo(){var e;return(e=this.rawBoundingInfo)!=null?e:this.getBoundingInfo()}setBoundingInfo(e){return this._boundingInfo=e,this}get hasBoundingInfo(){return this._boundingInfo!==null}buildBoundingInfo(e,t,i){return this._boundingInfo=new ri(e,t,i),this._boundingInfo}normalizeToUnitCube(e=!0,t=!1,i){return super.normalizeToUnitCube(e,t,i)}get useBones(){return this.skeleton&&this.getScene().skeletonsEnabled&&this.isVerticesDataPresent(A.MatricesIndicesKind)&&this.isVerticesDataPresent(A.MatricesWeightsKind)}_preActivate(){}_preActivateForIntermediateRendering(e){}_activate(e,t){return this._renderId=e,!0}_postActivate(){}_freeze(){}_unFreeze(){}getWorldMatrix(){return this._masterMesh&&this.billboardMode===Te.BILLBOARDMODE_NONE?this._masterMesh.getWorldMatrix():super.getWorldMatrix()}_getWorldMatrixDeterminant(){return this._masterMesh?this._masterMesh._getWorldMatrixDeterminant():super._getWorldMatrixDeterminant()}get isAnInstance(){return!1}get hasInstances(){return!1}get hasThinInstances(){return!1}movePOV(e,t,i){return this.position.addInPlace(this.calcMovePOV(e,t,i)),this}calcMovePOV(e,t,i){const s=new O;(this.rotationQuaternion?this.rotationQuaternion:re.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)).toRotationMatrix(s);const r=v.Zero(),o=this.definedFacingForward?-1:1;return v.TransformCoordinatesFromFloatsToRef(e*o,t,i*o,s,r),r}rotatePOV(e,t,i){return this.rotation.addInPlace(this.calcRotatePOV(e,t,i)),this}calcRotatePOV(e,t,i){const s=this.definedFacingForward?1:-1;return new v(e*s,t,i*s)}_refreshBoundingInfo(e,t){if(e){const i=Ic(e,0,this.getTotalVertices(),t);this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new ri(i.minimum,i.maximum)}if(this.subMeshes)for(let i=0;i{if(s){const o=s._vertexData||(s._vertexData={});return o[r]||this.copyVerticesData(r,o),o[r]}return this.getVerticesData(r)};if(t||(t=n(i)),!t)return null;if(s?(s._outputData?s._outputData.set(t):s._outputData=new Float32Array(t),t=s._outputData):(e.applyMorph&&this.morphTargetManager||e.applySkeleton&&this.skeleton)&&(t=t.slice()),e.applyMorph&&this.morphTargetManager&&Dp(t,i,this.morphTargetManager),e.applySkeleton&&this.skeleton){const r=n(A.MatricesIndicesKind),o=n(A.MatricesWeightsKind);if(o&&r){const h=this.numBoneInfluencers>4,l=h?n(A.MatricesIndicesExtraKind):null,c=h?n(A.MatricesWeightsExtraKind):null,u=this.skeleton.getTransformMatrices(this);Qe._ApplySkeleton(t,i,u,r,o,l,c)}}if(e.updatePositionsArray!==!1&&i===A.PositionKind){const r=this._internalAbstractMeshDataInfo._positions||[],o=r.length;if(r.length=t.length/3,o1||!s.IsGlobal)&&s.updateBoundingInfo(e)}return this}_afterComputeWorldMatrix(){this.doNotSyncBoundingInfo||(this._boundingInfoIsDirty=!0)}isInFrustum(e){return this.getBoundingInfo().isInFrustum(e,this.cullingStrategy)}isCompletelyInFrustum(e){return this.getBoundingInfo().isCompletelyInFrustum(e)}intersectsMesh(e,t=!1,i){const s=this.getBoundingInfo(),n=e.getBoundingInfo();if(s.intersects(n,t))return!0;if(i){for(const r of this.getChildMeshes())if(r.intersectsMesh(e,t,!0))return!0}return!1}intersectsPoint(e){return this.getBoundingInfo().intersectsPoint(e)}get checkCollisions(){return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions}set checkCollisions(e){this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions=e}get collider(){return this._internalAbstractMeshDataInfo._meshCollisionData._collider}moveWithCollisions(e){this.getAbsolutePosition().addToRef(this.ellipsoidOffset,this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);const i=this.getScene().collisionCoordinator;return this._internalAbstractMeshDataInfo._meshCollisionData._collider||(this._internalAbstractMeshDataInfo._meshCollisionData._collider=i.createCollider()),this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius=this.ellipsoid,i.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,e,this._internalAbstractMeshDataInfo._meshCollisionData._collider,this.collisionRetryCount,this,this._onCollisionPositionChange,this.uniqueId),this}_collideForSubMesh(e,t,i){var s;if(this._generatePointsArray(),!this._positions)return this;if(!e._lastColliderWorldVertices||!e._lastColliderTransformMatrix.equals(t)){e._lastColliderTransformMatrix=t.clone(),e._lastColliderWorldVertices=[],e._trianglePlanes=[];const n=e.verticesStart,r=e.verticesStart+e.verticesCount;for(let o=n;o1&&!r._checkCollision(e)||this._collideForSubMesh(r,t,e)}return this}_shouldConvertRHS(){return!1}_checkCollision(e){if(!this.getBoundingInfo()._checkCollision(e))return this;const t=N.Matrix[0],i=N.Matrix[1];return O.ScalingToRef(1/e._radius.x,1/e._radius.y,1/e._radius.z,t),this.worldMatrixFromCache.multiplyToRef(t,i),this._processCollisionsForSubMeshes(e,i),this}_generatePointsArray(){return!1}intersects(e,t,i,s=!1,n,r=!1){const o=new as,h=this.getClassName(),l=h==="InstancedLinesMesh"||h==="LinesMesh"||h==="GreasedLineMesh"?this.intersectionThreshold:0,c=this.getBoundingInfo();if(!this.subMeshes||!r&&(!e.intersectsSphere(c.boundingSphere,l)||!e.intersectsBox(c.boundingBox,l)))return o;if(s)return o.hit=!r,o.pickedMesh=r?null:this,o.distance=r?0:v.Distance(e.origin,c.boundingSphere.center),o.subMeshId=0,o;if(!this._generatePointsArray())return o;let u=null;const f=this._scene.getIntersectingSubMeshCandidates(this,e),d=f.length;let _=!1;for(let p=0;p1&&!r&&!g.canIntersects(e))continue;const m=g.intersects(e,this._positions,this.getIndices(),t,i);if(m&&(t||!u||m.distanceo!==this&&o.actionManager===this.actionManager)&&this.actionManager.dispose(),this.actionManager=null),this._internalAbstractMeshDataInfo._skeleton=null,this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null),i=0;i{let h=o.includedOnlyMeshes.indexOf(this);h!==-1&&o.includedOnlyMeshes.splice(h,1),h=o.excludedMeshes.indexOf(this),h!==-1&&o.excludedMeshes.splice(h,1);const l=o.getShadowGenerators();if(l){const c=l.values();for(let u=c.next();u.done!==!0;u=c.next()){const d=u.value.getShadowMap();d&&d.renderList&&(h=d.renderList.indexOf(this),h!==-1&&d.renderList.splice(h,1))}}}),(this.getClassName()!=="InstancedMesh"||this.getClassName()!=="InstancedLinesMesh")&&this.releaseSubMeshes(!0);const r=s.getEngine();if(this._occlusionQuery!==null&&(this.isOcclusionQueryInProgress=!1,r.deleteQuery(this._occlusionQuery),this._occlusionQuery=null),r.wipeCaches(),s.removeMesh(this),this._parentContainer){const o=this._parentContainer.meshes.indexOf(this);o>-1&&this._parentContainer.meshes.splice(o,1),this._parentContainer=null}if(t&&this.material&&(this.material.getClassName()==="MultiMaterial"?this.material.dispose(!1,!0,!0):this.material.dispose(!1,!0)),!e)for(i=0;i65535){o=!0;break}o?e.depthSortedIndices=new Uint32Array(i):e.depthSortedIndices=new Uint16Array(i)}if(e.facetDepthSortFunction=function(o,h){return h.sqDistance-o.sqDistance},!e.facetDepthSortFrom){const o=this.getScene().activeCamera;e.facetDepthSortFrom=o?o.position:v.Zero()}e.depthSortedFacets=[];for(let o=0;oLe?n.maximum.x-n.minimum.x:Le,e.bbSize.y=n.maximum.y-n.minimum.y>Le?n.maximum.y-n.minimum.y:Le,e.bbSize.z=n.maximum.z-n.minimum.z>Le?n.maximum.z-n.minimum.z:Le;let r=e.bbSize.x>e.bbSize.y?e.bbSize.x:e.bbSize.y;if(r=r>e.bbSize.z?r:e.bbSize.z,e.subDiv.max=e.partitioningSubdivisions,e.subDiv.X=Math.floor(e.subDiv.max*e.bbSize.x/r),e.subDiv.Y=Math.floor(e.subDiv.max*e.bbSize.y/r),e.subDiv.Z=Math.floor(e.subDiv.max*e.bbSize.z/r),e.subDiv.X=e.subDiv.X<1?1:e.subDiv.X,e.subDiv.Y=e.subDiv.Y<1?1:e.subDiv.Y,e.subDiv.Z=e.subDiv.Z<1?1:e.subDiv.Z,e.facetParameters.facetNormals=this.getFacetLocalNormals(),e.facetParameters.facetPositions=this.getFacetLocalPositions(),e.facetParameters.facetPartitioning=this.getFacetLocalPartitioning(),e.facetParameters.bInfo=n,e.facetParameters.bbSize=e.bbSize,e.facetParameters.subDiv=e.subDiv,e.facetParameters.ratio=this.partitioningBBoxRatio,e.facetParameters.depthSort=e.facetDepthSort,e.facetDepthSort&&e.facetDepthSortEnabled&&(this.computeWorldMatrix(!0),this._worldMatrix.invertToRef(e.invertedMatrix),v.TransformCoordinatesToRef(e.facetDepthSortFrom,e.invertedMatrix,e.facetDepthSortOrigin),e.facetParameters.distanceTo=e.facetDepthSortOrigin),e.facetParameters.depthSortedFacets=e.depthSortedFacets,s&&j.ComputeNormals(t,i,s,e.facetParameters),e.facetDepthSort&&e.facetDepthSortEnabled){e.depthSortedFacets.sort(e.facetDepthSortFunction);const o=e.depthSortedIndices.length/3|0;for(let h=0;hn.subDiv.max||o<0||o>n.subDiv.max||h<0||h>n.subDiv.max?null:n.facetPartitioning[r+n.subDiv.max*o+n.subDiv.max*n.subDiv.max*h]}getClosestFacetAtCoordinates(e,t,i,s,n=!1,r=!0){const o=this.getWorldMatrix(),h=N.Matrix[5];o.invertToRef(h);const l=N.Vector3[8];v.TransformCoordinatesFromFloatsToRef(e,t,i,h,l);const c=this.getClosestFacetAtLocalCoordinates(l.x,l.y,l.z,s,n,r);return s&&v.TransformCoordinatesFromFloatsToRef(s.x,s.y,s.z,o,s),c}getClosestFacetAtLocalCoordinates(e,t,i,s,n=!1,r=!0){let o=null,h=0,l=0,c=0,u=0,f=0,d=0,_=0,p=0;const g=this.getFacetLocalPositions(),m=this.getFacetLocalNormals(),b=this.getFacetsAtLocalCoordinates(e,t,i);if(!b)return null;let I=Number.MAX_VALUE,T=I,x,y,R;for(let E=0;E=0||n&&!r&&u<=0)&&(u=y.x*R.x+y.y*R.y+y.z*R.z,f=-(y.x*e+y.y*t+y.z*i-u)/(y.x*y.x+y.y*y.y+y.z*y.z),d=e+y.x*f,_=t+y.y*f,p=i+y.z*f,h=d-e,l=_-t,c=p-i,T=h*h+l*l+c*c,Te.emitter===this)}}Qe.OCCLUSION_TYPE_NONE=0;Qe.OCCLUSION_TYPE_OPTIMISTIC=1;Qe.OCCLUSION_TYPE_STRICT=2;Qe.OCCLUSION_ALGORITHM_TYPE_ACCURATE=0;Qe.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE=1;Qe.CULLINGSTRATEGY_STANDARD=0;Qe.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1;Qe.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2;Qe.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3;D([rs.filter((...[a,e,t,i,s])=>!Array.isArray(a)&&!Array.isArray(e)&&!Array.isArray(t)&&!Array.isArray(i)&&!Array.isArray(s))],Qe,"_ApplySkeleton",null);vt("BABYLON.AbstractMesh",Qe);class Lp{constructor(){this.occlusionInternalRetryCounter=0,this.isOcclusionQueryInProgress=!1,this.isOccluded=!1,this.occlusionRetryCount=-1,this.occlusionType=Qe.OCCLUSION_TYPE_NONE,this.occlusionQueryAlgorithmType=Qe.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE,this.forceRenderingWhenOccluded=!1}}ae.prototype.getGPUFrameTimeCounter=function(){return null};ae.prototype.captureGPUFrameTime=function(a){};ae.prototype.createQuery=function(){return null};ae.prototype.deleteQuery=function(a){return this};ae.prototype.isQueryResultAvailable=function(a){return!1};ae.prototype.getQueryResult=function(a){return 0};ae.prototype.beginOcclusionQuery=function(a,e){return!1};ae.prototype.endOcclusionQuery=function(a){return this};Object.defineProperty(Qe.prototype,"isOcclusionQueryInProgress",{get:function(){return this._occlusionDataStorage.isOcclusionQueryInProgress},set:function(a){this._occlusionDataStorage.isOcclusionQueryInProgress=a},enumerable:!1,configurable:!0});Object.defineProperty(Qe.prototype,"_occlusionDataStorage",{get:function(){return this.__occlusionDataStorage||(this.__occlusionDataStorage=new Lp),this.__occlusionDataStorage},enumerable:!1,configurable:!0});Object.defineProperty(Qe.prototype,"isOccluded",{get:function(){return this._occlusionDataStorage.isOccluded},set:function(a){this._occlusionDataStorage.isOccluded=a},enumerable:!0,configurable:!0});Object.defineProperty(Qe.prototype,"occlusionQueryAlgorithmType",{get:function(){return this._occlusionDataStorage.occlusionQueryAlgorithmType},set:function(a){this._occlusionDataStorage.occlusionQueryAlgorithmType=a},enumerable:!0,configurable:!0});Object.defineProperty(Qe.prototype,"occlusionType",{get:function(){return this._occlusionDataStorage.occlusionType},set:function(a){this._occlusionDataStorage.occlusionType=a},enumerable:!0,configurable:!0});Object.defineProperty(Qe.prototype,"occlusionRetryCount",{get:function(){return this._occlusionDataStorage.occlusionRetryCount},set:function(a){this._occlusionDataStorage.occlusionRetryCount=a},enumerable:!0,configurable:!0});Object.defineProperty(Qe.prototype,"forceRenderingWhenOccluded",{get:function(){return this._occlusionDataStorage.forceRenderingWhenOccluded},set:function(a){this._occlusionDataStorage.forceRenderingWhenOccluded=a},enumerable:!0,configurable:!0});Qe.prototype._checkOcclusionQuery=function(){const a=this._occlusionDataStorage;if(a.occlusionType===Qe.OCCLUSION_TYPE_NONE)return a.isOccluded=!1,!1;const e=this.getEngine();if(!e.getCaps().supportOcclusionQuery||!e.isQueryResultAvailable)return a.isOccluded=!1,!1;if(this.isOcclusionQueryInProgress&&this._occlusionQuery!==null&&this._occlusionQuery!==void 0)if(e.isQueryResultAvailable(this._occlusionQuery)){const s=e.getQueryResult(this._occlusionQuery);a.isOcclusionQueryInProgress=!1,a.occlusionInternalRetryCounter=0,a.isOccluded=!(s>0)}else if(a.occlusionInternalRetryCounter++,a.occlusionRetryCount!==-1&&a.occlusionInternalRetryCounter>a.occlusionRetryCount)a.isOcclusionQueryInProgress=!1,a.occlusionInternalRetryCounter=0,a.isOccluded=a.occlusionType===Qe.OCCLUSION_TYPE_OPTIMISTIC?!1:a.isOccluded;else return a.occlusionType===Qe.OCCLUSION_TYPE_OPTIMISTIC?!1:a.isOccluded;const t=this.getScene();if(t.getBoundingBoxRenderer){const i=t.getBoundingBoxRenderer();this._occlusionQuery===null&&(this._occlusionQuery=e.createQuery()),this._occlusionQuery&&e.beginOcclusionQuery(a.occlusionQueryAlgorithmType,this._occlusionQuery)&&(i.renderOcclusionBoundingBox(this),e.endOcclusionQuery(a.occlusionQueryAlgorithmType),this._occlusionDataStorage.isOcclusionQueryInProgress=!0)}return a.isOccluded};et.prototype.getGPUFrameTimeCounter=function(){return this._timestampQuery.gpuFrameTimeCounter};et.prototype.captureGPUFrameTime=function(a){this._timestampQuery.enable=a&&!!this._caps.timerQuery};et.prototype.createQuery=function(){return this._occlusionQuery.createQuery()};et.prototype.deleteQuery=function(a){return this._occlusionQuery.deleteQuery(a),this};et.prototype.isQueryResultAvailable=function(a){return this._occlusionQuery.isQueryResultAvailable(a)};et.prototype.getQueryResult=function(a){return this._occlusionQuery.getQueryResult(a)};et.prototype.beginOcclusionQuery=function(a,e){var t;if(this.compatibilityMode){if(this._occlusionQuery.canBeginQuery(e))return(t=this._currentRenderPass)==null||t.beginOcclusionQuery(e),!0}else return this._bundleList.addItem(new M0(e)),!0;return!1};et.prototype.endOcclusionQuery=function(){var a;return this.compatibilityMode?(a=this._currentRenderPass)==null||a.endOcclusionQuery():this._bundleList.addItem(new P0),this};const wh={label:"TextureView_SwapChain_ResolveTarget",dimension:"2d",format:void 0,mipLevelCount:1,arrayLayerCount:1},Dh={label:"TextureView_SwapChain",dimension:"2d",format:void 0,mipLevelCount:1,arrayLayerCount:1},Np=new H;class Ye extends et{get snapshotRenderingMode(){return this._snapshotRendering.mode}set snapshotRenderingMode(e){this._snapshotRendering.mode=e}snapshotRenderingReset(){this._snapshotRendering.reset()}get snapshotRendering(){return this._snapshotRendering.enabled}set snapshotRendering(e){this._snapshotRendering.enabled=e}get disableCacheSamplers(){return this._cacheSampler?this._cacheSampler.disabled:!1}set disableCacheSamplers(e){this._cacheSampler&&(this._cacheSampler.disabled=e)}get disableCacheRenderPipelines(){return this._cacheRenderPipeline?this._cacheRenderPipeline.disabled:!1}set disableCacheRenderPipelines(e){this._cacheRenderPipeline&&(this._cacheRenderPipeline.disabled=e)}get disableCacheBindGroups(){return this._cacheBindGroups?this._cacheBindGroups.disabled:!1}set disableCacheBindGroups(e){this._cacheBindGroups&&(this._cacheBindGroups.disabled=e)}areAllEffectsReady(){return!0}getFontOffset(e){return cc(e)}static get IsSupportedAsync(){return navigator.gpu?navigator.gpu.requestAdapter().then(e=>!!e,()=>!1).catch(()=>!1):Promise.resolve(!1)}static get IsSupported(){return U.Warn("You must call IsSupportedAsync for WebGPU!"),!1}get supportsUniformBuffers(){return!0}get supportedExtensions(){return this._adapterSupportedExtensions}get enabledExtensions(){return this._deviceEnabledExtensions}get supportedLimits(){return this._adapterSupportedLimits}get currentLimits(){return this._deviceLimits}get description(){return this.name+this.version}get version(){return 1}getInfo(){return{vendor:this._adapterInfo.vendor||"unknown vendor",renderer:this._adapterInfo.architecture||"unknown renderer",version:this._adapterInfo.description||"unknown version"}}get compatibilityMode(){return this._compatibilityMode}set compatibilityMode(e){this._compatibilityMode=e}get currentSampleCount(){return this._currentRenderTarget?this._currentRenderTarget.samples:this._mainPassSampleCount}static CreateAsync(e,t={}){const i=new Ye(e,t);return new Promise(s=>{i.initAsync(t.glslangOptions,t.twgslOptions).then(()=>s(i))})}constructor(e,t={}){var i,s;if(super((i=t.antialias)!=null?i:!0,t),this.uniqueId=-1,this._uploadEncoderDescriptor={label:"upload"},this._renderEncoderDescriptor={label:"render"},this._clearDepthValue=1,this._clearReverseDepthValue=0,this._clearStencilValue=0,this._defaultSampleCount=4,this._glslang=null,this._tintWASM=null,this._glslangAndTintAreFullyLoaded=!1,this._adapterInfo={vendor:"",architecture:"",device:"",description:""},this._compiledComputeEffects={},this._counters={numEnableEffects:0,numEnableDrawWrapper:0,numBundleCreationNonCompatMode:0,numBundleReuseNonCompatMode:0},this.countersLastFrame={numEnableEffects:0,numEnableDrawWrapper:0,numBundleCreationNonCompatMode:0,numBundleReuseNonCompatMode:0},this.numMaxUncapturedErrors=20,this.scenes=[],this._virtualScenes=new Array,this._commandBuffers=[null,null],this._mainRenderPassWrapper={renderPassDescriptor:null,colorAttachmentViewDescriptor:null,depthAttachmentViewDescriptor:null,colorAttachmentGPUTextures:[],depthTextureFormat:void 0},this._rttRenderPassWrapper={renderPassDescriptor:null,colorAttachmentViewDescriptor:null,depthAttachmentViewDescriptor:null,colorAttachmentGPUTextures:[],depthTextureFormat:void 0},this._pendingDebugCommands=[],this._currentOverrideVertexBuffers=null,this._currentIndexBuffer=null,this._colorWriteLocal=!0,this._forceEnableEffect=!1,this.isNDCHalfZRange=!0,this.hasOriginBottomLeft=!1,this._workingGlslangAndTintPromise=null,this._viewportsCurrent={x:0,y:0,w:0,h:0},this._scissorsCurrent={x:0,y:0,w:0,h:0},this._scissorCached={x:0,y:0,z:0,w:0},this._stencilRefsCurrent=-1,this._blendColorsCurrent=[null,null,null,null],this._performanceMonitor=new Yl,this._name="WebGPU",this._drawCalls=new ui,t.deviceDescriptor=t.deviceDescriptor||{},t.enableGPUDebugMarkers=(s=t.enableGPUDebugMarkers)!=null?s:!1,U.Log("Babylon.js v".concat(ae.Version," - ").concat(this.description," engine")),!navigator.gpu){U.Error("WebGPU is not supported by your browser.");return}t.swapChainFormat=t.swapChainFormat||navigator.gpu.getPreferredCanvasFormat(),this._isWebGPU=!0,this._shaderPlatformName="WEBGPU",this._renderingCanvas=e,this._options=t,this._mainPassSampleCount=t.antialias?this._defaultSampleCount:1,navigator&&navigator.userAgent&&this._setupMobileChecks(),this._sharedInit(this._renderingCanvas),this._shaderProcessor=new g_,this._shaderProcessorWGSL=new U_}prepareGlslangAndTintAsync(){return this._workingGlslangAndTintPromise||(this._workingGlslangAndTintPromise=new Promise(e=>{var t,i;this._initGlslang((i=this._glslangOptions)!=null?i:(t=this._options)==null?void 0:t.glslangOptions).then(s=>{var n,r;this._glslang=s,this._tintWASM=new ei,this._tintWASM.initTwgsl((r=this._twgslOptions)!=null?r:(n=this._options)==null?void 0:n.twgslOptions).then(()=>{this._glslangAndTintAreFullyLoaded=!0,e()})})})),this._workingGlslangAndTintPromise}initAsync(e,t){return this.uniqueId=Ye._InstanceId++,this._glslangOptions=e,this._twgslOptions=t,navigator.gpu.requestAdapter(this._options).then(i=>{var s,n,r;if(i){this._adapter=i,this._adapterSupportedExtensions=[],(s=this._adapter.features)==null||s.forEach(l=>this._adapterSupportedExtensions.push(l)),this._adapterSupportedLimits=this._adapter.limits,this._adapterInfo=this._adapter.info;const o=(n=this._options.deviceDescriptor)!=null?n:{},h=(r=o==null?void 0:o.requiredFeatures)!=null?r:this._options.enableAllFeatures?this._adapterSupportedExtensions:void 0;if(h){const l=h,c=[];for(const u of l)this._adapterSupportedExtensions.indexOf(u)!==-1&&c.push(u);o.requiredFeatures=c}if(this._options.setMaximumLimits&&!o.requiredLimits){o.requiredLimits={};for(const l in this._adapterSupportedLimits)l==="minSubgroupSize"||l==="maxSubgroupSize"||(o.requiredLimits[l]=this._adapterSupportedLimits[l])}return o.label="BabylonWebGPUDevice".concat(this.uniqueId),this._adapter.requestDevice(o)}else throw"Could not retrieve a WebGPU adapter (adapter is null)."}).then(i=>{var n,r;this._device=i,this._deviceEnabledExtensions=[],(n=this._device.features)==null||n.forEach(o=>this._deviceEnabledExtensions.push(o)),this._deviceLimits=i.limits;let s=-1;this._device.addEventListener("uncapturederror",o=>{++s{this._isDisposed||(this._contextWasLost=!0,U.Warn("WebGPU context lost. "+o),this.onContextLostObservable.notifyObservers(this),this._restoreEngineAfterContextLost(async()=>{var _,p,g,m;const h=this.snapshotRenderingMode,l=this.snapshotRendering,c=this.disableCacheSamplers,u=this.disableCacheRenderPipelines,f=this.disableCacheBindGroups,d=this.enableGPUTimingMeasurements;await this.initAsync((p=this._glslangOptions)!=null?p:(_=this._options)==null?void 0:_.glslangOptions,(m=this._twgslOptions)!=null?m:(g=this._options)==null?void 0:g.twgslOptions),this.snapshotRenderingMode=h,this.snapshotRendering=l,this.disableCacheSamplers=c,this.disableCacheRenderPipelines=u,this.disableCacheBindGroups=f,this.enableGPUTimingMeasurements=d,this._currentRenderPass=null}))})}).then(()=>{this._initializeLimits(),this._bufferManager=new Mr(this,this._device),this._textureHelper=new j_(this,this._device,this._bufferManager,this._deviceEnabledExtensions),this._cacheSampler=new Fs(this._device),this._cacheBindGroups=new qe(this._device,this._cacheSampler,this),this._timestampQuery=new bp(this,this._device,this._bufferManager),this._occlusionQuery=this._device.createQuerySet?new yp(this,this._device,this._bufferManager):void 0,this._bundleList=new D0(this._device),this._snapshotRendering=new Tp(this,this._snapshotRenderingMode,this._bundleList),this._ubInvertY=this._bufferManager.createBuffer(new Float32Array([-1,0]),We.Uniform|We.CopyDst,"UBInvertY"),this._ubDontInvertY=this._bufferManager.createBuffer(new Float32Array([1,0]),We.Uniform|We.CopyDst,"UBDontInvertY"),this.dbgVerboseLogsForFirstFrames&&this._count===void 0&&(this._count=0,U.Log(["%c frame #"+this._count+" - begin","background: #ffff00"])),this._uploadEncoder=this._device.createCommandEncoder(this._uploadEncoderDescriptor),this._renderEncoder=this._device.createCommandEncoder(this._renderEncoderDescriptor),this._emptyVertexBuffer=new A(this,[0],"",{stride:1,offset:0,size:1,label:"EmptyVertexBuffer"}),this._cacheRenderPipeline=new Ci(this._device,this._emptyVertexBuffer),this._depthCullingState=new up(this._cacheRenderPipeline),this._stencilStateComposer=new cp(this._cacheRenderPipeline),this._stencilStateComposer.stencilGlobal=this._stencilState,this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=515,this._depthCullingState.depthMask=!0,this._textureHelper.setCommandEncoder(this._uploadEncoder),this._clearQuad=new vp(this._device,this,this._emptyVertexBuffer),this._defaultDrawContext=this.createDrawContext(),this._currentDrawContext=this._defaultDrawContext,this._defaultMaterialContext=this.createMaterialContext(),this._currentMaterialContext=this._defaultMaterialContext,this._initializeContextAndSwapChain(),this._initializeMainAttachments(),this.resize()}).catch(i=>{throw U.Error("A fatal error occurred during WebGPU creation/initialization."),i})}_initGlslang(e){return e=e||{},e={...Ye._GlslangDefaultOptions,...e},e.glslang?Promise.resolve(e.glslang):self.glslang?self.glslang(e.wasmPath):e.jsPath&&e.wasmPath?J.LoadBabylonScriptAsync(e.jsPath).then(()=>self.glslang(J.GetBabylonScriptURL(e.wasmPath))):Promise.reject("gslang is not available.")}_initializeLimits(){this._caps={maxTexturesImageUnits:this._deviceLimits.maxSampledTexturesPerShaderStage,maxVertexTextureImageUnits:this._deviceLimits.maxSampledTexturesPerShaderStage,maxCombinedTexturesImageUnits:this._deviceLimits.maxSampledTexturesPerShaderStage*2,maxTextureSize:this._deviceLimits.maxTextureDimension2D,maxCubemapTextureSize:this._deviceLimits.maxTextureDimension2D,maxRenderTextureSize:this._deviceLimits.maxTextureDimension2D,maxVertexAttribs:this._deviceLimits.maxVertexAttributes,maxDrawBuffers:8,maxVaryingVectors:this._deviceLimits.maxInterStageShaderVariables,maxFragmentUniformVectors:Math.floor(this._deviceLimits.maxUniformBufferBindingSize/4),maxVertexUniformVectors:Math.floor(this._deviceLimits.maxUniformBufferBindingSize/4),standardDerivatives:!0,astc:this._deviceEnabledExtensions.indexOf("texture-compression-astc")>=0?!0:void 0,s3tc:this._deviceEnabledExtensions.indexOf("texture-compression-bc")>=0?!0:void 0,pvrtc:null,etc1:null,etc2:this._deviceEnabledExtensions.indexOf("texture-compression-etc2")>=0?!0:void 0,bptc:this._deviceEnabledExtensions.indexOf("texture-compression-bc")>=0?!0:void 0,maxAnisotropy:16,uintIndices:!0,fragmentDepthSupported:!0,highPrecisionShaderSupported:!0,colorBufferFloat:!0,supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:this._deviceEnabledExtensions.indexOf("rg11b10ufloat-renderable")>=0,textureFloat:!0,textureFloatLinearFiltering:this._deviceEnabledExtensions.indexOf("float32-filterable")>=0,textureFloatRender:!0,textureHalfFloat:!0,textureHalfFloatLinearFiltering:!0,textureHalfFloatRender:!0,textureLOD:!0,texelFetch:!0,drawBuffersExtension:!0,depthTextureExtension:!0,vertexArrayObject:!1,instancedArrays:!0,timerQuery:typeof BigUint64Array<"u"&&this._deviceEnabledExtensions.indexOf("timestamp-query")!==-1?!0:void 0,supportOcclusionQuery:typeof BigUint64Array<"u",canUseTimestampForTimerQuery:!0,multiview:!1,oculusMultiview:!1,parallelShaderCompile:void 0,blendMinMax:!0,maxMSAASamples:4,canUseGLInstanceID:!0,canUseGLVertexID:!0,supportComputeShaders:!0,supportSRGBBuffers:!0,supportTransformFeedbacks:!1,textureMaxLevel:!0,texture2DArrayMaxLayerCount:this._deviceLimits.maxTextureArrayLayers,disableMorphTargetTexture:!1,textureNorm16:!1},this._features={forceBitmapOverHTMLImageElement:!0,supportRenderAndCopyToLodForFloatTextures:!0,supportDepthStencilTexture:!0,supportShadowSamplers:!0,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:!0,trackUbosInFrame:!0,checkUbosContentBeforeUpload:!0,supportCSM:!0,basisNeedsPOT:!1,support3DTextures:!0,needTypeSuffixInShaderConstants:!0,supportMSAA:!0,supportSSAO2:!0,supportIBLShadows:!0,supportExtendedTextureFormats:!0,supportSwitchCaseInShader:!0,supportSyncTextureRead:!1,needsInvertingBitmap:!1,useUBOBindingCache:!1,needShaderCodeInlining:!0,needToAlwaysBindUniformBuffers:!0,supportRenderPasses:!0,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!0,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!0,_collectUbosUpdatedInFrame:!1}}_initializeContextAndSwapChain(){if(!this._renderingCanvas)throw"The rendering canvas has not been set!";this._context=this._renderingCanvas.getContext("webgpu"),this._configureContext(),this._colorFormat=this._options.swapChainFormat,this._mainRenderPassWrapper.colorAttachmentGPUTextures=[new pr(this)],this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].format=this._colorFormat,this._setColorFormat(this._mainRenderPassWrapper)}_initializeMainAttachments(){if(!this._bufferManager)return;this.flushFramebuffer(),this._mainTextureExtends={width:this.getRenderWidth(!0),height:this.getRenderHeight(!0),depthOrArrayLayers:1};const e=new Float32Array([this.getRenderHeight(!0)]);this._bufferManager.setSubData(this._ubInvertY,4,e),this._bufferManager.setSubData(this._ubDontInvertY,4,e);let t;if(this._options.antialias){const n={label:"Texture_MainColor_".concat(this._mainTextureExtends.width,"x").concat(this._mainTextureExtends.height,"_antialiasing"),size:this._mainTextureExtends,mipLevelCount:1,sampleCount:this._mainPassSampleCount,dimension:"2d",format:this._options.swapChainFormat,usage:16};this._mainTexture&&this._textureHelper.releaseTexture(this._mainTexture),this._mainTexture=this._device.createTexture(n),t=[{view:this._mainTexture.createView({label:"TextureView_MainColor_antialiasing",dimension:"2d",format:this._options.swapChainFormat,mipLevelCount:1,arrayLayerCount:1}),clearValue:new H(0,0,0,1),loadOp:"clear",storeOp:"store"}]}else t=[{view:void 0,clearValue:new H(0,0,0,1),loadOp:"clear",storeOp:"store"}];this._mainRenderPassWrapper.depthTextureFormat=this.isStencilEnable?"depth24plus-stencil8":"depth32float",this._setDepthTextureFormat(this._mainRenderPassWrapper),this._setColorFormat(this._mainRenderPassWrapper);const i={label:"Texture_MainDepthStencil_".concat(this._mainTextureExtends.width,"x").concat(this._mainTextureExtends.height),size:this._mainTextureExtends,mipLevelCount:1,sampleCount:this._mainPassSampleCount,dimension:"2d",format:this._mainRenderPassWrapper.depthTextureFormat,usage:16};this._depthTexture&&this._textureHelper.releaseTexture(this._depthTexture),this._depthTexture=this._device.createTexture(i);const s={view:this._depthTexture.createView({label:"TextureView_MainDepthStencil_".concat(this._mainTextureExtends.width,"x").concat(this._mainTextureExtends.height),dimension:"2d",format:this._depthTexture.format,mipLevelCount:1,arrayLayerCount:1}),depthClearValue:this._clearDepthValue,depthLoadOp:"clear",depthStoreOp:"store",stencilClearValue:this._clearStencilValue,stencilLoadOp:this.isStencilEnable?"clear":void 0,stencilStoreOp:this.isStencilEnable?"store":void 0};this._mainRenderPassWrapper.renderPassDescriptor={label:"MainRenderPass",colorAttachments:t,depthStencilAttachment:s}}_sharedInit(e){super._sharedInit(e),hc(this,e,this._creationOptions)}_configureContext(){this._context.configure({device:this._device,format:this._options.swapChainFormat,usage:17,alphaMode:this.premultipliedAlpha?"premultiplied":"opaque"})}resizeImageBitmap(e,t,i){return fc(this,e,t,i)}_createImageBitmapFromSource(e,t){return uc(this,e,t)}switchFullscreen(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&dc(this._renderingCanvas))}exitFullscreen(){this.isFullscreen&&_c()}enterPointerlock(){this._renderingCanvas&&R0(this._renderingCanvas)}exitPointerlock(){pc()}_rebuildBuffers(){super._rebuildBuffers();for(const e of this._storageBuffers)e.getBuffer().engineId!==this.uniqueId&&e._rebuild()}_restoreEngineAfterContextLost(e){Ci.ResetCache(),qe.ResetCache();const t=s=>{var n;for(const r of s){for(const o of r.meshes){const h=o.subMeshes;if(h)for(const l of h)l._drawWrappers=[]}for(const o of r.materials)(n=o._materialContext)==null||n.reset()}};t(this.scenes),t(this._virtualScenes);const i=[];for(const s of this._uniformBuffers)s.name.indexOf("leftOver")<0&&i.push(s);this._uniformBuffers=i,super._restoreEngineAfterContextLost(e)}setSize(e,t,i=!1){return super.setSize(e,t,i)?(this.dbgVerboseLogsForFirstFrames&&(this._count===void 0&&(this._count=0),(!this._count||this._count=0,n=t.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,r=i===0?this._compileRawShaderToSpirV(e,"vertex"):e,o=i===0?this._compileRawShaderToSpirV(t,"fragment"):t;return this._createPipelineStageDescriptor(r,o,i,s,n)}_compilePipelineStageDescriptor(e,t,i,s){this.onBeforeShaderCompilationObservable.notifyObservers(this);const n=e.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,r=t.indexOf("#define DISABLE_UNIFORMITY_ANALYSIS")>=0,o="#version 450\n",h=s===0?this._compileShaderToSpirV(e,"vertex",i,o):this._getWGSLShader(e,"vertex",i),l=s===0?this._compileShaderToSpirV(t,"fragment",i,o):this._getWGSLShader(t,"fragment",i),c=this._createPipelineStageDescriptor(h,l,s,n,r);return this.onAfterShaderCompilationObservable.notifyObservers(this),c}createRawShaderProgram(){throw"Not available on WebGPU"}createShaderProgram(){throw"Not available on WebGPU"}inlineShaderCode(e){const t=new Hr(e);return t.debug=!1,t.processCode(),t.code}createPipelineContext(e){return new u_(e,this)}createMaterialContext(){return new zr}createDrawContext(){return new Wr(this._bufferManager)}async _preparePipelineContext(e,t,i,s,n,r,o,h,l,c,u){const f=e,d=f.shaderProcessingContext.shaderLanguage;d===0&&!this._glslangAndTintAreFullyLoaded&&await this.prepareGlslangAndTintAsync(),this.dbgShowShaderCode&&(U.Log(["defines",h]),U.Log(t),U.Log(i),U.Log("***********************************************")),f.sources={fragment:i,vertex:t,rawVertex:n,rawFragment:r},s?f.stages=this._compileRawPipelineStageDescriptor(t,i,d):f.stages=this._compilePipelineStageDescriptor(t,i,h,d),u()}getAttributes(e,t){const i=new Array(t.length),s=e;for(let n=0;n0,r.is3D=l>0,r._cachedWrapU=0,r._cachedWrapV=0,r._useSRGBBuffer=n.useSRGBBuffer,r.label=n.label,this._internalTexturesCache.push(r),!i){const _=!n.generateMipMaps&&n.createMipMaps;_&&(r.generateMipMaps=!0),this._textureHelper.createGPUTextureForInternalTexture(r,o,h,c||1,n.creationFlags),_&&(r.generateMipMaps=!1)}return r}createTexture(e,t,i,s,n=3,r=null,o=null,h=null,l=null,c=null,u=null,f,d,_,p){return this._createTextureBase(e,t,i,s,n,r,o,(g,m,b,I,T,x,y,R)=>{var C;const E=I;if(g.baseWidth=E.width,g.baseHeight=E.height,g.width=E.width,g.height=E.height,g.format=g.format!==-1?g.format:c!=null?c:5,g.type=g.type!==-1?g.type:0,g._creationFlags=_!=null?_:0,R(g.width,g.height,E,m,g,()=>{}),(C=g._hardwareTexture)!=null&&C.underlyingResource)!x&&!y&&this._generateMipmaps(g,this._uploadEncoder);else{const S=this._textureHelper.createGPUTextureForInternalTexture(g,E.width,E.height,void 0,_);Ve.IsImageBitmap(E)&&(this._textureHelper.updateTexture(E,g,E.width,E.height,g.depth,S.format,0,0,T,!1,0,0),!x&&!y&&this._generateMipmaps(g,this._uploadEncoder))}b&&b.removePendingData(g),g.isReady=!0,g.onLoadedObservable.notifyObservers(g),g.onLoadedObservable.clear()},()=>!1,h,l,c,u,f,d,p)}wrapWebGPUTexture(e){const t=new pr(this,e),i=new ft(this,0,!0);return i._hardwareTexture=t,i.isReady=!0,i}wrapWebGLTexture(){throw new Error("wrapWebGLTexture is not supported, use wrapWebGPUTexture instead.")}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers}_unpackFlipY(e){}updateTextureSamplingMode(e,t,i=!1){i&&(t.generateMipMaps=!0,this._generateMipmaps(t)),t.samplingMode=e}updateTextureWrappingMode(e,t,i=null,s=null){t!==null&&(e._cachedWrapU=t),i!==null&&(e._cachedWrapV=i),(e.is2DArray||e.is3D)&&s!==null&&(e._cachedWrapR=s)}updateTextureDimensions(e,t,i,s=1){if(!e._hardwareTexture||e.width===t&&e.height===i&&e.depth===s)return;const n=e._hardwareTexture.textureAdditionalUsages;e._hardwareTexture.release(),this._textureHelper.createGPUTextureForInternalTexture(e,t,i,s,n)}_setInternalTexture(e,t,i){if(i=i!=null?i:e,this._currentEffect){const n=this._currentEffect._pipelineContext.shaderProcessingContext.availableTextures[i];if(this._currentMaterialContext.setTexture(e,t),n&&n.autoBindSampler){const r=i+"Sampler";this._currentMaterialContext.setSampler(r,t)}}}createPrefilteredCubeTexture(e,t,i,s,n=null,r=null,o,h=null,l=!0){const c=u=>{if(!u){n&&n(null);return}const f=u.texture;l?u.info.sphericalPolynomial&&(f._sphericalPolynomial=u.info.sphericalPolynomial):f._sphericalPolynomial=new On,f._source=9,n&&n(f)};return this.createCubeTexture(e,t,null,!1,c,r,o,h,l,i,s)}setTexture(e,t,i,s){this._setTexture(e,i,!1,!1,s,s)}setTextureArray(e,t,i,s){for(let n=0;n=13&&T.format<=18;((T==null?void 0:T.type)===1&&!this._caps.textureFloatLinearFiltering||x)&&(u|=m),m=m<<1}}this._currentMaterialContext.textureState=u;const f=this._cacheRenderPipeline.getRenderPipeline(t,this._currentEffect,this.currentSampleCount,u),d=this._cacheBindGroups.getBindGroups(h,this._currentDrawContext,this._currentMaterialContext);this._snapshotRendering.record||(this._applyRenderPassChanges(this.compatibilityMode?null:o),this.compatibilityMode||(this._counters.numBundleCreationNonCompatMode++,c=this._device.createRenderBundleEncoder({colorFormats:this._cacheRenderPipeline.colorFormats,depthStencilFormat:this._depthTextureFormat,sampleCount:Ve.GetSample(this.currentSampleCount)}))),c.setPipeline(f),this._currentIndexBuffer&&c.setIndexBuffer(this._currentIndexBuffer.underlyingResource,this._currentIndexBuffer.is32Bits?"uint32":"uint16",0);const _=this._cacheRenderPipeline.vertexBuffers;for(let m=0;m<_.length;m++){const b=_[m],I=b.effectiveBuffer;I&&c.setVertexBuffer(m,I.underlyingResource,b._validOffsetRange?0:b.byteOffset)}for(let m=0;m{const o=()=>{e.mapAsync(1,0,t).then(()=>{const h=e.getMappedRange(0,t);let l=i;if(l===void 0)l=new Uint8Array(t),l.set(new Uint8Array(h));else{const c=l.constructor;l=new c(l.buffer),l.set(new c(h))}e.unmap(),this._bufferManager.releaseBuffer(e),n(l)},h=>{this.isDisposed?n(new Uint8Array):r(h)})};s?(this.flushFramebuffer(),o()):this.onEndFrameObservable.addOnce(()=>{o()})})}readFromStorageBuffer(e,t,i,s,n){i=i||e.capacity;const r=this._bufferManager.createRawBuffer(i,We.MapRead|We.CopyDst,void 0,"TempReadFromStorageBuffer");return this._renderEncoder.copyBufferToBuffer(e.underlyingResource,t!=null?t:0,r,0,i),this._readFromGPUBuffer(r,i,s,n)}readFromMultipleStorageBuffers(e,t,i,s,n){i=i||e[0].capacity;const r=this._bufferManager.createRawBuffer(i*e.length,We.MapRead|We.CopyDst,void 0,"TempReadFromMultipleStorageBuffers");for(let o=0;othis.add(t,i))}get(e){const t=this._data[e];if(t!==void 0)return t}getOrAddWithFactory(e,t){let i=this.get(e);return i!==void 0||(i=t(e),i&&this.add(e,i)),i}getOrAdd(e,t){const i=this.get(e);return i!==void 0?i:(this.add(e,t),t)}contains(e){return this._data[e]!==void 0}add(e,t){return this._data[e]!==void 0?!1:(this._data[e]=t,++this._count,!0)}set(e,t){return this._data[e]===void 0?!1:(this._data[e]=t,!0)}getAndRemove(e){const t=this.get(e);return t!==void 0?(delete this._data[e],--this._count,t):null}remove(e){return this.contains(e)?(delete this._data[e],--this._count,!0):!1}clear(){this._data={},this._count=0}get count(){return this._count}forEach(e){for(const t in this._data){const i=this._data[t];e(t,i)}}first(e){for(const t in this._data){const i=this._data[t],s=e(t,i);if(s)return s}return null}}function Ec(a){a.push("vCameraColorCurveNeutral","vCameraColorCurvePositive","vCameraColorCurveNegative")}class ot{constructor(){this._dirty=!0,this._tempColor=new H(0,0,0,0),this._globalCurve=new H(0,0,0,0),this._highlightsCurve=new H(0,0,0,0),this._midtonesCurve=new H(0,0,0,0),this._shadowsCurve=new H(0,0,0,0),this._positiveCurve=new H(0,0,0,0),this._negativeCurve=new H(0,0,0,0),this._globalHue=30,this._globalDensity=0,this._globalSaturation=0,this._globalExposure=0,this._highlightsHue=30,this._highlightsDensity=0,this._highlightsSaturation=0,this._highlightsExposure=0,this._midtonesHue=30,this._midtonesDensity=0,this._midtonesSaturation=0,this._midtonesExposure=0,this._shadowsHue=30,this._shadowsDensity=0,this._shadowsSaturation=0,this._shadowsExposure=0}get globalHue(){return this._globalHue}set globalHue(e){this._globalHue=e,this._dirty=!0}get globalDensity(){return this._globalDensity}set globalDensity(e){this._globalDensity=e,this._dirty=!0}get globalSaturation(){return this._globalSaturation}set globalSaturation(e){this._globalSaturation=e,this._dirty=!0}get globalExposure(){return this._globalExposure}set globalExposure(e){this._globalExposure=e,this._dirty=!0}get highlightsHue(){return this._highlightsHue}set highlightsHue(e){this._highlightsHue=e,this._dirty=!0}get highlightsDensity(){return this._highlightsDensity}set highlightsDensity(e){this._highlightsDensity=e,this._dirty=!0}get highlightsSaturation(){return this._highlightsSaturation}set highlightsSaturation(e){this._highlightsSaturation=e,this._dirty=!0}get highlightsExposure(){return this._highlightsExposure}set highlightsExposure(e){this._highlightsExposure=e,this._dirty=!0}get midtonesHue(){return this._midtonesHue}set midtonesHue(e){this._midtonesHue=e,this._dirty=!0}get midtonesDensity(){return this._midtonesDensity}set midtonesDensity(e){this._midtonesDensity=e,this._dirty=!0}get midtonesSaturation(){return this._midtonesSaturation}set midtonesSaturation(e){this._midtonesSaturation=e,this._dirty=!0}get midtonesExposure(){return this._midtonesExposure}set midtonesExposure(e){this._midtonesExposure=e,this._dirty=!0}get shadowsHue(){return this._shadowsHue}set shadowsHue(e){this._shadowsHue=e,this._dirty=!0}get shadowsDensity(){return this._shadowsDensity}set shadowsDensity(e){this._shadowsDensity=e,this._dirty=!0}get shadowsSaturation(){return this._shadowsSaturation}set shadowsSaturation(e){this._shadowsSaturation=e,this._dirty=!0}get shadowsExposure(){return this._shadowsExposure}set shadowsExposure(e){this._shadowsExposure=e,this._dirty=!0}getClassName(){return"ColorCurves"}static Bind(e,t,i="vCameraColorCurvePositive",s="vCameraColorCurveNeutral",n="vCameraColorCurveNegative"){e._dirty&&(e._dirty=!1,e._getColorGradingDataToRef(e._globalHue,e._globalDensity,e._globalSaturation,e._globalExposure,e._globalCurve),e._getColorGradingDataToRef(e._highlightsHue,e._highlightsDensity,e._highlightsSaturation,e._highlightsExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._highlightsCurve),e._getColorGradingDataToRef(e._midtonesHue,e._midtonesDensity,e._midtonesSaturation,e._midtonesExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._midtonesCurve),e._getColorGradingDataToRef(e._shadowsHue,e._shadowsDensity,e._shadowsSaturation,e._shadowsExposure,e._tempColor),e._tempColor.multiplyToRef(e._globalCurve,e._shadowsCurve),e._highlightsCurve.subtractToRef(e._midtonesCurve,e._positiveCurve),e._midtonesCurve.subtractToRef(e._shadowsCurve,e._negativeCurve)),t&&(t.setFloat4(i,e._positiveCurve.r,e._positiveCurve.g,e._positiveCurve.b,e._positiveCurve.a),t.setFloat4(s,e._midtonesCurve.r,e._midtonesCurve.g,e._midtonesCurve.b,e._midtonesCurve.a),t.setFloat4(n,e._negativeCurve.r,e._negativeCurve.g,e._negativeCurve.b,e._negativeCurve.a))}_getColorGradingDataToRef(e,t,i,s,n){e!=null&&(e=ot._Clamp(e,0,360),t=ot._Clamp(t,-100,100),i=ot._Clamp(i,-100,100),s=ot._Clamp(s,-100,100),t=ot._ApplyColorGradingSliderNonlinear(t),t*=.5,s=ot._ApplyColorGradingSliderNonlinear(s),t<0&&(t*=-1,e=(e+180)%360),ot._FromHSBToRef(e,t,50+.25*s,n),n.scaleToRef(2,n),n.a=1+.01*i)}static _ApplyColorGradingSliderNonlinear(e){e/=100;let t=Math.abs(e);return t=Math.pow(t,2),e<0&&(t*=-1),t*=100,t}static _FromHSBToRef(e,t,i,s){let n=ot._Clamp(e,0,360);const r=ot._Clamp(t/100,0,1),o=ot._Clamp(i/100,0,1);if(r===0)s.r=o,s.g=o,s.b=o;else{n/=60;const h=Math.floor(n),l=n-h,c=o*(1-r),u=o*(1-r*l),f=o*(1-r*(1-l));switch(h){case 0:s.r=o,s.g=f,s.b=c;break;case 1:s.r=u,s.g=o,s.b=c;break;case 2:s.r=c,s.g=o,s.b=f;break;case 3:s.r=c,s.g=u,s.b=o;break;case 4:s.r=f,s.g=c,s.b=o;break;default:s.r=o,s.g=c,s.b=u;break}}s.a=1}static _Clamp(e,t,i){return Math.min(Math.max(e,t),i)}clone(){return Ae.Clone(()=>new ot,this)}serialize(){return Ae.Serialize(this)}static Parse(e){return Ae.Parse(()=>new ot,e,null,null)}}ot.PrepareUniforms=Ec;D([B()],ot.prototype,"_globalHue",void 0);D([B()],ot.prototype,"_globalDensity",void 0);D([B()],ot.prototype,"_globalSaturation",void 0);D([B()],ot.prototype,"_globalExposure",void 0);D([B()],ot.prototype,"_highlightsHue",void 0);D([B()],ot.prototype,"_highlightsDensity",void 0);D([B()],ot.prototype,"_highlightsSaturation",void 0);D([B()],ot.prototype,"_highlightsExposure",void 0);D([B()],ot.prototype,"_midtonesHue",void 0);D([B()],ot.prototype,"_midtonesDensity",void 0);D([B()],ot.prototype,"_midtonesSaturation",void 0);D([B()],ot.prototype,"_midtonesExposure",void 0);Ae._ColorCurvesParser=ot.Parse;function Up(a,e){e.EXPOSURE&&a.push("exposureLinear"),e.CONTRAST&&a.push("contrast"),e.COLORGRADING&&a.push("colorTransformSettings"),(e.VIGNETTE||e.DITHER)&&a.push("vInverseScreenSize"),e.VIGNETTE&&(a.push("vignetteSettings1"),a.push("vignetteSettings2")),e.COLORCURVES&&Ec(a),e.DITHER&&a.push("ditherIntensity")}function kp(a,e){e.COLORGRADING&&a.push("txColorTransform")}class Ne{constructor(){this.colorCurves=new ot,this._colorCurvesEnabled=!1,this._colorGradingEnabled=!1,this._colorGradingWithGreenDepth=!0,this._colorGradingBGR=!0,this._exposure=1,this._toneMappingEnabled=!1,this._toneMappingType=Ne.TONEMAPPING_STANDARD,this._contrast=1,this.vignetteStretch=0,this.vignetteCenterX=0,this.vignetteCenterY=0,this.vignetteWeight=1.5,this.vignetteColor=new H(0,0,0,0),this.vignetteCameraFov=.5,this._vignetteBlendMode=Ne.VIGNETTEMODE_MULTIPLY,this._vignetteEnabled=!1,this._ditheringEnabled=!1,this._ditheringIntensity=1/255,this._skipFinalColorClamp=!1,this._applyByPostProcess=!1,this._isEnabled=!0,this.onUpdateParameters=new Z}get colorCurvesEnabled(){return this._colorCurvesEnabled}set colorCurvesEnabled(e){this._colorCurvesEnabled!==e&&(this._colorCurvesEnabled=e,this._updateParameters())}get colorGradingTexture(){return this._colorGradingTexture}set colorGradingTexture(e){this._colorGradingTexture!==e&&(this._colorGradingTexture=e,this._updateParameters())}get colorGradingEnabled(){return this._colorGradingEnabled}set colorGradingEnabled(e){this._colorGradingEnabled!==e&&(this._colorGradingEnabled=e,this._updateParameters())}get colorGradingWithGreenDepth(){return this._colorGradingWithGreenDepth}set colorGradingWithGreenDepth(e){this._colorGradingWithGreenDepth!==e&&(this._colorGradingWithGreenDepth=e,this._updateParameters())}get colorGradingBGR(){return this._colorGradingBGR}set colorGradingBGR(e){this._colorGradingBGR!==e&&(this._colorGradingBGR=e,this._updateParameters())}get exposure(){return this._exposure}set exposure(e){this._exposure!==e&&(this._exposure=e,this._updateParameters())}get toneMappingEnabled(){return this._toneMappingEnabled}set toneMappingEnabled(e){this._toneMappingEnabled!==e&&(this._toneMappingEnabled=e,this._updateParameters())}get toneMappingType(){return this._toneMappingType}set toneMappingType(e){this._toneMappingType!==e&&(this._toneMappingType=e,this._updateParameters())}get contrast(){return this._contrast}set contrast(e){this._contrast!==e&&(this._contrast=e,this._updateParameters())}get vignetteCentreY(){return this.vignetteCenterY}set vignetteCentreY(e){this.vignetteCenterY=e}get vignetteCentreX(){return this.vignetteCenterX}set vignetteCentreX(e){this.vignetteCenterX=e}get vignetteBlendMode(){return this._vignetteBlendMode}set vignetteBlendMode(e){this._vignetteBlendMode!==e&&(this._vignetteBlendMode=e,this._updateParameters())}get vignetteEnabled(){return this._vignetteEnabled}set vignetteEnabled(e){this._vignetteEnabled!==e&&(this._vignetteEnabled=e,this._updateParameters())}get ditheringEnabled(){return this._ditheringEnabled}set ditheringEnabled(e){this._ditheringEnabled!==e&&(this._ditheringEnabled=e,this._updateParameters())}get ditheringIntensity(){return this._ditheringIntensity}set ditheringIntensity(e){this._ditheringIntensity!==e&&(this._ditheringIntensity=e,this._updateParameters())}get skipFinalColorClamp(){return this._skipFinalColorClamp}set skipFinalColorClamp(e){this._skipFinalColorClamp!==e&&(this._skipFinalColorClamp=e,this._updateParameters())}get applyByPostProcess(){return this._applyByPostProcess}set applyByPostProcess(e){this._applyByPostProcess!==e&&(this._applyByPostProcess=e,this._updateParameters())}get isEnabled(){return this._isEnabled}set isEnabled(e){this._isEnabled!==e&&(this._isEnabled=e,this._updateParameters())}_updateParameters(){this.onUpdateParameters.notifyObservers(this)}getClassName(){return"ImageProcessingConfiguration"}prepareDefines(e,t=!1){if(t!==this.applyByPostProcess||!this._isEnabled){e.VIGNETTE=!1,e.TONEMAPPING=0,e.CONTRAST=!1,e.EXPOSURE=!1,e.COLORCURVES=!1,e.COLORGRADING=!1,e.COLORGRADING3D=!1,e.DITHER=!1,e.IMAGEPROCESSING=!1,e.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,e.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess&&this._isEnabled;return}if(e.VIGNETTE=this.vignetteEnabled,e.VIGNETTEBLENDMODEMULTIPLY=this.vignetteBlendMode===Ne._VIGNETTEMODE_MULTIPLY,e.VIGNETTEBLENDMODEOPAQUE=!e.VIGNETTEBLENDMODEMULTIPLY,!this._toneMappingEnabled)e.TONEMAPPING=0;else switch(this._toneMappingType){case Ne.TONEMAPPING_KHR_PBR_NEUTRAL:e.TONEMAPPING=3;break;case Ne.TONEMAPPING_ACES:e.TONEMAPPING=2;break;default:e.TONEMAPPING=1;break}e.CONTRAST=this.contrast!==1,e.EXPOSURE=this.exposure!==1,e.COLORCURVES=this.colorCurvesEnabled&&!!this.colorCurves,e.COLORGRADING=this.colorGradingEnabled&&!!this.colorGradingTexture,e.COLORGRADING?e.COLORGRADING3D=this.colorGradingTexture.is3D:e.COLORGRADING3D=!1,e.SAMPLER3DGREENDEPTH=this.colorGradingWithGreenDepth,e.SAMPLER3DBGRMAP=this.colorGradingBGR,e.DITHER=this._ditheringEnabled,e.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess,e.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,e.IMAGEPROCESSING=e.VIGNETTE||!!e.TONEMAPPING||e.CONTRAST||e.EXPOSURE||e.COLORCURVES||e.COLORGRADING||e.DITHER}isReady(){return!this.colorGradingEnabled||!this.colorGradingTexture||this.colorGradingTexture.isReady()}bind(e,t){if(this._colorCurvesEnabled&&this.colorCurves&&ot.Bind(this.colorCurves,e),this._vignetteEnabled||this._ditheringEnabled){const i=1/e.getEngine().getRenderWidth(),s=1/e.getEngine().getRenderHeight();if(e.setFloat2("vInverseScreenSize",i,s),this._ditheringEnabled&&e.setFloat("ditherIntensity",.5*this._ditheringIntensity),this._vignetteEnabled){const n=t!=null?t:s/i;let r=Math.tan(this.vignetteCameraFov*.5),o=r*n;const h=Math.sqrt(o*r);o=Fa(o,h,this.vignetteStretch),r=Fa(r,h,this.vignetteStretch),e.setFloat4("vignetteSettings1",o,r,-o*this.vignetteCenterX,-r*this.vignetteCenterY);const l=-2*this.vignetteWeight;e.setFloat4("vignetteSettings2",this.vignetteColor.r,this.vignetteColor.g,this.vignetteColor.b,l)}}if(e.setFloat("exposureLinear",this.exposure),e.setFloat("contrast",this.contrast),this.colorGradingTexture){e.setTexture("txColorTransform",this.colorGradingTexture);const i=this.colorGradingTexture.getSize().height;e.setFloat4("colorTransformSettings",(i-1)/i,.5/i,i,this.colorGradingTexture.level)}}clone(){return Ae.Clone(()=>new Ne,this)}serialize(){return Ae.Serialize(this)}static Parse(e){const t=Ae.Parse(()=>new Ne,e,null,null);return e.vignetteCentreX!==void 0&&(t.vignetteCenterX=e.vignetteCentreX),e.vignetteCentreY!==void 0&&(t.vignetteCenterY=e.vignetteCentreY),t}static get VIGNETTEMODE_MULTIPLY(){return this._VIGNETTEMODE_MULTIPLY}static get VIGNETTEMODE_OPAQUE(){return this._VIGNETTEMODE_OPAQUE}}Ne.TONEMAPPING_STANDARD=0;Ne.TONEMAPPING_ACES=1;Ne.TONEMAPPING_KHR_PBR_NEUTRAL=2;Ne.PrepareUniforms=Up;Ne.PrepareSamplers=kp;Ne._VIGNETTEMODE_MULTIPLY=0;Ne._VIGNETTEMODE_OPAQUE=1;D([Qd()],Ne.prototype,"colorCurves",void 0);D([B()],Ne.prototype,"_colorCurvesEnabled",void 0);D([_i("colorGradingTexture")],Ne.prototype,"_colorGradingTexture",void 0);D([B()],Ne.prototype,"_colorGradingEnabled",void 0);D([B()],Ne.prototype,"_colorGradingWithGreenDepth",void 0);D([B()],Ne.prototype,"_colorGradingBGR",void 0);D([B()],Ne.prototype,"_exposure",void 0);D([B()],Ne.prototype,"_toneMappingEnabled",void 0);D([B()],Ne.prototype,"_toneMappingType",void 0);D([B()],Ne.prototype,"_contrast",void 0);D([B()],Ne.prototype,"vignetteStretch",void 0);D([B()],Ne.prototype,"vignetteCenterX",void 0);D([B()],Ne.prototype,"vignetteCenterY",void 0);D([B()],Ne.prototype,"vignetteWeight",void 0);D([p0()],Ne.prototype,"vignetteColor",void 0);D([B()],Ne.prototype,"vignetteCameraFov",void 0);D([B()],Ne.prototype,"_vignetteBlendMode",void 0);D([B()],Ne.prototype,"_vignetteEnabled",void 0);D([B()],Ne.prototype,"_ditheringEnabled",void 0);D([B()],Ne.prototype,"_ditheringIntensity",void 0);D([B()],Ne.prototype,"_skipFinalColorClamp",void 0);D([B()],Ne.prototype,"_applyByPostProcess",void 0);D([B()],Ne.prototype,"_isEnabled",void 0);Ae._ImageProcessingConfigurationParser=Ne.Parse;vt("BABYLON.ImageProcessingConfiguration",Ne);class Ot{constructor(e,t,i,s,n,r){this.source=e,this.pointerX=t,this.pointerY=i,this.meshUnderPointer=s,this.sourceEvent=n,this.additionalData=r}static CreateNew(e,t,i){const s=e.getScene();return new Ot(e,s.pointerX,s.pointerY,s.meshUnderPointer||e,t,i)}static CreateNewFromSprite(e,t,i,s){return new Ot(e,t.pointerX,t.pointerY,t.meshUnderPointer,i,s)}static CreateNewFromScene(e,t){return new Ot(null,e.pointerX,e.pointerY,e.meshUnderPointer,t)}static CreateNewFromPrimitive(e,t,i,s){return new Ot(e,t.x,t.y,null,i,s)}}class Re{}Re.NAME_EFFECTLAYER="EffectLayer";Re.NAME_LAYER="Layer";Re.NAME_LENSFLARESYSTEM="LensFlareSystem";Re.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer";Re.NAME_PARTICLESYSTEM="ParticleSystem";Re.NAME_GAMEPAD="Gamepad";Re.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue";Re.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer";Re.NAME_PREPASSRENDERER="PrePassRenderer";Re.NAME_DEPTHRENDERER="DepthRenderer";Re.NAME_DEPTHPEELINGRENDERER="DepthPeelingRenderer";Re.NAME_IBLSHADOWSRENDERER="IblShadowsRenderer";Re.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager";Re.NAME_SPRITE="Sprite";Re.NAME_SUBSURFACE="SubSurface";Re.NAME_OUTLINERENDERER="Outline";Re.NAME_PROCEDURALTEXTURE="ProceduralTexture";Re.NAME_SHADOWGENERATOR="ShadowGenerator";Re.NAME_OCTREE="Octree";Re.NAME_PHYSICSENGINE="PhysicsEngine";Re.NAME_AUDIO="Audio";Re.NAME_FLUIDRENDERER="FluidRenderer";Re.STEP_ISREADYFORMESH_EFFECTLAYER=0;Re.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0;Re.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0;Re.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER=0;Re.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1;Re.STEP_BEFORECAMERADRAW_PREPASS=0;Re.STEP_BEFORECAMERADRAW_EFFECTLAYER=1;Re.STEP_BEFORECAMERADRAW_LAYER=2;Re.STEP_BEFORERENDERTARGETDRAW_PREPASS=0;Re.STEP_BEFORERENDERTARGETDRAW_LAYER=1;Re.STEP_BEFORERENDERINGMESH_PREPASS=0;Re.STEP_BEFORERENDERINGMESH_OUTLINE=1;Re.STEP_AFTERRENDERINGMESH_PREPASS=0;Re.STEP_AFTERRENDERINGMESH_OUTLINE=1;Re.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0;Re.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1;Re.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0;Re.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0;Re.STEP_BEFORECLEAR_PREPASS=1;Re.STEP_BEFORERENDERTARGETCLEAR_PREPASS=0;Re.STEP_AFTERRENDERTARGETDRAW_PREPASS=0;Re.STEP_AFTERRENDERTARGETDRAW_LAYER=1;Re.STEP_AFTERCAMERADRAW_PREPASS=0;Re.STEP_AFTERCAMERADRAW_EFFECTLAYER=1;Re.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=2;Re.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=3;Re.STEP_AFTERCAMERADRAW_LAYER=4;Re.STEP_AFTERCAMERADRAW_FLUIDRENDERER=5;Re.STEP_AFTERCAMERAPOSTPROCESS_LAYER=0;Re.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER=0;Re.STEP_AFTERRENDER_AUDIO=0;Re.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0;Re.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1;Re.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2;Re.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3;Re.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0;Re.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER=1;Re.STEP_POINTERMOVE_SPRITE=0;Re.STEP_POINTERDOWN_SPRITE=0;Re.STEP_POINTERUP_SPRITE=0;class _t extends Array{constructor(e){super(...e)}static Create(){return Object.create(_t.prototype)}registerStep(e,t,i){let s=0,n=Number.MAX_VALUE;for(;s=1&&t<=7)return!0}return!1}static HasSpecificTrigger(e){for(const t in li.Triggers)if(Object.prototype.hasOwnProperty.call(li.Triggers,t)&&parseInt(t)===e)return!0;return!1}}li.Triggers={};class Nn{}Nn.KEYDOWN=1;Nn.KEYUP=2;class Wa{constructor(e,t){this.type=e,this.event=t}}class Oh extends Wa{get skipOnPointerObservable(){return this.skipOnKeyboardObservable}set skipOnPointerObservable(e){this.skipOnKeyboardObservable=e}constructor(e,t){super(e,t),this.type=e,this.event=t,this.skipOnKeyboardObservable=!1}}var ge;(function(a){a[a.Generic=0]="Generic",a[a.Keyboard=1]="Keyboard",a[a.Mouse=2]="Mouse",a[a.Touch=3]="Touch",a[a.DualShock=4]="DualShock",a[a.Xbox=5]="Xbox",a[a.Switch=6]="Switch",a[a.DualSense=7]="DualSense"})(ge||(ge={}));var xe;(function(a){a[a.Horizontal=0]="Horizontal",a[a.Vertical=1]="Vertical",a[a.LeftClick=2]="LeftClick",a[a.MiddleClick=3]="MiddleClick",a[a.RightClick=4]="RightClick",a[a.BrowserBack=5]="BrowserBack",a[a.BrowserForward=6]="BrowserForward",a[a.MouseWheelX=7]="MouseWheelX",a[a.MouseWheelY=8]="MouseWheelY",a[a.MouseWheelZ=9]="MouseWheelZ",a[a.Move=12]="Move"})(xe||(xe={}));var Bh;(function(a){a[a.Horizontal=0]="Horizontal",a[a.Vertical=1]="Vertical",a[a.LeftClick=2]="LeftClick",a[a.MiddleClick=3]="MiddleClick",a[a.RightClick=4]="RightClick",a[a.BrowserBack=5]="BrowserBack",a[a.BrowserForward=6]="BrowserForward",a[a.MouseWheelX=7]="MouseWheelX",a[a.MouseWheelY=8]="MouseWheelY",a[a.MouseWheelZ=9]="MouseWheelZ",a[a.DeltaHorizontal=10]="DeltaHorizontal",a[a.DeltaVertical=11]="DeltaVertical"})(Bh||(Bh={}));var Lh;(function(a){a[a.Cross=0]="Cross",a[a.Circle=1]="Circle",a[a.Square=2]="Square",a[a.Triangle=3]="Triangle",a[a.L1=4]="L1",a[a.R1=5]="R1",a[a.L2=6]="L2",a[a.R2=7]="R2",a[a.Share=8]="Share",a[a.Options=9]="Options",a[a.L3=10]="L3",a[a.R3=11]="R3",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.TouchPad=17]="TouchPad",a[a.LStickXAxis=18]="LStickXAxis",a[a.LStickYAxis=19]="LStickYAxis",a[a.RStickXAxis=20]="RStickXAxis",a[a.RStickYAxis=21]="RStickYAxis"})(Lh||(Lh={}));var Nh;(function(a){a[a.Cross=0]="Cross",a[a.Circle=1]="Circle",a[a.Square=2]="Square",a[a.Triangle=3]="Triangle",a[a.L1=4]="L1",a[a.R1=5]="R1",a[a.L2=6]="L2",a[a.R2=7]="R2",a[a.Create=8]="Create",a[a.Options=9]="Options",a[a.L3=10]="L3",a[a.R3=11]="R3",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.TouchPad=17]="TouchPad",a[a.LStickXAxis=18]="LStickXAxis",a[a.LStickYAxis=19]="LStickYAxis",a[a.RStickXAxis=20]="RStickXAxis",a[a.RStickYAxis=21]="RStickYAxis"})(Nh||(Nh={}));var Uh;(function(a){a[a.A=0]="A",a[a.B=1]="B",a[a.X=2]="X",a[a.Y=3]="Y",a[a.LB=4]="LB",a[a.RB=5]="RB",a[a.LT=6]="LT",a[a.RT=7]="RT",a[a.Back=8]="Back",a[a.Start=9]="Start",a[a.LS=10]="LS",a[a.RS=11]="RS",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.LStickXAxis=17]="LStickXAxis",a[a.LStickYAxis=18]="LStickYAxis",a[a.RStickXAxis=19]="RStickXAxis",a[a.RStickYAxis=20]="RStickYAxis"})(Uh||(Uh={}));var kh;(function(a){a[a.B=0]="B",a[a.A=1]="A",a[a.Y=2]="Y",a[a.X=3]="X",a[a.L=4]="L",a[a.R=5]="R",a[a.ZL=6]="ZL",a[a.ZR=7]="ZR",a[a.Minus=8]="Minus",a[a.Plus=9]="Plus",a[a.LS=10]="LS",a[a.RS=11]="RS",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.Capture=17]="Capture",a[a.LStickXAxis=18]="LStickXAxis",a[a.LStickYAxis=19]="LStickYAxis",a[a.RStickXAxis=20]="RStickXAxis",a[a.RStickYAxis=21]="RStickYAxis"})(kh||(kh={}));var Vh;(function(a){a[a.PointerMove=0]="PointerMove",a[a.PointerDown=1]="PointerDown",a[a.PointerUp=2]="PointerUp"})(Vh||(Vh={}));class jn{}jn.DOM_DELTA_PIXEL=0;jn.DOM_DELTA_LINE=1;jn.DOM_DELTA_PAGE=2;class Ps{static CreateDeviceEvent(e,t,i,s,n,r,o){switch(e){case ge.Keyboard:return this._CreateKeyboardEvent(i,s,n,r);case ge.Mouse:if(i===xe.MouseWheelX||i===xe.MouseWheelY||i===xe.MouseWheelZ)return this._CreateWheelEvent(e,t,i,s,n,r);case ge.Touch:return this._CreatePointerEvent(e,t,i,s,n,r,o);default:throw"Unable to generate event for device ".concat(ge[e])}}static _CreatePointerEvent(e,t,i,s,n,r,o){const h=this._CreateMouseEvent(e,t,i,s,n,r);e===ge.Mouse?(h.deviceType=ge.Mouse,h.pointerId=1,h.pointerType="mouse"):(h.deviceType=ge.Touch,h.pointerId=o!=null?o:t,h.pointerType="touch");let l=0;return l+=n.pollInput(e,t,xe.LeftClick),l+=n.pollInput(e,t,xe.RightClick)*2,l+=n.pollInput(e,t,xe.MiddleClick)*4,h.buttons=l,i===xe.Move?h.type="pointermove":i>=xe.LeftClick&&i<=xe.RightClick&&(h.type=s===1?"pointerdown":"pointerup",h.button=i-2),h}static _CreateWheelEvent(e,t,i,s,n,r){const o=this._CreateMouseEvent(e,t,i,s,n,r);switch(o.pointerId=1,o.type="wheel",o.deltaMode=jn.DOM_DELTA_PIXEL,o.deltaX=0,o.deltaY=0,o.deltaZ=0,i){case xe.MouseWheelX:o.deltaX=s;break;case xe.MouseWheelY:o.deltaY=s;break;case xe.MouseWheelZ:o.deltaZ=s;break}return o}static _CreateMouseEvent(e,t,i,s,n,r){const o=this._CreateEvent(r),h=n.pollInput(e,t,xe.Horizontal),l=n.pollInput(e,t,xe.Vertical);return r?(o.movementX=0,o.movementY=0,o.offsetX=o.movementX-r.getBoundingClientRect().x,o.offsetY=o.movementY-r.getBoundingClientRect().y):(o.movementX=n.pollInput(e,t,10),o.movementY=n.pollInput(e,t,11),o.offsetX=0,o.offsetY=0),this._CheckNonCharacterKeys(o,n),o.clientX=h,o.clientY=l,o.x=h,o.y=l,o.deviceType=e,o.deviceSlot=t,o.inputIndex=i,o}static _CreateKeyboardEvent(e,t,i,s){const n=this._CreateEvent(s);return this._CheckNonCharacterKeys(n,i),n.deviceType=ge.Keyboard,n.deviceSlot=0,n.inputIndex=e,n.type=t===1?"keydown":"keyup",n.key=String.fromCharCode(e),n.keyCode=e,n}static _CheckNonCharacterKeys(e,t){const i=t.isDeviceAvailable(ge.Keyboard),s=i&&t.pollInput(ge.Keyboard,0,18)===1,n=i&&t.pollInput(ge.Keyboard,0,17)===1,r=i&&(t.pollInput(ge.Keyboard,0,91)===1||t.pollInput(ge.Keyboard,0,92)===1||t.pollInput(ge.Keyboard,0,93)===1),o=i&&t.pollInput(ge.Keyboard,0,16)===1;e.altKey=s,e.ctrlKey=n,e.metaKey=r,e.shiftKey=o}static _CreateEvent(e){const t={};return t.preventDefault=()=>{},t.target=e,t}}class Gp{constructor(e,t,i){this._nativeInput=_native.DeviceInputSystem?new _native.DeviceInputSystem(e,t,(s,n,r,o)=>{const h=Ps.CreateDeviceEvent(s,n,r,o,this);i(s,n,h)}):this._createDummyNativeInput()}pollInput(e,t,i){return this._nativeInput.pollInput(e,t,i)}isDeviceAvailable(e){return e===ge.Mouse||e===ge.Touch}dispose(){this._nativeInput.dispose()}_createDummyNativeInput(){return{pollInput:()=>0,isDeviceAvailable:()=>!1,dispose:()=>{}}}}const Gh=255,zh=Object.keys(xe).length/2;class zp{constructor(e,t,i,s){this._inputs=[],this._keyboardActive=!1,this._pointerActive=!1,this._usingSafari=J.IsSafari(),this._usingMacOS=Qs()&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),this._keyboardDownEvent=n=>{},this._keyboardUpEvent=n=>{},this._keyboardBlurEvent=n=>{},this._pointerMoveEvent=n=>{},this._pointerDownEvent=n=>{},this._pointerUpEvent=n=>{},this._pointerCancelEvent=n=>{},this._pointerWheelEvent=n=>{},this._pointerBlurEvent=n=>{},this._pointerMacOSChromeOutEvent=n=>{},this._eventsAttached=!1,this._mouseId=-1,this._isUsingFirefox=Qs()&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox")!==-1,this._isUsingChromium=Qs()&&navigator.userAgent&&navigator.userAgent.indexOf("Chrome")!==-1,this._maxTouchPoints=0,this._pointerInputClearObserver=null,this._gamepadConnectedEvent=n=>{},this._gamepadDisconnectedEvent=n=>{},this._eventPrefix=J.GetPointerPrefix(e),this._engine=e,this._onDeviceConnected=t,this._onDeviceDisconnected=i,this._onInputChanged=s,this._mouseId=this._isUsingFirefox?0:1,this._enableEvents(),this._usingMacOS&&(this._metaKeys=[]),this._engine._onEngineViewChanged||(this._engine._onEngineViewChanged=()=>{this._enableEvents()})}pollInput(e,t,i){const s=this._inputs[e][t];if(!s)throw"Unable to find device ".concat(ge[e]);e>=ge.DualShock&&e<=ge.DualSense&&this._updateDevice(e,t,i);const n=s[i];if(n===void 0)throw"Unable to find input ".concat(i," for device ").concat(ge[e]," in slot ").concat(t);return i===xe.Move&&J.Warn("Unable to provide information for PointerInput.Move. Try using PointerInput.Horizontal or PointerInput.Vertical for move data."),n}isDeviceAvailable(e){return this._inputs[e]!==void 0}dispose(){this._onDeviceConnected=()=>{},this._onDeviceDisconnected=()=>{},this._onInputChanged=()=>{},delete this._engine._onEngineViewChanged,this._elementToAttachTo&&this._disableEvents()}_enableEvents(){const e=this==null?void 0:this._engine.getInputElement();if(e&&(!this._eventsAttached||this._elementToAttachTo!==e)){if(this._disableEvents(),this._inputs){for(const t of this._inputs)if(t)for(const i in t){const s=+i,n=t[s];if(n)for(let r=0;r{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(ge.Keyboard,0,Gh));const t=this._inputs[ge.Keyboard][0];if(t){t[e.keyCode]=1;const i=e;i.inputIndex=e.keyCode,this._usingMacOS&&e.metaKey&&e.key!=="Meta"&&(this._metaKeys.includes(e.keyCode)||this._metaKeys.push(e.keyCode)),this._onInputChanged(ge.Keyboard,0,i)}},this._keyboardUpEvent=e=>{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(ge.Keyboard,0,Gh));const t=this._inputs[ge.Keyboard][0];if(t){t[e.keyCode]=0;const i=e;if(i.inputIndex=e.keyCode,this._usingMacOS&&e.key==="Meta"&&this._metaKeys.length>0){for(const s of this._metaKeys){const n=Ps.CreateDeviceEvent(ge.Keyboard,0,s,0,this,this._elementToAttachTo);t[s]=0,this._onInputChanged(ge.Keyboard,0,n)}this._metaKeys.splice(0,this._metaKeys.length)}this._onInputChanged(ge.Keyboard,0,i)}},this._keyboardBlurEvent=()=>{if(this._keyboardActive){const e=this._inputs[ge.Keyboard][0];for(let t=0;t{const s=this._getPointerType(i);let n=s===ge.Mouse?0:this._activeTouchIds.indexOf(i.pointerId);if(s===ge.Touch&&n===-1){const o=this._activeTouchIds.indexOf(-1);if(o>=0)n=o,this._activeTouchIds[o]=i.pointerId,this._onDeviceConnected(s,n);else{J.Warn("Max number of touches exceeded. Ignoring touches in excess of ".concat(this._maxTouchPoints));return}}this._inputs[s]||(this._inputs[s]={}),this._inputs[s][n]||this._addPointerDevice(s,n,i.clientX,i.clientY);const r=this._inputs[s][n];if(r){const o=i;o.inputIndex=xe.Move,r[xe.Horizontal]=i.clientX,r[xe.Vertical]=i.clientY,s===ge.Touch&&r[xe.LeftClick]===0&&(r[xe.LeftClick]=1),i.pointerId===void 0&&(i.pointerId=this._mouseId),this._onInputChanged(s,n,o),!this._usingSafari&&i.button!==-1&&(o.inputIndex=i.button+2,r[i.button+2]=r[i.button+2]?0:1,this._onInputChanged(s,n,o))}},this._pointerDownEvent=i=>{const s=this._getPointerType(i);let n=s===ge.Mouse?0:i.pointerId;if(s===ge.Touch){let o=this._activeTouchIds.indexOf(i.pointerId);if(o===-1&&(o=this._activeTouchIds.indexOf(-1)),o>=0)n=o,this._activeTouchIds[o]=i.pointerId;else{J.Warn("Max number of touches exceeded. Ignoring touches in excess of ".concat(this._maxTouchPoints));return}}this._inputs[s]||(this._inputs[s]={}),this._inputs[s][n]?s===ge.Touch&&this._onDeviceConnected(s,n):this._addPointerDevice(s,n,i.clientX,i.clientY);const r=this._inputs[s][n];if(r){const o=r[xe.Horizontal],h=r[xe.Vertical];if(s===ge.Mouse){if(i.pointerId===void 0&&(i.pointerId=this._mouseId),!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(this._mouseId)}catch{}}else if(i.pointerId&&!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(i.pointerId)}catch{}r[xe.Horizontal]=i.clientX,r[xe.Vertical]=i.clientY,r[i.button+2]=1;const l=i;l.inputIndex=i.button+2,this._onInputChanged(s,n,l),(o!==i.clientX||h!==i.clientY)&&(l.inputIndex=xe.Move,this._onInputChanged(s,n,l))}},this._pointerUpEvent=i=>{var o,h,l,c,u;const s=this._getPointerType(i),n=s===ge.Mouse?0:this._activeTouchIds.indexOf(i.pointerId);if(s===ge.Touch){if(n===-1)return;this._activeTouchIds[n]=-1}const r=(o=this._inputs[s])==null?void 0:o[n];if(r&&r[i.button+2]!==0){const f=r[xe.Horizontal],d=r[xe.Vertical];r[xe.Horizontal]=i.clientX,r[xe.Vertical]=i.clientY,r[i.button+2]=0;const _=i;i.pointerId===void 0&&(i.pointerId=this._mouseId),(f!==i.clientX||d!==i.clientY)&&(_.inputIndex=xe.Move,this._onInputChanged(s,n,_)),_.inputIndex=i.button+2,s===ge.Mouse&&this._mouseId>=0&&((l=(h=this._elementToAttachTo).hasPointerCapture)!=null&&l.call(h,this._mouseId))?this._elementToAttachTo.releasePointerCapture(this._mouseId):i.pointerId&&((u=(c=this._elementToAttachTo).hasPointerCapture)!=null&&u.call(c,i.pointerId))&&this._elementToAttachTo.releasePointerCapture(i.pointerId),this._onInputChanged(s,n,_),s===ge.Touch&&this._onDeviceDisconnected(s,n)}},this._pointerCancelEvent=i=>{var s,n,r,o;if(i.pointerType==="mouse"){const h=this._inputs[ge.Mouse][0];this._mouseId>=0&&((n=(s=this._elementToAttachTo).hasPointerCapture)!=null&&n.call(s,this._mouseId))&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let l=xe.LeftClick;l<=xe.BrowserForward;l++)if(h[l]===1){h[l]=0;const c=Ps.CreateDeviceEvent(ge.Mouse,0,l,0,this,this._elementToAttachTo);this._onInputChanged(ge.Mouse,0,c)}}else{const h=this._activeTouchIds.indexOf(i.pointerId);if(h===-1)return;(o=(r=this._elementToAttachTo).hasPointerCapture)!=null&&o.call(r,i.pointerId)&&this._elementToAttachTo.releasePointerCapture(i.pointerId),this._inputs[ge.Touch][h][xe.LeftClick]=0;const l=Ps.CreateDeviceEvent(ge.Touch,h,xe.LeftClick,0,this,this._elementToAttachTo,i.pointerId);this._onInputChanged(ge.Touch,h,l),this._activeTouchIds[h]=-1,this._onDeviceDisconnected(ge.Touch,h)}},this._wheelEventName="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let e=!1;const t=function(){};try{const i=Object.defineProperty({},"passive",{get:function(){e=!0}});this._elementToAttachTo.addEventListener("test",t,i),this._elementToAttachTo.removeEventListener("test",t,i)}catch{}this._pointerBlurEvent=()=>{var i,s,n,r,o;if(this.isDeviceAvailable(ge.Mouse)){const h=this._inputs[ge.Mouse][0];this._mouseId>=0&&((s=(i=this._elementToAttachTo).hasPointerCapture)!=null&&s.call(i,this._mouseId))&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let l=xe.LeftClick;l<=xe.BrowserForward;l++)if(h[l]===1){h[l]=0;const c=Ps.CreateDeviceEvent(ge.Mouse,0,l,0,this,this._elementToAttachTo);this._onInputChanged(ge.Mouse,0,c)}}if(this.isDeviceAvailable(ge.Touch)){const h=this._inputs[ge.Touch];for(let l=0;l{const s=ge.Mouse,n=0;this._inputs[s]||(this._inputs[s]=[]),this._inputs[s][n]||(this._pointerActive=!0,this._registerDevice(s,n,zh));const r=this._inputs[s][n];if(r){r[xe.MouseWheelX]=i.deltaX||0,r[xe.MouseWheelY]=i.deltaY||i.wheelDelta||0,r[xe.MouseWheelZ]=i.deltaZ||0;const o=i;i.pointerId===void 0&&(i.pointerId=this._mouseId),r[xe.MouseWheelX]!==0&&(o.inputIndex=xe.MouseWheelX,this._onInputChanged(s,n,o)),r[xe.MouseWheelY]!==0&&(o.inputIndex=xe.MouseWheelY,this._onInputChanged(s,n,o)),r[xe.MouseWheelZ]!==0&&(o.inputIndex=xe.MouseWheelZ,this._onInputChanged(s,n,o))}},this._usingMacOS&&this._isUsingChromium&&(this._pointerMacOSChromeOutEvent=i=>{i.buttons>1&&this._pointerCancelEvent(i)},this._elementToAttachTo.addEventListener("lostpointercapture",this._pointerMacOSChromeOutEvent)),this._elementToAttachTo.addEventListener(this._eventPrefix+"move",this._pointerMoveEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"down",this._pointerDownEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"up",this._pointerUpEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"cancel",this._pointerCancelEvent),this._elementToAttachTo.addEventListener("blur",this._pointerBlurEvent),this._elementToAttachTo.addEventListener(this._wheelEventName,this._pointerWheelEvent,e?{passive:!1}:!1),this._pointerInputClearObserver=this._engine.onEndFrameObservable.add(()=>{if(this.isDeviceAvailable(ge.Mouse)){const i=this._inputs[ge.Mouse][0];i[xe.MouseWheelX]=0,i[xe.MouseWheelY]=0,i[xe.MouseWheelZ]=0}})}_handleGamepadActions(){this._gamepadConnectedEvent=e=>{this._addGamePad(e.gamepad)},this._gamepadDisconnectedEvent=e=>{if(this._gamepads){const t=this._getGamepadDeviceType(e.gamepad.id),i=e.gamepad.index;this._unregisterDevice(t,i),delete this._gamepads[i]}},window.addEventListener("gamepadconnected",this._gamepadConnectedEvent),window.addEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)}_updateDevice(e,t,i){const s=navigator.getGamepads()[t];if(s&&e===this._gamepads[t]){const n=this._inputs[e][t];i>=s.buttons.length?n[i]=s.axes[i-s.buttons.length].valueOf():n[i]=s.buttons[i].value}}_getGamepadDeviceType(e){return e.indexOf("054c")!==-1?e.indexOf("0ce6")!==-1?ge.DualSense:ge.DualShock:e.indexOf("Xbox One")!==-1||e.search("Xbox 360")!==-1||e.search("xinput")!==-1?ge.Xbox:e.indexOf("057e")!==-1?ge.Switch:ge.Generic}_getPointerType(e){let t=ge.Mouse;return(e.pointerType==="touch"||e.pointerType==="pen"||e.touches)&&(t=ge.Touch),t}}class Wh{constructor(e,t,i=0){this.deviceType=t,this.deviceSlot=i,this.onInputChangedObservable=new Z,this._deviceInputSystem=e}getInput(e){return this._deviceInputSystem.pollInput(this.deviceType,this.deviceSlot,e)}}class Wp{constructor(e){this._registeredManagers=new Array,this._refCount=0,this.registerManager=r=>{for(let o=0;o{const o=this._registeredManagers.indexOf(r);o>-1&&this._registeredManagers.splice(o,1)};const t=Object.keys(ge).length/2;this._devices=new Array(t);const i=(r,o)=>{this._devices[r]||(this._devices[r]=new Array),this._devices[r][o]||(this._devices[r][o]=o);for(const h of this._registeredManagers){const l=new Wh(this._deviceInputSystem,r,o);h._addDevice(l)}},s=(r,o)=>{var h;(h=this._devices[r])!=null&&h[o]&&delete this._devices[r][o];for(const l of this._registeredManagers)l._removeDevice(r,o)},n=(r,o,h)=>{if(h)for(const l of this._registeredManagers)l._onInputChanged(r,o,h)};typeof _native<"u"?this._deviceInputSystem=new Gp(i,s,n):this._deviceInputSystem=new zp(e,i,s,n)}dispose(){this._deviceInputSystem.dispose()}}class Hp{getDeviceSource(e,t){if(t===void 0){if(this._firstDevice[e]===void 0)return null;t=this._firstDevice[e]}return!this._devices[e]||this._devices[e][t]===void 0?null:this._devices[e][t]}getDeviceSources(e){return this._devices[e]?this._devices[e].filter(t=>!!t):[]}constructor(e){const t=Object.keys(ge).length/2;this._devices=new Array(t),this._firstDevice=new Array(t),this._engine=e,this._engine._deviceSourceManager||(this._engine._deviceSourceManager=new Wp(e)),this._engine._deviceSourceManager._refCount++,this.onDeviceConnectedObservable=new Z(i=>{for(const s of this._devices)if(s)for(const n of s)n&&this.onDeviceConnectedObservable.notifyObserver(i,n)}),this.onDeviceDisconnectedObservable=new Z,this._engine._deviceSourceManager.registerManager(this),this._onDisposeObserver=e.onDisposeObservable.add(()=>{this.dispose()})}dispose(){this.onDeviceConnectedObservable.clear(),this.onDeviceDisconnectedObservable.clear(),this._engine._deviceSourceManager&&(this._engine._deviceSourceManager.unregisterManager(this),--this._engine._deviceSourceManager._refCount<1&&(this._engine._deviceSourceManager.dispose(),delete this._engine._deviceSourceManager)),this._engine.onDisposeObservable.remove(this._onDisposeObserver)}_addDevice(e){this._devices[e.deviceType]||(this._devices[e.deviceType]=new Array),this._devices[e.deviceType][e.deviceSlot]||(this._devices[e.deviceType][e.deviceSlot]=e,this._updateFirstDevices(e.deviceType)),this.onDeviceConnectedObservable.notifyObservers(e)}_removeDevice(e,t){var s,n;const i=(s=this._devices[e])==null?void 0:s[t];this.onDeviceDisconnectedObservable.notifyObservers(i),(n=this._devices[e])!=null&&n[t]&&delete this._devices[e][t],this._updateFirstDevices(e)}_onInputChanged(e,t,i){var s,n;(n=(s=this._devices[e])==null?void 0:s[t])==null||n.onInputChangedObservable.notifyObservers(i)}_updateFirstDevices(e){switch(e){case ge.Keyboard:case ge.Mouse:this._firstDevice[e]=0;break;case ge.Touch:case ge.DualSense:case ge.DualShock:case ge.Xbox:case ge.Switch:case ge.Generic:{delete this._firstDevice[e];const t=this._devices[e];if(t){for(let i=0;i=xe.MouseWheelX&&t.inputIndex<=xe.MouseWheelZ?Ce.POINTERWHEEL:Ce.POINTERMOVE;i.onPointerMove&&(e=e||this._pickMove(t),i.onPointerMove(t,e,r));let o;e?(o=new Ji(r,t,e),this._setRayOnPointerInfo(e,t)):(o=new Ji(r,t,null,this),this._movePointerInfo=o),i.onPointerObservable.hasObservers()&&i.onPointerObservable.notifyObservers(o,r)}_setRayOnPointerInfo(e,t){const i=this._scene;e&&O0._IsPickingAvailable&&(e.ray||(e.ray=i.createPickingRay(t.offsetX,t.offsetY,O.Identity(),i.activeCamera)))}_addCameraPointerObserver(e,t){return this._cameraObserverCount++,this._scene.onPointerObservable.add(e,t)}_removeCameraPointerObserver(e){return this._cameraObserverCount--,this._scene.onPointerObservable.remove(e)}_checkForPicking(){return!!(this._scene.onPointerObservable.observers.length>this._cameraObserverCount||this._scene.onPointerPick)}_checkPrePointerObservable(e,t,i){const s=this._scene,n=new Vp(i,t,this._unTranslatedPointerX,this._unTranslatedPointerY);return e&&(n.originalPickingInfo=e,n.ray=e.ray,t.pointerType==="xr-near"&&e.originMesh&&(n.nearInteractionPickingInfo=e)),s.onPrePointerObservable.notifyObservers(n,i),!!n.skipOnPointerObservable}_pickMove(e){const t=this._scene,i=t.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,t.pointerMovePredicate,t.pointerMoveFastCheck,t.cameraToUseForPointers,t.pointerMoveTrianglePredicate);return this._setCursorAndPointerOverMesh(i,e,t),i}_setCursorAndPointerOverMesh(e,t,i){const n=i.getEngine().getInputElement();if(e!=null&&e.pickedMesh){if(this.setPointerOverMesh(e.pickedMesh,t.pointerId,e,t),!i.doNotHandleCursors&&n&&this._pointerOverMesh){const r=this._pointerOverMesh._getActionManagerForTrigger();r&&r.hasPointerTriggers&&(n.style.cursor=r.hoverCursor||i.hoverCursor)}}else this.setPointerOverMesh(null,t.pointerId,e,t)}simulatePointerMove(e,t){const i=new PointerEvent("pointermove",t);i.inputIndex=xe.Move,!this._checkPrePointerObservable(e,i,Ce.POINTERMOVE)&&this._processPointerMove(e,i)}simulatePointerDown(e,t){const i=new PointerEvent("pointerdown",t);i.inputIndex=i.button+2,!this._checkPrePointerObservable(e,i,Ce.POINTERDOWN)&&this._processPointerDown(e,i)}_processPointerDown(e,t){const i=this._scene;if(e!=null&&e.pickedMesh){this._pickedDownMesh=e.pickedMesh;const r=e.pickedMesh._getActionManagerForTrigger();if(r){if(r.hasPickTriggers)switch(r.processTrigger(5,Ot.CreateNew(e.pickedMesh,t,e)),t.button){case 0:r.processTrigger(2,Ot.CreateNew(e.pickedMesh,t,e));break;case 1:r.processTrigger(4,Ot.CreateNew(e.pickedMesh,t,e));break;case 2:r.processTrigger(3,Ot.CreateNew(e.pickedMesh,t,e));break}r.hasSpecificTrigger(8)&&window.setTimeout(()=>{const o=i.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,h=>h.isPickable&&h.isVisible&&h.isReady()&&h.actionManager&&h.actionManager.hasSpecificTrigger(8)&&h===this._pickedDownMesh,!1,i.cameraToUseForPointers);o!=null&&o.pickedMesh&&r&&this._activePointerIdsCount!==0&&Date.now()-this._startingPointerTime>pt.LongPressDelay&&!this._isPointerSwiping()&&(this._startingPointerTime=0,r.processTrigger(8,Ot.CreateNew(o.pickedMesh,t)))},pt.LongPressDelay)}}else for(const r of i._pointerDownStage)e=r.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,!1);let s;const n=Ce.POINTERDOWN;e?(i.onPointerDown&&i.onPointerDown(t,e,n),s=new Ji(n,t,e),this._setRayOnPointerInfo(e,t)):s=new Ji(n,t,null,this),i.onPointerObservable.hasObservers()&&i.onPointerObservable.notifyObservers(s,n)}_isPointerSwiping(){return this._isSwiping}simulatePointerUp(e,t,i){const s=new PointerEvent("pointerup",t);s.inputIndex=xe.Move;const n=new Hh;i?n.doubleClick=!0:n.singleClick=!0,!this._checkPrePointerObservable(e,s,Ce.POINTERUP)&&this._processPointerUp(e,s,n)}_processPointerUp(e,t,i){const s=this._scene;if(e!=null&&e.pickedMesh){if(this._pickedUpMesh=e.pickedMesh,this._pickedDownMesh===this._pickedUpMesh&&(s.onPointerPick&&s.onPointerPick(t,e),i.singleClick&&!i.ignore&&s.onPointerObservable.observers.length>this._cameraObserverCount)){const r=Ce.POINTERPICK,o=new Ji(r,t,e);this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(o,r)}const n=e.pickedMesh._getActionManagerForTrigger();if(n&&!i.ignore){n.processTrigger(7,Ot.CreateNew(e.pickedMesh,t,e)),!i.hasSwiped&&i.singleClick&&n.processTrigger(1,Ot.CreateNew(e.pickedMesh,t,e));const r=e.pickedMesh._getActionManagerForTrigger(6);i.doubleClick&&r&&r.processTrigger(6,Ot.CreateNew(e.pickedMesh,t,e))}}else if(!i.ignore)for(const n of s._pointerUpStage)e=n.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,i.doubleClick);if(this._pickedDownMesh&&this._pickedDownMesh!==this._pickedUpMesh){const n=this._pickedDownMesh._getActionManagerForTrigger(16);n&&n.processTrigger(16,Ot.CreateNew(this._pickedDownMesh,t))}if(!i.ignore){const n=new Ji(Ce.POINTERUP,t,e);if(this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(n,Ce.POINTERUP),s.onPointerUp&&s.onPointerUp(t,e,Ce.POINTERUP),!i.hasSwiped&&!this._skipPointerTap&&!this._isMultiTouchGesture){let r=0;if(i.singleClick?r=Ce.POINTERTAP:i.doubleClick&&(r=Ce.POINTERDOUBLETAP),r){const o=new Ji(r,t,e);s.onPointerObservable.hasObservers()&&s.onPointerObservable.hasSpecificMask(r)&&s.onPointerObservable.notifyObservers(o,r)}}}}isPointerCaptured(e=0){return this._pointerCaptures[e]}attachControl(e=!0,t=!0,i=!0,s=null){const n=this._scene,r=n.getEngine();s||(s=r.getInputElement()),this._alreadyAttached&&this.detachControl(),s&&(this._alreadyAttachedTo=s),this._deviceSourceManager=new Hp(r),this._initActionManager=o=>{if(!this._meshPickProceed){const h=n.skipPointerUpPicking||n._registeredActions===0&&!this._checkForPicking()&&!n.onPointerUp?null:n.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,n.pointerUpPredicate,n.pointerUpFastCheck,n.cameraToUseForPointers,n.pointerUpTrianglePredicate);this._currentPickResult=h,h&&(o=h.hit&&h.pickedMesh?h.pickedMesh._getActionManagerForTrigger():null),this._meshPickProceed=!0}return o},this._delayedSimpleClick=(o,h,l)=>{if((Date.now()-this._previousStartingPointerTime>pt.DoubleClickDelay&&!this._doubleClickOccured||o!==this._previousButtonPressed)&&(this._doubleClickOccured=!1,h.singleClick=!0,h.ignore=!1,this._delayedClicks[o])){const c=this._delayedClicks[o].evt,u=Ce.POINTERTAP,f=new Ji(u,c,this._currentPickResult);n.onPointerObservable.hasObservers()&&n.onPointerObservable.hasSpecificMask(u)&&n.onPointerObservable.notifyObservers(f,u),this._delayedClicks[o]=null}},this._initClickEvent=(o,h,l,c)=>{var p,g;const u=new Hh;this._currentPickResult=null;let f=null,d=o.hasSpecificMask(Ce.POINTERPICK)||h.hasSpecificMask(Ce.POINTERPICK)||o.hasSpecificMask(Ce.POINTERTAP)||h.hasSpecificMask(Ce.POINTERTAP)||o.hasSpecificMask(Ce.POINTERDOUBLETAP)||h.hasSpecificMask(Ce.POINTERDOUBLETAP);!d&&li&&(f=this._initActionManager(f,u),f&&(d=f.hasPickTriggers));let _=!1;if(d){const m=l.button;if(u.hasSwiped=this._isPointerSwiping(),!u.hasSwiped){let b=!pt.ExclusiveDoubleClickMode;if(b||(b=!o.hasSpecificMask(Ce.POINTERDOUBLETAP)&&!h.hasSpecificMask(Ce.POINTERDOUBLETAP),b&&!li.HasSpecificTrigger(6)&&(f=this._initActionManager(f,u),f&&(b=!f.hasSpecificTrigger(6)))),b)(Date.now()-this._previousStartingPointerTime>pt.DoubleClickDelay||m!==this._previousButtonPressed)&&(u.singleClick=!0,c(u,this._currentPickResult),_=!0);else{const T={evt:l,clickInfo:u,timeoutId:window.setTimeout(this._delayedSimpleClick.bind(this,m,u,c),pt.DoubleClickDelay)};this._delayedClicks[m]=T}let I=o.hasSpecificMask(Ce.POINTERDOUBLETAP)||h.hasSpecificMask(Ce.POINTERDOUBLETAP);!I&&li.HasSpecificTrigger(6)&&(f=this._initActionManager(f,u),f&&(I=f.hasSpecificTrigger(6))),I&&(m===this._previousButtonPressed&&Date.now()-this._previousStartingPointerTime{if(this._updatePointerPosition(o),!this._isSwiping&&this._swipeButtonPressed!==-1&&(this._isSwiping=Math.abs(this._startingPointerPosition.x-this._pointerX)>pt.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>pt.DragMovementThreshold),r.isPointerLock&&r._verifyPointerLock(),this._checkPrePointerObservable(null,o,o.inputIndex>=xe.MouseWheelX&&o.inputIndex<=xe.MouseWheelZ?Ce.POINTERWHEEL:Ce.POINTERMOVE)||!n.cameraToUseForPointers&&!n.activeCamera)return;if(n.skipPointerMovePicking){this._processPointerMove(new as,o);return}n.pointerMovePredicate||(n.pointerMovePredicate=l=>l.isPickable&&l.isVisible&&l.isReady()&&l.isEnabled()&&(l.enablePointerMoveEvents||n.constantlyUpdateMeshUnderPointer||l._getActionManagerForTrigger()!==null)&&(!n.cameraToUseForPointers||(n.cameraToUseForPointers.layerMask&l.layerMask)!==0));const h=n._registeredActions>0||n.constantlyUpdateMeshUnderPointer?this._pickMove(o):null;this._processPointerMove(h,o)},this._onPointerDown=o=>{var c;const h=this._activePointerIds.indexOf(-1);if(h===-1?this._activePointerIds.push(o.pointerId):this._activePointerIds[h]=o.pointerId,this._activePointerIdsCount++,this._pickedDownMesh=null,this._meshPickProceed=!1,pt.ExclusiveDoubleClickMode){for(let u=0;uu.isPickable&&u.isVisible&&u.isReady()&&u.isEnabled()&&(!n.cameraToUseForPointers||(n.cameraToUseForPointers.layerMask&u.layerMask)!==0)),this._pickedDownMesh=null;let l;n.skipPointerDownPicking||n._registeredActions===0&&!this._checkForPicking()&&!n.onPointerDown?l=new as:l=n.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,n.pointerDownPredicate,n.pointerDownFastCheck,n.cameraToUseForPointers,n.pointerDownTrianglePredicate),this._processPointerDown(l,o)},this._onPointerUp=o=>{const h=this._activePointerIds.indexOf(o.pointerId);h!==-1&&(this._activePointerIds[h]=-1,this._activePointerIdsCount--,this._pickedUpMesh=null,this._meshPickProceed=!1,this._updatePointerPosition(o),n.preventDefaultOnPointerUp&&s&&(o.preventDefault(),s.focus()),this._initClickEvent(n.onPrePointerObservable,n.onPointerObservable,o,(l,c)=>{if(n.onPrePointerObservable.hasObservers()&&(this._skipPointerTap=!1,!l.ignore)){if(this._checkPrePointerObservable(null,o,Ce.POINTERUP)){this._swipeButtonPressed===o.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1),o.buttons===0&&(this._pointerCaptures[o.pointerId]=!1);return}l.hasSwiped||(l.singleClick&&n.onPrePointerObservable.hasSpecificMask(Ce.POINTERTAP)&&this._checkPrePointerObservable(null,o,Ce.POINTERTAP)&&(this._skipPointerTap=!0),l.doubleClick&&n.onPrePointerObservable.hasSpecificMask(Ce.POINTERDOUBLETAP)&&this._checkPrePointerObservable(null,o,Ce.POINTERDOUBLETAP)&&(this._skipPointerTap=!0))}if(!this._pointerCaptures[o.pointerId]){this._swipeButtonPressed===o.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1);return}o.buttons===0&&(this._pointerCaptures[o.pointerId]=!1),!(!n.cameraToUseForPointers&&!n.activeCamera)&&(n.pointerUpPredicate||(n.pointerUpPredicate=u=>u.isPickable&&u.isVisible&&u.isReady()&&u.isEnabled()&&(!n.cameraToUseForPointers||(n.cameraToUseForPointers.layerMask&u.layerMask)!==0)),!this._meshPickProceed&&(li&&li.HasTriggers||this._checkForPicking()||n.onPointerUp)&&this._initActionManager(null,l),c||(c=this._currentPickResult),this._processPointerUp(c,o,l),this._previousPickResult=this._currentPickResult,this._swipeButtonPressed===o.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1))}))},this._onKeyDown=o=>{const h=Nn.KEYDOWN;if(n.onPreKeyboardObservable.hasObservers()){const l=new Oh(h,o);if(n.onPreKeyboardObservable.notifyObservers(l,h),l.skipOnKeyboardObservable)return}if(n.onKeyboardObservable.hasObservers()){const l=new Wa(h,o);n.onKeyboardObservable.notifyObservers(l,h)}n.actionManager&&n.actionManager.processTrigger(14,Ot.CreateNewFromScene(n,o))},this._onKeyUp=o=>{const h=Nn.KEYUP;if(n.onPreKeyboardObservable.hasObservers()){const l=new Oh(h,o);if(n.onPreKeyboardObservable.notifyObservers(l,h),l.skipOnKeyboardObservable)return}if(n.onKeyboardObservable.hasObservers()){const l=new Wa(h,o);n.onKeyboardObservable.notifyObservers(l,h)}n.actionManager&&n.actionManager.processTrigger(15,Ot.CreateNewFromScene(n,o))},this._deviceSourceManager.onDeviceConnectedObservable.add(o=>{o.deviceType===ge.Mouse?o.onInputChangedObservable.add(h=>{this._originMouseEvent=h,h.inputIndex===xe.LeftClick||h.inputIndex===xe.MiddleClick||h.inputIndex===xe.RightClick||h.inputIndex===xe.BrowserBack||h.inputIndex===xe.BrowserForward?t&&o.getInput(h.inputIndex)===1?this._onPointerDown(h):e&&o.getInput(h.inputIndex)===0&&this._onPointerUp(h):i&&(h.inputIndex===xe.Move?this._onPointerMove(h):(h.inputIndex===xe.MouseWheelX||h.inputIndex===xe.MouseWheelY||h.inputIndex===xe.MouseWheelZ)&&this._onPointerMove(h))}):o.deviceType===ge.Touch?o.onInputChangedObservable.add(h=>{h.inputIndex===xe.LeftClick&&(t&&o.getInput(h.inputIndex)===1?(this._onPointerDown(h),this._activePointerIdsCount>1&&(this._isMultiTouchGesture=!0)):e&&o.getInput(h.inputIndex)===0&&(this._onPointerUp(h),this._activePointerIdsCount===0&&(this._isMultiTouchGesture=!1))),i&&h.inputIndex===xe.Move&&this._onPointerMove(h)}):o.deviceType===ge.Keyboard&&o.onInputChangedObservable.add(h=>{h.type==="keydown"?this._onKeyDown(h):h.type==="keyup"&&this._onKeyUp(h)})}),this._alreadyAttached=!0}detachControl(){this._alreadyAttached&&(this._deviceSourceManager.dispose(),this._deviceSourceManager=null,this._alreadyAttachedTo&&!this._scene.doNotHandleCursors&&(this._alreadyAttachedTo.style.cursor=this._scene.defaultCursor),this._alreadyAttached=!1,this._alreadyAttachedTo=null)}setPointerOverMesh(e,t=0,i,s){if(this._meshUnderPointerId[t]===e&&(!e||!e._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting))return;const n=this._meshUnderPointerId[t];let r;n&&(r=n._getActionManagerForTrigger(10),r&&r.processTrigger(10,Ot.CreateNew(n,s,{pointerId:t}))),e?(this._meshUnderPointerId[t]=e,this._pointerOverMesh=e,r=e._getActionManagerForTrigger(9),r&&r.processTrigger(9,Ot.CreateNew(e,s,{pointerId:t,pickResult:i}))):(delete this._meshUnderPointerId[t],this._pointerOverMesh=null)}getPointerOverMesh(){return this.meshUnderPointer}_invalidateMesh(e){this._pointerOverMesh===e&&(this._pointerOverMesh=null),this._pickedDownMesh===e&&(this._pickedDownMesh=null),this._pickedUpMesh===e&&(this._pickedUpMesh=null);for(const t in this._meshUnderPointerId)this._meshUnderPointerId[t]===e&&delete this._meshUnderPointerId[t]}}pt.DragMovementThreshold=10;pt.LongPressDelay=500;pt.DoubleClickDelay=300;pt.ExclusiveDoubleClickMode=!1;class Sc{static get UniqueId(){const e=this._UniqueIdCounter;return this._UniqueIdCounter++,e}}Sc._UniqueIdCounter=1;class Xe{static CompareLightsPriority(e,t){return e.shadowEnabled!==t.shadowEnabled?(t.shadowEnabled?1:0)-(e.shadowEnabled?1:0):t.renderPriority-e.renderPriority}}Xe.FALLOFF_DEFAULT=0;Xe.FALLOFF_PHYSICAL=1;Xe.FALLOFF_GLTF=2;Xe.FALLOFF_STANDARD=3;Xe.LIGHTMAP_DEFAULT=0;Xe.LIGHTMAP_SPECULAR=1;Xe.LIGHTMAP_SHADOWSONLY=2;Xe.INTENSITYMODE_AUTOMATIC=0;Xe.INTENSITYMODE_LUMINOUSPOWER=1;Xe.INTENSITYMODE_LUMINOUSINTENSITY=2;Xe.INTENSITYMODE_ILLUMINANCE=3;Xe.INTENSITYMODE_LUMINANCE=4;Xe.LIGHTTYPEID_POINTLIGHT=0;Xe.LIGHTTYPEID_DIRECTIONALLIGHT=1;Xe.LIGHTTYPEID_SPOTLIGHT=2;Xe.LIGHTTYPEID_HEMISPHERICLIGHT=3;class Kp{constructor(){this.pointerDownFastCheck=!1,this.pointerUpFastCheck=!1,this.pointerMoveFastCheck=!1,this.skipPointerMovePicking=!1,this.skipPointerDownPicking=!1,this.skipPointerUpPicking=!1}}var Ha;(function(a){a[a.BackwardCompatible=0]="BackwardCompatible",a[a.Intermediate=1]="Intermediate",a[a.Aggressive=2]="Aggressive"})(Ha||(Ha={}));class it{static DefaultMaterialFactory(e){throw ye("StandardMaterial")}static CollisionCoordinatorFactory(){throw ye("DefaultCollisionCoordinator")}get clearColor(){return this._clearColor}set clearColor(e){e!==this._clearColor&&(this._clearColor=e,this.onClearColorChangedObservable.notifyObservers(this._clearColor))}get imageProcessingConfiguration(){return this._imageProcessingConfiguration}get performancePriority(){return this._performancePriority}set performancePriority(e){if(e!==this._performancePriority){switch(this._performancePriority=e,e){case 0:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!1,this.autoClear=!0;break;case 1:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!0,this.autoClear=!1;break;case 2:this.skipFrustumClipping=!0,this._renderingManager.maintainStateBetweenFrames=!0,this.skipPointerMovePicking=!0,this.autoClear=!1;break}this.onScenePerformancePriorityChangedObservable.notifyObservers(e)}}set forceWireframe(e){this._forceWireframe!==e&&(this._forceWireframe=e,this.markAllMaterialsAsDirty(16))}get forceWireframe(){return this._forceWireframe}set skipFrustumClipping(e){this._skipFrustumClipping!==e&&(this._skipFrustumClipping=e)}get skipFrustumClipping(){return this._skipFrustumClipping}set forcePointsCloud(e){this._forcePointsCloud!==e&&(this._forcePointsCloud=e,this.markAllMaterialsAsDirty(16))}get forcePointsCloud(){return this._forcePointsCloud}get environmentTexture(){return this._environmentTexture}set environmentTexture(e){this._environmentTexture!==e&&(this._environmentTexture=e,this.markAllMaterialsAsDirty(1))}getNodes(){let e=[];return e=e.concat(this.meshes),e=e.concat(this.lights),e=e.concat(this.cameras),e=e.concat(this.transformNodes),this.skeletons.forEach(t=>e=e.concat(t.bones)),e}get animationPropertiesOverride(){return this._animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set beforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),e&&(this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e))}set afterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),e&&(this._onAfterRenderObserver=this.onAfterRenderObservable.add(e))}set beforeCameraRender(e){this._onBeforeCameraRenderObserver&&this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=this.onBeforeCameraRenderObservable.add(e)}set afterCameraRender(e){this._onAfterCameraRenderObserver&&this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=this.onAfterCameraRenderObservable.add(e)}get pointerDownPredicate(){return this._pointerPickingConfiguration.pointerDownPredicate}set pointerDownPredicate(e){this._pointerPickingConfiguration.pointerDownPredicate=e}get pointerUpPredicate(){return this._pointerPickingConfiguration.pointerUpPredicate}set pointerUpPredicate(e){this._pointerPickingConfiguration.pointerUpPredicate=e}get pointerMovePredicate(){return this._pointerPickingConfiguration.pointerMovePredicate}set pointerMovePredicate(e){this._pointerPickingConfiguration.pointerMovePredicate=e}get pointerDownFastCheck(){return this._pointerPickingConfiguration.pointerDownFastCheck}set pointerDownFastCheck(e){this._pointerPickingConfiguration.pointerDownFastCheck=e}get pointerUpFastCheck(){return this._pointerPickingConfiguration.pointerUpFastCheck}set pointerUpFastCheck(e){this._pointerPickingConfiguration.pointerUpFastCheck=e}get pointerMoveFastCheck(){return this._pointerPickingConfiguration.pointerMoveFastCheck}set pointerMoveFastCheck(e){this._pointerPickingConfiguration.pointerMoveFastCheck=e}get skipPointerMovePicking(){return this._pointerPickingConfiguration.skipPointerMovePicking}set skipPointerMovePicking(e){this._pointerPickingConfiguration.skipPointerMovePicking=e}get skipPointerDownPicking(){return this._pointerPickingConfiguration.skipPointerDownPicking}set skipPointerDownPicking(e){this._pointerPickingConfiguration.skipPointerDownPicking=e}get skipPointerUpPicking(){return this._pointerPickingConfiguration.skipPointerUpPicking}set skipPointerUpPicking(e){this._pointerPickingConfiguration.skipPointerUpPicking=e}get unTranslatedPointer(){return this._inputManager.unTranslatedPointer}static get DragMovementThreshold(){return pt.DragMovementThreshold}static set DragMovementThreshold(e){pt.DragMovementThreshold=e}static get LongPressDelay(){return pt.LongPressDelay}static set LongPressDelay(e){pt.LongPressDelay=e}static get DoubleClickDelay(){return pt.DoubleClickDelay}static set DoubleClickDelay(e){pt.DoubleClickDelay=e}static get ExclusiveDoubleClickMode(){return pt.ExclusiveDoubleClickMode}static set ExclusiveDoubleClickMode(e){pt.ExclusiveDoubleClickMode=e}bindEyePosition(e,t="vEyePosition",i=!1){const s=this._forcedViewPosition?this._forcedViewPosition:this._mirroredCameraPosition?this._mirroredCameraPosition:this.activeCamera.globalPosition,n=this.useRightHandedSystem===(this._mirroredCameraPosition!=null);return N.Vector4[0].set(s.x,s.y,s.z,n?-1:1),e&&(i?e.setFloat3(t,N.Vector4[0].x,N.Vector4[0].y,N.Vector4[0].z):e.setVector4(t,N.Vector4[0])),N.Vector4[0]}finalizeSceneUbo(){const e=this.getSceneUniformBuffer(),t=this.bindEyePosition(null);return e.updateFloat4("vEyePosition",t.x,t.y,t.z,t.w),e.update(),e}set useRightHandedSystem(e){this._useRightHandedSystem!==e&&(this._useRightHandedSystem=e,this.markAllMaterialsAsDirty(16))}get useRightHandedSystem(){return this._useRightHandedSystem}setStepId(e){this._currentStepId=e}getStepId(){return this._currentStepId}getInternalStep(){return this._currentInternalStep}set fogEnabled(e){this._fogEnabled!==e&&(this._fogEnabled=e,this.markAllMaterialsAsDirty(16))}get fogEnabled(){return this._fogEnabled}set fogMode(e){this._fogMode!==e&&(this._fogMode=e,this.markAllMaterialsAsDirty(16))}get fogMode(){return this._fogMode}get prePass(){return!!this.prePassRenderer&&this.prePassRenderer.defaultRT.enabled}set shadowsEnabled(e){this._shadowsEnabled!==e&&(this._shadowsEnabled=e,this.markAllMaterialsAsDirty(2))}get shadowsEnabled(){return this._shadowsEnabled}set lightsEnabled(e){this._lightsEnabled!==e&&(this._lightsEnabled=e,this.markAllMaterialsAsDirty(2))}get lightsEnabled(){return this._lightsEnabled}get activeCameras(){return this._activeCameras}set activeCameras(e){this._unObserveActiveCameras&&(this._unObserveActiveCameras(),this._unObserveActiveCameras=null),e&&(this._unObserveActiveCameras=Ql(e,()=>{this.onActiveCamerasChanged.notifyObservers(this)})),this._activeCameras=e}get activeCamera(){return this._activeCamera}set activeCamera(e){e!==this._activeCamera&&(this._activeCamera=e,this.onActiveCameraChanged.notifyObservers(this))}get defaultMaterial(){return this._defaultMaterial||(this._defaultMaterial=it.DefaultMaterialFactory(this)),this._defaultMaterial}set defaultMaterial(e){this._defaultMaterial=e}set texturesEnabled(e){this._texturesEnabled!==e&&(this._texturesEnabled=e,this.markAllMaterialsAsDirty(1))}get texturesEnabled(){return this._texturesEnabled}get frameGraph(){return this._frameGraph}set frameGraph(e){if(this._frameGraph){this._frameGraph=e,e||(this.customRenderFunction=this._currentCustomRenderFunction);return}this._frameGraph=e,e&&(this._currentCustomRenderFunction=this.customRenderFunction,this.customRenderFunction=this._renderWithFrameGraph)}set skeletonsEnabled(e){this._skeletonsEnabled!==e&&(this._skeletonsEnabled=e,this.markAllMaterialsAsDirty(8))}get skeletonsEnabled(){return this._skeletonsEnabled}get collisionCoordinator(){return this._collisionCoordinator||(this._collisionCoordinator=it.CollisionCoordinatorFactory(),this._collisionCoordinator.init(this)),this._collisionCoordinator}get renderingManager(){return this._renderingManager}get frustumPlanes(){return this._frustumPlanes}_registerTransientComponents(){if(this._transientComponents.length>0){for(const e of this._transientComponents)e.register();this._transientComponents.length=0}}_addComponent(e){this._components.push(e),this._transientComponents.push(e);const t=e;t.addFromContainer&&t.serialize&&this._serializableComponents.push(t)}_getComponent(e){for(const t of this._components)if(t.name===e)return t;return null}constructor(e,t){this._inputManager=new pt(this),this.cameraToUseForPointers=null,this._isScene=!0,this._blockEntityCollection=!1,this.autoClear=!0,this.autoClearDepthAndStencil=!0,this._clearColor=new H(.2,.2,.3,1),this.onClearColorChangedObservable=new Z,this.ambientColor=new de(0,0,0),this.environmentIntensity=1,this._performancePriority=0,this.onScenePerformancePriorityChangedObservable=new Z,this._forceWireframe=!1,this._skipFrustumClipping=!1,this._forcePointsCloud=!1,this.rootNodes=[],this.cameras=[],this.lights=[],this.meshes=[],this.skeletons=[],this.particleSystems=[],this.animations=[],this.animationGroups=[],this.multiMaterials=[],this.materials=[],this.morphTargetManagers=[],this.geometries=[],this.transformNodes=[],this.actionManagers=[],this.textures=[],this._environmentTexture=null,this.postProcesses=[],this.effectLayers=[],this.sounds=null,this.layers=[],this.lensFlareSystems=[],this.proceduralTextures=[],this.animationsEnabled=!0,this._animationPropertiesOverride=null,this.useConstantAnimationDeltaTime=!1,this.constantlyUpdateMeshUnderPointer=!1,this.hoverCursor="pointer",this.defaultCursor="",this.doNotHandleCursors=!1,this.preventDefaultOnPointerDown=!0,this.preventDefaultOnPointerUp=!0,this.metadata=null,this.reservedDataStore=null,this.disableOfflineSupportExceptionRules=[],this.onDisposeObservable=new Z,this._onDisposeObserver=null,this.onBeforeRenderObservable=new Z,this._onBeforeRenderObserver=null,this.onAfterRenderObservable=new Z,this.onAfterRenderCameraObservable=new Z,this._onAfterRenderObserver=null,this.onBeforeAnimationsObservable=new Z,this.onAfterAnimationsObservable=new Z,this.onBeforeDrawPhaseObservable=new Z,this.onAfterDrawPhaseObservable=new Z,this.onReadyObservable=new Z,this.onBeforeCameraRenderObservable=new Z,this._onBeforeCameraRenderObserver=null,this.onAfterCameraRenderObservable=new Z,this._onAfterCameraRenderObserver=null,this.onBeforeActiveMeshesEvaluationObservable=new Z,this.onAfterActiveMeshesEvaluationObservable=new Z,this.onBeforeParticlesRenderingObservable=new Z,this.onAfterParticlesRenderingObservable=new Z,this.onDataLoadedObservable=new Z,this.onNewCameraAddedObservable=new Z,this.onCameraRemovedObservable=new Z,this.onNewLightAddedObservable=new Z,this.onLightRemovedObservable=new Z,this.onNewGeometryAddedObservable=new Z,this.onGeometryRemovedObservable=new Z,this.onNewTransformNodeAddedObservable=new Z,this.onTransformNodeRemovedObservable=new Z,this.onNewMeshAddedObservable=new Z,this.onMeshRemovedObservable=new Z,this.onNewSkeletonAddedObservable=new Z,this.onSkeletonRemovedObservable=new Z,this.onNewMaterialAddedObservable=new Z,this.onNewMultiMaterialAddedObservable=new Z,this.onMaterialRemovedObservable=new Z,this.onMultiMaterialRemovedObservable=new Z,this.onNewTextureAddedObservable=new Z,this.onTextureRemovedObservable=new Z,this.onBeforeRenderTargetsRenderObservable=new Z,this.onAfterRenderTargetsRenderObservable=new Z,this.onBeforeStepObservable=new Z,this.onAfterStepObservable=new Z,this.onActiveCameraChanged=new Z,this.onActiveCamerasChanged=new Z,this.onBeforeRenderingGroupObservable=new Z,this.onAfterRenderingGroupObservable=new Z,this.onMeshImportedObservable=new Z,this.onAnimationFileImportedObservable=new Z,this._registeredForLateAnimationBindings=new Ms(256),this._pointerPickingConfiguration=new Kp,this.onPrePointerObservable=new Z,this.onPointerObservable=new Z,this.onPreKeyboardObservable=new Z,this.onKeyboardObservable=new Z,this._useRightHandedSystem=!1,this._timeAccumulator=0,this._currentStepId=0,this._currentInternalStep=0,this._fogEnabled=!0,this._fogMode=it.FOGMODE_NONE,this.fogColor=new de(.2,.2,.3),this.fogDensity=.1,this.fogStart=0,this.fogEnd=1e3,this.needsPreviousWorldMatrices=!1,this._shadowsEnabled=!0,this._lightsEnabled=!0,this._unObserveActiveCameras=null,this._texturesEnabled=!0,this._frameGraph=null,this.physicsEnabled=!0,this.particlesEnabled=!0,this.spritesEnabled=!0,this._skeletonsEnabled=!0,this.lensFlaresEnabled=!0,this.collisionsEnabled=!0,this.gravity=new v(0,-9.807,0),this.postProcessesEnabled=!0,this.renderTargetsEnabled=!0,this.dumpNextRenderTargets=!1,this.customRenderTargets=[],this.importedMeshesFiles=[],this.probesEnabled=!0,this._meshesForIntersections=new Ms(256),this.proceduralTexturesEnabled=!0,this._totalVertices=new ui,this._activeIndices=new ui,this._activeParticles=new ui,this._activeBones=new ui,this._animationTime=0,this.animationTimeScale=1,this._renderId=0,this._frameId=0,this._executeWhenReadyTimeoutId=null,this._intermediateRendering=!1,this._defaultFrameBufferCleared=!1,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1,this._toBeDisposed=new Array(256),this._activeRequests=new Array,this._pendingData=new Array,this._isDisposed=!1,this.dispatchAllSubMeshesOfActiveMeshes=!1,this._activeMeshes=new Ut(256),this._processedMaterials=new Ut(256),this._renderTargets=new Ms(256),this._materialsRenderTargets=new Ms(256),this._activeParticleSystems=new Ut(256),this._activeSkeletons=new Ms(32),this._softwareSkinnedMeshes=new Ms(32),this._activeAnimatables=new Array,this._transformMatrix=O.Zero(),this.requireLightSorting=!1,this._components=[],this._serializableComponents=[],this._transientComponents=[],this._beforeCameraUpdateStage=_t.Create(),this._beforeClearStage=_t.Create(),this._beforeRenderTargetClearStage=_t.Create(),this._gatherRenderTargetsStage=_t.Create(),this._gatherActiveCameraRenderTargetsStage=_t.Create(),this._isReadyForMeshStage=_t.Create(),this._beforeEvaluateActiveMeshStage=_t.Create(),this._evaluateSubMeshStage=_t.Create(),this._preActiveMeshStage=_t.Create(),this._cameraDrawRenderTargetStage=_t.Create(),this._beforeCameraDrawStage=_t.Create(),this._beforeRenderTargetDrawStage=_t.Create(),this._beforeRenderingGroupDrawStage=_t.Create(),this._beforeRenderingMeshStage=_t.Create(),this._afterRenderingMeshStage=_t.Create(),this._afterRenderingGroupDrawStage=_t.Create(),this._afterCameraDrawStage=_t.Create(),this._afterCameraPostProcessStage=_t.Create(),this._afterRenderTargetDrawStage=_t.Create(),this._afterRenderTargetPostProcessStage=_t.Create(),this._afterRenderStage=_t.Create(),this._pointerMoveStage=_t.Create(),this._pointerDownStage=_t.Create(),this._pointerUpStage=_t.Create(),this._geometriesByUniqueId=null,this._defaultMeshCandidates={data:[],length:0},this._defaultSubMeshCandidates={data:[],length:0},this._preventFreeActiveMeshesAndRenderingGroups=!1,this._activeMeshesFrozen=!1,this._activeMeshesFrozenButKeepClipping=!1,this._skipEvaluateActiveMeshesCompletely=!1,this._allowPostProcessClearColor=!0,this.getDeterministicFrameTime=()=>this._engine.getTimeStep(),this._registeredActions=0,this._blockMaterialDirtyMechanism=!1,this._perfCollector=null,this.activeCameras=[];const i={useGeometryUniqueIdsMap:!0,useMaterialMeshMap:!0,useClonedMeshMap:!0,virtual:!1,...t};e=this._engine=e||Ee.LastCreatedEngine,i.virtual?e._virtualScenes.push(this):(Ee._LastCreatedScene=this,e.scenes.push(this)),this._uid=null,this._renderingManager=new Lt(this),ka&&(this.postProcessManager=new ka(this)),St()&&this.attachControl(),this._createUbo(),Ne&&(this._imageProcessingConfiguration=new Ne),this.setDefaultCandidateProviders(),i.useGeometryUniqueIdsMap&&(this._geometriesByUniqueId={}),this.useMaterialMeshMap=i.useMaterialMeshMap,this.useClonedMeshMap=i.useClonedMeshMap,(!t||!t.virtual)&&e.onNewSceneAddedObservable.notifyObservers(this)}getClassName(){return"Scene"}_getDefaultMeshCandidates(){return this._defaultMeshCandidates.data=this.meshes,this._defaultMeshCandidates.length=this.meshes.length,this._defaultMeshCandidates}_getDefaultSubMeshCandidates(e){return this._defaultSubMeshCandidates.data=e.subMeshes,this._defaultSubMeshCandidates.length=e.subMeshes.length,this._defaultSubMeshCandidates}setDefaultCandidateProviders(){this.getActiveMeshCandidates=()=>this._getDefaultMeshCandidates(),this.getActiveSubMeshCandidates=e=>this._getDefaultSubMeshCandidates(e),this.getIntersectingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e),this.getCollidingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e)}get meshUnderPointer(){return this._inputManager.meshUnderPointer}get pointerX(){return this._inputManager.pointerX}set pointerX(e){this._inputManager.pointerX=e}get pointerY(){return this._inputManager.pointerY}set pointerY(e){this._inputManager.pointerY=e}getCachedMaterial(){return this._cachedMaterial}getCachedEffect(){return this._cachedEffect}getCachedVisibility(){return this._cachedVisibility}isCachedMaterialInvalid(e,t,i=1){return this._cachedEffect!==t||this._cachedMaterial!==e||this._cachedVisibility!==i}getEngine(){return this._engine}getTotalVertices(){return this._totalVertices.current}get totalVerticesPerfCounter(){return this._totalVertices}getActiveIndices(){return this._activeIndices.current}get totalActiveIndicesPerfCounter(){return this._activeIndices}getActiveParticles(){return this._activeParticles.current}get activeParticlesPerfCounter(){return this._activeParticles}getActiveBones(){return this._activeBones.current}get activeBonesPerfCounter(){return this._activeBones}getActiveMeshes(){return this._activeMeshes}getAnimationRatio(){return this._animationRatio!==void 0?this._animationRatio:1}getRenderId(){return this._renderId}getFrameId(){return this._frameId}incrementRenderId(){this._renderId++}_createUbo(){this.setSceneUniformBuffer(this.createSceneUniformBuffer())}simulatePointerMove(e,t){return this._inputManager.simulatePointerMove(e,t),this}simulatePointerDown(e,t){return this._inputManager.simulatePointerDown(e,t),this}simulatePointerUp(e,t,i){return this._inputManager.simulatePointerUp(e,t,i),this}isPointerCaptured(e=0){return this._inputManager.isPointerCaptured(e)}attachControl(e=!0,t=!0,i=!0){this._inputManager.attachControl(e,t,i)}detachControl(){this._inputManager.detachControl()}isReady(e=!0){var r,o,h;if(this._isDisposed)return!1;let t;const i=this.getEngine(),s=i.currentRenderPassId;i.currentRenderPassId=(o=(r=this.activeCamera)==null?void 0:r.renderPassId)!=null?o:s;let n=!0;for(this._pendingData.length>0&&(n=!1),(h=this.prePassRenderer)==null||h.update(),this.useOrderIndependentTransparency&&this.depthPeelingRenderer&&n&&(n=this.depthPeelingRenderer.isReady()),e&&(this._processedMaterials.reset(),this._materialsRenderTargets.reset()),t=0;t0;for(const f of this._isReadyForMeshStage)f.action(l,c)||(n=!1);if(!e)continue;const u=l.material||this.defaultMaterial;if(u)if(u._storeEffectOnSubMeshes)for(const f of l.subMeshes){const d=f.getMaterial();d&&d.hasRenderTargetTextures&&d.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(d)===-1&&(this._processedMaterials.push(d),this._materialsRenderTargets.concatWithNoDuplicate(d.getRenderTargetTextures()))}else u.hasRenderTargetTextures&&u.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(u)===-1&&(this._processedMaterials.push(u),this._materialsRenderTargets.concatWithNoDuplicate(u.getRenderTargetTextures()))}if(e)for(t=0;t0)for(const l of this.activeCameras)l.isReady(!0)||(n=!1);else this.activeCamera&&(this.activeCamera.isReady(!0)||(n=!1));for(const l of this.particleSystems)l.isReady()||(n=!1);if(this.layers)for(const l of this.layers)l.isReady()||(n=!1);return i.areAllEffectsReady()||(n=!1),i.currentRenderPassId=s,n}resetCachedMaterial(){this._cachedMaterial=null,this._cachedEffect=null,this._cachedVisibility=null}registerBeforeRender(e){this.onBeforeRenderObservable.add(e)}unregisterBeforeRender(e){this.onBeforeRenderObservable.removeCallback(e)}registerAfterRender(e){this.onAfterRenderObservable.add(e)}unregisterAfterRender(e){this.onAfterRenderObservable.removeCallback(e)}_executeOnceBeforeRender(e){const t=()=>{e(),setTimeout(()=>{this.unregisterBeforeRender(t)})};this.registerBeforeRender(t)}executeOnceBeforeRender(e,t){t!==void 0?setTimeout(()=>{this._executeOnceBeforeRender(e)},t):this._executeOnceBeforeRender(e)}addPendingData(e){this._pendingData.push(e)}removePendingData(e){const t=this.isLoading,i=this._pendingData.indexOf(e);i!==-1&&this._pendingData.splice(i,1),t&&!this.isLoading&&this.onDataLoadedObservable.notifyObservers(this)}getWaitingItemsCount(){return this._pendingData.length}get isLoading(){return this._pendingData.length>0}executeWhenReady(e,t=!1){this.onReadyObservable.addOnce(e),this._executeWhenReadyTimeoutId===null&&this._checkIsReady(t)}whenReadyAsync(e=!1){return new Promise(t=>{this.executeWhenReady(()=>{t()},e)})}_checkIsReady(e=!1){if(this._registerTransientComponents(),this.isReady(e)){this.onReadyObservable.notifyObservers(this),this.onReadyObservable.clear(),this._executeWhenReadyTimeoutId=null;return}if(this._isDisposed){this.onReadyObservable.clear(),this._executeWhenReadyTimeoutId=null;return}this._executeWhenReadyTimeoutId=setTimeout(()=>{this.incrementRenderId(),this._checkIsReady(e)},100)}get animatables(){return this._activeAnimatables}resetLastAnimationTimeFrame(){this._animationTimeLast=bi.Now}getViewMatrix(){return this._viewMatrix}getProjectionMatrix(){return this._projectionMatrix}getTransformMatrix(){return this._transformMatrix}setTransformMatrix(e,t,i,s){!i&&!s&&this._multiviewSceneUbo&&(this._multiviewSceneUbo.dispose(),this._multiviewSceneUbo=null),!(this._viewUpdateFlag===e.updateFlag&&this._projectionUpdateFlag===t.updateFlag)&&(this._viewUpdateFlag=e.updateFlag,this._projectionUpdateFlag=t.updateFlag,this._viewMatrix=e,this._projectionMatrix=t,this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._frustumPlanes?mi.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=mi.GetPlanes(this._transformMatrix),this._multiviewSceneUbo&&this._multiviewSceneUbo.useUbo?this._updateMultiviewUbo(i,s):this._sceneUbo.useUbo&&(this._sceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._sceneUbo.updateMatrix("view",this._viewMatrix),this._sceneUbo.updateMatrix("projection",this._projectionMatrix)))}getSceneUniformBuffer(){return this._multiviewSceneUbo?this._multiviewSceneUbo:this._sceneUbo}createSceneUniformBuffer(e){const t=new fe(this._engine,void 0,!1,e!=null?e:"scene");return t.addUniform("viewProjection",16),t.addUniform("view",16),t.addUniform("projection",16),t.addUniform("vEyePosition",4),t}setSceneUniformBuffer(e){this._sceneUbo=e,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1}getUniqueId(){return Sc.UniqueId}addMesh(e,t=!1){this._blockEntityCollection||(this.meshes.push(e),e._resyncLightSources(),e.parent||e._addToSceneRootNodes(),J.SetImmediate(()=>{this.onNewMeshAddedObservable.notifyObservers(e)}),t&&e.getChildMeshes().forEach(i=>{this.addMesh(i)}))}removeMesh(e,t=!1){const i=this.meshes.indexOf(e);return i!==-1&&(this.meshes.splice(i,1),e.parent||e._removeFromSceneRootNodes()),this._inputManager._invalidateMesh(e),this.onMeshRemovedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach(s=>{this.removeMesh(s)}),i}addTransformNode(e){this._blockEntityCollection||e.getScene()===this&&e._indexInSceneTransformNodesArray!==-1||(e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),e.parent||e._addToSceneRootNodes(),this.onNewTransformNodeAddedObservable.notifyObservers(e))}removeTransformNode(e){const t=e._indexInSceneTransformNodesArray;if(t!==-1){if(t!==this.transformNodes.length-1){const i=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=i,i._indexInSceneTransformNodesArray=t}e._indexInSceneTransformNodesArray=-1,this.transformNodes.pop(),e.parent||e._removeFromSceneRootNodes()}return this.onTransformNodeRemovedObservable.notifyObservers(e),t}removeSkeleton(e){const t=this.skeletons.indexOf(e);return t!==-1&&(this.skeletons.splice(t,1),this.onSkeletonRemovedObservable.notifyObservers(e),this._executeActiveContainerCleanup(this._activeSkeletons)),t}removeMorphTargetManager(e){const t=this.morphTargetManagers.indexOf(e);return t!==-1&&this.morphTargetManagers.splice(t,1),t}removeLight(e){const t=this.lights.indexOf(e);if(t!==-1){for(const i of this.meshes)i._removeLightSource(e,!1);this.lights.splice(t,1),this.sortLightsByPriority(),e.parent||e._removeFromSceneRootNodes()}return this.onLightRemovedObservable.notifyObservers(e),t}removeCamera(e){const t=this.cameras.indexOf(e);if(t!==-1&&(this.cameras.splice(t,1),e.parent||e._removeFromSceneRootNodes()),this.activeCameras){const i=this.activeCameras.indexOf(e);i!==-1&&this.activeCameras.splice(i,1)}return this.activeCamera===e&&(this.cameras.length>0?this.activeCamera=this.cameras[0]:this.activeCamera=null),this.onCameraRemovedObservable.notifyObservers(e),t}removeParticleSystem(e){const t=this.particleSystems.indexOf(e);return t!==-1&&(this.particleSystems.splice(t,1),this._executeActiveContainerCleanup(this._activeParticleSystems)),t}removeAnimation(e){const t=this.animations.indexOf(e);return t!==-1&&this.animations.splice(t,1),t}stopAnimation(e,t,i){}removeAnimationGroup(e){const t=this.animationGroups.indexOf(e);return t!==-1&&this.animationGroups.splice(t,1),t}removeMultiMaterial(e){const t=this.multiMaterials.indexOf(e);return t!==-1&&this.multiMaterials.splice(t,1),this.onMultiMaterialRemovedObservable.notifyObservers(e),t}removeMaterial(e){const t=e._indexInSceneMaterialArray;if(t!==-1&&t{this.onNewLightAddedObservable.notifyObservers(e)})}}sortLightsByPriority(){this.requireLightSorting&&this.lights.sort(Xe.CompareLightsPriority)}addCamera(e){this._blockEntityCollection||(this.cameras.push(e),J.SetImmediate(()=>{this.onNewCameraAddedObservable.notifyObservers(e)}),e.parent||e._addToSceneRootNodes())}addSkeleton(e){this._blockEntityCollection||(this.skeletons.push(e),J.SetImmediate(()=>{this.onNewSkeletonAddedObservable.notifyObservers(e)}))}addParticleSystem(e){this._blockEntityCollection||this.particleSystems.push(e)}addAnimation(e){this._blockEntityCollection||this.animations.push(e)}addAnimationGroup(e){this._blockEntityCollection||this.animationGroups.push(e)}addMultiMaterial(e){this._blockEntityCollection||(this.multiMaterials.push(e),J.SetImmediate(()=>{this.onNewMultiMaterialAddedObservable.notifyObservers(e)}))}addMaterial(e){this._blockEntityCollection||e.getScene()===this&&e._indexInSceneMaterialArray!==-1||(e._indexInSceneMaterialArray=this.materials.length,this.materials.push(e),J.SetImmediate(()=>{this.onNewMaterialAddedObservable.notifyObservers(e)}))}addMorphTargetManager(e){this._blockEntityCollection||this.morphTargetManagers.push(e)}addGeometry(e){this._blockEntityCollection||(this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=this.geometries.length),this.geometries.push(e))}addActionManager(e){this.actionManagers.push(e)}addTexture(e){this._blockEntityCollection||(this.textures.push(e),this.onNewTextureAddedObservable.notifyObservers(e))}switchActiveCamera(e,t=!0){this._engine.getInputElement()&&(this.activeCamera&&this.activeCamera.detachControl(),this.activeCamera=e,t&&e.attachControl())}setActiveCameraById(e){const t=this.getCameraById(e);return t?(this.activeCamera=t,t):null}setActiveCameraByName(e){const t=this.getCameraByName(e);return t?(this.activeCamera=t,t):null}getAnimationGroupByName(e){for(let t=0;ti.uniqueId===e)}getMaterialById(e,t=!1){return this._getMaterial(t,i=>i.id===e)}getMaterialByName(e,t=!1){return this._getMaterial(t,i=>i.name===e)}getLastMaterialById(e,t=!1){for(let i=this.materials.length-1;i>=0;i--)if(this.materials[i].id===e)return this.materials[i];if(t){for(let i=this.multiMaterials.length-1;i>=0;i--)if(this.multiMaterials[i].id===e)return this.multiMaterials[i]}return null}getTextureByUniqueId(e){for(let t=0;t{this.onNewGeometryAddedObservable.notifyObservers(e)}),!0)}removeGeometry(e){let t;if(this._geometriesByUniqueId){if(t=this._geometriesByUniqueId[e.uniqueId],t===void 0)return!1}else if(t=this.geometries.indexOf(e),t<0)return!1;if(t!==this.geometries.length-1){const i=this.geometries[this.geometries.length-1];i&&(this.geometries[t]=i,this._geometriesByUniqueId&&(this._geometriesByUniqueId[i.uniqueId]=t))}return this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=void 0),this.geometries.pop(),this.onGeometryRemovedObservable.notifyObservers(e),!0}getGeometries(){return this.geometries}getMeshById(e){for(let t=0;t=0;t--)if(this.meshes[t].id===e)return this.meshes[t];return null}getLastTransformNodeById(e){for(let t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null}getLastEntryById(e){let t;for(t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];for(t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];for(t=this.cameras.length-1;t>=0;t--)if(this.cameras[t].id===e)return this.cameras[t];for(t=this.lights.length-1;t>=0;t--)if(this.lights[t].id===e)return this.lights[t];return null}getNodeById(e){const t=this.getMeshById(e);if(t)return t;const i=this.getTransformNodeById(e);if(i)return i;const s=this.getLightById(e);if(s)return s;const n=this.getCameraById(e);if(n)return n;const r=this.getBoneById(e);return r||null}getNodeByName(e){const t=this.getMeshByName(e);if(t)return t;const i=this.getTransformNodeByName(e);if(i)return i;const s=this.getLightByName(e);if(s)return s;const n=this.getCameraByName(e);if(n)return n;const r=this.getBoneByName(e);return r||null}getMeshByName(e){for(let t=0;t=0;t--)if(this.skeletons[t].id===e)return this.skeletons[t];return null}getSkeletonByUniqueId(e){for(let t=0;t{if(!this.activeCamera){i&&i("No active camera found");return}if(this._frustumPlanes||this.updateTransformMatrix(),this._evaluateActiveMeshes(),this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=n,this._skipEvaluateActiveMeshesCompletely=e,s)for(let r=0;re.dispose())}_evaluateActiveMeshes(){var i;if(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1){this._activeMeshes.length>0&&((i=this.activeCamera)==null||i._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset());return}if(this._activeMeshesFrozen&&this._activeMeshes.length){if(!this._skipEvaluateActiveMeshesCompletely){const s=this._activeMeshes.length;for(let n=0;n0&&n.layerMask&this.activeCamera.layerMask&&(this._skipFrustumClipping||n.alwaysSelectAsActiveMesh||n.isInFrustum(this._frustumPlanes)))){this._activeMeshes.push(n),this.activeCamera._activeMeshes.push(n),r!==n&&r._activate(this._renderId,!1);for(const o of this._preActiveMeshStage)o.action(n);n._activate(this._renderId,!1)&&(n.isAnInstance?n._internalAbstractMeshDataInfo._actAsRegularMesh&&(r=n):r._internalAbstractMeshDataInfo._onlyForInstances=!1,r._internalAbstractMeshDataInfo._isActive=!0,this._activeMesh(n,r)),n._postActivate()}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(let s=0;s0){const s=this.getActiveSubMeshCandidates(t),n=s.length;i=i||n===1;for(let r=0;r0&&this._renderTargets.concatWithNoDuplicate(e.customRenderTargets),t&&t.customRenderTargets&&t.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(t.customRenderTargets),this.environmentTexture&&this.environmentTexture.isRenderTarget&&this._renderTargets.pushNoDuplicate(this.environmentTexture);for(const l of this._gatherActiveCameraRenderTargetsStage)l.action(this._renderTargets);let n=!1;if(this.renderTargetsEnabled){if(this._intermediateRendering=!0,this._renderTargets.length>0){J.StartPerformanceCounter("Render targets",this._renderTargets.length>0);for(let l=0;l0),this._renderId++}for(const l of this._cameraDrawRenderTargetStage)n=l.action(this.activeCamera)||n;this._intermediateRendering=!1}this._engine.currentRenderPassId=(h=(o=(r=e.outputRenderTarget)==null?void 0:r.renderPassId)!=null?o:e.renderPassId)!=null?h:0,n&&!this.prePass&&(this._bindFrameBuffer(this._activeCamera,!1),this.updateTransformMatrix()),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),this.postProcessManager&&!e._multiviewTexture&&!this.prePass&&this.postProcessManager._prepareFrame();for(const l of this._beforeCameraDrawStage)l.action(this.activeCamera);this.onBeforeDrawPhaseObservable.notifyObservers(this),s.snapshotRendering&&s.snapshotRenderingMode===1&&this.finalizeSceneUbo(),this._renderingManager.render(null,null,!0,!0),this.onAfterDrawPhaseObservable.notifyObservers(this);for(const l of this._afterCameraDrawStage)l.action(this.activeCamera);if(this.postProcessManager&&!e._multiviewTexture){const l=e.outputRenderTarget?e.outputRenderTarget.renderTarget:void 0;this.postProcessManager._finalizeFrame(e.isIntermediate,l)}for(const l of this._afterCameraPostProcessStage)l.action(this.activeCamera);this._renderTargets.reset(),this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera)}_processSubCameras(e,t=!0){if(e.cameraRigMode===0||e._renderingMultiview){e._renderingMultiview&&!this._multiviewSceneUbo&&this._createMultiviewUbo(),this._renderForCamera(e,void 0,t),this.onAfterRenderCameraObservable.notifyObservers(e);return}if(e._useMultiviewToSingleView)this._renderMultiviewToSingleView(e);else{this.onBeforeCameraRenderObservable.notifyObservers(e);for(let i=0;i-1&&(s.trigger===13&&s._executeCurrent(Ot.CreateNew(t,void 0,r)),(!t.actionManager.hasSpecificTrigger(13,l=>{const c=l.mesh?l.mesh:l;return r===c})||s.trigger===13)&&t._intersectionsInProgress.splice(h,1))}}}}_advancePhysicsEngineStep(e){}_animate(e){}animate(){if(this._engine.isDeterministicLockStep()){let e=Math.max(it.MinDeltaTime,Math.min(this._engine.getDeltaTime(),it.MaxDeltaTime))+this._timeAccumulator;const t=this._engine.getTimeStep(),i=1e3/t/1e3;let s=0;const n=this._engine.getLockstepMaxSteps();let r=Math.floor(e/t);for(r=Math.min(r,n);e>0&&s0)for(let r=0;r0),this._intermediateRendering=!0;for(let h=0;h0),this._intermediateRendering=!1,this._renderId++}this._engine.currentRenderPassId=(n=o==null?void 0:o.renderPassId)!=null?n:0,this.activeCamera=o,this._activeCamera&&this._activeCamera.cameraRigMode!==22&&!this.prePass&&this._bindFrameBuffer(this._activeCamera,!1),this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(const h of this._beforeClearStage)h.action();this._clearFrameBuffer(this.activeCamera);for(const h of this._gatherRenderTargetsStage)h.action(this._renderTargets);if(this.activeCameras&&this.activeCameras.length>0)for(let h=0;h0);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera,!!this.activeCamera.outputRenderTarget)}}this._checkIntersections();for(const r of this._afterRenderStage)r.action();if(this.afterRender&&this.afterRender(),this.onAfterRenderObservable.notifyObservers(this),this._toBeDisposed.length){for(let r=0;r{n.onAnimationEndObservable.clear(),n.onAnimationEnd=null}),this.stopAllAnimations()),this.resetCachedMaterial(),this.activeCamera&&(this.activeCamera._activeMeshes.dispose(),this.activeCamera=null),this.activeCameras=null,this._activeMeshes.dispose(),this._renderingManager.dispose(),this._processedMaterials.dispose(),this._activeParticleSystems.dispose(),this._activeSkeletons.dispose(),this._softwareSkinnedMeshes.dispose(),this._renderTargets.dispose(),this._materialsRenderTargets.dispose(),this._registeredForLateAnimationBindings.dispose(),this._meshesForIntersections.dispose(),this._toBeDisposed.length=0;const e=this._activeRequests.slice();for(const n of e)n.abort();this._activeRequests.length=0;try{this.onDisposeObservable.notifyObservers(this)}catch(n){U.Error("An error occurred while calling onDisposeObservable!",n)}if(this.detachControl(),this._engine.getInputElement())for(let n=0;nn.dispose(!0)),this._disposeList(this.transformNodes,n=>n.dispose(!0));const i=this.cameras;this._disposeList(i),this._disposeList(this.particleSystems),this._disposeList(this.postProcesses),this._disposeList(this.textures),this._disposeList(this.morphTargetManagers),this._sceneUbo.dispose(),this._multiviewSceneUbo&&this._multiviewSceneUbo.dispose(),this.postProcessManager.dispose(),this._disposeList(this._components);let s=this._engine.scenes.indexOf(this);s>-1&&this._engine.scenes.splice(s,1),Ee._LastCreatedScene===this&&(this._engine.scenes.length>0?Ee._LastCreatedScene=this._engine.scenes[this._engine.scenes.length-1]:Ee._LastCreatedScene=null),s=this._engine._virtualScenes.indexOf(this),s>-1&&this._engine._virtualScenes.splice(s,1),this._engine.wipeCaches(!0),this.onDisposeObservable.clear(),this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderTargetsRenderObservable.clear(),this.onAfterRenderTargetsRenderObservable.clear(),this.onAfterStepObservable.clear(),this.onBeforeStepObservable.clear(),this.onBeforeActiveMeshesEvaluationObservable.clear(),this.onAfterActiveMeshesEvaluationObservable.clear(),this.onBeforeParticlesRenderingObservable.clear(),this.onAfterParticlesRenderingObservable.clear(),this.onBeforeDrawPhaseObservable.clear(),this.onAfterDrawPhaseObservable.clear(),this.onBeforeAnimationsObservable.clear(),this.onAfterAnimationsObservable.clear(),this.onDataLoadedObservable.clear(),this.onBeforeRenderingGroupObservable.clear(),this.onAfterRenderingGroupObservable.clear(),this.onMeshImportedObservable.clear(),this.onBeforeCameraRenderObservable.clear(),this.onAfterCameraRenderObservable.clear(),this.onAfterRenderCameraObservable.clear(),this.onReadyObservable.clear(),this.onNewCameraAddedObservable.clear(),this.onCameraRemovedObservable.clear(),this.onNewLightAddedObservable.clear(),this.onLightRemovedObservable.clear(),this.onNewGeometryAddedObservable.clear(),this.onGeometryRemovedObservable.clear(),this.onNewTransformNodeAddedObservable.clear(),this.onTransformNodeRemovedObservable.clear(),this.onNewMeshAddedObservable.clear(),this.onMeshRemovedObservable.clear(),this.onNewSkeletonAddedObservable.clear(),this.onSkeletonRemovedObservable.clear(),this.onNewMaterialAddedObservable.clear(),this.onNewMultiMaterialAddedObservable.clear(),this.onMaterialRemovedObservable.clear(),this.onMultiMaterialRemovedObservable.clear(),this.onNewTextureAddedObservable.clear(),this.onTextureRemovedObservable.clear(),this.onPrePointerObservable.clear(),this.onPointerObservable.clear(),this.onPreKeyboardObservable.clear(),this.onKeyboardObservable.clear(),this.onActiveCameraChanged.clear(),this.onScenePerformancePriorityChangedObservable.clear(),this.onClearColorChangedObservable.clear(),this._isDisposed=!0}_disposeList(e,t){const i=e.slice(0);t=t!=null?t:s=>s.dispose();for(const s of i)t(s);e.length=0}get isDisposed(){return this._isDisposed}clearCachedVertexData(){for(let e=0;e!0),this.meshes.filter(e).forEach(s=>{if(s.computeWorldMatrix(!0),!s.subMeshes||s.subMeshes.length===0||s.infiniteDistance)return;const n=s.getBoundingInfo(),r=n.boundingBox.minimumWorld,o=n.boundingBox.maximumWorld;v.CheckExtends(r,t,i),v.CheckExtends(o,t,i)}),{min:t,max:i}}createPickingRay(e,t,i,s,n=!1){throw ye("Ray")}createPickingRayToRef(e,t,i,s,n,r=!1,o=!1){throw ye("Ray")}createPickingRayInCameraSpace(e,t,i){throw ye("Ray")}createPickingRayInCameraSpaceToRef(e,t,i,s){throw ye("Ray")}pick(e,t,i,s,n,r){const o=ye("Ray",!0);return o&&U.Warn(o),new as}pickWithBoundingInfo(e,t,i,s,n){const r=ye("Ray",!0);return r&&U.Warn(r),new as}pickWithRay(e,t,i,s){throw ye("Ray")}multiPick(e,t,i,s,n){throw ye("Ray")}multiPickWithRay(e,t,i){throw ye("Ray")}setPointerOverMesh(e,t,i){this._inputManager.setPointerOverMesh(e,t,i)}getPointerOverMesh(){return this._inputManager.getPointerOverMesh()}_rebuildGeometries(){for(const e of this.geometries)e._rebuild();for(const e of this.meshes)e._rebuild();this.postProcessManager&&this.postProcessManager._rebuild();for(const e of this._components)e.rebuild();for(const e of this.particleSystems)e.rebuild();if(this.spriteManagers)for(const e of this.spriteManagers)e.rebuild()}_rebuildTextures(){for(const e of this.textures)e._rebuild(!0);this.markAllMaterialsAsDirty(1)}_getByTags(e,t,i){if(t===void 0)return e;const s=[];for(const n in e){const r=e[n];ke&&ke.MatchesQuery(r,t)&&(!i||i(r))&&s.push(r)}return s}getMeshesByTags(e,t){return this._getByTags(this.meshes,e,t)}getCamerasByTags(e,t){return this._getByTags(this.cameras,e,t)}getLightsByTags(e,t){return this._getByTags(this.lights,e,t)}getMaterialByTags(e,t){return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))}getTransformNodesByTags(e,t){return this._getByTags(this.transformNodes,e,t)}setRenderingOrder(e,t=null,i=null,s=null){this._renderingManager.setRenderingOrder(e,t,i,s)}setRenderingAutoClearDepthStencil(e,t,i=!0,s=!0){this._renderingManager.setRenderingAutoClearDepthStencil(e,t,i,s)}getAutoClearDepthStencilSetup(e){return this._renderingManager.getAutoClearDepthStencilSetup(e)}_forceBlockMaterialDirtyMechanism(e){this._blockMaterialDirtyMechanism=e}get blockMaterialDirtyMechanism(){return this._blockMaterialDirtyMechanism}set blockMaterialDirtyMechanism(e){this._blockMaterialDirtyMechanism!==e&&(this._blockMaterialDirtyMechanism=e,e||this.markAllMaterialsAsDirty(63))}markAllMaterialsAsDirty(e,t){if(!this._blockMaterialDirtyMechanism)for(const i of this.materials)t&&!t(i)||i.markAsDirty(e)}_loadFile(e,t,i,s,n,r,o){const h=Ts(e,t,i,s?this.offlineProvider:void 0,n,r,o);return this._activeRequests.push(h),h.onCompleteObservable.add(l=>{this._activeRequests.splice(this._activeRequests.indexOf(l),1)}),h}_loadFileAsync(e,t,i,s,n){return new Promise((r,o)=>{this._loadFile(e,h=>{r(h)},t,i,s,(h,l)=>{o(l)},n)})}_requestFile(e,t,i,s,n,r,o){const h=x0(e,t,i,s?this.offlineProvider:void 0,n,r,o);return this._activeRequests.push(h),h.onCompleteObservable.add(l=>{this._activeRequests.splice(this._activeRequests.indexOf(l),1)}),h}_requestFileAsync(e,t,i,s,n){return new Promise((r,o)=>{this._requestFile(e,h=>{r(h)},t,i,s,h=>{o(h)},n)})}_readFile(e,t,i,s,n){const r=Ln(e,t,i,s,n);return this._activeRequests.push(r),r.onCompleteObservable.add(o=>{this._activeRequests.splice(this._activeRequests.indexOf(o),1)}),r}_readFileAsync(e,t,i){return new Promise((s,n)=>{this._readFile(e,r=>{s(r)},t,i,r=>{n(r)})})}getPerfCollector(){throw ye("performanceViewerSceneExtension")}setActiveCameraByID(e){return this.setActiveCameraById(e)}getMaterialByID(e){return this.getMaterialById(e)}getLastMaterialByID(e){return this.getLastMaterialById(e)}getTextureByUniqueID(e){return this.getTextureByUniqueId(e)}getCameraByID(e){return this.getCameraById(e)}getCameraByUniqueID(e){return this.getCameraByUniqueId(e)}getBoneByID(e){return this.getBoneById(e)}getLightByID(e){return this.getLightById(e)}getLightByUniqueID(e){return this.getLightByUniqueId(e)}getParticleSystemByID(e){return this.getParticleSystemById(e)}getGeometryByID(e){return this.getGeometryById(e)}getMeshByID(e){return this.getMeshById(e)}getMeshByUniqueID(e){return this.getMeshByUniqueId(e)}getLastMeshByID(e){return this.getLastMeshById(e)}getMeshesByID(e){return this.getMeshesById(e)}getTransformNodeByID(e){return this.getTransformNodeById(e)}getTransformNodeByUniqueID(e){return this.getTransformNodeByUniqueId(e)}getTransformNodesByID(e){return this.getTransformNodesById(e)}getNodeByID(e){return this.getNodeById(e)}getLastEntryByID(e){return this.getLastEntryById(e)}getLastSkeletonByID(e){return this.getLastSkeletonById(e)}}it.FOGMODE_NONE=0;it.FOGMODE_EXP=1;it.FOGMODE_EXP2=2;it.FOGMODE_LINEAR=3;it.MinDeltaTime=1;it.MaxDeltaTime=1e3;vt("BABYLON.Scene",it);class ve extends bt{get position(){return this._position}set position(e){this._position=e}set upVector(e){this._upVector=e}get upVector(){return this._upVector}get screenArea(){var i,s,n,r;let e=0,t=0;if(this.mode===ve.PERSPECTIVE_CAMERA)this.fovMode===ve.FOVMODE_VERTICAL_FIXED?(t=this.minZ*2*Math.tan(this.fov/2),e=this.getEngine().getAspectRatio(this)*t):(e=this.minZ*2*Math.tan(this.fov/2),t=e/this.getEngine().getAspectRatio(this));else{const o=this.getEngine().getRenderWidth()/2,h=this.getEngine().getRenderHeight()/2;e=((i=this.orthoRight)!=null?i:o)-((s=this.orthoLeft)!=null?s:-o),t=((n=this.orthoTop)!=null?n:h)-((r=this.orthoBottom)!=null?r:-h)}return e*t}set orthoLeft(e){this._orthoLeft=e;for(const t of this._rigCameras)t.orthoLeft=e}get orthoLeft(){return this._orthoLeft}set orthoRight(e){this._orthoRight=e;for(const t of this._rigCameras)t.orthoRight=e}get orthoRight(){return this._orthoRight}set orthoBottom(e){this._orthoBottom=e;for(const t of this._rigCameras)t.orthoBottom=e}get orthoBottom(){return this._orthoBottom}set orthoTop(e){this._orthoTop=e;for(const t of this._rigCameras)t.orthoTop=e}get orthoTop(){return this._orthoTop}set mode(e){this._mode=e;for(const t of this._rigCameras)t.mode=e}get mode(){return this._mode}get hasMoved(){return this._hasMoved}constructor(e,t,i,s=!0){super(e,i,!1),this._position=v.Zero(),this._upVector=v.Up(),this.oblique=null,this._orthoLeft=null,this._orthoRight=null,this._orthoBottom=null,this._orthoTop=null,this.fov=.8,this.projectionPlaneTilt=0,this.minZ=1,this.maxZ=1e4,this.inertia=.9,this._mode=ve.PERSPECTIVE_CAMERA,this.isIntermediate=!1,this.viewport=new on(0,0,1,1),this.layerMask=268435455,this.fovMode=ve.FOVMODE_VERTICAL_FIXED,this.cameraRigMode=ve.RIG_MODE_NONE,this.customRenderTargets=[],this.outputRenderTarget=null,this.onViewMatrixChangedObservable=new Z,this.onProjectionMatrixChangedObservable=new Z,this.onAfterCheckInputsObservable=new Z,this.onRestoreStateObservable=new Z,this.isRigCamera=!1,this._hasMoved=!1,this._rigCameras=new Array,this._skipRendering=!1,this._projectionMatrix=new O,this._postProcesses=new Array,this._activeMeshes=new Ut(256),this._globalPosition=v.Zero(),this._computedViewMatrix=O.Identity(),this._doNotComputeProjectionMatrix=!1,this._transformMatrix=O.Zero(),this._refreshFrustumPlanes=!0,this._absoluteRotation=re.Identity(),this._isCamera=!0,this._isLeftCamera=!1,this._isRightCamera=!1,this.getScene().addCamera(this),s&&!this.getScene().activeCamera&&(this.getScene().activeCamera=this),this.position=t,this.renderPassId=this.getScene().getEngine().createRenderPassId("Camera ".concat(e))}storeState(){return this._stateStored=!0,this._storedFov=this.fov,this}hasStateStored(){return!!this._stateStored}_restoreStateValues(){return this._stateStored?(this.fov=this._storedFov,!0):!1}restoreState(){return this._restoreStateValues()?(this.onRestoreStateObservable.notifyObservers(this),!0):!1}getClassName(){return"Camera"}toString(e){let t="Name: "+this.name;if(t+=", type: "+this.getClassName(),this.animations)for(let i=0;i-1?(U.Error("You're trying to reuse a post process not defined as reusable."),0):(t==null||t<0?this._postProcesses.push(e):this._postProcesses[t]===null?this._postProcesses[t]=e:this._postProcesses.splice(t,0,e),this._cascadePostProcessesToRigCams(),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._postProcesses.indexOf(e))}detachPostProcess(e){const t=this._postProcesses.indexOf(e);t!==-1&&(this._postProcesses[t]=null),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._cascadePostProcessesToRigCams()}getWorldMatrix(){return this._isSynchronizedViewMatrix()?this._worldMatrix:(this.getViewMatrix(),this._worldMatrix)}_getViewMatrix(){return O.Identity()}getViewMatrix(e){return!e&&this._isSynchronizedViewMatrix()?this._computedViewMatrix:(this._hasMoved=!0,this.updateCache(),this._computedViewMatrix=this._getViewMatrix(),this._currentRenderId=this.getScene().getRenderId(),this._childUpdateId++,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),this.parent&&this.parent.onViewMatrixChangedObservable&&this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent),this.onViewMatrixChangedObservable.notifyObservers(this),this._computedViewMatrix.invertToRef(this._worldMatrix),this._computedViewMatrix)}freezeProjectionMatrix(e){this._doNotComputeProjectionMatrix=!0,e!==void 0&&(this._projectionMatrix=e)}unfreezeProjectionMatrix(){this._doNotComputeProjectionMatrix=!1}getProjectionMatrix(e){var n,r,o,h,l,c,u,f,d,_,p,g,m,b,I,T,x,y,R;if(this._doNotComputeProjectionMatrix||!e&&this._isSynchronizedProjectionMatrix())return this._projectionMatrix;this._cache.mode=this.mode,this._cache.minZ=this.minZ,this._cache.maxZ=this.maxZ,this._refreshFrustumPlanes=!0;const t=this.getEngine(),i=this.getScene(),s=t.useReverseDepthBuffer;if(this.mode===ve.PERSPECTIVE_CAMERA){this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=t.getAspectRatio(this),this._cache.projectionPlaneTilt=this.projectionPlaneTilt,this.minZ<=0&&(this.minZ=.1);let E;i.useRightHandedSystem?E=O.PerspectiveFovRHToRef:E=O.PerspectiveFovLHToRef,E(this.fov,t.getAspectRatio(this),s?this.maxZ:this.minZ,s?this.minZ:this.maxZ,this._projectionMatrix,this.fovMode===ve.FOVMODE_VERTICAL_FIXED,t.isNDCHalfZRange,this.projectionPlaneTilt,s)}else{const E=t.getRenderWidth()/2,C=t.getRenderHeight()/2;i.useRightHandedSystem?this.oblique?O.ObliqueOffCenterRHToRef((n=this.orthoLeft)!=null?n:-E,(r=this.orthoRight)!=null?r:E,(o=this.orthoBottom)!=null?o:-C,(h=this.orthoTop)!=null?h:C,s?this.maxZ:this.minZ,s?this.minZ:this.maxZ,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,t.isNDCHalfZRange):O.OrthoOffCenterRHToRef((l=this.orthoLeft)!=null?l:-E,(c=this.orthoRight)!=null?c:E,(u=this.orthoBottom)!=null?u:-C,(f=this.orthoTop)!=null?f:C,s?this.maxZ:this.minZ,s?this.minZ:this.maxZ,this._projectionMatrix,t.isNDCHalfZRange):this.oblique?O.ObliqueOffCenterLHToRef((d=this.orthoLeft)!=null?d:-E,(_=this.orthoRight)!=null?_:E,(p=this.orthoBottom)!=null?p:-C,(g=this.orthoTop)!=null?g:C,s?this.maxZ:this.minZ,s?this.minZ:this.maxZ,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,t.isNDCHalfZRange):O.OrthoOffCenterLHToRef((m=this.orthoLeft)!=null?m:-E,(b=this.orthoRight)!=null?b:E,(I=this.orthoBottom)!=null?I:-C,(T=this.orthoTop)!=null?T:C,s?this.maxZ:this.minZ,s?this.minZ:this.maxZ,this._projectionMatrix,t.isNDCHalfZRange),this._cache.orthoLeft=this.orthoLeft,this._cache.orthoRight=this.orthoRight,this._cache.orthoBottom=this.orthoBottom,this._cache.orthoTop=this.orthoTop,this._cache.obliqueAngle=(x=this.oblique)==null?void 0:x.angle,this._cache.obliqueLength=(y=this.oblique)==null?void 0:y.length,this._cache.obliqueOffset=(R=this.oblique)==null?void 0:R.offset,this._cache.renderWidth=t.getRenderWidth(),this._cache.renderHeight=t.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix}getTransformationMatrix(){return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix}_computeObliqueDistance(e){const t=this,i=this;return(t.radius||(i.target?v.Distance(this.position,i.target):this.position.length()))+e}_updateFrustumPlanes(){this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?mi.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=mi.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)}isInFrustum(e,t=!1){if(this._updateFrustumPlanes(),t&&this.rigCameras.length>0){let i=!1;return this.rigCameras.forEach(s=>{s._updateFrustumPlanes(),i=i||e.isInFrustum(s._frustumPlanes)}),i}else return e.isInFrustum(this._frustumPlanes)}isCompletelyInFrustum(e){return this._updateFrustumPlanes(),e.isCompletelyInFrustum(this._frustumPlanes)}getForwardRay(e=100,t,i){throw ye("Ray")}getForwardRayToRef(e,t=100,i,s){throw ye("Ray")}dispose(e,t=!1){for(this.onViewMatrixChangedObservable.clear(),this.onProjectionMatrixChangedObservable.clear(),this.onAfterCheckInputsObservable.clear(),this.onRestoreStateObservable.clear(),this.inputs&&this.inputs.clear(),this.getScene().stopAnimation(this),this.getScene().removeCamera(this);this._rigCameras.length>0;){const s=this._rigCameras.pop();s&&s.dispose()}if(this._parentContainer){const s=this._parentContainer.cameras.indexOf(this);s>-1&&this._parentContainer.cameras.splice(s,1),this._parentContainer=null}if(this._rigPostProcess)this._rigPostProcess.dispose(this),this._rigPostProcess=null,this._postProcesses.length=0;else if(this.cameraRigMode!==ve.RIG_MODE_NONE)this._rigPostProcess=null,this._postProcesses.length=0;else{let s=this._postProcesses.length;for(;--s>=0;){const n=this._postProcesses[s];n&&n.dispose(this)}}let i=this.customRenderTargets.length;for(;--i>=0;)this.customRenderTargets[i].dispose();this.customRenderTargets.length=0,this._activeMeshes.dispose(),this.getScene().getEngine().releaseRenderPassId(this.renderPassId),super.dispose(e,t)}get isLeftCamera(){return this._isLeftCamera}get isRightCamera(){return this._isRightCamera}get leftCamera(){return this._rigCameras.length<1?null:this._rigCameras[0]}get rightCamera(){return this._rigCameras.length<2?null:this._rigCameras[1]}getLeftTarget(){return this._rigCameras.length<1?null:this._rigCameras[0].getTarget()}getRightTarget(){return this._rigCameras.length<2?null:this._rigCameras[1].getTarget()}setCameraRigMode(e,t){if(this.cameraRigMode!==e){for(;this._rigCameras.length>0;){const i=this._rigCameras.pop();i&&i.dispose()}if(this.cameraRigMode=e,this._cameraRigParams={},this._cameraRigParams.interaxialDistance=t.interaxialDistance||.0637,this._cameraRigParams.stereoHalfAngle=J.ToRadians(this._cameraRigParams.interaxialDistance/.0637),this.cameraRigMode!==ve.RIG_MODE_NONE){const i=this.createRigCamera(this.name+"_L",0);i&&(i._isLeftCamera=!0);const s=this.createRigCamera(this.name+"_R",1);s&&(s._isRightCamera=!0),i&&s&&(this._rigCameras.push(i),this._rigCameras.push(s))}this._setRigMode(t),this._cascadePostProcessesToRigCams(),this.update()}}_setRigMode(e){}_getVRProjectionMatrix(){return O.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov,this._cameraRigParams.vrMetrics.aspectRatio,this.minZ,this.maxZ,this._cameraRigParams.vrWorkMatrix,!0,this.getEngine().isNDCHalfZRange),this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix,this._projectionMatrix),this._projectionMatrix}setCameraRigParameter(e,t){this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[e]=t,e==="interaxialDistance"&&(this._cameraRigParams.stereoHalfAngle=J.ToRadians(t/.0637))}createRigCamera(e,t){return null}_updateRigCameras(){for(let e=0;eve._CreateDefaultParsedCamera(t,i))}computeWorldMatrix(){return this.getWorldMatrix()}static Parse(e,t){const i=e.type,s=ve.GetConstructorFromName(i,e.name,t,e.interaxial_distance,e.isStereoscopicSideBySide),n=Ae.Parse(s,e,t);if(e.parentId!==void 0&&(n._waitingParentId=e.parentId),e.parentInstanceIndex!==void 0&&(n._waitingParentInstanceIndex=e.parentInstanceIndex),n.inputs&&(n.inputs.parse(e),n._setupInputs()),e.upVector&&(n.upVector=v.FromArray(e.upVector)),n.setPosition&&(n.position.copyFromFloats(0,0,0),n.setPosition(v.FromArray(e.position))),e.target&&n.setTarget&&n.setTarget(v.FromArray(e.target)),e.cameraRigMode){const r=e.interaxial_distance?{interaxialDistance:e.interaxial_distance}:{};n.setCameraRigMode(e.cameraRigMode,r)}if(e.animations){for(let r=0;r{throw ye("UniversalCamera")};ve.PERSPECTIVE_CAMERA=0;ve.ORTHOGRAPHIC_CAMERA=1;ve.FOVMODE_VERTICAL_FIXED=0;ve.FOVMODE_HORIZONTAL_FIXED=1;ve.RIG_MODE_NONE=0;ve.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10;ve.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11;ve.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12;ve.RIG_MODE_STEREOSCOPIC_OVERUNDER=13;ve.RIG_MODE_STEREOSCOPIC_INTERLACED=14;ve.RIG_MODE_VR=20;ve.RIG_MODE_CUSTOM=22;ve.ForceAttachControlToAlwaysPreventDefault=!1;D([yi("position")],ve.prototype,"_position",void 0);D([yi("upVector")],ve.prototype,"_upVector",void 0);D([B()],ve.prototype,"orthoLeft",null);D([B()],ve.prototype,"orthoRight",null);D([B()],ve.prototype,"orthoBottom",null);D([B()],ve.prototype,"orthoTop",null);D([B()],ve.prototype,"fov",void 0);D([B()],ve.prototype,"projectionPlaneTilt",void 0);D([B()],ve.prototype,"minZ",void 0);D([B()],ve.prototype,"maxZ",void 0);D([B()],ve.prototype,"inertia",void 0);D([B()],ve.prototype,"mode",null);D([B()],ve.prototype,"layerMask",void 0);D([B()],ve.prototype,"fovMode",void 0);D([B()],ve.prototype,"cameraRigMode",void 0);D([B()],ve.prototype,"interaxialDistance",void 0);D([B()],ve.prototype,"isStereoscopicSideBySide",void 0);class Tt{static get ForceFullSceneLoadingForIncremental(){return Tt._ForceFullSceneLoadingForIncremental}static set ForceFullSceneLoadingForIncremental(e){Tt._ForceFullSceneLoadingForIncremental=e}static get ShowLoadingScreen(){return Tt._ShowLoadingScreen}static set ShowLoadingScreen(e){Tt._ShowLoadingScreen=e}static get loggingLevel(){return Tt._LoggingLevel}static set loggingLevel(e){Tt._LoggingLevel=e}static get CleanBoneMatrixWeights(){return Tt._CleanBoneMatrixWeights}static set CleanBoneMatrixWeights(e){Tt._CleanBoneMatrixWeights=e}}Tt._ForceFullSceneLoadingForIncremental=!1;Tt._ShowLoadingScreen=!0;Tt._CleanBoneMatrixWeights=!1;Tt._LoggingLevel=0;function Xp(a,e,t,i,s,n,r,o){const h=e*A.GetTypeByteLength(t),l=r*e;if(o.length!==l)throw new Error("Output length is not valid");if(t!==A.FLOAT||s!==h){A.ForEach(a,i,s,e,t,l,n,(c,u)=>o[u]=c);return}if(a instanceof Array){const c=i/4;o.set(a,c)}else if(a instanceof ArrayBuffer){const c=new Float32Array(a,i,l);o.set(c)}else{const c=a.byteOffset+i;if(c%4){U.Warn("CopyFloatData: copied misaligned data."),o.set(new Float32Array(a.buffer.slice(c,c+l*4)));return}const f=new Float32Array(a.buffer,c,l);o.set(f)}}class Nt{get boundingBias(){return this._boundingBias}set boundingBias(e){this._boundingBias?this._boundingBias.copyFrom(e):this._boundingBias=e.clone(),this._updateBoundingInfo(!0,null)}static CreateGeometryForMesh(e){const t=new Nt(Nt.RandomId(),e.getScene());return t.applyToMesh(e),t}get meshes(){return this._meshes}constructor(e,t,i,s=!1,n=null){this.delayLoadState=0,this._totalVertices=0,this._isDisposed=!1,this._indexBufferIsUpdatable=!1,this._positionsCache=[],this._parentContainer=null,this.useBoundingInfoFromGeometry=!1,this._scene=t||Ee.LastCreatedScene,this._scene&&(this.id=e,this.uniqueId=this._scene.getUniqueId(),this._engine=this._scene.getEngine(),this._meshes=[],this._vertexBuffers={},this._indices=[],this._updatable=s,i?this.setAllVerticesData(i,s):this._totalVertices=0,this._engine.getCaps().vertexArrayObject&&(this._vertexArrayObjects={}),n&&(this.applyToMesh(n),n.computeWorldMatrix(!0)))}get extend(){return this._extend}getScene(){return this._scene}getEngine(){return this._engine}isReady(){return this.delayLoadState===1||this.delayLoadState===0}get doNotSerialize(){for(let e=0;e{t._rebuild()})}setAllVerticesData(e,t){e.applyToGeometry(this,t),this._notifyUpdate()}setVerticesData(e,t,i=!1,s){i&&Array.isArray(t)&&(t=new Float32Array(t));const n=new A(this._engine,t,e,{updatable:i,postponeInternalCreation:this._meshes.length===0,stride:s,label:"Geometry_"+this.id+"_"+e});this.setVerticesBuffer(n)}removeVerticesData(e){this._vertexBuffers[e]&&(this._vertexBuffers[e].dispose(),delete this._vertexBuffers[e]),this._vertexArrayObjects&&this._disposeVertexArrayObjects()}setVerticesBuffer(e,t=null,i=!0){const s=e.getKind();this._vertexBuffers[s]&&i&&this._vertexBuffers[s].dispose(),e._buffer&&e._buffer._increaseReferences(),this._vertexBuffers[s]=e;const n=this._meshes,r=n.length;if(s===A.PositionKind){this._totalVertices=t!=null?t:e._maxVerticesCount,this._updateExtend(e.getFloatData(this._totalVertices)),this._resetPointsArrayCache();const o=this._extend&&this._extend.minimum||new v(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),h=this._extend&&this._extend.maximum||new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let l=0;l65535);for(const s of this._meshes)s._createGlobalSubMesh(!0),s.synchronizeInstances();this._notifyUpdate()}setIndices(e,t=null,i=!1,s=!1){this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indices=e,this._indexBufferIsUpdatable=i,this._meshes.length!==0&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,i,"Geometry_"+this.id+"_IndexBuffer")),t!=null&&(this._totalVertices=t);for(const n of this._meshes)n._createGlobalSubMesh(!s),n.synchronizeInstances();this._notifyUpdate()}getTotalIndices(){return this.isReady()?this._totalIndices!==void 0?this._totalIndices:this._indices.length:0}getIndices(e,t){if(!this.isReady())return null;const i=this._indices;return!t&&(!e||this._meshes.length===1)?i:i.slice()}getIndexBuffer(){return this.isReady()?this._indexBuffer:null}_releaseVertexArrayObject(e=null){!e||!this._vertexArrayObjects||this._vertexArrayObjects[e.key]&&(this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e.key]),delete this._vertexArrayObjects[e.key])}releaseForMesh(e,t){const i=this._meshes,s=i.indexOf(e);s!==-1&&(i.splice(s,1),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject(),e._geometry=null,i.length===0&&t&&this.dispose())}applyToMesh(e){if(e._geometry===this)return;const t=e._geometry;t&&t.releaseForMesh(e),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject();const i=this._meshes;e._geometry=this,e._internalAbstractMeshDataInfo._positions=null,this._scene.pushGeometry(this),i.push(e),this.isReady()?this._applyToMesh(e):this._boundingInfo&&e.setBoundingInfo(this._boundingInfo)}_updateExtend(e=null){if(this.useBoundingInfoFromGeometry&&this._boundingInfo)this._extend={minimum:this._boundingInfo.minimum.clone(),maximum:this._boundingInfo.maximum.clone()};else{if(!e&&(e=this.getVerticesData(A.PositionKind),!e))return;this._extend=Ic(e,0,this._totalVertices,this.boundingBias,3)}}_applyToMesh(e){const t=this._meshes.length;for(const i in this._vertexBuffers)t===1&&this._vertexBuffers[i].create(),i===A.PositionKind&&(this._extend||this._updateExtend(),e.buildBoundingInfo(this._extend.minimum,this._extend.maximum),e._createGlobalSubMesh(e.isUnIndexed),e._updateBoundingInfo());t===1&&this._indices&&this._indices.length>0&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer")),e._syncGeometryWithMorphTargetManager(),e.synchronizeInstances()}_notifyUpdate(e){this.onGeometryUpdated&&this.onGeometryUpdated(this,e),this._vertexArrayObjects&&this._disposeVertexArrayObjects();for(const t of this._meshes)t._markSubMeshesAsAttributesDirty()}load(e,t){if(this.delayLoadState!==2){if(this.isReady()){t&&t();return}this.delayLoadState=2,this._queueLoad(e,t)}}_queueLoad(e,t){this.delayLoadingFile&&(e.addPendingData(this),e._loadFile(this.delayLoadingFile,i=>{if(!this._delayLoadingFunction)return;this._delayLoadingFunction(JSON.parse(i),this),this.delayLoadState=1,this._delayInfo=[],e.removePendingData(this);const s=this._meshes,n=s.length;for(let r=0;r0){for(let s=0;s0){for(let s=0;s0){for(let s=0;s-1&&this._parentContainer.geometries.splice(s,1),this._parentContainer=null}this._isDisposed=!0}copy(e){const t=new j;t.indices=[];const i=this.getIndices();if(i)for(let h=0;h0){const o=new Float32Array(e,r.positionsAttrDesc.offset,r.positionsAttrDesc.count);t.setVerticesData(A.PositionKind,o,!1)}if(r.normalsAttrDesc&&r.normalsAttrDesc.count>0){const o=new Float32Array(e,r.normalsAttrDesc.offset,r.normalsAttrDesc.count);t.setVerticesData(A.NormalKind,o,!1)}if(r.tangetsAttrDesc&&r.tangetsAttrDesc.count>0){const o=new Float32Array(e,r.tangetsAttrDesc.offset,r.tangetsAttrDesc.count);t.setVerticesData(A.TangentKind,o,!1)}if(r.uvsAttrDesc&&r.uvsAttrDesc.count>0){const o=new Float32Array(e,r.uvsAttrDesc.offset,r.uvsAttrDesc.count);t.setVerticesData(A.UVKind,o,!1)}if(r.uvs2AttrDesc&&r.uvs2AttrDesc.count>0){const o=new Float32Array(e,r.uvs2AttrDesc.offset,r.uvs2AttrDesc.count);t.setVerticesData(A.UV2Kind,o,!1)}if(r.uvs3AttrDesc&&r.uvs3AttrDesc.count>0){const o=new Float32Array(e,r.uvs3AttrDesc.offset,r.uvs3AttrDesc.count);t.setVerticesData(A.UV3Kind,o,!1)}if(r.uvs4AttrDesc&&r.uvs4AttrDesc.count>0){const o=new Float32Array(e,r.uvs4AttrDesc.offset,r.uvs4AttrDesc.count);t.setVerticesData(A.UV4Kind,o,!1)}if(r.uvs5AttrDesc&&r.uvs5AttrDesc.count>0){const o=new Float32Array(e,r.uvs5AttrDesc.offset,r.uvs5AttrDesc.count);t.setVerticesData(A.UV5Kind,o,!1)}if(r.uvs6AttrDesc&&r.uvs6AttrDesc.count>0){const o=new Float32Array(e,r.uvs6AttrDesc.offset,r.uvs6AttrDesc.count);t.setVerticesData(A.UV6Kind,o,!1)}if(r.colorsAttrDesc&&r.colorsAttrDesc.count>0){const o=new Float32Array(e,r.colorsAttrDesc.offset,r.colorsAttrDesc.count);t.setVerticesData(A.ColorKind,o,!1,r.colorsAttrDesc.stride)}if(r.matricesIndicesAttrDesc&&r.matricesIndicesAttrDesc.count>0){const o=new Int32Array(e,r.matricesIndicesAttrDesc.offset,r.matricesIndicesAttrDesc.count),h=[];for(let l=0;l>8),h.push((c&16711680)>>16),h.push(c>>24&255)}t.setVerticesData(A.MatricesIndicesKind,h,!1)}if(r.matricesIndicesExtraAttrDesc&&r.matricesIndicesExtraAttrDesc.count>0){const o=new Int32Array(e,r.matricesIndicesExtraAttrDesc.offset,r.matricesIndicesExtraAttrDesc.count),h=[];for(let l=0;l>8),h.push((c&16711680)>>16),h.push(c>>24&255)}t.setVerticesData(A.MatricesIndicesExtraKind,h,!1)}if(r.matricesWeightsAttrDesc&&r.matricesWeightsAttrDesc.count>0){const o=new Float32Array(e,r.matricesWeightsAttrDesc.offset,r.matricesWeightsAttrDesc.count);t.setVerticesData(A.MatricesWeightsKind,o,!1)}if(r.indicesAttrDesc&&r.indicesAttrDesc.count>0){const o=new Int32Array(e,r.indicesAttrDesc.offset,r.indicesAttrDesc.count);t.setIndices(o,null)}if(r.subMeshesAttrDesc&&r.subMeshesAttrDesc.count>0){const o=new Int32Array(e,r.subMeshesAttrDesc.offset,r.subMeshesAttrDesc.count*5);t.subMeshes=[];for(let h=0;h>8),r.push((h&16711680)>>16),r.push(h>>24&255)}t.setVerticesData(A.MatricesIndicesKind,r,e.matricesIndices._updatable)}if(e.matricesIndicesExtra)if(e.matricesIndicesExtra._isExpanded)delete e.matricesIndices._isExpanded,t.setVerticesData(A.MatricesIndicesExtraKind,e.matricesIndicesExtra,e.matricesIndicesExtra._updatable);else{const r=[];for(let o=0;o>8),r.push((h&16711680)>>16),r.push(h>>24&255)}t.setVerticesData(A.MatricesIndicesExtraKind,r,e.matricesIndicesExtra._updatable)}e.matricesWeights&&(Nt._CleanMatricesWeights(e,t),t.setVerticesData(A.MatricesWeightsKind,e.matricesWeights,e.matricesWeights._updatable)),e.matricesWeightsExtra&&t.setVerticesData(A.MatricesWeightsExtraKind,e.matricesWeightsExtra,e.matricesWeights._updatable),t.setIndices(e.indices,null)}if(e.subMeshes){t.subMeshes=[];for(let r=0;r-1){const u=t.getScene().getLastSkeletonById(e.skeletonId);if(!u)return;s=u.bones.length}else return;const n=t.getVerticesData(A.MatricesIndicesKind),r=t.getVerticesData(A.MatricesIndicesExtraKind),o=e.matricesWeights,h=e.matricesWeightsExtra,l=e.numBoneInfluencer,c=o.length;for(let u=0;ul-1)&&(d=l-1),f>.001){const _=1/f;for(let p=0;p<4;p++)o[u+p]*=_;if(h)for(let p=0;p<4;p++)h[u+p]*=_}else d>=4?(h[u+d-4]=1-f,r[u+d-4]=s):(o[u+d]=1-f,n[u+d]=s)}t.setVerticesData(A.MatricesIndicesKind,n),e.matricesWeightsExtra&&t.setVerticesData(A.MatricesIndicesExtraKind,r)}static Parse(e,t,i){const s=new Nt(e.id,t,void 0,e.updatable);return s._loadedUniqueId=e.uniqueId,ke&&ke.AddTagsTo(s,e.tags),e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s._boundingInfo=new ri(v.FromArray(e.boundingBoxMinimum),v.FromArray(e.boundingBoxMaximum)),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(A.UVKind),e.hasUVs2&&s._delayInfo.push(A.UV2Kind),e.hasUVs3&&s._delayInfo.push(A.UV3Kind),e.hasUVs4&&s._delayInfo.push(A.UV4Kind),e.hasUVs5&&s._delayInfo.push(A.UV5Kind),e.hasUVs6&&s._delayInfo.push(A.UV6Kind),e.hasColors&&s._delayInfo.push(A.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(A.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(A.MatricesWeightsKind),s._delayLoadingFunction=j.ImportVertexData):j.ImportVertexData(e,s),t.pushGeometry(s,!0),s}}class fs{constructor(){this.reset()}reset(){this.enabled=!1,this.mask=255,this.func=519,this.funcRef=1,this.funcMask=255,this.opStencilFail=7680,this.opDepthFail=7680,this.opStencilDepthPass=7681}get func(){return this._func}set func(e){this._func=e}get funcRef(){return this._funcRef}set funcRef(e){this._funcRef=e}get funcMask(){return this._funcMask}set funcMask(e){this._funcMask=e}get opStencilFail(){return this._opStencilFail}set opStencilFail(e){this._opStencilFail=e}get opDepthFail(){return this._opDepthFail}set opDepthFail(e){this._opDepthFail=e}get opStencilDepthPass(){return this._opStencilDepthPass}set opStencilDepthPass(e){this._opStencilDepthPass=e}get mask(){return this._mask}set mask(e){this._mask=e}get enabled(){return this._enabled}set enabled(e){this._enabled=e}getClassName(){return"MaterialStencilState"}copyTo(e){Ae.Clone(()=>e,this)}serialize(){return Ae.Serialize(this)}parse(e,t,i){Ae.Parse(()=>this,e,t,i)}}D([B()],fs.prototype,"func",null);D([B()],fs.prototype,"funcRef",null);D([B()],fs.prototype,"funcMask",null);D([B()],fs.prototype,"opStencilFail",null);D([B()],fs.prototype,"opDepthFail",null);D([B()],fs.prototype,"opStencilDepthPass",null);D([B()],fs.prototype,"mask",null);D([B()],fs.prototype,"enabled",null);function Xr(a){a.indexOf("vClipPlane")===-1&&a.push("vClipPlane"),a.indexOf("vClipPlane2")===-1&&a.push("vClipPlane2"),a.indexOf("vClipPlane3")===-1&&a.push("vClipPlane3"),a.indexOf("vClipPlane4")===-1&&a.push("vClipPlane4"),a.indexOf("vClipPlane5")===-1&&a.push("vClipPlane5"),a.indexOf("vClipPlane6")===-1&&a.push("vClipPlane6")}function Mc(a,e,t){var l,c,u,f,d,_;const i=!!((l=a.clipPlane)!=null?l:e.clipPlane),s=!!((c=a.clipPlane2)!=null?c:e.clipPlane2),n=!!((u=a.clipPlane3)!=null?u:e.clipPlane3),r=!!((f=a.clipPlane4)!=null?f:e.clipPlane4),o=!!((d=a.clipPlane5)!=null?d:e.clipPlane5),h=!!((_=a.clipPlane6)!=null?_:e.clipPlane6);i&&t.push("#define CLIPPLANE"),s&&t.push("#define CLIPPLANE2"),n&&t.push("#define CLIPPLANE3"),r&&t.push("#define CLIPPLANE4"),o&&t.push("#define CLIPPLANE5"),h&&t.push("#define CLIPPLANE6")}function Yp(a,e,t){var c,u,f,d,_,p;let i=!1;const s=!!((c=a.clipPlane)!=null?c:e.clipPlane),n=!!((u=a.clipPlane2)!=null?u:e.clipPlane2),r=!!((f=a.clipPlane3)!=null?f:e.clipPlane3),o=!!((d=a.clipPlane4)!=null?d:e.clipPlane4),h=!!((_=a.clipPlane5)!=null?_:e.clipPlane5),l=!!((p=a.clipPlane6)!=null?p:e.clipPlane6);return t.CLIPPLANE!==s&&(t.CLIPPLANE=s,i=!0),t.CLIPPLANE2!==n&&(t.CLIPPLANE2=n,i=!0),t.CLIPPLANE3!==r&&(t.CLIPPLANE3=r,i=!0),t.CLIPPLANE4!==o&&(t.CLIPPLANE4=o,i=!0),t.CLIPPLANE5!==h&&(t.CLIPPLANE5=h,i=!0),t.CLIPPLANE6!==l&&(t.CLIPPLANE6=l,i=!0),i}function Yr(a,e,t){var s,n,r,o,h,l;let i=(s=e.clipPlane)!=null?s:t.clipPlane;qs(a,"vClipPlane",i),i=(n=e.clipPlane2)!=null?n:t.clipPlane2,qs(a,"vClipPlane2",i),i=(r=e.clipPlane3)!=null?r:t.clipPlane3,qs(a,"vClipPlane3",i),i=(o=e.clipPlane4)!=null?o:t.clipPlane4,qs(a,"vClipPlane4",i),i=(h=e.clipPlane5)!=null?h:t.clipPlane5,qs(a,"vClipPlane5",i),i=(l=e.clipPlane6)!=null?l:t.clipPlane6,qs(a,"vClipPlane6",i)}function qs(a,e,t){t&&a.setFloat4(e,t.normal.x,t.normal.y,t.normal.z,t.d)}const Kh=de.Black(),Xh={NUM_MORPH_INFLUENCERS:0};function B0(a,e,t){if(!a||a.LOGARITHMICDEPTH||a.indexOf&&a.indexOf("LOGARITHMICDEPTH")>=0){const i=t.activeCamera;i.mode===1&&U.Error("Logarithmic depth is not compatible with orthographic cameras!",20),e.setFloat("logarithmicDepthConstant",2/(Math.log(i.maxZ+1)/Math.LN2))}}function L0(a,e,t,i=!1){t&&a.fogEnabled&&(!e||e.applyFog)&&a.fogMode!==0&&(t.setFloat4("vFogInfos",a.fogMode,a.fogStart,a.fogEnd,a.fogDensity),i?(a.fogColor.toLinearSpaceToRef(Kh,a.getEngine().useExactSrgbConversions),t.setColor3("vFogColor",Kh)):t.setColor3("vFogColor",a.fogColor))}function qp(a,e,t){Xh.NUM_MORPH_INFLUENCERS=t,Pc(a,e,Xh)}function Pc(a,e,t){const i=t.NUM_MORPH_INFLUENCERS;if(i>0&&Ee.LastCreatedEngine){const s=Ee.LastCreatedEngine.getCaps().maxVertexAttribs,n=e.morphTargetManager;if(n!=null&&n.isUsingTextureForTargets)return;const r=n&&n.supportsNormals&&t.NORMAL,o=n&&n.supportsTangents&&t.TANGENT,h=n&&n.supportsUVs&&t.UV1;for(let l=0;ls&&U.Error("Cannot add more vertex attributes for mesh "+e.name)}}function N0(a,e=!1){a.push("world0"),a.push("world1"),a.push("world2"),a.push("world3"),e&&(a.push("previousWorld0"),a.push("previousWorld1"),a.push("previousWorld2"),a.push("previousWorld3"))}function U0(a,e){const t=a.morphTargetManager;!a||!t||e.setFloatArray("morphTargetInfluences",t.influences)}function wc(a,e){e.bindToEffect(a,"Scene")}function ms(a,e,t){e._needUVs=!0,e[t]=!0,a.optimizeUVAllocation&&a.getTextureMatrix().isIdentityAs3x2()?(e[t+"DIRECTUV"]=a.coordinatesIndex+1,e["MAINUV"+(a.coordinatesIndex+1)]=!0):e[t+"DIRECTUV"]=0}function vs(a,e,t){const i=a.getTextureMatrix();e.updateMatrix(t+"Matrix",i)}function Dc(a,e,t){t.BAKED_VERTEX_ANIMATION_TEXTURE&&t.INSTANCES&&a.push("bakedVertexAnimationSettingsInstanced")}function Fc(a,e,t){if(!(!e||!a)&&(a.computeBonesUsingShaders&&e._bonesComputationForcedToCPU&&(a.computeBonesUsingShaders=!1),a.useBones&&a.computeBonesUsingShaders&&a.skeleton)){const i=a.skeleton;if(i.isUsingTextureForMatrices&&e.getUniformIndex("boneTextureWidth")>-1){const s=i.getTransformMatrixTexture(a);e.setTexture("boneSampler",s),e.setFloat("boneTextureWidth",4*(i.bones.length+1))}else{const s=i.getTransformMatrices(a);s&&e.setMatrices("mBones",s)}}}function jp(a,e,t,i,s,n=!0){a._bindLight(e,t,i,s,n)}function $p(a,e,t,i,s=4){const n=Math.min(e.lightSources.length,s);for(let r=0;r0&&(i.addCPUSkinningFallback(0,e),a.push("matricesIndices"),a.push("matricesWeights"),t.NUM_BONE_INFLUENCERS>4&&(a.push("matricesIndicesExtra"),a.push("matricesWeightsExtra")))}function Oc(a,e){(e.INSTANCES||e.THIN_INSTANCES)&&N0(a,!!e.PREPASS_VELOCITY),e.INSTANCESCOLOR&&a.push("instanceColor")}function Qp(a,e,t=4,i=0){let s=0;for(let n=0;n0&&(s=i+n,e.addFallback(s,"LIGHT"+n)),a.SHADOWS||(a["SHADOW"+n]&&e.addFallback(i,"SHADOW"+n),a["SHADOWPCF"+n]&&e.addFallback(i,"SHADOWPCF"+n),a["SHADOWPCSS"+n]&&e.addFallback(i,"SHADOWPCSS"+n),a["SHADOWPOISSON"+n]&&e.addFallback(i,"SHADOWPOISSON"+n),a["SHADOWESM"+n]&&e.addFallback(i,"SHADOWESM"+n),a["SHADOWCLOSEESM"+n]&&e.addFallback(i,"SHADOWCLOSEESM"+n));return s++}function Jp(a,e){return e.fogEnabled&&a.applyFog&&e.fogMode!==0}function Bc(a,e,t,i,s,n,r,o=!1){r._areMiscDirty&&(r.LOGARITHMICDEPTH=t,r.POINTSIZE=i,r.FOG=s&&Jp(a,e),r.NONUNIFORMSCALING=a.nonUniformScaling,r.ALPHATEST=n,r.DECAL_AFTER_DETAIL=o)}function eg(a,e,t,i,s=4,n=!1){if(!t._areLightsDirty)return t._needNormals;let r=0;const o={needNormals:t._needNormals,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};if(a.lightsEnabled&&!n){for(const l of e.lightSources)if(tg(a,e,l,r,t,i,o),r++,r===s)break}t.SPECULARTERM=o.specularEnabled,t.SHADOWS=o.shadowEnabled;for(let l=r;l0&&(r.shadowEnabled=!0,h.prepareDefines(s,i))}}t.lightmapMode!=Xe.LIGHTMAP_DEFAULT?(r.lightmapMode=!0,s["LIGHTMAPEXCLUDED"+i]=!0,s["LIGHTMAPNOSPECULAR"+i]=t.lightmapMode==Xe.LIGHTMAP_SHADOWSONLY):(s["LIGHTMAPEXCLUDED"+i]=!1,s["LIGHTMAPNOSPECULAR"+i]=!1)}function Lc(a,e,t,i,s,n=null,r=!1){let o=hg(a,i);n!==!1&&(o=Yp(t,a,i)),i.DEPTHPREPASS!==!e.getColorWrite()&&(i.DEPTHPREPASS=!i.DEPTHPREPASS,o=!0),i.INSTANCES!==s&&(i.INSTANCES=s,o=!0),i.THIN_INSTANCES!==r&&(i.THIN_INSTANCES=r,o=!0),o&&i.markAsUnprocessed()}function ig(a,e){if(a.useBones&&a.computeBonesUsingShaders&&a.skeleton){e.NUM_BONE_INFLUENCERS=a.numBoneInfluencers;const t=e.BONETEXTURE!==void 0;if(a.skeleton.isUsingTextureForMatrices&&t)e.BONETEXTURE=!0;else{e.BonesPerMesh=a.skeleton.bones.length+1,e.BONETEXTURE=t?!1:void 0;const i=a.getScene().prePassRenderer;if(i&&i.enabled){const s=i.excludedSkinnedMesh.indexOf(a)===-1;e.BONES_VELOCITY_ENABLED=s}}}else e.NUM_BONE_INFLUENCERS=0,e.BonesPerMesh=0,e.BONETEXTURE!==void 0&&(e.BONETEXTURE=!1)}function sg(a,e){const t=a.morphTargetManager;t?(e.MORPHTARGETS_UV=t.supportsUVs&&e.UV1,e.MORPHTARGETS_TANGENT=t.supportsTangents&&e.TANGENT,e.MORPHTARGETS_NORMAL=t.supportsNormals&&e.NORMAL,e.NUM_MORPH_INFLUENCERS=t.numMaxInfluencers||t.numInfluencers,e.MORPHTARGETS=e.NUM_MORPH_INFLUENCERS>0,e.MORPHTARGETS_TEXTURE=t.isUsingTextureForTargets):(e.MORPHTARGETS_UV=!1,e.MORPHTARGETS_TANGENT=!1,e.MORPHTARGETS_NORMAL=!1,e.MORPHTARGETS=!1,e.NUM_MORPH_INFLUENCERS=0)}function ng(a,e){const t=a.bakedVertexAnimationManager;e.BAKED_VERTEX_ANIMATION_TEXTURE=!!(t&&t.isEnabled)}function Nc(a,e,t,i,s=!1,n=!0,r=!0){if(!e._areAttributesDirty&&e._needNormals===e._normals&&e._needUVs===e._uvs)return!1;e._normals=e._needNormals,e._uvs=e._needUVs,e.NORMAL=e._needNormals&&a.isVerticesDataPresent("normal"),e._needNormals&&a.isVerticesDataPresent("tangent")&&(e.TANGENT=!0);for(let o=1;o<=6;++o)e["UV"+o]=e._needUVs?a.isVerticesDataPresent("uv".concat(o===1?"":o)):!1;if(t){const o=a.useVertexColors&&a.isVerticesDataPresent("color");e.VERTEXCOLOR=o,e.VERTEXALPHA=a.hasVertexAlpha&&o&&n}return a.isVerticesDataPresent("instanceColor")&&(a.hasInstances||a.hasThinInstances)&&(e.INSTANCESCOLOR=!0),i&&ig(a,e),s&&sg(a,e),r&&ng(a,e),!0}function rg(a,e){if(a.activeCamera){const t=e.MULTIVIEW;e.MULTIVIEW=a.activeCamera.outputRenderTarget!==null&&a.activeCamera.outputRenderTarget.getViewCount()>1,e.MULTIVIEW!=t&&e.markAsUnprocessed()}}function ag(a,e,t){const i=e.ORDER_INDEPENDENT_TRANSPARENCY,s=e.ORDER_INDEPENDENT_TRANSPARENCY_16BITS;e.ORDER_INDEPENDENT_TRANSPARENCY=a.useOrderIndependentTransparency&&t,e.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!a.getEngine().getCaps().textureFloatLinearFiltering,(i!==e.ORDER_INDEPENDENT_TRANSPARENCY||s!==e.ORDER_INDEPENDENT_TRANSPARENCY_16BITS)&&e.markAsUnprocessed()}function og(a,e,t){const i=e.PREPASS;if(!e._arePrePassDirty)return;const s=[{type:1,define:"PREPASS_POSITION",index:"PREPASS_POSITION_INDEX"},{type:9,define:"PREPASS_LOCAL_POSITION",index:"PREPASS_LOCAL_POSITION_INDEX"},{type:2,define:"PREPASS_VELOCITY",index:"PREPASS_VELOCITY_INDEX"},{type:11,define:"PREPASS_VELOCITY_LINEAR",index:"PREPASS_VELOCITY_LINEAR_INDEX"},{type:3,define:"PREPASS_REFLECTIVITY",index:"PREPASS_REFLECTIVITY_INDEX"},{type:0,define:"PREPASS_IRRADIANCE",index:"PREPASS_IRRADIANCE_INDEX"},{type:7,define:"PREPASS_ALBEDO_SQRT",index:"PREPASS_ALBEDO_SQRT_INDEX"},{type:5,define:"PREPASS_DEPTH",index:"PREPASS_DEPTH_INDEX"},{type:10,define:"PREPASS_SCREENSPACE_DEPTH",index:"PREPASS_SCREENSPACE_DEPTH_INDEX"},{type:6,define:"PREPASS_NORMAL",index:"PREPASS_NORMAL_INDEX"},{type:8,define:"PREPASS_WORLD_NORMAL",index:"PREPASS_WORLD_NORMAL_INDEX"}];if(a.prePassRenderer&&a.prePassRenderer.enabled&&t){e.PREPASS=!0,e.SCENE_MRT_COUNT=a.prePassRenderer.mrtCount,e.PREPASS_NORMAL_WORLDSPACE=a.prePassRenderer.generateNormalsInWorldSpace,e.PREPASS_COLOR=!0,e.PREPASS_COLOR_INDEX=0;for(let n=0;n{},this._callbackPluginEventIsReadyForSubMesh=()=>{},this._callbackPluginEventPrepareDefines=()=>{},this._callbackPluginEventPrepareDefinesBeforeAttributes=()=>{},this._callbackPluginEventHardBindForSubMesh=()=>{},this._callbackPluginEventBindForSubMesh=()=>{},this._callbackPluginEventHasRenderTargetTextures=()=>{},this._callbackPluginEventFillRenderTargetTextures=()=>{},this._forceAlphaTest=!1,this._transparencyMode=null,this.name=e;const n=t||Ee.LastCreatedScene;n&&(this._scene=n,this._dirtyCallbacks={},this._forceGLSL=s,this._dirtyCallbacks[1]=this._markAllSubMeshesAsTexturesDirty.bind(this),this._dirtyCallbacks[2]=this._markAllSubMeshesAsLightsDirty.bind(this),this._dirtyCallbacks[4]=this._markAllSubMeshesAsFresnelDirty.bind(this),this._dirtyCallbacks[8]=this._markAllSubMeshesAsAttributesDirty.bind(this),this._dirtyCallbacks[16]=this._markAllSubMeshesAsMiscDirty.bind(this),this._dirtyCallbacks[32]=this._markAllSubMeshesAsPrePassDirty.bind(this),this._dirtyCallbacks[63]=this._markAllSubMeshesAsAllDirty.bind(this),this.id=e||J.RandomId(),this.uniqueId=this._scene.getUniqueId(),this._materialContext=this._scene.getEngine().createMaterialContext(),this._drawWrapper=new Xn(this._scene.getEngine(),!1),this._drawWrapper.materialContext=this._materialContext,this._uniformBuffer=new fe(this._scene.getEngine(),void 0,void 0,e),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,this._createUniformBuffer(),i||this._scene.addMaterial(this),this._scene.useMaterialMeshMap&&(this.meshMap={}),X.OnEventObservable.notifyObservers(this,1))}_createUniformBuffer(){var t;const e=this.getScene().getEngine();(t=this._uniformBuffer)==null||t.dispose(),e.isWebGPU&&!this._forceGLSL?(this._uniformBuffer=new fe(e,void 0,void 0,this.name,!0),this._shaderLanguage=1):this._uniformBuffer=new fe(this._scene.getEngine(),void 0,void 0,this.name),this._uniformBufferLayoutBuilt=!1}toString(e){return"Name: "+this.name}getClassName(){return"Material"}get _isMaterial(){return!0}get isFrozen(){return this.checkReadyOnlyOnce}freeze(){this.markDirty(),this.checkReadyOnlyOnce=!0}unfreeze(){this.markDirty(),this.checkReadyOnlyOnce=!1}isReady(e,t){return!0}isReadyForSubMesh(e,t,i){const s=t.materialDefines;return s?(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=s,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),this._eventInfo.isReadyForSubMesh):!1}getEffect(){return this._drawWrapper.effect}getScene(){return this._scene}_getEffectiveOrientation(e){return this.sideOrientation!==null?this.sideOrientation:e.sideOrientation}get transparencyMode(){return this._transparencyMode}set transparencyMode(e){this._transparencyMode!==e&&(this._transparencyMode=e,this._forceAlphaTest=e===X.MATERIAL_ALPHATESTANDBLEND,this._markAllSubMeshesAsTexturesAndMiscDirty())}get _disableAlphaBlending(){return this._transparencyMode===X.MATERIAL_OPAQUE||this._transparencyMode===X.MATERIAL_ALPHATEST}needAlphaBlending(){return this._disableAlphaBlending?!1:this.alpha<1}needAlphaBlendingForMesh(e){return e.visibility<1?!0:this._disableAlphaBlending?!1:e.hasVertexAlpha||this.needAlphaBlending()}needAlphaTesting(){return!!this._forceAlphaTest}_shouldTurnAlphaTestOn(e){return!this.needAlphaBlendingForMesh(e)&&this.needAlphaTesting()}getAlphaTestTexture(){return null}markDirty(e=!1){const t=this.getScene().meshes;for(const i of t)if(i.subMeshes){for(const s of i.subMeshes)if(s.getMaterial()===this)for(const n of s._drawWrappers)n&&this._materialContext===n.materialContext&&(n._wasPreviouslyReady=!1,n._wasPreviouslyUsingInstances=null,n._forceRebindOnNextCall=e)}e&&this.markAsDirty(X.AllDirtyFlag)}_preBind(e,t=null){const i=this._scene.getEngine(),n=(t==null?this.sideOrientation:t)===X.ClockWiseSideOrientation;return i.enableEffect(e||this._getDrawWrapper()),i.setState(this.backFaceCulling,this.zOffset,!1,n,this._scene._mirroredCameraPosition?!this.cullBackFaces:this.cullBackFaces,this.stencil,this.zOffsetUnits),n}bind(e,t){}buildUniformLayout(){const e=this._uniformBuffer;this._eventInfo.ubo=e,this._callbackPluginEventGeneric(8,this._eventInfo),e.create(),this._uniformBufferLayoutBuilt=!0}bindForSubMesh(e,t,i){const s=i._drawWrapper;this._eventInfo.subMesh=i,this._callbackPluginEventBindForSubMesh(this._eventInfo),s._forceRebindOnNextCall=!1}bindOnlyWorldMatrix(e){}bindView(e){this._useUBO?this._needToBindSceneUbo=!0:e.setMatrix("view",this.getScene().getViewMatrix())}bindViewProjection(e){this._useUBO?this._needToBindSceneUbo=!0:(e.setMatrix("viewProjection",this.getScene().getTransformMatrix()),e.setMatrix("projection",this.getScene().getProjectionMatrix()))}bindEyePosition(e,t){this._useUBO?this._needToBindSceneUbo=!0:this._scene.bindEyePosition(e,t)}_afterBind(e,t=null,i){if(this._scene._cachedMaterial=this,this._needToBindSceneUbo&&t&&(this._needToBindSceneUbo=!1,wc(t,this.getScene().getSceneUniformBuffer()),this._scene.finalizeSceneUbo()),e?this._scene._cachedVisibility=e.visibility:this._scene._cachedVisibility=1,this._onBindObservable&&e&&this._onBindObservable.notifyObservers(e),this.disableDepthWrite){const s=this._scene.getEngine();this._cachedDepthWriteState=s.getDepthWrite(),s.setDepthWrite(!1)}if(this.disableColorWrite){const s=this._scene.getEngine();this._cachedColorWriteState=s.getColorWrite(),s.setColorWrite(!1)}if(this.depthFunction!==0){const s=this._scene.getEngine();this._cachedDepthFunctionState=s.getDepthFunction()||0,s.setDepthFunction(this.depthFunction)}}unbind(){this._onUnBindObservable&&this._onUnBindObservable.notifyObservers(this),this.depthFunction!==0&&this._scene.getEngine().setDepthFunction(this._cachedDepthFunctionState),this.disableDepthWrite&&this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState),this.disableColorWrite&&this._scene.getEngine().setColorWrite(this._cachedColorWriteState)}getAnimatables(){return this._eventInfo.animatables=[],this._callbackPluginEventGeneric(256,this._eventInfo),this._eventInfo.animatables}getActiveTextures(){return this._eventInfo.activeTextures=[],this._callbackPluginEventGeneric(512,this._eventInfo),this._eventInfo.activeTextures}hasTexture(e){return this._eventInfo.hasTexture=!1,this._eventInfo.texture=e,this._callbackPluginEventGeneric(1024,this._eventInfo),this._eventInfo.hasTexture}clone(e){return null}_clonePlugins(e,t){const i={};if(this._serializePlugins(i),X._ParsePlugins(i,e,this._scene,t),this.pluginManager)for(const s of this.pluginManager._plugins){const n=e.pluginManager.getPlugin(s.name);n&&s.copyTo(n)}}getBindedMeshes(){if(this.meshMap){const e=[];for(const t in this.meshMap){const i=this.meshMap[t];i&&e.push(i)}return e}else return this._scene.meshes.filter(t=>t.material===this)}forceCompilation(e,t,i,s){const n={clipPlane:!1,useInstances:!1,...i},r=this.getScene(),o=this.allowShaderHotSwapping;this.allowShaderHotSwapping=!1;const h=()=>{if(!this._scene||!this._scene.getEngine())return;const l=r.clipPlane;if(n.clipPlane&&(r.clipPlane=new Xt(0,0,0,1)),this._storeEffectOnSubMeshes){let c=!0,u=null;if(e.subMeshes){const f=new vi(0,0,0,0,0,e,void 0,!1,!1);f.materialDefines&&(f.materialDefines._renderId=-1),this.isReadyForSubMesh(e,f,n.useInstances)||(f.effect&&f.effect.getCompilationError()&&f.effect.allFallbacksProcessed()?u=f.effect.getCompilationError():(c=!1,setTimeout(h,16)))}c&&(this.allowShaderHotSwapping=o,u&&s&&s(u),t&&t(this))}else this.isReady()?(this.allowShaderHotSwapping=o,t&&t(this)):setTimeout(h,16);n.clipPlane&&(r.clipPlane=l)};h()}forceCompilationAsync(e,t){return new Promise((i,s)=>{this.forceCompilation(e,()=>{i()},t,n=>{s(n)})})}markAsDirty(e){this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism||(X._DirtyCallbackArray.length=0,e&X.TextureDirtyFlag&&X._DirtyCallbackArray.push(X._TextureDirtyCallBack),e&X.LightDirtyFlag&&X._DirtyCallbackArray.push(X._LightsDirtyCallBack),e&X.FresnelDirtyFlag&&X._DirtyCallbackArray.push(X._FresnelDirtyCallBack),e&X.AttributesDirtyFlag&&X._DirtyCallbackArray.push(X._AttributeDirtyCallBack),e&X.MiscDirtyFlag&&X._DirtyCallbackArray.push(X._MiscDirtyCallBack),e&X.PrePassDirtyFlag&&X._DirtyCallbackArray.push(X._PrePassDirtyCallBack),X._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(X._RunDirtyCallBacks),this.getScene().resetCachedMaterial())}resetDrawCache(){const e=this.getScene().meshes;for(const t of e)if(t.subMeshes)for(const i of t.subMeshes)i.getMaterial()===this&&i.resetDrawCache()}_markAllSubMeshesAsDirty(e){if(this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const t=this.getScene().meshes;for(const i of t)if(i.subMeshes){for(const s of i.subMeshes)if(s.getMaterial(!1)===this)for(const n of s._drawWrappers)!n||!n.defines||!n.defines.markAllAsDirty||this._materialContext===n.materialContext&&e(n.defines)}}_markScenePrePassDirty(){if(this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const e=this.getScene().enablePrePassRenderer();e&&e.markAsDirty()}_markAllSubMeshesAsAllDirty(){this._markAllSubMeshesAsDirty(X._AllDirtyCallBack)}_markAllSubMeshesAsImageProcessingDirty(){this._markAllSubMeshesAsDirty(X._ImageProcessingDirtyCallBack)}_markAllSubMeshesAsTexturesDirty(){this._markAllSubMeshesAsDirty(X._TextureDirtyCallBack)}_markAllSubMeshesAsFresnelDirty(){this._markAllSubMeshesAsDirty(X._FresnelDirtyCallBack)}_markAllSubMeshesAsFresnelAndMiscDirty(){this._markAllSubMeshesAsDirty(X._FresnelAndMiscDirtyCallBack)}_markAllSubMeshesAsLightsDirty(){this._markAllSubMeshesAsDirty(X._LightsDirtyCallBack)}_markAllSubMeshesAsAttributesDirty(){this._markAllSubMeshesAsDirty(X._AttributeDirtyCallBack)}_markAllSubMeshesAsMiscDirty(){this._markAllSubMeshesAsDirty(X._MiscDirtyCallBack)}_markAllSubMeshesAsPrePassDirty(){this._markAllSubMeshesAsDirty(X._MiscDirtyCallBack)}_markAllSubMeshesAsTexturesAndMiscDirty(){this._markAllSubMeshesAsDirty(X._TextureAndMiscDirtyCallBack)}_checkScenePerformancePriority(){if(this._scene.performancePriority!==0){this.checkReadyOnlyOnce=!0;const e=this._scene.onScenePerformancePriorityChangedObservable.addOnce(()=>{this.checkReadyOnlyOnce=!1});this.onDisposeObservable.add(()=>{this._scene.onScenePerformancePriorityChangedObservable.remove(e)})}}setPrePassRenderer(e){return!1}dispose(e,t,i){const s=this.getScene();if(s.stopAnimation(this),s.freeProcessedMaterials(),s.removeMaterial(this),this._eventInfo.forceDisposeTextures=t,this._callbackPluginEventGeneric(2,this._eventInfo),this._parentContainer){const n=this._parentContainer.materials.indexOf(this);n>-1&&this._parentContainer.materials.splice(n,1),this._parentContainer=null}if(i!==!0)if(this.meshMap)for(const n in this.meshMap){const r=this.meshMap[n];r&&(this.releaseVertexArrayObject(r,!0),r.material=null)}else{const n=s.meshes;for(const r of n)r.material===this&&!r.sourceMesh&&(this.releaseVertexArrayObject(r,!0),r.material=null)}this._uniformBuffer.dispose(),this._drawWrapper.effect&&(this._storeEffectOnSubMeshes||this._drawWrapper.effect.dispose(),this._drawWrapper.effect=null),this.metadata=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._onBindObservable&&this._onBindObservable.clear(),this._onUnBindObservable&&this._onUnBindObservable.clear(),this._onEffectCreatedObservable&&this._onEffectCreatedObservable.clear(),this._eventInfo&&(this._eventInfo={})}releaseVertexArrayObject(e,t){const i=e.geometry;if(i)if(this._storeEffectOnSubMeshes){if(e.subMeshes)for(const s of e.subMeshes)i._releaseVertexArrayObject(s.effect),t&&s.effect&&s.effect.dispose()}else i._releaseVertexArrayObject(this._drawWrapper.effect)}serialize(){const e=Ae.Serialize(this);return e.stencil=this.stencil.serialize(),e.uniqueId=this.uniqueId,this._serializePlugins(e),e}_serializePlugins(e){if(e.plugins={},this.pluginManager)for(const t of this.pluginManager._plugins)e.plugins[t.getClassName()]=t.serialize()}static Parse(e,t,i){if(!e.customType)e.customType="BABYLON.StandardMaterial";else if(e.customType==="BABYLON.PBRMaterial"&&e.overloadedAlbedo&&(e.customType="BABYLON.LegacyPBRMaterial",!BABYLON.LegacyPBRMaterial))return U.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."),null;const n=J.Instantiate(e.customType).Parse(e,t,i);return n._loadedUniqueId=e.uniqueId,n}static _ParsePlugins(e,t,i,s){var n;if(e.plugins)for(const r in e.plugins){const o=e.plugins[r];let h=(n=t.pluginManager)==null?void 0:n.getPlugin(o.name);if(!h){const l=J.Instantiate("BABYLON."+r);l&&(h=new l(t))}h==null||h.parse(o,i,s)}}}X.TriangleFillMode=0;X.WireFrameFillMode=1;X.PointFillMode=2;X.PointListDrawMode=3;X.LineListDrawMode=4;X.LineLoopDrawMode=5;X.LineStripDrawMode=6;X.TriangleStripDrawMode=7;X.TriangleFanDrawMode=8;X.ClockWiseSideOrientation=0;X.CounterClockWiseSideOrientation=1;X.TextureDirtyFlag=1;X.LightDirtyFlag=2;X.FresnelDirtyFlag=4;X.AttributesDirtyFlag=8;X.MiscDirtyFlag=16;X.PrePassDirtyFlag=32;X.AllDirtyFlag=63;X.MATERIAL_OPAQUE=0;X.MATERIAL_ALPHATEST=1;X.MATERIAL_ALPHABLEND=2;X.MATERIAL_ALPHATESTANDBLEND=3;X.MATERIAL_NORMALBLENDMETHOD_WHITEOUT=0;X.MATERIAL_NORMALBLENDMETHOD_RNM=1;X.OnEventObservable=new Z;X._AllDirtyCallBack=a=>a.markAllAsDirty();X._ImageProcessingDirtyCallBack=a=>a.markAsImageProcessingDirty();X._TextureDirtyCallBack=a=>a.markAsTexturesDirty();X._FresnelDirtyCallBack=a=>a.markAsFresnelDirty();X._MiscDirtyCallBack=a=>a.markAsMiscDirty();X._PrePassDirtyCallBack=a=>a.markAsPrePassDirty();X._LightsDirtyCallBack=a=>a.markAsLightDirty();X._AttributeDirtyCallBack=a=>a.markAsAttributesDirty();X._FresnelAndMiscDirtyCallBack=a=>{X._FresnelDirtyCallBack(a),X._MiscDirtyCallBack(a)};X._TextureAndMiscDirtyCallBack=a=>{X._TextureDirtyCallBack(a),X._MiscDirtyCallBack(a)};X._DirtyCallbackArray=[];X._RunDirtyCallBacks=a=>{for(const e of X._DirtyCallbackArray)e(a)};D([B()],X.prototype,"id",void 0);D([B()],X.prototype,"uniqueId",void 0);D([B()],X.prototype,"name",void 0);D([B()],X.prototype,"metadata",void 0);D([B()],X.prototype,"checkReadyOnEveryCall",void 0);D([B()],X.prototype,"checkReadyOnlyOnce",void 0);D([B()],X.prototype,"state",void 0);D([B("alpha")],X.prototype,"_alpha",void 0);D([B("backFaceCulling")],X.prototype,"_backFaceCulling",void 0);D([B("cullBackFaces")],X.prototype,"_cullBackFaces",void 0);D([B()],X.prototype,"sideOrientation",void 0);D([B("alphaMode")],X.prototype,"_alphaMode",void 0);D([B()],X.prototype,"_needDepthPrePass",void 0);D([B()],X.prototype,"disableDepthWrite",void 0);D([B()],X.prototype,"disableColorWrite",void 0);D([B()],X.prototype,"forceDepthWrite",void 0);D([B()],X.prototype,"depthFunction",void 0);D([B()],X.prototype,"separateCullingPass",void 0);D([B("fogEnabled")],X.prototype,"_fogEnabled",void 0);D([B()],X.prototype,"pointSize",void 0);D([B()],X.prototype,"zOffset",void 0);D([B()],X.prototype,"zOffsetUnits",void 0);D([B()],X.prototype,"pointsCloud",null);D([B()],X.prototype,"fillMode",null);D([B()],X.prototype,"useLogarithmicDepth",null);D([B()],X.prototype,"transparencyMode",null);class cn extends X{get subMaterials(){return this._subMaterials}set subMaterials(e){this._subMaterials=e,this._hookArray(e)}getChildren(){return this.subMaterials}constructor(e,t){super(e,t,!0),this._waitingSubMaterialsUniqueIds=[],this.getScene().addMultiMaterial(this),this.subMaterials=[],this._storeEffectOnSubMeshes=!0}_hookArray(e){const t=e.push;e.push=(...s)=>{const n=t.apply(e,s);return this._markAllSubMeshesAsTexturesDirty(),n};const i=e.splice;e.splice=(s,n)=>{const r=i.apply(e,[s,n]);return this._markAllSubMeshesAsTexturesDirty(),r}}getSubMaterial(e){return e<0||e>=this.subMaterials.length?this.getScene().defaultMaterial:this.subMaterials[e]}getActiveTextures(){return super.getActiveTextures().concat(...this.subMaterials.map(e=>e?e.getActiveTextures():[]))}hasTexture(e){var t;if(super.hasTexture(e))return!0;for(let i=0;i=0&&s.multiMaterials.splice(n,1),super.dispose(e,t)}static ParseMultiMaterial(e,t){const i=new cn(e.name,t);return i.id=e.id,i._loadedUniqueId=e.uniqueId,ke&&ke.AddTagsTo(i,e.tags),e.materialsUniqueIds?i._waitingSubMaterialsUniqueIds=e.materialsUniqueIds:e.materials.forEach(s=>i.subMaterials.push(t.getLastMaterialById(s))),i}}vt("BABYLON.MultiMaterial",cn);class ug{constructor(e,t){this.distanceOrScreenCoverage=e,this.mesh=t}}class Uc{}class fg{constructor(){this.visibleInstances={},this.batchCache=new Yh,this.batchCacheReplacementModeInFrozenMode=new Yh,this.instancesBufferSize=32*16*4}}class Yh{constructor(){this.mustReturn=!1,this.visibleInstances=new Array,this.renderSelf=[],this.hardwareInstancedRendering=[]}}class dg{constructor(){this.instancesCount=0,this.matrixBuffer=null,this.previousMatrixBuffer=null,this.matrixBufferSize=32*16,this.matrixData=null,this.boundingVectors=[],this.worldMatrices=null}}class _g{constructor(){this._areNormalsFrozen=!1,this._source=null,this.meshMap=null,this._preActivateId=-1,this._LODLevels=new Array,this._useLODScreenCoverage=!1,this._effectiveMaterial=null,this._forcedInstanceCount=0,this._overrideRenderingFillMode=null}}class F extends Qe{static _GetDefaultSideOrientation(e){return e||F.FRONTSIDE}get useLODScreenCoverage(){return this._internalMeshDataInfo._useLODScreenCoverage}set useLODScreenCoverage(e){this._internalMeshDataInfo._useLODScreenCoverage=e,this._sortLODLevels()}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(e&&this._internalMeshDataInfo._sourcePositions&&(this.setVerticesData(A.PositionKind,this._internalMeshDataInfo._sourcePositions,!0),this._internalMeshDataInfo._sourceNormals&&this.setVerticesData(A.NormalKind,this._internalMeshDataInfo._sourceNormals,!0),this._internalMeshDataInfo._sourcePositions=null,this._internalMeshDataInfo._sourceNormals=null),this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get onBeforeRenderObservable(){return this._internalMeshDataInfo._onBeforeRenderObservable||(this._internalMeshDataInfo._onBeforeRenderObservable=new Z),this._internalMeshDataInfo._onBeforeRenderObservable}get onBeforeBindObservable(){return this._internalMeshDataInfo._onBeforeBindObservable||(this._internalMeshDataInfo._onBeforeBindObservable=new Z),this._internalMeshDataInfo._onBeforeBindObservable}get onAfterRenderObservable(){return this._internalMeshDataInfo._onAfterRenderObservable||(this._internalMeshDataInfo._onAfterRenderObservable=new Z),this._internalMeshDataInfo._onAfterRenderObservable}get onBetweenPassObservable(){return this._internalMeshDataInfo._onBetweenPassObservable||(this._internalMeshDataInfo._onBetweenPassObservable=new Z),this._internalMeshDataInfo._onBetweenPassObservable}get onBeforeDrawObservable(){return this._internalMeshDataInfo._onBeforeDrawObservable||(this._internalMeshDataInfo._onBeforeDrawObservable=new Z),this._internalMeshDataInfo._onBeforeDrawObservable}set onBeforeDraw(e){this._onBeforeDrawObserver&&this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver),this._onBeforeDrawObserver=this.onBeforeDrawObservable.add(e)}get hasInstances(){return this.instances.length>0}get hasThinInstances(){return(this.forcedInstanceCount||this._thinInstanceDataStorage.instancesCount||0)>0}get forcedInstanceCount(){return this._internalMeshDataInfo._forcedInstanceCount}set forcedInstanceCount(e){this._internalMeshDataInfo._forcedInstanceCount=e}get sideOrientation(){return this._internalMeshDataInfo._sideOrientation}set sideOrientation(e){this._internalMeshDataInfo._sideOrientation=e,this._internalAbstractMeshDataInfo._sideOrientationHint=this._scene.useRightHandedSystem&&e===1||!this._scene.useRightHandedSystem&&e===0}get overrideMaterialSideOrientation(){return this.sideOrientation}set overrideMaterialSideOrientation(e){this.sideOrientation=e,this.material&&(this.material.sideOrientation=null)}get overrideRenderingFillMode(){return this._internalMeshDataInfo._overrideRenderingFillMode}set overrideRenderingFillMode(e){this._internalMeshDataInfo._overrideRenderingFillMode=e}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){e&&(this.material&&this.material.sideOrientation===null||this._internalAbstractMeshDataInfo._sideOrientationHint)&&(e.sideOrientation=null),this._setMaterial(e)}get source(){return this._internalMeshDataInfo._source}get cloneMeshMap(){return this._internalMeshDataInfo.meshMap}get isUnIndexed(){return this._unIndexed}set isUnIndexed(e){this._unIndexed!==e&&(this._unIndexed=e,this._markSubMeshesAsAttributesDirty())}get worldMatrixInstancedBuffer(){return this._instanceDataStorage.instancesData}get previousWorldMatrixInstancedBuffer(){return this._instanceDataStorage.instancesPreviousData}get manualUpdateOfWorldMatrixInstancedBuffer(){return this._instanceDataStorage.manualUpdate}set manualUpdateOfWorldMatrixInstancedBuffer(e){this._instanceDataStorage.manualUpdate=e}get manualUpdateOfPreviousWorldMatrixInstancedBuffer(){return this._instanceDataStorage.previousManualUpdate}set manualUpdateOfPreviousWorldMatrixInstancedBuffer(e){this._instanceDataStorage.previousManualUpdate=e}get forceWorldMatrixInstancedBufferUpdate(){return this._instanceDataStorage.forceMatrixUpdates}set forceWorldMatrixInstancedBufferUpdate(e){this._instanceDataStorage.forceMatrixUpdates=e}_copySource(e,t,i=!0){const s=this.getScene();if(e._geometry&&e._geometry.applyToMesh(this),I0.DeepCopy(e,this,["name","material","skeleton","instances","parent","uniqueId","source","metadata","morphTargetManager","hasInstances","worldMatrixInstancedBuffer","previousWorldMatrixInstancedBuffer","hasLODLevels","geometry","isBlocked","areNormalsFrozen","facetNb","isFacetDataEnabled","lightSources","useBones","isAnInstance","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","cloneMeshMap","hasBoundingInfo","physicsBody","physicsImpostor"],["_poseMatrix"]),this._internalMeshDataInfo._source=e,s.useClonedMeshMap&&(e._internalMeshDataInfo.meshMap||(e._internalMeshDataInfo.meshMap={}),e._internalMeshDataInfo.meshMap[this.uniqueId]=this),this._originalBuilderSideOrientation=e._originalBuilderSideOrientation,this._creationDataStorage=e._creationDataStorage,e._ranges){const n=e._ranges;for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&n[r]&&this.createAnimationRange(r,n[r].from,n[r].to)}if(e.metadata&&e.metadata.clone?this.metadata=e.metadata.clone():this.metadata=e.metadata,this._internalMetadata=e._internalMetadata,ke&&ke.HasTags(e)&&ke.AddTagsTo(this,ke.GetTags(e,!0)),this.setEnabled(e.isEnabled(!1)),this.parent=e.parent,this.setPivotMatrix(e.getPivotMatrix(),this._postMultiplyPivotMatrix),this.id=this.name+"."+e.id,this.material=e.material,!t){const n=e.getDescendants(!0);for(let r=0;r{o&&l&&(this._uniformBuffer?this.transferToEffect(h):l.bindOnlyWorldMatrix(h))},s&&this._copySource(s,n,r),i!==null&&(this.parent=i),this._instanceDataStorage.hardwareInstancedRendering=this.getEngine().getCaps().instancedArrays,this._internalMeshDataInfo._onMeshReadyObserverAdded=o=>{o.unregisterOnNextCall=!0,this.isReady(!0)?this.onMeshReadyObservable.notifyObservers(this):this._internalMeshDataInfo._checkReadinessObserver||(this._internalMeshDataInfo._checkReadinessObserver=this._scene.onBeforeRenderObservable.add(()=>{this.isReady(!0)&&(this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),this._internalMeshDataInfo._checkReadinessObserver=null,this.onMeshReadyObservable.notifyObservers(this))}))},this.onMeshReadyObservable=new Z(this._internalMeshDataInfo._onMeshReadyObserverAdded),s&&s.onClonedObservable.notifyObservers(this)}instantiateHierarchy(e=null,t,i){const s=this.getTotalVertices()===0||t&&t.doNotInstantiate&&(t.doNotInstantiate===!0||t.doNotInstantiate(this))?this.clone("Clone of "+(this.name||this.id),e||this.parent,!0):this.createInstance("instance of "+(this.name||this.id));s.parent=e||this.parent,s.position=this.position.clone(),s.scaling=this.scaling.clone(),this.rotationQuaternion?s.rotationQuaternion=this.rotationQuaternion.clone():s.rotation=this.rotation.clone(),i&&i(this,s);for(const n of this.getChildTransformNodes(!0))n.getClassName()==="InstancedMesh"&&s.getClassName()==="Mesh"&&n.sourceMesh===this?n.instantiateHierarchy(s,{doNotInstantiate:t&&t.doNotInstantiate||!1,newSourcedMesh:s},i):n.instantiateHierarchy(s,t,i);return s}getClassName(){return"Mesh"}get _isMesh(){return!0}toString(e){let t=super.toString(e);if(t+=", n vertices: "+this.getTotalVertices(),t+=", parent: "+(this._waitingParentId?this._waitingParentId:this.parent?this.parent.name:"NONE"),this.animations)for(let i=0;i0}getLODLevels(){return this._internalMeshDataInfo._LODLevels}_sortLODLevels(){const e=this._internalMeshDataInfo._useLODScreenCoverage?-1:1;this._internalMeshDataInfo._LODLevels.sort((t,i)=>t.distanceOrScreenCoveragei.distanceOrScreenCoverage?-e:0)}addLODLevel(e,t){if(t&&t._masterMesh)return U.Warn("You cannot use a mesh as LOD level twice"),this;const i=new ug(e,t);return this._internalMeshDataInfo._LODLevels.push(i),t&&(t._masterMesh=this),this._sortLODLevels(),this}getLODLevelAtDistance(e){const t=this._internalMeshDataInfo;for(let i=0;io*r)return this.onLODLevelSelection&&this.onLODLevelSelection(r,this,this),this;for(let h=0;h0||this.hasThinInstances);this.computeWorldMatrix();const r=this.material||s.defaultMaterial;if(r){if(r._storeEffectOnSubMeshes)for(const p of this.subMeshes){const g=p.getMaterial();if(g){if(g._storeEffectOnSubMeshes){if(!g.isReadyForSubMesh(this,p,n))return!1}else if(!g.isReady(this,n))return!1}}else if(!r.isReady(this,n))return!1}const o=i.currentRenderPassId;for(const p of this.lightSources){const g=p.getShadowGenerators();if(!g)continue;const m=g.values();for(let b=m.next();b.done!==!0;b=m.next()){const I=b.value;if(I&&(!((h=I.getShadowMap())!=null&&h.renderList)||(l=I.getShadowMap())!=null&&l.renderList&&((u=(c=I.getShadowMap())==null?void 0:c.renderList)==null?void 0:u.indexOf(this))!==-1)){const x=(f=I.getShadowMap().renderPassIds)!=null?f:[i.currentRenderPassId];for(let y=0;y0){const i=this.getIndices();if(!i)return null;const s=i.length;let n=!1;if(e)n=!0;else for(const r of this.subMeshes){if(r.indexStart+r.indexCount>s){n=!0;break}if(r.verticesStart+r.verticesCount>t){n=!0;break}}if(!n)return this.subMeshes[0]}return this.releaseSubMeshes(),new vi(0,0,t,0,this.getTotalIndices(),this)}subdivide(e){if(e<1)return;const t=this.getTotalIndices();let i=t/e|0,s=0;for(;i%3!==0;)i++;this.releaseSubMeshes();for(let n=0;n=t);n++)vi.CreateFromIndices(0,s,n===e-1?t-s:i,this,void 0,!1),s+=i;this.refreshBoundingInfo(),this.synchronizeInstances()}setVerticesData(e,t,i=!1,s){if(this._geometry)this._geometry.setVerticesData(e,t,i,s);else{const n=new j;n.set(t,e);const r=this.getScene();new Nt(Nt.RandomId(),r,n,i,this)}return this}removeVerticesData(e){this._geometry&&this._geometry.removeVerticesData(e)}markVerticesDataAsUpdatable(e,t=!0){const i=this.getVertexBuffer(e);!i||i.isUpdatable()===t||this.setVerticesData(e,this.getVerticesData(e),t)}setVerticesBuffer(e,t=!0){return this._geometry||(this._geometry=Nt.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e,null,t),this}updateVerticesData(e,t,i,s){return this._geometry?(s?(this.makeGeometryUnique(),this.updateVerticesData(e,t,i,!1)):this._geometry.updateVerticesData(e,t,i),this):this}updateMeshPositions(e,t=!0){const i=this.getVerticesData(A.PositionKind);if(!i)return this;if(e(i),this.updateVerticesData(A.PositionKind,i,!1,!1),t){const s=this.getIndices(),n=this.getVerticesData(A.NormalKind);if(!n)return this;j.ComputeNormals(i,s,n),this.updateVerticesData(A.NormalKind,n,!1,!1)}return this}makeGeometryUnique(){if(!this._geometry)return this;if(this._geometry.meshes.length===1)return this;const e=this._geometry,t=this._geometry.copy(Nt.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this}setIndexBuffer(e,t,i){let s=this._geometry;s||(s=new Nt(Nt.RandomId(),this.getScene(),void 0,void 0,this)),s.setIndexBuffer(e,t,i)}setIndices(e,t=null,i=!1,s=!1){if(this._geometry)this._geometry.setIndices(e,t,i,s);else{const n=new j;n.indices=e;const r=this.getScene();new Nt(Nt.RandomId(),r,n,i,this)}return this}updateIndices(e,t,i=!1){return this._geometry?(this._geometry.updateIndices(e,t,i),this):this}toLeftHanded(){return this._geometry?(this._geometry.toLeftHanded(),this):this}_bind(e,t,i,s=!0){if(!this._geometry)return this;const n=this.getScene().getEngine();let r;if(this._unIndexed)switch(this._getRenderingFillMode(i)){case X.WireFrameFillMode:r=e._getLinesIndexBuffer(this.getIndices(),n);break;default:r=null;break}else switch(this._getRenderingFillMode(i)){case X.PointFillMode:r=null;break;case X.WireFrameFillMode:r=e._getLinesIndexBuffer(this.getIndices(),n);break;default:case X.TriangleFillMode:r=this._geometry.getIndexBuffer();break}return this._bindDirect(t,r,s)}_bindDirect(e,t,i=!0){return this._geometry?(this.morphTargetManager&&this.morphTargetManager.isUsingTextureForTargets&&this.morphTargetManager._bind(e),!i||!this._userInstancedBuffersStorage||this.hasThinInstances?this._geometry._bind(e,t):this._geometry._bind(e,t,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects),this):this}_draw(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeDrawObservable&&this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);const n=this.getScene().getEngine();return this._unIndexed&&t!==X.WireFrameFillMode||t==X.PointFillMode?n.drawArraysType(t,e.verticesStart,e.verticesCount,this.forcedInstanceCount||i):t==X.WireFrameFillMode?n.drawElementsType(t,0,e._linesIndexCount,this.forcedInstanceCount||i):n.drawElementsType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i),this}registerBeforeRender(e){return this.onBeforeRenderObservable.add(e),this}unregisterBeforeRender(e){return this.onBeforeRenderObservable.removeCallback(e),this}registerAfterRender(e){return this.onAfterRenderObservable.add(e),this}unregisterAfterRender(e){return this.onAfterRenderObservable.removeCallback(e),this}_getInstancesRenderList(e,t=!1){if(this._instanceDataStorage.isFrozen){if(t)return this._instanceDataStorage.batchCacheReplacementModeInFrozenMode.hardwareInstancedRendering[e]=!1,this._instanceDataStorage.batchCacheReplacementModeInFrozenMode.renderSelf[e]=!0,this._instanceDataStorage.batchCacheReplacementModeInFrozenMode;if(this._instanceDataStorage.previousBatch)return this._instanceDataStorage.previousBatch}const i=this.getScene(),s=i._isInIntermediateRendering(),n=s?this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate:this._internalAbstractMeshDataInfo._onlyForInstances,r=this._instanceDataStorage.batchCache;if(r.mustReturn=!1,r.renderSelf[e]=t||!n&&this.isEnabled()&&this.isVisible,r.visibleInstances[e]=null,this._instanceDataStorage.visibleInstances&&!t){const o=this._instanceDataStorage.visibleInstances,h=i.getRenderId(),l=s?o.intermediateDefaultRenderId:o.defaultRenderId;r.visibleInstances[e]=o[h],!r.visibleInstances[e]&&l&&(r.visibleInstances[e]=o[l])}return r.hardwareInstancedRendering[e]=!t&&this._instanceDataStorage.hardwareInstancedRendering&&r.visibleInstances[e]!==null&&r.visibleInstances[e]!==void 0,this._instanceDataStorage.previousBatch=r,r}_renderWithInstances(e,t,i,s,n){var b;const r=i.visibleInstances[e._id],o=r?r.length:0,h=this._instanceDataStorage,l=h.instancesBufferSize;let c=h.instancesBuffer,u=h.instancesPreviousBuffer;const d=(o+1)*16*4;for(;h.instancesBufferSizex._distanceToCamera>y._distanceToCamera?-1:x._distanceToCamera1&&s.activeCamera===s.activeCameras[0]||n<=1)&&this._checkOcclusionQuery()&&!this._occlusionDataStorage.forceRenderingWhenOccluded)return this;const o=this._getInstancesRenderList(e._id,!!i);if(o.mustReturn)return this;if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;const h=s.getEngine();let l=0,c=null;this.ignoreCameraMaxZ&&s.activeCamera&&!s._isInIntermediateRendering()&&(l=s.activeCamera.maxZ,c=s.activeCamera,s.activeCamera.maxZ=0,s.updateTransformMatrix(!0)),this._internalMeshDataInfo._onBeforeRenderObservable&&this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);const u=e.getRenderingMesh(),f=o.hardwareInstancedRendering[e._id]||u.hasThinInstances||!!this._userInstancedBuffersStorage&&!e.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh,d=this._instanceDataStorage,_=e.getMaterial();if(!_)return c&&(c.maxZ=l,s.updateTransformMatrix(!0)),this;if(!d.isFrozen||!this._internalMeshDataInfo._effectiveMaterial||this._internalMeshDataInfo._effectiveMaterial!==_){if(_._storeEffectOnSubMeshes){if(!_.isReadyForSubMesh(this,e,f))return c&&(c.maxZ=l,s.updateTransformMatrix(!0)),this}else if(!_.isReady(this,f))return c&&(c.maxZ=l,s.updateTransformMatrix(!0)),this;this._internalMeshDataInfo._effectiveMaterial=_}else if(_._storeEffectOnSubMeshes&&!((C=e._drawWrapper)!=null&&C._wasPreviouslyReady)||!_._storeEffectOnSubMeshes&&!_._getDrawWrapper()._wasPreviouslyReady)return c&&(c.maxZ=l,s.updateTransformMatrix(!0)),this;t&&h.setAlphaMode(this._internalMeshDataInfo._effectiveMaterial.alphaMode);let p;this._internalMeshDataInfo._effectiveMaterial._storeEffectOnSubMeshes?p=e._drawWrapper:p=this._internalMeshDataInfo._effectiveMaterial._getDrawWrapper();const g=(S=p==null?void 0:p.effect)!=null?S:null;for(const w of s._beforeRenderingMeshStage)w.action(this,e,o,g);if(!p||!g)return c&&(c.maxZ=l,s.updateTransformMatrix(!0)),this;const m=i||this;let b;if(!d.isFrozen&&(this._internalMeshDataInfo._effectiveMaterial.backFaceCulling||this._internalMeshDataInfo._effectiveMaterial.sideOrientation!==null||this._internalMeshDataInfo._effectiveMaterial.twoSidedLighting)){const w=m._getWorldMatrixDeterminant();b=this._internalMeshDataInfo._effectiveMaterial._getEffectiveOrientation(this),w<0&&(b=b===X.ClockWiseSideOrientation?X.CounterClockWiseSideOrientation:X.ClockWiseSideOrientation),d.sideOrientation=b}else b=d.sideOrientation;const I=this._internalMeshDataInfo._effectiveMaterial._preBind(p,b);this._internalMeshDataInfo._effectiveMaterial.forceDepthWrite&&h.setDepthWrite(!0);const T=this._internalMeshDataInfo._effectiveMaterial,x=T.fillMode;this._internalMeshDataInfo._onBeforeBindObservable&&this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this),f||this._bind(e,g,x,!1);const y=m.getWorldMatrix();T._storeEffectOnSubMeshes?T.bindForSubMesh(y,this,e):T.bind(y,this),!T.backFaceCulling&&T.separateCullingPass&&(h.setState(!0,T.zOffset,!1,!I,T.cullBackFaces,T.stencil,T.zOffsetUnits),this._processRendering(this,e,g,x,o,f,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),h.setState(!0,T.zOffset,!1,I,T.cullBackFaces,T.stencil,T.zOffsetUnits),this._internalMeshDataInfo._onBetweenPassObservable&&this._internalMeshDataInfo._onBetweenPassObservable.notifyObservers(e)),this._processRendering(this,e,g,x,o,f,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),this._internalMeshDataInfo._effectiveMaterial.unbind();for(const w of s._afterRenderingMeshStage)w.action(this,e,o,g);return this._internalMeshDataInfo._onAfterRenderObservable&&this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this),c&&(c.maxZ=l,s.updateTransformMatrix(!0)),s.performancePriority===2&&!d.isFrozen&&this._freeze(),this}cleanMatrixWeights(){this.isVerticesDataPresent(A.MatricesWeightsKind)&&(this.isVerticesDataPresent(A.MatricesWeightsExtraKind)?this._normalizeSkinWeightsAndExtra():this._normalizeSkinFourWeights())}_normalizeSkinFourWeights(){const e=this.getVerticesData(A.MatricesWeightsKind),t=e.length;for(let i=0;im&&s++,x!==0&&I++,b+=x,m=x}if(l[I]++,I>r&&(r=I),b===0)n++;else{const T=1/b;let x=0;for(let y=0;yc&&o++}}const u=this.skeleton.bones.length,f=this.getVerticesData(A.MatricesIndicesKind),d=this.getVerticesData(A.MatricesIndicesExtraKind);let _=0;for(let g=0;g=u||b<0)&&_++}const p="Number of Weights = "+i/4+"\nMaximum influences = "+r+"\nMissing Weights = "+n+"\nNot Sorted = "+s+"\nNot Normalized = "+o+"\nWeightCounts = ["+l+"]\nNumber of bones = "+u+"\nBad Bone Indices = "+_;return{skinned:!0,valid:n===0&&o===0&&_===0,report:p}}_checkDelayState(){const e=this.getScene();return this._geometry?this._geometry.load(e):this.delayLoadState===4&&(this.delayLoadState=2,this._queueLoad(e)),this}_queueLoad(e){e.addPendingData(this);const t=this.delayLoadingFile.indexOf(".babylonbinarymeshdata")!==-1;return J.LoadFile(this.delayLoadingFile,i=>{i instanceof ArrayBuffer?this._delayLoadingFunction(i,this):this._delayLoadingFunction(JSON.parse(i),this),this.instances.forEach(s=>{s.refreshBoundingInfo(),s._syncSubMeshes()}),this.delayLoadState=1,e.removePendingData(this)},()=>{},e.offlineProvider,t),this}isInFrustum(e){return this.delayLoadState===2||!super.isInFrustum(e)?!1:(this._checkDelayState(),!0)}setMaterialById(e){const t=this.getScene().materials;let i;for(i=t.length-1;i>-1;i--)if(t[i].id===e)return this.material=t[i],this;const s=this.getScene().multiMaterials;for(i=s.length-1;i>-1;i--)if(s[i].id===e)return this.material=s[i],this;return this}getAnimatables(){const e=[];return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e}bakeTransformIntoVertices(e){if(!this.isVerticesDataPresent(A.PositionKind))return this;const t=this.subMeshes.splice(0);this._resetPointsArrayCache();let i=this.getVerticesData(A.PositionKind);const s=v.Zero();let n;for(n=0;n{const f=u.width,d=u.height,p=this.getEngine().createCanvas(f,d).getContext("2d");p.drawImage(u,0,0);const g=p.getImageData(0,0,f,d).data;this.applyDisplacementMapFromBuffer(g,f,d,t,i,n,r,o),s&&s(this)};return J.LoadImage(e,c,h||(()=>{}),l.offlineProvider),this}applyDisplacementMapFromBuffer(e,t,i,s,n,r,o,h=!1){if(!this.isVerticesDataPresent(A.PositionKind)||!this.isVerticesDataPresent(A.NormalKind)||!this.isVerticesDataPresent(A.UVKind))return U.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"),this;const l=this.getVerticesData(A.PositionKind,!0,!0),c=this.getVerticesData(A.NormalKind),u=this.getVerticesData(A.UVKind);let f=v.Zero();const d=v.Zero(),_=oe.Zero();r=r||oe.Zero(),o=o||new oe(1,1);for(let p=0;p{var l;return!((l=this.getVertexBuffer(h))!=null&&l.getIsInstanced())}),i=this.getIndices(),s={},n=(h,l)=>{const c=new Float32Array(i.length*l);let u=0;for(let f=0;f{const o=s.length-1-r,h=s[o];for(let l=0;l{for(let o=0;o-1&&(s._waitingMorphTargetManagerId=e.morphTargetManagerId),e.skeletonId!==void 0&&e.skeletonId!==null&&(s.skeleton=t.getLastSkeletonById(e.skeletonId),e.numBoneInfluencers&&(s.numBoneInfluencers=e.numBoneInfluencers)),e.animations){for(let n=0;n4,l=h?this.getVerticesData(A.MatricesIndicesExtraKind):null,c=h?this.getVerticesData(A.MatricesWeightsExtraKind):null,u=e.getTransformMatrices(this),f=v.Zero(),d=new O,_=new O;let p=0,g;for(let m=0;m0&&(O.FromFloat32ArrayToRefScaled(u,Math.floor(r[p+g]*16),b,_),d.addToSelf(_));if(h)for(g=0;g<4;g++)b=c[p+g],b>0&&(O.FromFloat32ArrayToRefScaled(u,Math.floor(l[p+g]*16),b,_),d.addToSelf(_));v.TransformCoordinatesFromFloatsToRef(i._sourcePositions[m],i._sourcePositions[m+1],i._sourcePositions[m+2],d,f),f.toArray(s,m),t&&(v.TransformNormalFromFloatsToRef(i._sourceNormals[m],i._sourceNormals[m+1],i._sourceNormals[m+2],d,f),f.toArray(n,m)),d.reset()}return this.updateVerticesData(A.PositionKind,s),t&&this.updateVerticesData(A.NormalKind,n),this}static MinMax(e){let t=null,i=null;return e.forEach(function(s){const r=s.getBoundingInfo().boundingBox;!t||!i?(t=r.minimumWorld,i=r.maximumWorld):(t.minimizeInPlace(r.minimumWorld),i.maximizeInPlace(r.maximumWorld))}),!t||!i?{min:v.Zero(),max:v.Zero()}:{min:t,max:i}}static Center(e){const t=e instanceof Array?F.MinMax(e):e;return v.Center(t.min,t.max)}static MergeMeshes(e,t=!0,i,s,n,r){return F0(F._MergeMeshesCoroutine(e,t,i,s,n,r,!1))}static MergeMeshesAsync(e,t=!0,i,s,n,r){return Ep(F._MergeMeshesCoroutine(e,t,i,s,n,r,!0),Ip())}static*_MergeMeshesCoroutine(e,t=!0,i,s,n,r,o){if(e=e.filter(Boolean),e.length===0)return null;let h;if(!i){let R=0;for(h=0;h=65536)return U.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}r&&(n=!1);const l=new Array,c=new Array,u=new Array,f=e[0].sideOrientation;for(h=0;h{const E=R.computeWorldMatrix(!0);return{vertexData:j.ExtractFromMesh(R,!1,!1),transform:E}},{vertexData:p,transform:g}=_(d);o&&(yield);const m=new Array(e.length-1);for(let R=1;R{throw ye("GroundMesh")};F._GoldbergMeshParser=(a,e)=>{throw ye("GoldbergMesh")};F._LinesMeshParser=(a,e)=>{throw ye("LinesMesh")};F._GreasedLineMeshParser=(a,e)=>{throw ye("GreasedLineMesh")};F._GreasedLineRibbonMeshParser=(a,e)=>{throw ye("GreasedLineRibbonMesh")};F._TrailMeshParser=(a,e)=>{throw ye("TrailMesh")};vt("BABYLON.Mesh",F);class pg{constructor(){this._zoomStopsAnimation=!1,this._idleRotationSpeed=.05,this._idleRotationWaitTime=2e3,this._idleRotationSpinupTime=2e3,this.targetAlpha=null,this._isPointerDown=!1,this._lastFrameTime=null,this._lastInteractionTime=-1/0,this._cameraRotationSpeed=0,this._lastFrameRadius=0}get name(){return"AutoRotation"}set zoomStopsAnimation(e){this._zoomStopsAnimation=e}get zoomStopsAnimation(){return this._zoomStopsAnimation}set idleRotationSpeed(e){this._idleRotationSpeed=e}get idleRotationSpeed(){return this._idleRotationSpeed}set idleRotationWaitTime(e){this._idleRotationWaitTime=e}get idleRotationWaitTime(){return this._idleRotationWaitTime}set idleRotationSpinupTime(e){this._idleRotationSpinupTime=e}get idleRotationSpinupTime(){return this._idleRotationSpinupTime}get rotationInProgress(){return Math.abs(this._cameraRotationSpeed)>0}init(){}attach(e){this._attachedCamera=e;const t=this._attachedCamera.getScene();this._onPrePointerObservableObserver=t.onPrePointerObservable.add(i=>{if(i.type===Ce.POINTERDOWN){this._isPointerDown=!0;return}i.type===Ce.POINTERUP&&(this._isPointerDown=!1)}),this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(()=>{if(this._reachTargetAlpha())return;const i=bi.Now;let s=0;this._lastFrameTime!=null&&(s=i-this._lastFrameTime),this._lastFrameTime=i,this._applyUserInteraction();const n=i-this._lastInteractionTime-this._idleRotationWaitTime,r=Math.max(Math.min(n/this._idleRotationSpinupTime,1),0);this._cameraRotationSpeed=this._idleRotationSpeed*r,this._attachedCamera&&(this._attachedCamera.alpha-=this._cameraRotationSpeed*(s/1e3))})}detach(){if(!this._attachedCamera)return;const e=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&e.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._attachedCamera=null,this._lastFrameTime=null}resetLastInteractionTime(e){this._lastInteractionTime=e!=null?e:bi.Now}_reachTargetAlpha(){return this._attachedCamera&&this.targetAlpha?Math.abs(this._attachedCamera.alpha-this.targetAlpha)=.5?(1-this.easeInCore((1-e)*2))*.5+.5:this.easeInCore(e*2)*.5}}wi.EASINGMODE_EASEIN=0;wi.EASINGMODE_EASEOUT=1;wi.EASINGMODE_EASEINOUT=2;class gg extends wi{constructor(e=1){super(),this.amplitude=e}easeInCore(e){const t=Math.max(0,this.amplitude);return Math.pow(e,3)-e*t*Math.sin(3.141592653589793*e)}}class mg extends wi{constructor(e=2){super(),this.exponent=e}easeInCore(e){return this.exponent<=0?e:(Math.exp(this.exponent*e)-1)/(Math.exp(this.exponent)-1)}}class qr{constructor(e,t,i){this.name=e,this.from=t,this.to=i}clone(){return new qr(this.name,this.from,this.to)}}const vg=Object.freeze(new re(0,0,0,0)),bg=Object.freeze(v.Zero()),xg=Object.freeze(oe.Zero()),yg=Object.freeze(hi.Zero()),Tg=Object.freeze(de.Black()),Ag=Object.freeze(new H(0,0,0,0)),Ii={key:0,repeatCount:0,loopMode:2};class te{static _PrepareAnimation(e,t,i,s,n,r,o,h){let l;if(!isNaN(parseFloat(n))&&isFinite(n)?l=te.ANIMATIONTYPE_FLOAT:n instanceof re?l=te.ANIMATIONTYPE_QUATERNION:n instanceof v?l=te.ANIMATIONTYPE_VECTOR3:n instanceof oe?l=te.ANIMATIONTYPE_VECTOR2:n instanceof de?l=te.ANIMATIONTYPE_COLOR3:n instanceof H?l=te.ANIMATIONTYPE_COLOR4:n instanceof hi&&(l=te.ANIMATIONTYPE_SIZE),l==null)return null;const c=new te(e,t,i,l,o),u=[{frame:0,value:n},{frame:s,value:r}];return c.setKeys(u),h!==void 0&&c.setEasingFunction(h),c}static CreateAnimation(e,t,i,s){const n=new te(e+"Animation",e,i,t,te.ANIMATIONLOOPMODE_CONSTANT);return n.setEasingFunction(s),n}static CreateAndStartAnimation(e,t,i,s,n,r,o,h,l,c,u){const f=te._PrepareAnimation(e,i,s,n,r,o,h,l);return!f||(t.getScene&&(u=t.getScene()),!u)?null:u.beginDirectAnimation(t,[f],0,n,f.loopMode===1,1,c)}static CreateAndStartHierarchyAnimation(e,t,i,s,n,r,o,h,l,c,u){const f=te._PrepareAnimation(e,s,n,r,o,h,l,c);return f?t.getScene().beginDirectHierarchyAnimation(t,i,[f],0,r,f.loopMode===1,1,u):null}static CreateMergeAndStartAnimation(e,t,i,s,n,r,o,h,l,c){const u=te._PrepareAnimation(e,i,s,n,r,o,h,l);return u?(t.animations.push(u),t.getScene().beginAnimation(t,0,n,u.loopMode===1,1,c)):null}static MakeAnimationAdditive(e,t,i,s=!1,n){var b,I;let r;typeof t=="object"?r=t:r={referenceFrame:t!=null?t:0,range:i,cloneOriginalAnimation:s,clonedAnimationName:n};let o=e;if(r.cloneOriginalAnimation&&(o=e.clone(),o.name=r.clonedAnimationName||o.name),!o._keys.length)return o;const h=r.referenceFrame&&r.referenceFrame>=0?r.referenceFrame:0;let l=0;const c=o._keys[0];let u=o._keys.length-1;const f=o._keys[u],d={referenceValue:c.value,referencePosition:N.Vector3[0],referenceQuaternion:N.Quaternion[0],referenceScaling:N.Vector3[1],keyPosition:N.Vector3[2],keyQuaternion:N.Quaternion[1],keyScaling:N.Vector3[3]};let _=c.frame,p=f.frame;if(r.range){const T=o.getRange(r.range);T&&(_=T.from,p=T.to)}else _=(b=r.fromFrame)!=null?b:_,p=(I=r.toFrame)!=null?I:p;if(_!==c.frame&&(l=o.createKeyForFrame(_)),p!==f.frame&&(u=o.createKeyForFrame(p)),o._keys.length===1){const T=o._getKeyValue(o._keys[0]);d.referenceValue=T.clone?T.clone():T}else if(h<=c.frame){const T=o._getKeyValue(c.value);d.referenceValue=T.clone?T.clone():T}else if(h>=f.frame){const T=o._getKeyValue(f.value);d.referenceValue=T.clone?T.clone():T}else{Ii.key=0;const T=o._interpolate(h,Ii);d.referenceValue=T.clone?T.clone():T}o.dataType===te.ANIMATIONTYPE_QUATERNION?d.referenceValue.normalize().conjugateInPlace():o.dataType===te.ANIMATIONTYPE_MATRIX&&(d.referenceValue.decompose(d.referenceScaling,d.referenceQuaternion,d.referencePosition),d.referenceQuaternion.normalize().conjugateInPlace());let g=Number.MAX_VALUE;const m=r.clipKeys?[]:null;for(let T=l;T<=u;T++){let x=o._keys[T];if((m||r.cloneOriginalAnimation)&&(x={frame:x.frame,value:x.value.clone?x.value.clone():x.value,inTangent:x.inTangent,outTangent:x.outTangent,interpolation:x.interpolation,lockedTangent:x.lockedTangent},m&&(g===Number.MAX_VALUE&&(g=x.frame),x.frame-=g,m.push(x))),!(T&&o.dataType!==te.ANIMATIONTYPE_FLOAT&&x.value===c.value))switch(o.dataType){case te.ANIMATIONTYPE_MATRIX:x.value.decompose(d.keyScaling,d.keyQuaternion,d.keyPosition),d.keyPosition.subtractInPlace(d.referencePosition),d.keyScaling.divideInPlace(d.referenceScaling),d.referenceQuaternion.multiplyToRef(d.keyQuaternion,d.keyQuaternion),O.ComposeToRef(d.keyScaling,d.keyQuaternion,d.keyPosition,x.value);break;case te.ANIMATIONTYPE_QUATERNION:d.referenceValue.multiplyToRef(x.value,x.value);break;case te.ANIMATIONTYPE_VECTOR2:case te.ANIMATIONTYPE_VECTOR3:case te.ANIMATIONTYPE_COLOR3:case te.ANIMATIONTYPE_COLOR4:x.value.subtractToRef(d.referenceValue,x.value);break;case te.ANIMATIONTYPE_SIZE:x.value.width-=d.referenceValue.width,x.value.height-=d.referenceValue.height;break;default:x.value-=d.referenceValue}}return m&&o.setKeys(m,!0),o}static TransitionTo(e,t,i,s,n,r,o,h=null){if(o<=0)return i[e]=t,h&&h(),null;const l=n*(o/1e3);r.setKeys([{frame:0,value:i[e].clone?i[e].clone():i[e]},{frame:l,value:t}]),i.animations||(i.animations=[]),i.animations.push(r);const c=s.beginAnimation(i,0,l,!1);return c.onAnimationEnd=h,c}get runtimeAnimations(){return this._runtimeAnimations}get hasRunningRuntimeAnimations(){for(const e of this._runtimeAnimations)if(!e.isStopped())return!0;return!1}constructor(e,t,i,s,n,r){this.name=e,this.targetProperty=t,this.framePerSecond=i,this.dataType=s,this.loopMode=n,this.enableBlending=r,this._easingFunction=null,this._runtimeAnimations=new Array,this._events=new Array,this.blendingSpeed=.01,this._ranges={},this.targetPropertyPath=t.split("."),this.dataType=s,this.loopMode=n===void 0?te.ANIMATIONLOOPMODE_CYCLE:n,this.uniqueId=te._UniqueIdGenerator++}toString(e){let t="Name: "+this.name+", property: "+this.targetProperty;if(t+=", datatype: "+["Float","Vector3","Quaternion","Matrix","Color3","Vector2"][this.dataType],t+=", nKeys: "+(this._keys?this._keys.length:"none"),t+=", nRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";let i=!0;for(const s in this._ranges)i&&(t+=", ",i=!1),t+=s;t+="}"}return t}addEvent(e){this._events.push(e),this._events.sort((t,i)=>t.frame-i.frame)}removeEvents(e){for(let t=0;t=0;r--)this._keys[r].frame>=s&&this._keys[r].frame<=n&&this._keys.splice(r,1)}this._ranges[e]=null}}getRange(e){return this._ranges[e]}getKeys(){return this._keys}getHighestFrame(){let e=0;for(let t=0,i=this._keys.length;t0)return t.highLimitValue.clone?t.highLimitValue.clone():t.highLimitValue;const s=this._keys,n=s.length;let r=t.key;for(;r>=0&&e=s[r+1].frame;)++r;if(t.key=r,r<0)return i?void 0:this._getKeyValue(s[0].value);if(r+1>n-1)return i?void 0:this._getKeyValue(s[n-1].value);const o=s[r],h=s[r+1];if(i&&(e===o.frame||e===h.frame))return;const l=this._getKeyValue(o.value),c=this._getKeyValue(h.value);if(o.interpolation===1)return h.frame>e?l:c;const u=o.outTangent!==void 0&&h.inTangent!==void 0,f=h.frame-o.frame;let d=(e-o.frame)/f;const _=o.easingFunction||this.getEasingFunction();switch(_!==null&&(d=_.ease(d)),this.dataType){case te.ANIMATIONTYPE_FLOAT:{const g=u?this.floatInterpolateFunctionWithTangents(l,o.outTangent*f,c,h.inTangent*f,d):this.floatInterpolateFunction(l,c,d);switch(t.loopMode){case te.ANIMATIONLOOPMODE_CYCLE:case te.ANIMATIONLOOPMODE_CONSTANT:case te.ANIMATIONLOOPMODE_YOYO:return g;case te.ANIMATIONLOOPMODE_RELATIVE:case te.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return((p=t.offsetValue)!=null?p:0)*t.repeatCount+g}break}case te.ANIMATIONTYPE_QUATERNION:{const g=u?this.quaternionInterpolateFunctionWithTangents(l,o.outTangent.scale(f),c,h.inTangent.scale(f),d):this.quaternionInterpolateFunction(l,c,d);switch(t.loopMode){case te.ANIMATIONLOOPMODE_CYCLE:case te.ANIMATIONLOOPMODE_CONSTANT:case te.ANIMATIONLOOPMODE_YOYO:return g;case te.ANIMATIONLOOPMODE_RELATIVE:case te.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return g.addInPlace((t.offsetValue||vg).scale(t.repeatCount))}return g}case te.ANIMATIONTYPE_VECTOR3:{const g=u?this.vector3InterpolateFunctionWithTangents(l,o.outTangent.scale(f),c,h.inTangent.scale(f),d):this.vector3InterpolateFunction(l,c,d);switch(t.loopMode){case te.ANIMATIONLOOPMODE_CYCLE:case te.ANIMATIONLOOPMODE_CONSTANT:case te.ANIMATIONLOOPMODE_YOYO:return g;case te.ANIMATIONLOOPMODE_RELATIVE:case te.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return g.add((t.offsetValue||bg).scale(t.repeatCount))}break}case te.ANIMATIONTYPE_VECTOR2:{const g=u?this.vector2InterpolateFunctionWithTangents(l,o.outTangent.scale(f),c,h.inTangent.scale(f),d):this.vector2InterpolateFunction(l,c,d);switch(t.loopMode){case te.ANIMATIONLOOPMODE_CYCLE:case te.ANIMATIONLOOPMODE_CONSTANT:case te.ANIMATIONLOOPMODE_YOYO:return g;case te.ANIMATIONLOOPMODE_RELATIVE:case te.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return g.add((t.offsetValue||xg).scale(t.repeatCount))}break}case te.ANIMATIONTYPE_SIZE:{switch(t.loopMode){case te.ANIMATIONLOOPMODE_CYCLE:case te.ANIMATIONLOOPMODE_CONSTANT:case te.ANIMATIONLOOPMODE_YOYO:return this.sizeInterpolateFunction(l,c,d);case te.ANIMATIONLOOPMODE_RELATIVE:case te.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return this.sizeInterpolateFunction(l,c,d).add((t.offsetValue||yg).scale(t.repeatCount))}break}case te.ANIMATIONTYPE_COLOR3:{const g=u?this.color3InterpolateFunctionWithTangents(l,o.outTangent.scale(f),c,h.inTangent.scale(f),d):this.color3InterpolateFunction(l,c,d);switch(t.loopMode){case te.ANIMATIONLOOPMODE_CYCLE:case te.ANIMATIONLOOPMODE_CONSTANT:case te.ANIMATIONLOOPMODE_YOYO:return g;case te.ANIMATIONLOOPMODE_RELATIVE:case te.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return g.add((t.offsetValue||Tg).scale(t.repeatCount))}break}case te.ANIMATIONTYPE_COLOR4:{const g=u?this.color4InterpolateFunctionWithTangents(l,o.outTangent.scale(f),c,h.inTangent.scale(f),d):this.color4InterpolateFunction(l,c,d);switch(t.loopMode){case te.ANIMATIONLOOPMODE_CYCLE:case te.ANIMATIONLOOPMODE_CONSTANT:case te.ANIMATIONLOOPMODE_YOYO:return g;case te.ANIMATIONLOOPMODE_RELATIVE:case te.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return g.add((t.offsetValue||Ag).scale(t.repeatCount))}break}case te.ANIMATIONTYPE_MATRIX:{switch(t.loopMode){case te.ANIMATIONLOOPMODE_CYCLE:case te.ANIMATIONLOOPMODE_CONSTANT:case te.ANIMATIONLOOPMODE_YOYO:return te.AllowMatricesInterpolation?this.matrixInterpolateFunction(l,c,d,t.workValue):l;case te.ANIMATIONLOOPMODE_RELATIVE:case te.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return l}break}}return 0}matrixInterpolateFunction(e,t,i,s){return te.AllowMatrixDecomposeForInterpolation?s?(O.DecomposeLerpToRef(e,t,i,s),s):O.DecomposeLerp(e,t,i):s?(O.LerpToRef(e,t,i,s),s):O.Lerp(e,t,i)}clone(){const e=new te(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);if(e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed,this._keys&&e.setKeys(this._keys),this._ranges){e._ranges={};for(const t in this._ranges){const i=this._ranges[t];i&&(e._ranges[t]=i.clone())}}return e}setKeys(e,t=!1){this._keys=t?e:e.slice(0)}createKeyForFrame(e){Ii.key=0;const t=this._interpolate(e,Ii,!0);if(!t)return this._keys[Ii.key].frame===e?Ii.key:Ii.key+1;const i={frame:e,value:t.clone?t.clone():t};return this._keys.splice(Ii.key+1,0,i),Ii.key+1}serialize(){const e={};e.name=this.name,e.property=this.targetProperty,e.framePerSecond=this.framePerSecond,e.dataType=this.dataType,e.loopBehavior=this.loopMode,e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed;const t=this.dataType;e.keys=[];const i=this.getKeys();for(let s=0;s=2&&(h=o.values[1]),o.values.length>=3&&(l=o.values[2]),o.values.length>=4&&(c=o.values[3]);break;case te.ANIMATIONTYPE_QUATERNION:if(n=re.FromArray(o.values),o.values.length>=8){const f=re.FromArray(o.values.slice(4,8));f.equals(re.Zero())||(h=f)}if(o.values.length>=12){const f=re.FromArray(o.values.slice(8,12));f.equals(re.Zero())||(l=f)}o.values.length>=13&&(c=o.values[12]);break;case te.ANIMATIONTYPE_MATRIX:n=O.FromArray(o.values),o.values.length>=17&&(c=o.values[16]);break;case te.ANIMATIONTYPE_COLOR3:n=de.FromArray(o.values),o.values[3]&&(h=de.FromArray(o.values[3])),o.values[4]&&(l=de.FromArray(o.values[4])),o.values[5]&&(c=o.values[5]);break;case te.ANIMATIONTYPE_COLOR4:n=H.FromArray(o.values),o.values[4]&&(h=H.FromArray(o.values[4])),o.values[5]&&(l=H.FromArray(o.values[5])),o.values[6]&&(c=H.FromArray(o.values[6]));break;case te.ANIMATIONTYPE_VECTOR3:default:n=v.FromArray(o.values),o.values[3]&&(h=v.FromArray(o.values[3])),o.values[4]&&(l=v.FromArray(o.values[4])),o.values[5]&&(c=o.values[5]);break}const u={};u.frame=o.frame,u.value=n,h!=null&&(u.inTangent=h),l!=null&&(u.outTangent=l),c!=null&&(u.interpolation=c),s.push(u)}if(t.setKeys(s),e.ranges)for(r=0;r{const n=new Ft;n.addEventListener("readystatechange",()=>{if(n.readyState==4)if(n.status==200){let r=JSON.parse(n.responseText);if(r.animations&&(r=r.animations),r.length){const o=[];for(const h of r)o.push(this.Parse(h));i(o)}else{const o=this.Parse(r);e&&(o.name=e),i(o)}}else s("Unable to load the animation")}),n.open("GET",t),n.send()})}static ParseFromSnippetAsync(e){return new Promise((t,i)=>{const s=new Ft;s.addEventListener("readystatechange",()=>{if(s.readyState==4)if(s.status==200){const n=JSON.parse(JSON.parse(s.responseText).jsonPayload);if(n.animations){const r=JSON.parse(n.animations),o=[];for(const h of r.animations){const l=this.Parse(h);l.snippetId=e,o.push(l)}t(o)}else{const r=JSON.parse(n.animation),o=this.Parse(r);o.snippetId=e,t(o)}}else i("Unable to load the snippet "+e)}),s.open("GET",this.SnippetUrl+"/"+e.replace(/#/g,"/")),s.send()})}}te._UniqueIdGenerator=0;te.AllowMatricesInterpolation=!1;te.AllowMatrixDecomposeForInterpolation=!0;te.SnippetUrl="https://snippet.babylonjs.com";te.ANIMATIONTYPE_FLOAT=0;te.ANIMATIONTYPE_VECTOR3=1;te.ANIMATIONTYPE_QUATERNION=2;te.ANIMATIONTYPE_MATRIX=3;te.ANIMATIONTYPE_COLOR3=4;te.ANIMATIONTYPE_COLOR4=7;te.ANIMATIONTYPE_VECTOR2=5;te.ANIMATIONTYPE_SIZE=6;te.ANIMATIONLOOPMODE_RELATIVE=0;te.ANIMATIONLOOPMODE_CYCLE=1;te.ANIMATIONLOOPMODE_CONSTANT=2;te.ANIMATIONLOOPMODE_YOYO=4;te.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT=5;te.CreateFromSnippetAsync=te.ParseFromSnippetAsync;vt("BABYLON.Animation",te);bt._AnimationRangeFactory=(a,e,t)=>new qr(a,e,t);class Ns{constructor(){this.transitionDuration=450,this.lowerRadiusTransitionRange=2,this.upperRadiusTransitionRange=-2,this._autoTransitionRange=!1,this._radiusIsAnimating=!1,this._radiusBounceTransition=null,this._animatables=new Array}get name(){return"Bouncing"}get autoTransitionRange(){return this._autoTransitionRange}set autoTransitionRange(e){if(this._autoTransitionRange===e)return;this._autoTransitionRange=e;const t=this._attachedCamera;t&&(e?this._onMeshTargetChangedObserver=t.onMeshTargetChangedObservable.add(i=>{if(i&&(i.computeWorldMatrix(!0),i.getBoundingInfo)){const s=i.getBoundingInfo().diagonalLength;this.lowerRadiusTransitionRange=s*.05,this.upperRadiusTransitionRange=s*.05}}):this._onMeshTargetChangedObserver&&t.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver))}init(){}attach(e){this._attachedCamera=e,this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(()=>{this._attachedCamera&&(this._isRadiusAtLimit(this._attachedCamera.lowerRadiusLimit)&&this._applyBoundRadiusAnimation(this.lowerRadiusTransitionRange),this._isRadiusAtLimit(this._attachedCamera.upperRadiusLimit)&&this._applyBoundRadiusAnimation(this.upperRadiusTransitionRange))})}detach(){this._attachedCamera&&(this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null)}_isRadiusAtLimit(e){return this._attachedCamera?this._attachedCamera.radius===e&&!this._radiusIsAnimating:!1}_applyBoundRadiusAnimation(e){if(!this._attachedCamera)return;this._radiusBounceTransition||(Ns.EasingFunction.setEasingMode(Ns.EasingMode),this._radiusBounceTransition=te.CreateAnimation("radius",te.ANIMATIONTYPE_FLOAT,60,Ns.EasingFunction)),this._cachedWheelPrecision=this._attachedCamera.wheelPrecision,this._attachedCamera.wheelPrecision=1/0,this._attachedCamera.inertialRadiusOffset=0,this.stopAllAnimations(),this._radiusIsAnimating=!0;const t=te.TransitionTo("radius",this._attachedCamera.radius+e,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusBounceTransition,this.transitionDuration,()=>this._clearAnimationLocks());t&&this._animatables.push(t)}_clearAnimationLocks(){this._radiusIsAnimating=!1,this._attachedCamera&&(this._attachedCamera.wheelPrecision=this._cachedWheelPrecision)}stopAllAnimations(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0].onAnimationEnd=null,this._animatables[0].stop(),this._animatables.shift()}}Ns.EasingFunction=new gg(.3);Ns.EasingMode=wi.EASINGMODE_EASEOUT;class jt{constructor(){this.onTargetFramingAnimationEndObservable=new Z,this._mode=jt.FitFrustumSidesMode,this._radiusScale=1,this._positionScale=.5,this._defaultElevation=.3,this._elevationReturnTime=1500,this._elevationReturnWaitTime=1e3,this._zoomStopsAnimation=!1,this._framingTime=1500,this.autoCorrectCameraLimitsAndSensibility=!0,this._isPointerDown=!1,this._lastInteractionTime=-1/0,this._animatables=new Array,this._betaIsAnimating=!1}get name(){return"Framing"}set mode(e){this._mode=e}get mode(){return this._mode}set radiusScale(e){this._radiusScale=e}get radiusScale(){return this._radiusScale}set positionScale(e){this._positionScale=e}get positionScale(){return this._positionScale}set defaultElevation(e){this._defaultElevation=e}get defaultElevation(){return this._defaultElevation}set elevationReturnTime(e){this._elevationReturnTime=e}get elevationReturnTime(){return this._elevationReturnTime}set elevationReturnWaitTime(e){this._elevationReturnWaitTime=e}get elevationReturnWaitTime(){return this._elevationReturnWaitTime}set zoomStopsAnimation(e){this._zoomStopsAnimation=e}get zoomStopsAnimation(){return this._zoomStopsAnimation}set framingTime(e){this._framingTime=e}get framingTime(){return this._framingTime}init(){}attach(e){this._attachedCamera=e;const t=this._attachedCamera.getScene();jt.EasingFunction.setEasingMode(jt.EasingMode),this._onPrePointerObservableObserver=t.onPrePointerObservable.add(i=>{if(i.type===Ce.POINTERDOWN){this._isPointerDown=!0;return}i.type===Ce.POINTERUP&&(this._isPointerDown=!1)}),this._onMeshTargetChangedObserver=e.onMeshTargetChangedObservable.add(i=>{i&&i.getBoundingInfo&&this.zoomOnMesh(i,void 0,()=>{this.onTargetFramingAnimationEndObservable.notifyObservers()})}),this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(()=>{this._applyUserInteraction(),this._maintainCameraAboveGround()})}detach(){if(!this._attachedCamera)return;const e=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&e.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null}zoomOnMesh(e,t=!1,i=null){e.computeWorldMatrix(!0);const s=e.getBoundingInfo().boundingBox;this.zoomOnBoundingInfo(s.minimumWorld,s.maximumWorld,t,i)}zoomOnMeshHierarchy(e,t=!1,i=null){e.computeWorldMatrix(!0);const s=e.getHierarchyBoundingVectors(!0);this.zoomOnBoundingInfo(s.min,s.max,t,i)}zoomOnMeshesHierarchy(e,t=!1,i=null){const s=new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),n=new v(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let r=0;r{this.stopAllAnimations(),s&&s(),this._attachedCamera&&this._attachedCamera.useInputToRestoreState&&this._attachedCamera.storeState()}),c&&this._animatables.push(c),!0}_calculateLowerRadiusFromModelBoundingSphere(e,t){const i=this._attachedCamera;if(!i)return 0;let s=i._calculateLowerRadiusFromModelBoundingSphere(e,t,this._radiusScale);return i.lowerRadiusLimit&&this._mode===jt.IgnoreBoundsSizeMode&&(s=si.upperRadiusLimit?i.upperRadiusLimit:s),s}_maintainCameraAboveGround(){if(this._elevationReturnTime<0)return;const e=bi.Now-this._lastInteractionTime,t=Math.PI*.5-this._defaultElevation,i=Math.PI*.5;if(this._attachedCamera&&!this._betaIsAnimating&&this._attachedCamera.beta>i&&e>=this._elevationReturnWaitTime){this._betaIsAnimating=!0,this.stopAllAnimations(),this._betaTransition||(this._betaTransition=te.CreateAnimation("beta",te.ANIMATIONTYPE_FLOAT,60,jt.EasingFunction));const s=te.TransitionTo("beta",t,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,()=>{this._clearAnimationLocks(),this.stopAllAnimations()});s&&this._animatables.push(s)}}_clearAnimationLocks(){this._betaIsAnimating=!1}_applyUserInteraction(){this.isUserIsMoving&&(this._lastInteractionTime=bi.Now,this.stopAllAnimations(),this._clearAnimationLocks())}stopAllAnimations(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0]&&(this._animatables[0].onAnimationEnd=null,this._animatables[0].stop()),this._animatables.shift()}get isUserIsMoving(){return this._attachedCamera?this._attachedCamera.inertialAlphaOffset!==0||this._attachedCamera.inertialBetaOffset!==0||this._attachedCamera.inertialRadiusOffset!==0||this._attachedCamera.inertialPanningX!==0||this._attachedCamera.inertialPanningY!==0||this._isPointerDown:!1}}jt.EasingFunction=new mg;jt.EasingMode=wi.EASINGMODE_EASEINOUT;jt.IgnoreBoundsSizeMode=0;jt.FitFrustumSidesMode=1;bt.AddNodeConstructor("TargetCamera",(a,e)=>()=>new wt(a,v.Zero(),e));class wt extends ve{constructor(e,t,i,s=!0){super(e,t,i,s),this._tmpUpVector=v.Zero(),this._tmpTargetVector=v.Zero(),this.cameraDirection=new v(0,0,0),this.cameraRotation=new oe(0,0),this.ignoreParentScaling=!1,this.updateUpVectorFromRotation=!1,this._tmpQuaternion=new re,this.rotation=new v(0,0,0),this.speed=2,this.noRotationConstraint=!1,this.invertRotation=!1,this.inverseRotationSpeed=.2,this.lockedTarget=null,this._currentTarget=v.Zero(),this._initialFocalDistance=1,this._viewMatrix=O.Zero(),this._camMatrix=O.Zero(),this._cameraTransformMatrix=O.Zero(),this._cameraRotationMatrix=O.Zero(),this._referencePoint=new v(0,0,1),this._transformedReferencePoint=v.Zero(),this._deferredPositionUpdate=new v,this._deferredRotationQuaternionUpdate=new re,this._deferredRotationUpdate=new v,this._deferredUpdated=!1,this._deferOnly=!1,this._defaultUp=v.Up(),this._cachedRotationZ=0,this._cachedQuaternionRotationZ=0}getFrontPosition(e){this.getWorldMatrix();const t=this.getTarget().subtract(this.position);return t.normalize(),t.scaleInPlace(e),this.globalPosition.add(t)}_getLockedTargetPosition(){if(!this.lockedTarget)return null;if(this.lockedTarget.absolutePosition){const e=this.lockedTarget;e.computeWorldMatrix().getTranslationToRef(e.absolutePosition)}return this.lockedTarget.absolutePosition||this.lockedTarget}storeState(){return this._storedPosition=this.position.clone(),this._storedRotation=this.rotation.clone(),this.rotationQuaternion&&(this._storedRotationQuaternion=this.rotationQuaternion.clone()),super.storeState()}_restoreStateValues(){return super._restoreStateValues()?(this.position=this._storedPosition.clone(),this.rotation=this._storedRotation.clone(),this.rotationQuaternion&&(this.rotationQuaternion=this._storedRotationQuaternion.clone()),this.cameraDirection.copyFromFloats(0,0,0),this.cameraRotation.copyFromFloats(0,0),!0):!1}_initCache(){super._initCache(),this._cache.lockedTarget=new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new re(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)}_updateCache(e){e||super._updateCache();const t=this._getLockedTargetPosition();t?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(t):this._cache.lockedTarget=t.clone():this._cache.lockedTarget=null,this._cache.rotation.copyFrom(this.rotation),this.rotationQuaternion&&this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)}_isSynchronizedViewMatrix(){if(!super._isSynchronizedViewMatrix())return!1;const e=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(e):!e)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))}_computeLocalCameraSpeed(){const e=this.getEngine();return this.speed*Math.sqrt(e.getDeltaTime()/(e.getFps()*100))}setTarget(e){this.upVector.normalize(),this._initialFocalDistance=e.subtract(this.position).length(),this.position.z===e.z&&(this.position.z+=Le),this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance),O.LookAtLHToRef(this.position,e,this._defaultUp,this._camMatrix),this._camMatrix.invert(),this.rotation.x=Math.atan(this._camMatrix.m[6]/this._camMatrix.m[10]);const t=e.subtract(this.position);t.x>=0?this.rotation.y=-Math.atan(t.z/t.x)+Math.PI/2:this.rotation.y=-Math.atan(t.z/t.x)-Math.PI/2,this.rotation.z=0,isNaN(this.rotation.x)&&(this.rotation.x=0),isNaN(this.rotation.y)&&(this.rotation.y=0),isNaN(this.rotation.z)&&(this.rotation.z=0),this.rotationQuaternion&&re.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this.rotationQuaternion)}get target(){return this.getTarget()}set target(e){this.setTarget(e)}getTarget(){return this._currentTarget}_decideIfNeedsToMove(){return Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){if(this.parent){this.parent.getWorldMatrix().invertToRef(N.Matrix[0]),v.TransformNormalToRef(this.cameraDirection,N.Matrix[0],N.Vector3[0]),this._deferredPositionUpdate.addInPlace(N.Vector3[0]),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate);return}this._deferredPositionUpdate.addInPlace(this.cameraDirection),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate)}_checkInputs(){const e=this.invertRotation?-this.inverseRotationSpeed:1,t=this._decideIfNeedsToMove(),i=this.cameraRotation.x||this.cameraRotation.y;this._deferredUpdated=!1,this._deferredRotationUpdate.copyFrom(this.rotation),this._deferredPositionUpdate.copyFrom(this.position),this.rotationQuaternion&&this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion),t&&this._updatePosition(),i&&(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate),this._deferredRotationUpdate.x+=this.cameraRotation.x*e,this._deferredRotationUpdate.y+=this.cameraRotation.y*e,this.noRotationConstraint||(this._deferredRotationUpdate.x>1.570796&&(this._deferredRotationUpdate.x=1.570796),this._deferredRotationUpdate.x<-1.570796&&(this._deferredRotationUpdate.x=-1.570796)),this._deferOnly?this._deferredUpdated=!0:this.rotation.copyFrom(this._deferredRotationUpdate),this.rotationQuaternion&&this._deferredRotationUpdate.lengthSquared()&&(re.RotationYawPitchRollToRef(this._deferredRotationUpdate.y,this._deferredRotationUpdate.x,this._deferredRotationUpdate.z,this._deferredRotationQuaternionUpdate),this._deferOnly?this._deferredUpdated=!0:this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate))),t&&(Math.abs(this.cameraDirection.x){}}add(e){const t=e.getSimpleName();if(this.attached[t]){U.Warn("camera input of type "+t+" already exists on camera");return}this.attached[t]=e,e.camera=this.camera,e.checkInputs&&(this.checkInputs=this._addCheckInputs(e.checkInputs.bind(e))),this.attachedToElement&&e.attachControl(this.noPreventDefault)}remove(e){for(const t in this.attached){const i=this.attached[t];if(i===e){i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck();return}}}removeByType(e){for(const t in this.attached){const i=this.attached[t];i.getClassName()===e&&(i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck())}}_addCheckInputs(e){const t=this.checkInputs;return()=>{t(),e()}}attachInput(e){this.attachedToElement&&e.attachControl(this.noPreventDefault)}attachElement(e=!1){if(!this.attachedToElement){e=ve.ForceAttachControlToAlwaysPreventDefault?!1:e,this.attachedToElement=!0,this.noPreventDefault=e;for(const t in this.attached)this.attached[t].attachControl(e)}}detachElement(e=!1){for(const t in this.attached)this.attached[t].detachControl(),e&&(this.attached[t].camera=null);this.attachedToElement=!1}rebuildInputCheck(){this.checkInputs=()=>{};for(const e in this.attached){const t=this.attached[e];t.checkInputs&&(this.checkInputs=this._addCheckInputs(t.checkInputs.bind(t)))}}clear(){this.attachedToElement&&this.detachElement(!0),this.attached={},this.attachedToElement=!1,this.checkInputs=()=>{}}serialize(e){const t={};for(const i in this.attached){const s=this.attached[i],n=Ae.Serialize(s);t[s.getClassName()]=n}e.inputsmgr=t}parse(e){const t=e.inputsmgr;if(t){this.clear();for(const i in t){const s=Un[i];if(s){const n=t[i],r=Ae.Parse(()=>new s,n,null);this.add(r)}}}else for(const i in this.attached){const s=Un[this.attached[i].getClassName()];if(s){const n=Ae.Parse(()=>new s,e,null);this.remove(this.attached[i]),this.add(n)}}}}class kc{constructor(){this._currentActiveButton=-1,this.buttons=[0,1,2]}attachControl(e){e=J.BackCompatCameraNoPreventDefault(arguments);const t=this.camera.getEngine(),i=t.getInputElement();let s=0,n=null;this._pointA=null,this._pointB=null,this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._pointerInput=o=>{var u,f;const h=o.event,l=h.pointerType==="touch";if(o.type!==Ce.POINTERMOVE&&this.buttons.indexOf(h.button)===-1)return;const c=h.target;if(this._altKey=h.altKey,this._ctrlKey=h.ctrlKey,this._metaKey=h.metaKey,this._shiftKey=h.shiftKey,this._buttonsPressed=h.buttons,t.isPointerLock){const d=h.movementX,_=h.movementY;this.onTouch(null,d,_),this._pointA=null,this._pointB=null}else{if(o.type!==Ce.POINTERDOWN&&o.type!==Ce.POINTERDOUBLETAP&&l&&((u=this._pointA)==null?void 0:u.pointerId)!==h.pointerId&&((f=this._pointB)==null?void 0:f.pointerId)!==h.pointerId)return;if(o.type===Ce.POINTERDOWN&&(this._currentActiveButton===-1||l)){try{c==null||c.setPointerCapture(h.pointerId)}catch{}if(this._pointA===null)this._pointA={x:h.clientX,y:h.clientY,pointerId:h.pointerId,type:h.pointerType};else if(this._pointB===null)this._pointB={x:h.clientX,y:h.clientY,pointerId:h.pointerId,type:h.pointerType};else return;this._currentActiveButton===-1&&!l&&(this._currentActiveButton=h.button),this.onButtonDown(h),e||(h.preventDefault(),i&&i.focus())}else if(o.type===Ce.POINTERDOUBLETAP)this.onDoubleTap(h.pointerType);else if(o.type===Ce.POINTERUP&&(this._currentActiveButton===h.button||l)){try{c==null||c.releasePointerCapture(h.pointerId)}catch{}l||(this._pointB=null),t._badOS?this._pointA=this._pointB=null:this._pointB&&this._pointA&&this._pointA.pointerId==h.pointerId?(this._pointA=this._pointB,this._pointB=null):this._pointA&&this._pointB&&this._pointB.pointerId==h.pointerId?this._pointB=null:this._pointA=this._pointB=null,(s!==0||n)&&(this.onMultiTouch(this._pointA,this._pointB,s,0,n,null),s=0,n=null),this._currentActiveButton=-1,this.onButtonUp(h),e||h.preventDefault()}else if(o.type===Ce.POINTERMOVE){if(e||h.preventDefault(),this._pointA&&this._pointB===null){const d=h.clientX-this._pointA.x,_=h.clientY-this._pointA.y;this._pointA.x=h.clientX,this._pointA.y=h.clientY,this.onTouch(this._pointA,d,_)}else if(this._pointA&&this._pointB){const d=this._pointA.pointerId===h.pointerId?this._pointA:this._pointB;d.x=h.clientX,d.y=h.clientY;const _=this._pointA.x-this._pointB.x,p=this._pointA.y-this._pointB.y,g=_*_+p*p,m={x:(this._pointA.x+this._pointB.x)/2,y:(this._pointA.y+this._pointB.y)/2,pointerId:h.pointerId,type:o.type};this.onMultiTouch(this._pointA,this._pointB,s,g,n,m),n=m,s=g}}}},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,Ce.POINTERDOWN|Ce.POINTERUP|Ce.POINTERMOVE|Ce.POINTERDOUBLETAP),this._onLostFocus=()=>{this._pointA=this._pointB=null,s=0,n=null,this.onLostFocus()},this._contextMenuBind=o=>this.onContextMenu(o),i&&i.addEventListener("contextmenu",this._contextMenuBind,!1);const r=this.camera.getScene().getEngine().getHostWindow();r&&J.RegisterTopRootEvents(r,[{name:"blur",handler:this._onLostFocus}])}detachControl(){if(this._onLostFocus){const e=this.camera.getScene().getEngine().getHostWindow();e&&J.UnregisterTopRootEvents(e,[{name:"blur",handler:this._onLostFocus}])}if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._contextMenuBind){const e=this.camera.getScene().getEngine().getInputElement();e&&e.removeEventListener("contextmenu",this._contextMenuBind)}this._onLostFocus=null}this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._currentActiveButton=-1}getClassName(){return"BaseCameraPointersInput"}getSimpleName(){return"pointers"}onDoubleTap(e){}onTouch(e,t,i){}onMultiTouch(e,t,i,s,n,r){}onContextMenu(e){e.preventDefault()}onButtonDown(e){}onButtonUp(e){}onLostFocus(){}}D([B()],kc.prototype,"buttons",void 0);class Qt extends kc{constructor(){super(...arguments),this.buttons=[0,1,2],this.angularSensibilityX=1e3,this.angularSensibilityY=1e3,this.pinchPrecision=12,this.pinchDeltaPercentage=0,this.useNaturalPinchZoom=!1,this.pinchZoom=!0,this.panningSensibility=1e3,this.multiTouchPanning=!0,this.multiTouchPanAndZoom=!0,this.pinchInwards=!0,this._isPanClick=!1,this._twoFingerActivityCount=0,this._isPinching=!1}getClassName(){return"ArcRotateCameraPointersInput"}_computeMultiTouchPanning(e,t){if(this.panningSensibility!==0&&e&&t){const i=t.x-e.x,s=t.y-e.y;this.camera.inertialPanningX+=-i/this.panningSensibility,this.camera.inertialPanningY+=s/this.panningSensibility}}_computePinchZoom(e,t){const i=this.camera.radius||Qt.MinimumRadiusForPinch;this.useNaturalPinchZoom?this.camera.radius=i*Math.sqrt(e)/Math.sqrt(t):this.pinchDeltaPercentage?this.camera.inertialRadiusOffset+=(t-e)*.001*i*this.pinchDeltaPercentage:this.camera.inertialRadiusOffset+=(t-e)/(this.pinchPrecision*(this.pinchInwards?1:-1)*(this.angularSensibilityX+this.angularSensibilityY)/2)}onTouch(e,t,i){this.panningSensibility!==0&&(this._ctrlKey&&this.camera._useCtrlForPanning||this._isPanClick)?(this.camera.inertialPanningX+=-t/this.panningSensibility,this.camera.inertialPanningY+=i/this.panningSensibility):(this.camera.inertialAlphaOffset-=t/this.angularSensibilityX,this.camera.inertialBetaOffset-=i/this.angularSensibilityY)}onDoubleTap(){this.camera.useInputToRestoreState&&this.camera.restoreState()}onMultiTouch(e,t,i,s,n,r){i===0&&n===null||s===0&&r===null||(this.multiTouchPanAndZoom?(this._computePinchZoom(i,s),this._computeMultiTouchPanning(n,r)):this.multiTouchPanning&&this.pinchZoom?(this._twoFingerActivityCount++,this._isPinching||this._twoFingerActivityCount<20&&Math.abs(Math.sqrt(s)-Math.sqrt(i))>this.camera.pinchToPanMaxDistance?(this._computePinchZoom(i,s),this._isPinching=!0):this._computeMultiTouchPanning(n,r)):this.multiTouchPanning?this._computeMultiTouchPanning(n,r):this.pinchZoom&&this._computePinchZoom(i,s))}onButtonDown(e){this._isPanClick=e.button===this.camera._panningMouseButton}onButtonUp(e){this._twoFingerActivityCount=0,this._isPinching=!1}onLostFocus(){this._isPanClick=!1,this._twoFingerActivityCount=0,this._isPinching=!1}}Qt.MinimumRadiusForPinch=.001;D([B()],Qt.prototype,"buttons",void 0);D([B()],Qt.prototype,"angularSensibilityX",void 0);D([B()],Qt.prototype,"angularSensibilityY",void 0);D([B()],Qt.prototype,"pinchPrecision",void 0);D([B()],Qt.prototype,"pinchDeltaPercentage",void 0);D([B()],Qt.prototype,"useNaturalPinchZoom",void 0);D([B()],Qt.prototype,"pinchZoom",void 0);D([B()],Qt.prototype,"panningSensibility",void 0);D([B()],Qt.prototype,"multiTouchPanning",void 0);D([B()],Qt.prototype,"multiTouchPanAndZoom",void 0);Un.ArcRotateCameraPointersInput=Qt;class Fi{constructor(){this.keysUp=[38],this.keysDown=[40],this.keysLeft=[37],this.keysRight=[39],this.keysReset=[220],this.panningSensibility=50,this.zoomingSensibility=25,this.useAltToZoom=!0,this.angularSpeed=.01,this._keys=new Array}attachControl(e){e=J.BackCompatCameraNoPreventDefault(arguments),!this._onCanvasBlurObserver&&(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(t=>{const i=t.event;if(!i.metaKey){if(t.type===Nn.KEYDOWN)this._ctrlPressed=i.ctrlKey,this._altPressed=i.altKey,(this.keysUp.indexOf(i.keyCode)!==-1||this.keysDown.indexOf(i.keyCode)!==-1||this.keysLeft.indexOf(i.keyCode)!==-1||this.keysRight.indexOf(i.keyCode)!==-1||this.keysReset.indexOf(i.keyCode)!==-1)&&(this._keys.indexOf(i.keyCode)===-1&&this._keys.push(i.keyCode),i.preventDefault&&(e||i.preventDefault()));else if(this.keysUp.indexOf(i.keyCode)!==-1||this.keysDown.indexOf(i.keyCode)!==-1||this.keysLeft.indexOf(i.keyCode)!==-1||this.keysRight.indexOf(i.keyCode)!==-1||this.keysReset.indexOf(i.keyCode)!==-1){const s=this._keys.indexOf(i.keyCode);s>=0&&this._keys.splice(s,1),i.preventDefault&&(e||i.preventDefault())}}}))}detachControl(){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){if(this._onKeyboardObserver){const e=this.camera;for(let t=0;t0?i=s/(1+this.wheelDeltaPercentage):i=s*(1+this.wheelDeltaPercentage),i}attachControl(e){e=J.BackCompatCameraNoPreventDefault(arguments),this._wheel=t=>{if(t.type!==Ce.POINTERWHEEL)return;const i=t.event;let s=0;const n=i.deltaMode===jn.DOM_DELTA_LINE?Ig:1,r=-(i.deltaY*n);if(this.customComputeDeltaFromMouseWheel)s=this.customComputeDeltaFromMouseWheel(r,this,i);else if(this.wheelDeltaPercentage){if(s=this._computeDeltaFromMouseWheelLegacyEvent(r,this.camera.radius),s>0){let o=this.camera.radius,h=this.camera.inertialRadiusOffset+s;for(let l=0;l<20&&Math.abs(h)>.001;l++)o-=h,h*=this.camera.inertia;o=ht(o,0,Number.MAX_VALUE),s=this._computeDeltaFromMouseWheelLegacyEvent(r,o)}}else s=r/(this.wheelPrecision*40);s&&(this.zoomToMouseLocation?(this._hitPlane||this._updateHitPlane(),this._zoomToMouse(s)):this.camera.inertialRadiusOffset+=s),i.preventDefault&&(e||i.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,Ce.POINTERWHEEL),this.zoomToMouseLocation&&this._inertialPanning.setAll(0)}detachControl(){this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null)}checkInputs(){if(!this.zoomToMouseLocation)return;const e=this.camera;0+e.inertialAlphaOffset+e.inertialBetaOffset+e.inertialRadiusOffset&&(this._updateHitPlane(),e.target.addInPlace(this._inertialPanning),this._inertialPanning.scaleInPlace(e.inertia),this._zeroIfClose(this._inertialPanning))}getClassName(){return"ArcRotateCameraMouseWheelInput"}getSimpleName(){return"mousewheel"}_updateHitPlane(){const e=this.camera,t=e.target.subtract(e.position);this._hitPlane=Xt.FromPositionAndNormal(e.target,t)}_getPosition(){var n;const e=this.camera,t=e.getScene(),i=t.createPickingRay(t.pointerX,t.pointerY,O.Identity(),e,!1);(e.targetScreenOffset.x!==0||e.targetScreenOffset.y!==0)&&(this._viewOffset.set(e.targetScreenOffset.x,e.targetScreenOffset.y,0),e.getViewMatrix().invertToRef(e._cameraTransformMatrix),this._globalOffset=v.TransformNormal(this._viewOffset,e._cameraTransformMatrix),i.origin.addInPlace(this._globalOffset));let s=0;return this._hitPlane&&(s=(n=i.intersectsPlane(this._hitPlane))!=null?n:0),i.origin.addInPlace(i.direction.scaleInPlace(s))}_zoomToMouse(e){var h,l;const t=this.camera,i=1-t.inertia;if(t.lowerRadiusLimit){const c=(h=t.lowerRadiusLimit)!=null?h:0;t.radius-(t.inertialRadiusOffset+e)/ic&&(e=(t.radius-c)*i-t.inertialRadiusOffset)}const n=e/i/t.radius,r=this._getPosition(),o=N.Vector3[6];r.subtractToRef(t.target,o),o.scaleInPlace(n),o.scaleInPlace(i),this._inertialPanning.addInPlace(o),t.inertialRadiusOffset+=e}_zeroIfClose(e){Math.abs(e.x)()=>new tt(a,0,0,1,v.Zero(),e));class tt extends wt{get target(){return this._target}set target(e){this.setTarget(e)}get targetHost(){return this._targetHost}set targetHost(e){e&&this.setTarget(e)}getTarget(){return this.target}get position(){return this._position}set position(e){this.setPosition(e)}set upVector(e){this._upToYMatrix||(this._yToUpMatrix=new O,this._upToYMatrix=new O,this._upVector=v.Zero()),e.normalize(),this._upVector.copyFrom(e),this.setMatUp()}get upVector(){return this._upVector}setMatUp(){O.RotationAlignToRef(v.UpReadOnly,this._upVector,this._yToUpMatrix),O.RotationAlignToRef(this._upVector,v.UpReadOnly,this._upToYMatrix)}get angularSensibilityX(){const e=this.inputs.attached.pointers;return e?e.angularSensibilityX:0}set angularSensibilityX(e){const t=this.inputs.attached.pointers;t&&(t.angularSensibilityX=e)}get angularSensibilityY(){const e=this.inputs.attached.pointers;return e?e.angularSensibilityY:0}set angularSensibilityY(e){const t=this.inputs.attached.pointers;t&&(t.angularSensibilityY=e)}get pinchPrecision(){const e=this.inputs.attached.pointers;return e?e.pinchPrecision:0}set pinchPrecision(e){const t=this.inputs.attached.pointers;t&&(t.pinchPrecision=e)}get pinchDeltaPercentage(){const e=this.inputs.attached.pointers;return e?e.pinchDeltaPercentage:0}set pinchDeltaPercentage(e){const t=this.inputs.attached.pointers;t&&(t.pinchDeltaPercentage=e)}get useNaturalPinchZoom(){const e=this.inputs.attached.pointers;return e?e.useNaturalPinchZoom:!1}set useNaturalPinchZoom(e){const t=this.inputs.attached.pointers;t&&(t.useNaturalPinchZoom=e)}get panningSensibility(){const e=this.inputs.attached.pointers;return e?e.panningSensibility:0}set panningSensibility(e){const t=this.inputs.attached.pointers;t&&(t.panningSensibility=e)}get keysUp(){const e=this.inputs.attached.keyboard;return e?e.keysUp:[]}set keysUp(e){const t=this.inputs.attached.keyboard;t&&(t.keysUp=e)}get keysDown(){const e=this.inputs.attached.keyboard;return e?e.keysDown:[]}set keysDown(e){const t=this.inputs.attached.keyboard;t&&(t.keysDown=e)}get keysLeft(){const e=this.inputs.attached.keyboard;return e?e.keysLeft:[]}set keysLeft(e){const t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)}get keysRight(){const e=this.inputs.attached.keyboard;return e?e.keysRight:[]}set keysRight(e){const t=this.inputs.attached.keyboard;t&&(t.keysRight=e)}get wheelPrecision(){const e=this.inputs.attached.mousewheel;return e?e.wheelPrecision:0}set wheelPrecision(e){const t=this.inputs.attached.mousewheel;t&&(t.wheelPrecision=e)}get zoomToMouseLocation(){const e=this.inputs.attached.mousewheel;return e?e.zoomToMouseLocation:!1}set zoomToMouseLocation(e){const t=this.inputs.attached.mousewheel;t&&(t.zoomToMouseLocation=e)}get wheelDeltaPercentage(){const e=this.inputs.attached.mousewheel;return e?e.wheelDeltaPercentage:0}set wheelDeltaPercentage(e){const t=this.inputs.attached.mousewheel;t&&(t.wheelDeltaPercentage=e)}get bouncingBehavior(){return this._bouncingBehavior}get useBouncingBehavior(){return this._bouncingBehavior!=null}set useBouncingBehavior(e){e!==this.useBouncingBehavior&&(e?(this._bouncingBehavior=new Ns,this.addBehavior(this._bouncingBehavior)):this._bouncingBehavior&&(this.removeBehavior(this._bouncingBehavior),this._bouncingBehavior=null))}get framingBehavior(){return this._framingBehavior}get useFramingBehavior(){return this._framingBehavior!=null}set useFramingBehavior(e){e!==this.useFramingBehavior&&(e?(this._framingBehavior=new jt,this.addBehavior(this._framingBehavior)):this._framingBehavior&&(this.removeBehavior(this._framingBehavior),this._framingBehavior=null))}get autoRotationBehavior(){return this._autoRotationBehavior}get useAutoRotationBehavior(){return this._autoRotationBehavior!=null}set useAutoRotationBehavior(e){e!==this.useAutoRotationBehavior&&(e?(this._autoRotationBehavior=new pg,this.addBehavior(this._autoRotationBehavior)):this._autoRotationBehavior&&(this.removeBehavior(this._autoRotationBehavior),this._autoRotationBehavior=null))}constructor(e,t,i,s,n,r,o=!0){super(e,v.Zero(),r,o),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.lowerAlphaLimit=null,this.upperAlphaLimit=null,this.lowerBetaLimit=.01,this.upperBetaLimit=Math.PI-.01,this.lowerRadiusLimit=null,this.upperRadiusLimit=null,this.inertialPanningX=0,this.inertialPanningY=0,this.pinchToPanMaxDistance=20,this.panningDistanceLimit=null,this.panningOriginTarget=v.Zero(),this.panningInertia=.9,this.zoomOnFactor=1,this.targetScreenOffset=oe.Zero(),this.allowUpsideDown=!0,this.useInputToRestoreState=!0,this.restoreStateInterpolationFactor=0,this._viewMatrix=new O,this.panningAxis=new v(1,1,0),this._transformedDirection=new v,this.mapPanning=!1,this._progressiveRestore=!1,this.onMeshTargetChangedObservable=new Z,this.checkCollisions=!1,this.collisionRadius=new v(.5,.5,.5),this._previousPosition=v.Zero(),this._collisionVelocity=v.Zero(),this._newPosition=v.Zero(),this._computationVector=v.Zero(),this._onCollisionPositionChange=(h,l,c=null)=>{c?(this.setPosition(l),this.onCollide&&this.onCollide(c)):this._previousPosition.copyFrom(this._position);const u=Math.cos(this.alpha),f=Math.sin(this.alpha),d=Math.cos(this.beta);let _=Math.sin(this.beta);_===0&&(_=1e-4);const p=this._getTargetPosition();this._computationVector.copyFromFloats(this.radius*u*_,this.radius*d,this.radius*f*_),p.addToRef(this._computationVector,this._newPosition),this._position.copyFrom(this._newPosition);let g=this.upVector;this.allowUpsideDown&&this.beta<0&&(g=g.clone(),g=g.negate()),this._computeViewMatrix(this._position,p,g),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y),this._collisionTriggered=!1},this._target=v.Zero(),n&&this.setTarget(n),this.alpha=t,this.beta=i,this.radius=s,this.getViewMatrix(),this.inputs=new Eg(this),this.inputs.addKeyboard().addMouseWheel().addPointers()}_initCache(){super._initCache(),this._cache._target=new v(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.alpha=void 0,this._cache.beta=void 0,this._cache.radius=void 0,this._cache.targetScreenOffset=oe.Zero()}_updateCache(e){e||super._updateCache(),this._cache._target.copyFrom(this._getTargetPosition()),this._cache.alpha=this.alpha,this._cache.beta=this.beta,this._cache.radius=this.radius,this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset)}_getTargetPosition(){if(this._targetHost&&this._targetHost.getAbsolutePosition){const t=this._targetHost.getAbsolutePosition();this._targetBoundingCenter?t.addToRef(this._targetBoundingCenter,this._target):this._target.copyFrom(t)}const e=this._getLockedTargetPosition();return e||this._target}storeState(){return this._storedAlpha=this._goalAlpha=this.alpha,this._storedBeta=this._goalBeta=this.beta,this._storedRadius=this._goalRadius=this.radius,this._storedTarget=this._goalTarget=this._getTargetPosition().clone(),this._storedTargetScreenOffset=this._goalTargetScreenOffset=this.targetScreenOffset.clone(),super.storeState()}_restoreStateValues(){return this.hasStateStored()&&this.restoreStateInterpolationFactor>Le&&this.restoreStateInterpolationFactor<1?(this.interpolateTo(this._storedAlpha,this._storedBeta,this._storedRadius,this._storedTarget,this._storedTargetScreenOffset),!0):super._restoreStateValues()?(this.setTarget(this._storedTarget.clone()),this.alpha=this._storedAlpha,this.beta=this._storedBeta,this.radius=this._storedRadius,this.targetScreenOffset=this._storedTargetScreenOffset.clone(),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,!0):!1}interpolateTo(e=this.alpha,t=this.beta,i=this.radius,s=this.target,n=this.targetScreenOffset){var r,o,h,l,c,u;this._progressiveRestore=!0,this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,e=ht(e,(r=this.lowerAlphaLimit)!=null?r:-1/0,(o=this.upperAlphaLimit)!=null?o:1/0),t=ht(t,(h=this.lowerBetaLimit)!=null?h:-1/0,(l=this.upperBetaLimit)!=null?l:1/0),i=ht(i,(c=this.lowerRadiusLimit)!=null?c:-1/0,(u=this.upperRadiusLimit)!=null?u:1/0),this._goalAlpha=e,this._goalBeta=t,this._goalRadius=i,this._goalTarget=s,this._goalTargetScreenOffset=n}_isSynchronizedViewMatrix(){return super._isSynchronizedViewMatrix()?this._cache._target.equals(this._getTargetPosition())&&this._cache.alpha===this.alpha&&this._cache.beta===this.beta&&this._cache.radius===this.radius&&this._cache.targetScreenOffset.equals(this.targetScreenOffset):!1}attachControl(e,t,i=!0,s=2){const n=arguments;t=J.BackCompatCameraNoPreventDefault(n),this._useCtrlForPanning=i,this._panningMouseButton=s,typeof n[0]=="boolean"&&(n.length>1&&(this._useCtrlForPanning=n[1]),n.length>2&&(this._panningMouseButton=n[2])),this.inputs.attachElement(t),this._reset=()=>{this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0}}detachControl(){this.inputs.detachElement(),this._reset&&this._reset()}_checkInputs(){if(!this._collisionTriggered){if(this.inputs.checkInputs(),this._progressiveRestore){const e=this._scene.getEngine().getDeltaTime()/1e3,t=1-Math.pow(2,-e/this.restoreStateInterpolationFactor);this.setTarget(v.Lerp(this.getTarget(),this._goalTarget,t)),re.RotationAlphaBetaGammaToRef(this._goalAlpha,this._goalBeta,0,N.Quaternion[0]),re.RotationAlphaBetaGammaToRef(this.alpha,this.beta,0,N.Quaternion[1]),re.SlerpToRef(N.Quaternion[1],N.Quaternion[0],t,N.Quaternion[2]),N.Quaternion[2].normalize(),N.Quaternion[2].toAlphaBetaGammaToRef(N.Vector3[0]),this.alpha=N.Vector3[0].x,this.beta=N.Vector3[0].y,this.radius+=(this._goalRadius-this.radius)*t,oe.LerpToRef(this.targetScreenOffset,this._goalTargetScreenOffset,t,this.targetScreenOffset),(v.DistanceSquared(this.getTarget(),this._goalTarget)Math.PI&&(this.beta=this.beta-2*Math.PI):this.betathis.upperBetaLimit&&(this.beta=this.upperBetaLimit),this.lowerAlphaLimit!==null&&this.alphathis.upperAlphaLimit&&(this.alpha=this.upperAlphaLimit),this.lowerRadiusLimit!==null&&this.radiusthis.upperRadiusLimit&&(this.radius=this.upperRadiusLimit,this.inertialRadiusOffset=0)}rebuildAnglesAndRadius(){this._position.subtractToRef(this._getTargetPosition(),this._computationVector),(this._upVector.x!==0||this._upVector.y!==1||this._upVector.z!==0)&&v.TransformCoordinatesToRef(this._computationVector,this._upToYMatrix,this._computationVector),this.radius=this._computationVector.length(),this.radius===0&&(this.radius=1e-4);const e=this.alpha;this._computationVector.x===0&&this._computationVector.z===0?this.alpha=Math.PI/2:this.alpha=Math.acos(this._computationVector.x/Math.sqrt(Math.pow(this._computationVector.x,2)+Math.pow(this._computationVector.z,2))),this._computationVector.z<0&&(this.alpha=2*Math.PI-this.alpha);const t=Math.round((e-this.alpha)/(2*Math.PI));this.alpha+=t*2*Math.PI,this.beta=Math.acos(this._computationVector.y/this.radius),this._checkLimits()}setPosition(e){this._position.equals(e)||(this._position.copyFrom(e),this.rebuildAnglesAndRadius())}setTarget(e,t=!1,i=!1,s=!1){var n;if(s=(n=this.overrideCloneAlphaBetaRadius)!=null?n:s,e.computeWorldMatrix)t&&e.getBoundingInfo?this._targetBoundingCenter=e.getBoundingInfo().boundingBox.centerWorld.clone():this._targetBoundingCenter=null,e.computeWorldMatrix(),this._targetHost=e,this._target=this._getTargetPosition(),this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);else{const r=e,o=this._getTargetPosition();if(o&&!i&&o.equals(r))return;this._targetHost=null,this._target=r,this._targetBoundingCenter=null,this.onMeshTargetChangedObservable.notifyObservers(null)}s||this.rebuildAnglesAndRadius()}_getViewMatrix(){const e=Math.cos(this.alpha),t=Math.sin(this.alpha),i=Math.cos(this.beta);let s=Math.sin(this.beta);s===0&&(s=1e-4),this.radius===0&&(this.radius=1e-4);const n=this._getTargetPosition();if(this._computationVector.copyFromFloats(this.radius*e*s,this.radius*i,this.radius*t*s),(this._upVector.x!==0||this._upVector.y!==1||this._upVector.z!==0)&&v.TransformCoordinatesToRef(this._computationVector,this._yToUpMatrix,this._computationVector),n.addToRef(this._computationVector,this._newPosition),this.getScene().collisionsEnabled&&this.checkCollisions){const r=this.getScene().collisionCoordinator;this._collider||(this._collider=r.createCollider()),this._collider._radius=this.collisionRadius,this._newPosition.subtractToRef(this._position,this._collisionVelocity),this._collisionTriggered=!0,r.getNewPosition(this._position,this._collisionVelocity,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}else{this._position.copyFrom(this._newPosition);let r=this.upVector;this.allowUpsideDown&&s<0&&(r=r.negate()),this._computeViewMatrix(this._position,n,r),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y)}return this._currentTarget=n,this._viewMatrix}zoomOn(e,t=!1){e=e||this.getScene().meshes;const i=F.MinMax(e);let s=this._calculateLowerRadiusFromModelBoundingSphere(i.min,i.max);s=Math.max(Math.min(s,this.upperRadiusLimit||Number.MAX_VALUE),this.lowerRadiusLimit||0),this.radius=s*this.zoomOnFactor,this.focusOn({min:i.min,max:i.max,distance:s},t)}focusOn(e,t=!1){let i,s;if(e.min===void 0){const n=e||this.getScene().meshes;i=F.MinMax(n),s=v.Distance(i.min,i.max)}else{const n=e;i=n,s=n.distance}this._target=F.Center(i),t||(this.maxZ=s*2)}createRigCamera(e,t){let i=0;switch(this.cameraRigMode){case ve.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case ve.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case ve.RIG_MODE_STEREOSCOPIC_OVERUNDER:case ve.RIG_MODE_STEREOSCOPIC_INTERLACED:case ve.RIG_MODE_VR:i=this._cameraRigParams.stereoHalfAngle*(t===0?1:-1);break;case ve.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:i=this._cameraRigParams.stereoHalfAngle*(t===0?-1:1);break}const s=new tt(e,this.alpha+i,this.beta,this.radius,this._target,this.getScene());return s._cameraRigParams={},s.isRigCamera=!0,s.rigParent=this,s.upVector=this.upVector,s.mode=this.mode,s.orthoLeft=this.orthoLeft,s.orthoRight=this.orthoRight,s.orthoBottom=this.orthoBottom,s.orthoTop=this.orthoTop,s}_updateRigCameras(){const e=this._rigCameras[0],t=this._rigCameras[1];switch(e.beta=t.beta=this.beta,this.cameraRigMode){case ve.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case ve.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case ve.RIG_MODE_STEREOSCOPIC_OVERUNDER:case ve.RIG_MODE_STEREOSCOPIC_INTERLACED:case ve.RIG_MODE_VR:e.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle,t.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle;break;case ve.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:e.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle,t.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle;break}super._updateRigCameras()}_calculateLowerRadiusFromModelBoundingSphere(e,t,i=1){const s=v.Distance(e,t),r=this.getScene().getEngine().getAspectRatio(this),o=Math.tan(this.fov/2),h=o*r,c=s*.5*i,u=c*Math.sqrt(1+1/(h*h)),f=c*Math.sqrt(1+1/(o*o));return Math.max(u,f)}dispose(){this.inputs.clear(),super.dispose()}getClassName(){return"ArcRotateCamera"}}D([B()],tt.prototype,"alpha",void 0);D([B()],tt.prototype,"beta",void 0);D([B()],tt.prototype,"radius",void 0);D([B()],tt.prototype,"overrideCloneAlphaBetaRadius",void 0);D([yi("target")],tt.prototype,"_target",void 0);D([ic("targetHost")],tt.prototype,"_targetHost",void 0);D([B()],tt.prototype,"inertialAlphaOffset",void 0);D([B()],tt.prototype,"inertialBetaOffset",void 0);D([B()],tt.prototype,"inertialRadiusOffset",void 0);D([B()],tt.prototype,"lowerAlphaLimit",void 0);D([B()],tt.prototype,"upperAlphaLimit",void 0);D([B()],tt.prototype,"lowerBetaLimit",void 0);D([B()],tt.prototype,"upperBetaLimit",void 0);D([B()],tt.prototype,"lowerRadiusLimit",void 0);D([B()],tt.prototype,"upperRadiusLimit",void 0);D([B()],tt.prototype,"inertialPanningX",void 0);D([B()],tt.prototype,"inertialPanningY",void 0);D([B()],tt.prototype,"pinchToPanMaxDistance",void 0);D([B()],tt.prototype,"panningDistanceLimit",void 0);D([yi()],tt.prototype,"panningOriginTarget",void 0);D([B()],tt.prototype,"panningInertia",void 0);D([B()],tt.prototype,"zoomToMouseLocation",null);D([B()],tt.prototype,"zoomOnFactor",void 0);D([tc()],tt.prototype,"targetScreenOffset",void 0);D([B()],tt.prototype,"allowUpsideDown",void 0);D([B()],tt.prototype,"useInputToRestoreState",void 0);D([B()],tt.prototype,"restoreStateInterpolationFactor",void 0);vt("BABYLON.ArcRotateCamera",tt);class Fe extends bt{get range(){return this._range}set range(e){this._range=e,this._inverseSquaredRange=1/(this.range*this.range)}get intensityMode(){return this._intensityMode}set intensityMode(e){this._intensityMode=e,this._computePhotometricScale()}get radius(){return this._radius}set radius(e){this._radius=e,this._computePhotometricScale()}get shadowEnabled(){return this._shadowEnabled}set shadowEnabled(e){this._shadowEnabled!==e&&(this._shadowEnabled=e,this._markMeshesAsLightDirty())}get includedOnlyMeshes(){return this._includedOnlyMeshes}set includedOnlyMeshes(e){this._includedOnlyMeshes=e,this._hookArrayForIncludedOnly(e)}get excludedMeshes(){return this._excludedMeshes}set excludedMeshes(e){this._excludedMeshes=e,this._hookArrayForExcluded(e)}get excludeWithLayerMask(){return this._excludeWithLayerMask}set excludeWithLayerMask(e){this._excludeWithLayerMask=e,this._resyncMeshes()}get includeOnlyWithLayerMask(){return this._includeOnlyWithLayerMask}set includeOnlyWithLayerMask(e){this._includeOnlyWithLayerMask=e,this._resyncMeshes()}get lightmapMode(){return this._lightmapMode}set lightmapMode(e){this._lightmapMode!==e&&(this._lightmapMode=e,this._markMeshesAsLightDirty())}getViewMatrix(e){return null}getProjectionMatrix(e,t){return null}constructor(e,t){super(e,t,!1),this.diffuse=new de(1,1,1),this.specular=new de(1,1,1),this.falloffType=Fe.FALLOFF_DEFAULT,this.intensity=1,this._range=Number.MAX_VALUE,this._inverseSquaredRange=0,this._photometricScale=1,this._intensityMode=Fe.INTENSITYMODE_AUTOMATIC,this._radius=1e-5,this.renderPriority=0,this._shadowEnabled=!0,this._excludeWithLayerMask=0,this._includeOnlyWithLayerMask=0,this._lightmapMode=0,this._shadowGenerators=null,this._excludedMeshesIds=new Array,this._includedOnlyMeshesIds=new Array,this._isLight=!0,this.getScene().addLight(this),this._uniformBuffer=new fe(this.getScene().getEngine(),void 0,void 0,e),this._buildUniformLayout(),this.includedOnlyMeshes=[],this.excludedMeshes=[],this._resyncMeshes()}transferTexturesToEffect(e,t){return this}_bindLight(e,t,i,s,n=!0){var h;const r=e.toString();let o=!1;if(this._uniformBuffer.bindToEffect(i,"Light"+r),this._renderId!==t.getRenderId()||this._lastUseSpecular!==s||!this._uniformBuffer.useUbo){this._renderId=t.getRenderId(),this._lastUseSpecular=s;const l=this.getScaledIntensity();this.transferToEffect(i,r),this.diffuse.scaleToRef(l,Js.Color3[0]),this._uniformBuffer.updateColor4("vLightDiffuse",Js.Color3[0],this.range,r),s&&(this.specular.scaleToRef(l,Js.Color3[1]),this._uniformBuffer.updateColor4("vLightSpecular",Js.Color3[1],this.radius,r)),o=!0}if(this.transferTexturesToEffect(i,r),t.shadowsEnabled&&this.shadowEnabled&&n){const l=(h=this.getShadowGenerator(t.activeCamera))!=null?h:this.getShadowGenerator();l&&(l.bindShadowLight(r,i),o=!0)}o?this._uniformBuffer.update():this._uniformBuffer.bindUniformBuffer()}getClassName(){return"Light"}toString(e){let t="Name: "+this.name;if(t+=", type: "+["Point","Directional","Spot","Hemispheric"][this.getTypeID()],this.animations)for(let i=0;i0&&this.includedOnlyMeshes.indexOf(e)===-1||this.excludedMeshes&&this.excludedMeshes.length>0&&this.excludedMeshes.indexOf(e)!==-1||this.includeOnlyWithLayerMask!==0&&!(this.includeOnlyWithLayerMask&e.layerMask)||this.excludeWithLayerMask!==0&&this.excludeWithLayerMask&e.layerMask):!0}dispose(e,t=!1){if(this._shadowGenerators){const i=this._shadowGenerators.values();for(let s=i.next();s.done!==!0;s=i.next())s.value.dispose();this._shadowGenerators=null}if(this.getScene().stopAnimation(this),this._parentContainer){const i=this._parentContainer.lights.indexOf(this);i>-1&&this._parentContainer.lights.splice(i,1),this._parentContainer=null}for(const i of this.getScene().meshes)i._removeLightSource(this,!0);this._uniformBuffer.dispose(),this.getScene().removeLight(this),super.dispose(e,t)}getTypeID(){return 0}getScaledIntensity(){return this._photometricScale*this.intensity}clone(e,t=null){const i=Fe.GetConstructorFromName(this.getTypeID(),e,this.getScene());if(!i)return null;const s=Ae.Clone(i,this);return e&&(s.name=e),t&&(s.parent=t),s.setEnabled(this.isEnabled()),this.onClonedObservable.notifyObservers(s),s}serialize(){const e=Ae.Serialize(this);return e.uniqueId=this.uniqueId,e.type=this.getTypeID(),this.parent&&this.parent._serializeAsParent(e),this.excludedMeshes.length>0&&(e.excludedMeshesIds=[],this.excludedMeshes.forEach(t=>{e.excludedMeshesIds.push(t.id)})),this.includedOnlyMeshes.length>0&&(e.includedOnlyMeshesIds=[],this.includedOnlyMeshes.forEach(t=>{e.includedOnlyMeshesIds.push(t.id)})),Ae.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.isEnabled=this.isEnabled(),e}static GetConstructorFromName(e,t,i){const s=bt.Construct("Light_Type_"+e,t,i);return s||null}static Parse(e,t){const i=Fe.GetConstructorFromName(e.type,e.name,t);if(!i)return null;const s=Ae.Parse(i,e,t);if(e.excludedMeshesIds&&(s._excludedMeshesIds=e.excludedMeshesIds),e.includedOnlyMeshesIds&&(s._includedOnlyMeshesIds=e.includedOnlyMeshesIds),e.parentId!==void 0&&(s._waitingParentId=e.parentId),e.parentInstanceIndex!==void 0&&(s._waitingParentInstanceIndex=e.parentInstanceIndex),e.falloffType!==void 0&&(s.falloffType=e.falloffType),e.lightmapMode!==void 0&&(s.lightmapMode=e.lightmapMode),e.animations){for(let n=0;n{const n=t.apply(e,s);for(const r of s)r._resyncLightSource(this);return n};const i=e.splice;e.splice=(s,n)=>{const r=i.apply(e,[s,n]);for(const o of r)o._resyncLightSource(this);return r};for(const s of e)s._resyncLightSource(this)}_hookArrayForIncludedOnly(e){const t=e.push;e.push=(...s)=>{const n=t.apply(e,s);return this._resyncMeshes(),n};const i=e.splice;e.splice=(s,n)=>{const r=i.apply(e,[s,n]);return this._resyncMeshes(),r},this._resyncMeshes()}_resyncMeshes(){for(const e of this.getScene().meshes)e._resyncLightSource(this)}_markMeshesAsLightDirty(){for(const e of this.getScene().meshes)e.lightSources.indexOf(this)!==-1&&e._markSubMeshesAsLightDirty()}_computePhotometricScale(){this._photometricScale=this._getPhotometricScale(),this.getScene().resetCachedMaterial()}_getPhotometricScale(){let e=0;const t=this.getTypeID();let i=this.intensityMode;switch(i===Fe.INTENSITYMODE_AUTOMATIC&&(t===Fe.LIGHTTYPEID_DIRECTIONALLIGHT?i=Fe.INTENSITYMODE_ILLUMINANCE:i=Fe.INTENSITYMODE_LUMINOUSINTENSITY),t){case Fe.LIGHTTYPEID_POINTLIGHT:case Fe.LIGHTTYPEID_SPOTLIGHT:switch(i){case Fe.INTENSITYMODE_LUMINOUSPOWER:e=1/(4*Math.PI);break;case Fe.INTENSITYMODE_LUMINOUSINTENSITY:e=1;break;case Fe.INTENSITYMODE_LUMINANCE:e=this.radius*this.radius;break}break;case Fe.LIGHTTYPEID_DIRECTIONALLIGHT:switch(i){case Fe.INTENSITYMODE_ILLUMINANCE:e=1;break;case Fe.INTENSITYMODE_LUMINANCE:{let s=this.radius;s=Math.max(s,.001),e=2*Math.PI*(1-Math.cos(s));break}}break;case Fe.LIGHTTYPEID_HEMISPHERICLIGHT:e=1;break}return e}_reorderLightsInScene(){const e=this.getScene();this._renderPriority!=0&&(e.requireLightSorting=!0),this.getScene().sortLightsByPriority()}}Fe.FALLOFF_DEFAULT=Xe.FALLOFF_DEFAULT;Fe.FALLOFF_PHYSICAL=Xe.FALLOFF_PHYSICAL;Fe.FALLOFF_GLTF=Xe.FALLOFF_GLTF;Fe.FALLOFF_STANDARD=Xe.FALLOFF_STANDARD;Fe.LIGHTMAP_DEFAULT=Xe.LIGHTMAP_DEFAULT;Fe.LIGHTMAP_SPECULAR=Xe.LIGHTMAP_SPECULAR;Fe.LIGHTMAP_SHADOWSONLY=Xe.LIGHTMAP_SHADOWSONLY;Fe.INTENSITYMODE_AUTOMATIC=Xe.INTENSITYMODE_AUTOMATIC;Fe.INTENSITYMODE_LUMINOUSPOWER=Xe.INTENSITYMODE_LUMINOUSPOWER;Fe.INTENSITYMODE_LUMINOUSINTENSITY=Xe.INTENSITYMODE_LUMINOUSINTENSITY;Fe.INTENSITYMODE_ILLUMINANCE=Xe.INTENSITYMODE_ILLUMINANCE;Fe.INTENSITYMODE_LUMINANCE=Xe.INTENSITYMODE_LUMINANCE;Fe.LIGHTTYPEID_POINTLIGHT=Xe.LIGHTTYPEID_POINTLIGHT;Fe.LIGHTTYPEID_DIRECTIONALLIGHT=Xe.LIGHTTYPEID_DIRECTIONALLIGHT;Fe.LIGHTTYPEID_SPOTLIGHT=Xe.LIGHTTYPEID_SPOTLIGHT;Fe.LIGHTTYPEID_HEMISPHERICLIGHT=Xe.LIGHTTYPEID_HEMISPHERICLIGHT;D([ls()],Fe.prototype,"diffuse",void 0);D([ls()],Fe.prototype,"specular",void 0);D([B()],Fe.prototype,"falloffType",void 0);D([B()],Fe.prototype,"intensity",void 0);D([B()],Fe.prototype,"range",null);D([B()],Fe.prototype,"intensityMode",null);D([B()],Fe.prototype,"radius",null);D([B()],Fe.prototype,"_renderPriority",void 0);D([je("_reorderLightsInScene")],Fe.prototype,"renderPriority",void 0);D([B("shadowEnabled")],Fe.prototype,"_shadowEnabled",void 0);D([B("excludeWithLayerMask")],Fe.prototype,"_excludeWithLayerMask",void 0);D([B("includeOnlyWithLayerMask")],Fe.prototype,"_includeOnlyWithLayerMask",void 0);D([B("lightmapMode")],Fe.prototype,"_lightmapMode",void 0);class Zn extends Fe{constructor(){super(...arguments),this._needProjectionMatrixCompute=!0,this._viewMatrix=O.Identity(),this._projectionMatrix=O.Identity()}_setPosition(e){this._position=e}get position(){return this._position}set position(e){this._setPosition(e)}_setDirection(e){this._direction=e}get direction(){return this._direction}set direction(e){this._setDirection(e)}get shadowMinZ(){return this._shadowMinZ}set shadowMinZ(e){this._shadowMinZ=e,this.forceProjectionMatrixCompute()}get shadowMaxZ(){return this._shadowMaxZ}set shadowMaxZ(e){this._shadowMaxZ=e,this.forceProjectionMatrixCompute()}computeTransformedInformation(){return this.parent&&this.parent.getWorldMatrix?(this.transformedPosition||(this.transformedPosition=v.Zero()),v.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),this.transformedPosition),this.direction&&(this.transformedDirection||(this.transformedDirection=v.Zero()),v.TransformNormalToRef(this.direction,this.parent.getWorldMatrix(),this.transformedDirection)),!0):!1}getDepthScale(){return 50}getShadowDirection(e){return this.transformedDirection?this.transformedDirection:this.direction}getAbsolutePosition(){return this.transformedPosition?this.transformedPosition:this.position}setDirectionToTarget(e){return this.direction=v.Normalize(e.subtract(this.position)),this.direction}getRotation(){this.direction.normalize();const e=v.Cross(this.direction,Gt.Y),t=v.Cross(e,this.direction);return v.RotationFromAxis(e,t,this.direction)}needCube(){return!1}needProjectionMatrixCompute(){return this._needProjectionMatrixCompute}forceProjectionMatrixCompute(){this._needProjectionMatrixCompute=!0}_initCache(){super._initCache(),this._cache.position=v.Zero()}_isSynchronized(){return!!this._cache.position.equals(this.position)}computeWorldMatrix(e){return!e&&this.isSynchronized()?(this._currentRenderId=this.getScene().getRenderId(),this._worldMatrix):(this._updateCache(),this._cache.position.copyFrom(this.position),this._worldMatrix||(this._worldMatrix=O.Identity()),O.TranslationToRef(this.position.x,this.position.y,this.position.z,this._worldMatrix),this.parent&&this.parent.getWorldMatrix&&(this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(),this._worldMatrix),this._markSyncedWithParent()),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix)}getDepthMinZ(e){return this.shadowMinZ!==void 0?this.shadowMinZ:e.minZ}getDepthMaxZ(e){return this.shadowMaxZ!==void 0?this.shadowMaxZ:e.maxZ}setShadowProjectionMatrix(e,t,i){return this.customProjectionMatrixBuilder?this.customProjectionMatrixBuilder(t,i,e):this._setDefaultShadowProjectionMatrix(e,t,i),this}_syncParentEnabledState(){super._syncParentEnabledState(),(!this.parent||!this.parent.getWorldMatrix)&&(this.transformedPosition=null,this.transformedDirection=null)}getViewMatrix(e){const t=N.Vector3[0];let i=this.position;this.computeTransformedInformation()&&(i=this.transformedPosition),v.NormalizeToRef(this.getShadowDirection(e),t),Math.abs(v.Dot(t,v.Up()))===1&&(t.z=1e-13);const s=N.Vector3[1];return i.addToRef(t,s),O.LookAtLHToRef(i,s,v.Up(),this._viewMatrix),this._viewMatrix}getProjectionMatrix(e,t){return this.setShadowProjectionMatrix(this._projectionMatrix,e!=null?e:this._viewMatrix,t!=null?t:[]),this._projectionMatrix}}D([yi()],Zn.prototype,"position",null);D([yi()],Zn.prototype,"direction",null);D([B()],Zn.prototype,"shadowMinZ",null);D([B()],Zn.prototype,"shadowMaxZ",null);bt.AddNodeConstructor("Light_Type_0",(a,e)=>()=>new jr(a,v.Zero(),e));class jr extends Zn{get shadowAngle(){return this._shadowAngle}set shadowAngle(e){this._shadowAngle=e,this.forceProjectionMatrixCompute()}get direction(){return this._direction}set direction(e){const t=this.needCube();if(this._direction=e,this.needCube()!==t&&this._shadowGenerators){const i=this._shadowGenerators.values();for(let s=i.next();s.done!==!0;s=i.next())s.value.recreateShadowMap()}}constructor(e,t,i){super(e,i),this._shadowAngle=Math.PI/2,this.position=t}getClassName(){return"PointLight"}getTypeID(){return Fe.LIGHTTYPEID_POINTLIGHT}needCube(){return!this.direction}getShadowDirection(e){if(this.direction)return super.getShadowDirection(e);switch(e){case 0:return new v(1,0,0);case 1:return new v(-1,0,0);case 2:return new v(0,-1,0);case 3:return new v(0,1,0);case 4:return new v(0,0,1);case 5:return new v(0,0,-1)}return v.Zero()}_setDefaultShadowProjectionMatrix(e,t,i){const s=this.getScene().activeCamera;if(!s)return;const n=this.shadowMinZ!==void 0?this.shadowMinZ:s.minZ,r=this.shadowMaxZ!==void 0?this.shadowMaxZ:s.maxZ,o=this.getScene().getEngine().useReverseDepthBuffer;O.PerspectiveFovLHToRef(this.shadowAngle,1,o?r:n,o?n:r,e,!0,this._scene.getEngine().isNDCHalfZRange,void 0,o)}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}transferToEffect(e,t){return this.computeTransformedInformation()?this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z,0,t):this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,0,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,0,0,t),this}transferToNodeMaterialEffect(e,t){return this.computeTransformedInformation()?e.setFloat3(t,this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z):e.setFloat3(t,this.position.x,this.position.y,this.position.z),this}prepareLightSpecificDefines(e,t){e["POINTLIGHT"+t]=!0}}D([B()],jr.prototype,"shadowAngle",null);vt("BABYLON.PointLight",jr);class qh{constructor(){this.previousWorldMatrices={},this.previousBones={}}static AddUniforms(e){e.push("previousWorld","previousViewProjection","mPreviousBones")}static AddSamplers(e){}bindForSubMesh(e,t,i,s,n){if(t.prePassRenderer&&t.prePassRenderer.enabled&&t.prePassRenderer.currentRTisSceneRT&&(t.prePassRenderer.getIndex(2)!==-1||t.prePassRenderer.getIndex(11)!==-1)){this.previousWorldMatrices[i.uniqueId]||(this.previousWorldMatrices[i.uniqueId]=s.clone()),this.previousViewProjection||(this.previousViewProjection=t.getTransformMatrix().clone(),this.currentViewProjection=t.getTransformMatrix().clone());const r=t.getEngine();this.currentViewProjection.updateFlag!==t.getTransformMatrix().updateFlag?(this._lastUpdateFrameId=r.frameId,this.previousViewProjection.copyFrom(this.currentViewProjection),this.currentViewProjection.copyFrom(t.getTransformMatrix())):this._lastUpdateFrameId!==r.frameId&&(this._lastUpdateFrameId=r.frameId,this.previousViewProjection.copyFrom(this.currentViewProjection)),e.setMatrix("previousWorld",this.previousWorldMatrices[i.uniqueId]),e.setMatrix("previousViewProjection",this.previousViewProjection),this.previousWorldMatrices[i.uniqueId]=s.clone()}}}class k0{constructor(e){if(this._keys=[],this._isDirty=!0,this._areLightsDirty=!0,this._areLightsDisposed=!1,this._areAttributesDirty=!0,this._areTexturesDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._arePrePassDirty=!0,this._areImageProcessingDirty=!0,this._normals=!1,this._uvs=!1,this._needNormals=!1,this._needUVs=!1,this._externalProperties=e,e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this._setDefaultValue(t)}get isDirty(){return this._isDirty}markAsProcessed(){this._isDirty=!1,this._areAttributesDirty=!1,this._areTexturesDirty=!1,this._areFresnelDirty=!1,this._areLightsDirty=!1,this._areLightsDisposed=!1,this._areMiscDirty=!1,this._arePrePassDirty=!1,this._areImageProcessingDirty=!1}markAsUnprocessed(){this._isDirty=!0}markAllAsDirty(){this._areTexturesDirty=!0,this._areAttributesDirty=!0,this._areLightsDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._arePrePassDirty=!1,this._areImageProcessingDirty=!0,this._isDirty=!0}markAsImageProcessingDirty(){this._areImageProcessingDirty=!0,this._isDirty=!0}markAsLightDirty(e=!1){this._areLightsDirty=!0,this._areLightsDisposed=this._areLightsDisposed||e,this._isDirty=!0}markAsAttributesDirty(){this._areAttributesDirty=!0,this._isDirty=!0}markAsTexturesDirty(){this._areTexturesDirty=!0,this._isDirty=!0}markAsFresnelDirty(){this._areFresnelDirty=!0,this._isDirty=!0}markAsMiscDirty(){this._areMiscDirty=!0,this._isDirty=!0}markAsPrePassDirty(){this._arePrePassDirty=!0,this._isDirty=!0}rebuild(){this._keys.length=0;for(const e of Object.keys(this))e[0]!=="_"&&this._keys.push(e);if(this._externalProperties)for(const e in this._externalProperties)this._keys.indexOf(e)===-1&&this._keys.push(e)}isEqual(e){if(this._keys.length!==e._keys.length)return!1;for(let t=0;tthis._setDefaultValue(e))}_setDefaultValue(e){var s,n,r,o,h;const t=(r=(n=(s=this._externalProperties)==null?void 0:s[e])==null?void 0:n.type)!=null?r:typeof this[e],i=(h=(o=this._externalProperties)==null?void 0:o[e])==null?void 0:h.default;switch(t){case"number":this[e]=i!=null?i:0;break;case"string":this[e]=i!=null?i:"";break;default:this[e]=i!=null?i:!1;break}}toString(){let e="";for(let t=0;tthis._maxRank&&(this._maxRank=e),this._defines[e]=new Array),this._defines[e].push(t)}addCPUSkinningFallback(e,t){this._mesh=t,ethis._maxRank&&(this._maxRank=e)}get hasMoreFallbacks(){return this._currentRank<=this._maxRank}reduce(e,t){if(this._mesh&&this._mesh.computeBonesUsingShaders&&this._mesh.numBoneInfluencers>0){this._mesh.computeBonesUsingShaders=!1,e=e.replace("#define NUM_BONE_INFLUENCERS "+this._mesh.numBoneInfluencers,"#define NUM_BONE_INFLUENCERS 0"),t._bonesComputationForcedToCPU=!0;const i=this._mesh.getScene();for(let s=0;s0&&(n.computeBonesUsingShaders=!1);continue}if(!(!n.computeBonesUsingShaders||n.numBoneInfluencers===0)){if(n.material.getEffect()===t)n.computeBonesUsingShaders=!1;else if(n.subMeshes){for(const r of n.subMeshes)if(r.effect===t){n.computeBonesUsingShaders=!1;break}}}}}else{const i=this._defines[this._currentRank];if(i)for(let s=0;sthis._handlePluginEvent(s,n),this._plugins.push(e),this._plugins.sort((s,n)=>s.priority-n.priority),this._codeInjectionPoints={};const i={};i[xs._MaterialPluginClassToMainDefine[t]]={type:"boolean",default:!0};for(const s of this._plugins)s.collectDefines(i),this._collectPointNames("vertex",s.getCustomCode("vertex",this._material.shaderLanguage)),this._collectPointNames("fragment",s.getCustomCode("fragment",this._material.shaderLanguage));return this._defineNamesFromPlugins=i,!0}_activatePlugin(e){this._activePlugins.indexOf(e)===-1&&(this._activePlugins.push(e),this._activePlugins.sort((t,i)=>t.priority-i.priority),this._material._callbackPluginEventIsReadyForSubMesh=this._handlePluginEventIsReadyForSubMesh.bind(this),this._material._callbackPluginEventPrepareDefinesBeforeAttributes=this._handlePluginEventPrepareDefinesBeforeAttributes.bind(this),this._material._callbackPluginEventPrepareDefines=this._handlePluginEventPrepareDefines.bind(this),this._material._callbackPluginEventBindForSubMesh=this._handlePluginEventBindForSubMesh.bind(this),e.registerForExtraEvents&&(this._activePluginsForExtraEvents.push(e),this._activePluginsForExtraEvents.sort((t,i)=>t.priority-i.priority),this._material._callbackPluginEventHasRenderTargetTextures=this._handlePluginEventHasRenderTargetTextures.bind(this),this._material._callbackPluginEventFillRenderTargetTextures=this._handlePluginEventFillRenderTargetTextures.bind(this),this._material._callbackPluginEventHardBindForSubMesh=this._handlePluginEventHardBindForSubMesh.bind(this)))}getPlugin(e){for(let t=0;t0&&s.uniforms.push(...this._uniformList),this._samplerList.length>0&&s.samplers.push(...this._samplerList),this._uboList.length>0&&s.uniformBuffersNames.push(...this._uboList),s.customCode=this._injectCustomCode(s,s.customCode);break}case 8:{const s=t;this._uboDeclaration="",this._vertexDeclaration="",this._fragmentDeclaration="",this._uniformList=[],this._samplerList=[],this._uboList=[];const n=this._material.shaderLanguage===1;for(const r of this._plugins){const o=r.getUniforms(this._material.shaderLanguage);if(o){if(o.ubo)for(const h of o.ubo){if(h.size&&h.type){const l=(i=h.arraySize)!=null?i:0;if(s.ubo.addUniform(h.name,h.size,l),n){let c;switch(h.type){case"mat4":c="mat4x4f";break;case"float":c="f32";break;default:c="".concat(h.type,"f");break}this._uboDeclaration+="uniform ".concat(h.name,": ").concat(c).concat(l>0?"[".concat(l,"]"):"",";\n")}else this._uboDeclaration+="".concat(h.type," ").concat(h.name).concat(l>0?"[".concat(l,"]"):"",";\n")}this._uniformList.push(h.name)}o.vertex&&(this._vertexDeclaration+=o.vertex+"\n"),o.fragment&&(this._fragmentDeclaration+=o.fragment+"\n")}r.getSamplers(this._samplerList),r.getUniformBuffersNames(this._uboList)}break}}}_collectPointNames(e,t){if(t)for(const i in t)this._codeInjectionPoints[e]||(this._codeInjectionPoints[e]={}),this._codeInjectionPoints[e][i]=!0}_injectCustomCode(e,t){return(i,s)=>{var o,h;t&&(s=t(i,s)),this._uboDeclaration&&(s=s.replace("#define ADDITIONAL_UBO_DECLARATION",this._uboDeclaration)),this._vertexDeclaration&&(s=s.replace("#define ADDITIONAL_VERTEX_DECLARATION",this._vertexDeclaration)),this._fragmentDeclaration&&(s=s.replace("#define ADDITIONAL_FRAGMENT_DECLARATION",this._fragmentDeclaration));const n=(o=this._codeInjectionPoints)==null?void 0:o[i];if(!n)return s;let r=null;for(let l in n){let c="";for(const u of this._activePlugins){let f=(h=u.getCustomCode(i,this._material.shaderLanguage))==null?void 0:h[l];f&&(u.resolveIncludes&&(r===null&&(r={defines:[],indexParameters:e.indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:void 0,supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:Me.GetShadersRepository(0),includesShadersStore:Me.GetIncludesShadersStore(0),version:void 0,platformName:this._engine.shaderPlatformName,processingContext:void 0,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,processCodeAfterIncludes:void 0}),r.isFragment=i==="fragment",Dn(f,r,d=>f=d)),c+=f+"\n")}if(c.length>0)if(l.charAt(0)==="!"){l=l.substring(1);let u="g";if(l.charAt(0)==="!")u="",l=l.substring(1);else{const p=Cg.exec(l);p&&p.length>=2&&(u=p[1],l=l.substring(u.length+1))}u.indexOf("g")<0&&(u+="g");const f=s,d=new RegExp(l,u);let _=d.exec(f);for(;_!==null;){let p=c;for(let g=0;g<_.length;++g)p=p.replace("$"+g,_[g]);s=s.replace(_[0],p),_=d.exec(f)}}else{const u="#define "+l;s=s.replace(u,"\n"+c+"\n"+u)}}return s}}}xs._MaterialPluginClassToMainDefine={};xs._MaterialPluginCounter=0;Ee.OnEnginesDisposedObservable.add(()=>{Mg()});const Sg=[];let jh=null;function Mg(){Sg.length=0,X.OnEventObservable.remove(jh),jh=null}class gn{isCompatible(e){switch(e){case 0:return!0;default:return!1}}_enable(e){e&&this._pluginManager._activatePlugin(this)}constructor(e,t,i,s,n=!0,r=!1,o=!1){this.priority=500,this.resolveIncludes=!1,this.registerForExtraEvents=!1,this._material=e,this.name=t,this.priority=i,this.resolveIncludes=o,e.pluginManager||(e.pluginManager=new xs(e),e.onDisposeObservable.add(()=>{e.pluginManager=void 0})),this._pluginDefineNames=s,this._pluginManager=e.pluginManager,n&&this._pluginManager._addPlugin(this),r&&this._enable(!0),this.markAllDefinesAsDirty=e._dirtyCallbacks[63]}getClassName(){return"MaterialPluginBase"}isReadyForSubMesh(e,t,i,s){return!0}hardBindForSubMesh(e,t,i,s){}bindForSubMesh(e,t,i,s){}dispose(e){}getCustomCode(e,t=0){return null}collectDefines(e){if(this._pluginDefineNames)for(const t of Object.keys(this._pluginDefineNames)){if(t[0]==="_")continue;const i=typeof this._pluginDefineNames[t];e[t]={type:i==="number"?"number":i==="string"?"string":i==="boolean"?"boolean":"object",default:this._pluginDefineNames[t]}}}prepareDefinesBeforeAttributes(e,t,i){}prepareDefines(e,t,i){}hasTexture(e){return!1}hasRenderTargetTextures(){return!1}fillRenderTargetTextures(e){}getActiveTextures(e){}getAnimatables(e){}addFallbacks(e,t,i){return i}getSamplers(e){}getAttributes(e,t,i){}getUniformBuffersNames(e){}getUniforms(e=0){return{}}copyTo(e){Ae.Clone(()=>e,this)}serialize(){return Ae.Serialize(this)}parse(e,t,i){Ae.Parse(()=>this,e,t,i)}}D([B()],gn.prototype,"name",void 0);D([B()],gn.prototype,"priority",void 0);D([B()],gn.prototype,"resolveIncludes",void 0);D([B()],gn.prototype,"registerForExtraEvents",void 0);vt("BABYLON.MaterialPluginBase",gn);class Pg extends k0{constructor(){super(...arguments),this.DETAIL=!1,this.DETAILDIRECTUV=0,this.DETAIL_NORMALBLENDMETHOD=0}}class Ks extends gn{_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"DetailMap",140,new Pg,t),this._texture=null,this.diffuseBlendLevel=1,this.roughnessBlendLevel=1,this.bumpLevel=1,this._normalBlendMethod=X.MATERIAL_NORMALBLENDMETHOD_WHITEOUT,this._isEnabled=!1,this.isEnabled=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t,i){return this._isEnabled?!(e._areTexturesDirty&&t.texturesEnabled&&i.getCaps().standardDerivatives&&this._texture&&De.DetailTextureEnabled&&!this._texture.isReady()):!0}prepareDefines(e,t){if(this._isEnabled){e.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod;const i=t.getEngine();e._areTexturesDirty&&(i.getCaps().standardDerivatives&&this._texture&&De.DetailTextureEnabled&&this._isEnabled?(ms(this._texture,e,"DETAIL"),e.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod):e.DETAIL=!1)}else e.DETAIL=!1}bindForSubMesh(e,t){if(!this._isEnabled)return;const i=this._material.isFrozen;(!e.useUbo||!i||!e.isSync)&&this._texture&&De.DetailTextureEnabled&&(e.updateFloat4("vDetailInfos",this._texture.coordinatesIndex,this.diffuseBlendLevel,this.bumpLevel,this.roughnessBlendLevel),vs(this._texture,e,"detail")),t.texturesEnabled&&this._texture&&De.DetailTextureEnabled&&e.setTexture("detailSampler",this._texture)}hasTexture(e){return this._texture===e}getActiveTextures(e){this._texture&&e.push(this._texture)}getAnimatables(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture)}dispose(e){var t;e&&((t=this._texture)==null||t.dispose())}getClassName(){return"DetailMapConfiguration"}getSamplers(e){e.push("detailSampler")}getUniforms(){return{ubo:[{name:"vDetailInfos",size:4,type:"vec4"},{name:"detailMatrix",size:16,type:"mat4"}]}}}D([_i("detailTexture"),je("_markAllSubMeshesAsTexturesDirty")],Ks.prototype,"texture",void 0);D([B()],Ks.prototype,"diffuseBlendLevel",void 0);D([B()],Ks.prototype,"roughnessBlendLevel",void 0);D([B()],Ks.prototype,"bumpLevel",void 0);D([B(),je("_markAllSubMeshesAsTexturesDirty")],Ks.prototype,"normalBlendMethod",void 0);D([B(),je("_markAllSubMeshesAsTexturesDirty")],Ks.prototype,"isEnabled",void 0);var $h;(function(a){a[a.Zero=0]="Zero",a[a.One=1]="One",a[a.MaxViewZ=2]="MaxViewZ"})($h||($h={}));class ti{static CreateConfiguration(e){return ti._Configurations[e]={defines:{},previousWorldMatrices:{},previousViewProjection:O.Zero(),currentViewProjection:O.Zero(),previousBones:{},lastUpdateFrameId:-1,excludedSkinnedMesh:[]},ti._Configurations[e]}static DeleteConfiguration(e){delete ti._Configurations[e]}static GetConfiguration(e){return ti._Configurations[e]}static AddUniformsAndSamplers(e,t){e.push("previousWorld","previousViewProjection","mPreviousBones")}static MarkAsDirty(e,t){for(const i of t)if(i.subMeshes)for(const s of i.subMeshes)s._removeDrawWrapper(e)}static PrepareDefines(e,t,i){if(!i._arePrePassDirty)return;const s=ti._Configurations[e];if(!s)return;i.PREPASS=!0,i.PREPASS_COLOR=!1,i.PREPASS_COLOR_INDEX=-1;let n=0;for(let r=0;r{this._markAllSubMeshesAsImageProcessingDirty()})))}get isPrePassCapable(){return!this.disableDepthWrite}get cameraColorCurvesEnabled(){return this.imageProcessingConfiguration.colorCurvesEnabled}set cameraColorCurvesEnabled(e){this.imageProcessingConfiguration.colorCurvesEnabled=e}get cameraColorGradingEnabled(){return this.imageProcessingConfiguration.colorGradingEnabled}set cameraColorGradingEnabled(e){this.imageProcessingConfiguration.colorGradingEnabled=e}get cameraToneMappingEnabled(){return this._imageProcessingConfiguration.toneMappingEnabled}set cameraToneMappingEnabled(e){this._imageProcessingConfiguration.toneMappingEnabled=e}get cameraExposure(){return this._imageProcessingConfiguration.exposure}set cameraExposure(e){this._imageProcessingConfiguration.exposure=e}get cameraContrast(){return this._imageProcessingConfiguration.contrast}set cameraContrast(e){this._imageProcessingConfiguration.contrast=e}get cameraColorGradingTexture(){return this._imageProcessingConfiguration.colorGradingTexture}set cameraColorGradingTexture(e){this._imageProcessingConfiguration.colorGradingTexture=e}get cameraColorCurves(){return this._imageProcessingConfiguration.colorCurves}set cameraColorCurves(e){this._imageProcessingConfiguration.colorCurves=e}get canRenderToMRT(){return!0}constructor(e,t,i=!1){super(e,t,void 0,i||ee.ForceGLSL),this._diffuseTexture=null,this._ambientTexture=null,this._opacityTexture=null,this._reflectionTexture=null,this._emissiveTexture=null,this._specularTexture=null,this._bumpTexture=null,this._lightmapTexture=null,this._refractionTexture=null,this.ambientColor=new de(0,0,0),this.diffuseColor=new de(1,1,1),this.specularColor=new de(1,1,1),this.emissiveColor=new de(0,0,0),this.specularPower=64,this._useAlphaFromDiffuseTexture=!1,this._useEmissiveAsIllumination=!1,this._linkEmissiveWithDiffuse=!1,this._useSpecularOverAlpha=!1,this._useReflectionOverAlpha=!1,this._disableLighting=!1,this._useObjectSpaceNormalMap=!1,this._useParallax=!1,this._useParallaxOcclusion=!1,this.parallaxScaleBias=.05,this._roughness=0,this.indexOfRefraction=.98,this.invertRefractionY=!0,this.alphaCutOff=.4,this._useLightmapAsShadowmap=!1,this._useReflectionFresnelFromSpecular=!1,this._useGlossinessFromSpecularMapAlpha=!1,this._maxSimultaneousLights=4,this._invertNormalMapX=!1,this._invertNormalMapY=!1,this._twoSidedLighting=!1,this._applyDecalMapAfterDetailMap=!1,this._shadersLoaded=!1,this._renderTargets=new Ut(16),this._worldViewProjectionMatrix=O.Zero(),this._globalAmbientColor=new de(0,0,0),this._cacheHasRenderTargetTextures=!1,this.detailMap=new Ks(this),this._attachImageProcessingConfiguration(null),this.prePassConfiguration=new qh,this.getRenderTargetTextures=()=>(this._renderTargets.reset(),ee.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._renderTargets.push(this._reflectionTexture),ee.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&this._renderTargets.push(this._refractionTexture),this._eventInfo.renderTargets=this._renderTargets,this._callbackPluginEventFillRenderTargetTextures(this._eventInfo),this._renderTargets)}get hasRenderTargetTextures(){return ee.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget||ee.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget?!0:this._cacheHasRenderTargetTextures}getClassName(){return"StandardMaterial"}needAlphaBlending(){return this._disableAlphaBlending?!1:this.alpha<1||this._opacityTexture!=null||this._shouldUseAlphaFromDiffuseTexture()||this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled}needAlphaTesting(){return this._forceAlphaTest?!0:this._hasAlphaChannel()&&(this._transparencyMode==null||this._transparencyMode===X.MATERIAL_ALPHATEST)}_shouldUseAlphaFromDiffuseTexture(){return this._diffuseTexture!=null&&this._diffuseTexture.hasAlpha&&this._useAlphaFromDiffuseTexture&&this._transparencyMode!==X.MATERIAL_OPAQUE}_hasAlphaChannel(){return this._diffuseTexture!=null&&this._diffuseTexture.hasAlpha||this._opacityTexture!=null}getAlphaTestTexture(){return this._diffuseTexture}isReadyForSubMesh(e,t,i=!1){this._uniformBufferLayoutBuilt||this.buildUniformLayout();const s=t._drawWrapper;if(s.effect&&this.isFrozen&&s._wasPreviouslyReady&&s._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(this._callbackPluginEventGeneric(4,this._eventInfo),t.materialDefines=new wg(this._eventInfo.defineNames));const n=this.getScene(),r=t.materialDefines;if(this._isReadyForSubMesh(t))return!0;const o=n.getEngine();r._needNormals=eg(n,e,r,!0,this._maxSimultaneousLights,this._disableLighting),rg(n,r);const h=this.needAlphaBlendingForMesh(e)&&this.getScene().useOrderIndependentTransparency;if(og(n,r,this.canRenderToMRT&&!h),ag(n,r,h),ti.PrepareDefines(o.currentRenderPassId,e,r),r._areTexturesDirty){this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,r._needUVs=!1;for(let c=1;c<=6;++c)r["MAINUV"+c]=!1;if(n.texturesEnabled){if(r.DIFFUSEDIRECTUV=0,r.BUMPDIRECTUV=0,r.AMBIENTDIRECTUV=0,r.OPACITYDIRECTUV=0,r.EMISSIVEDIRECTUV=0,r.SPECULARDIRECTUV=0,r.LIGHTMAPDIRECTUV=0,this._diffuseTexture&&ee.DiffuseTextureEnabled)if(this._diffuseTexture.isReadyOrNotBlocking())ms(this._diffuseTexture,r,"DIFFUSE");else return!1;else r.DIFFUSE=!1;if(this._ambientTexture&&ee.AmbientTextureEnabled)if(this._ambientTexture.isReadyOrNotBlocking())ms(this._ambientTexture,r,"AMBIENT");else return!1;else r.AMBIENT=!1;if(this._opacityTexture&&ee.OpacityTextureEnabled)if(this._opacityTexture.isReadyOrNotBlocking())ms(this._opacityTexture,r,"OPACITY"),r.OPACITYRGB=this._opacityTexture.getAlphaFromRGB;else return!1;else r.OPACITY=!1;if(this._reflectionTexture&&ee.ReflectionTextureEnabled)if(this._reflectionTexture.isReadyOrNotBlocking()){switch(r._needNormals=!0,r.REFLECTION=!0,r.ROUGHNESS=this._roughness>0,r.REFLECTIONOVERALPHA=this._useReflectionOverAlpha,r.INVERTCUBICMAP=this._reflectionTexture.coordinatesMode===ie.INVCUBIC_MODE,r.REFLECTIONMAP_3D=this._reflectionTexture.isCube,r.REFLECTIONMAP_OPPOSITEZ=r.REFLECTIONMAP_3D&&this.getScene().useRightHandedSystem?!this._reflectionTexture.invertZ:this._reflectionTexture.invertZ,r.RGBDREFLECTION=this._reflectionTexture.isRGBD,this._reflectionTexture.coordinatesMode){case ie.EXPLICIT_MODE:r.setReflectionMode("REFLECTIONMAP_EXPLICIT");break;case ie.PLANAR_MODE:r.setReflectionMode("REFLECTIONMAP_PLANAR");break;case ie.PROJECTION_MODE:r.setReflectionMode("REFLECTIONMAP_PROJECTION");break;case ie.SKYBOX_MODE:r.setReflectionMode("REFLECTIONMAP_SKYBOX");break;case ie.SPHERICAL_MODE:r.setReflectionMode("REFLECTIONMAP_SPHERICAL");break;case ie.EQUIRECTANGULAR_MODE:r.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");break;case ie.FIXED_EQUIRECTANGULAR_MODE:r.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");break;case ie.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:r.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");break;case ie.CUBIC_MODE:case ie.INVCUBIC_MODE:default:r.setReflectionMode("REFLECTIONMAP_CUBIC");break}r.USE_LOCAL_REFLECTIONMAP_CUBIC=!!this._reflectionTexture.boundingBoxSize}else return!1;else r.REFLECTION=!1,r.REFLECTIONMAP_OPPOSITEZ=!1;if(this._emissiveTexture&&ee.EmissiveTextureEnabled)if(this._emissiveTexture.isReadyOrNotBlocking())ms(this._emissiveTexture,r,"EMISSIVE");else return!1;else r.EMISSIVE=!1;if(this._lightmapTexture&&ee.LightmapTextureEnabled)if(this._lightmapTexture.isReadyOrNotBlocking())ms(this._lightmapTexture,r,"LIGHTMAP"),r.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,r.RGBDLIGHTMAP=this._lightmapTexture.isRGBD;else return!1;else r.LIGHTMAP=!1;if(this._specularTexture&&ee.SpecularTextureEnabled)if(this._specularTexture.isReadyOrNotBlocking())ms(this._specularTexture,r,"SPECULAR"),r.GLOSSINESS=this._useGlossinessFromSpecularMapAlpha;else return!1;else r.SPECULAR=!1;if(n.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&ee.BumpTextureEnabled){if(this._bumpTexture.isReady())ms(this._bumpTexture,r,"BUMP"),r.PARALLAX=this._useParallax,r.PARALLAX_RHS=n.useRightHandedSystem,r.PARALLAXOCCLUSION=this._useParallaxOcclusion;else return!1;r.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap}else r.BUMP=!1,r.PARALLAX=!1,r.PARALLAX_RHS=!1,r.PARALLAXOCCLUSION=!1;if(this._refractionTexture&&ee.RefractionTextureEnabled)if(this._refractionTexture.isReadyOrNotBlocking())r._needUVs=!0,r.REFRACTION=!0,r.REFRACTIONMAP_3D=this._refractionTexture.isCube,r.RGBDREFRACTION=this._refractionTexture.isRGBD,r.USE_LOCAL_REFRACTIONMAP_CUBIC=!!this._refractionTexture.boundingBoxSize;else return!1;else r.REFRACTION=!1;r.TWOSIDEDLIGHTING=!this._backFaceCulling&&this._twoSidedLighting}else r.DIFFUSE=!1,r.AMBIENT=!1,r.OPACITY=!1,r.REFLECTION=!1,r.EMISSIVE=!1,r.LIGHTMAP=!1,r.BUMP=!1,r.REFRACTION=!1;r.ALPHAFROMDIFFUSE=this._shouldUseAlphaFromDiffuseTexture(),r.EMISSIVEASILLUMINATION=this._useEmissiveAsIllumination,r.LINKEMISSIVEWITHDIFFUSE=this._linkEmissiveWithDiffuse,r.SPECULAROVERALPHA=this._useSpecularOverAlpha,r.PREMULTIPLYALPHA=this.alphaMode===7||this.alphaMode===8,r.ALPHATEST_AFTERALLALPHACOMPUTATIONS=this.transparencyMode!==null,r.ALPHABLEND=this.transparencyMode===null||this.needAlphaBlendingForMesh(e)}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=r,this._eventInfo.subMesh=t,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh)return!1;if(r._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(r),r.IS_REFLECTION_LINEAR=this.reflectionTexture!=null&&!this.reflectionTexture.gammaSpace,r.IS_REFRACTION_LINEAR=this.refractionTexture!=null&&!this.refractionTexture.gammaSpace}r._areFresnelDirty&&(ee.FresnelEnabled?(this._diffuseFresnelParameters||this._opacityFresnelParameters||this._emissiveFresnelParameters||this._refractionFresnelParameters||this._reflectionFresnelParameters)&&(r.DIFFUSEFRESNEL=this._diffuseFresnelParameters&&this._diffuseFresnelParameters.isEnabled,r.OPACITYFRESNEL=this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled,r.REFLECTIONFRESNEL=this._reflectionFresnelParameters&&this._reflectionFresnelParameters.isEnabled,r.REFLECTIONFRESNELFROMSPECULAR=this._useReflectionFresnelFromSpecular,r.REFRACTIONFRESNEL=this._refractionFresnelParameters&&this._refractionFresnelParameters.isEnabled,r.EMISSIVEFRESNEL=this._emissiveFresnelParameters&&this._emissiveFresnelParameters.isEnabled,r._needNormals=!0,r.FRESNEL=!0):r.FRESNEL=!1),Bc(e,n,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e)||this._forceAlphaTest,r,this._applyDecalMapAfterDetailMap),Lc(n,o,this,r,i,null,t.getRenderingMesh().hasThinInstances),this._eventInfo.defines=r,this._eventInfo.mesh=e,this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo),Nc(e,r,!0,!0,!0),this._callbackPluginEventPrepareDefines(this._eventInfo);let l=!1;if(r.isDirty){const c=r._areLightsDisposed;r.markAsProcessed();const u=new G0;r.REFLECTION&&u.addFallback(0,"REFLECTION"),r.SPECULAR&&u.addFallback(0,"SPECULAR"),r.BUMP&&u.addFallback(0,"BUMP"),r.PARALLAX&&u.addFallback(1,"PARALLAX"),r.PARALLAX_RHS&&u.addFallback(1,"PARALLAX_RHS"),r.PARALLAXOCCLUSION&&u.addFallback(0,"PARALLAXOCCLUSION"),r.SPECULAROVERALPHA&&u.addFallback(0,"SPECULAROVERALPHA"),r.FOG&&u.addFallback(1,"FOG"),r.POINTSIZE&&u.addFallback(0,"POINTSIZE"),r.LOGARITHMICDEPTH&&u.addFallback(0,"LOGARITHMICDEPTH"),Qp(r,u,this._maxSimultaneousLights),r.SPECULARTERM&&u.addFallback(0,"SPECULARTERM"),r.DIFFUSEFRESNEL&&u.addFallback(1,"DIFFUSEFRESNEL"),r.OPACITYFRESNEL&&u.addFallback(2,"OPACITYFRESNEL"),r.REFLECTIONFRESNEL&&u.addFallback(3,"REFLECTIONFRESNEL"),r.EMISSIVEFRESNEL&&u.addFallback(4,"EMISSIVEFRESNEL"),r.FRESNEL&&u.addFallback(4,"FRESNEL"),r.MULTIVIEW&&u.addFallback(0,"MULTIVIEW");const f=[A.PositionKind];r.NORMAL&&f.push(A.NormalKind),r.TANGENT&&f.push(A.TangentKind);for(let y=1;y<=6;++y)r["UV"+y]&&f.push("uv".concat(y===1?"":y));r.VERTEXCOLOR&&f.push(A.ColorKind),Zp(f,e,r,u),Oc(f,r),Pc(f,e,r),Dc(f,e,r);let d="default";const _=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vDiffuseColor","vSpecularColor","vEmissiveColor","visibility","vFogInfos","vFogColor","pointSize","vDiffuseInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vEmissiveInfos","vSpecularInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","diffuseMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","specularMatrix","bumpMatrix","normalMatrix","lightmapMatrix","refractionMatrix","diffuseLeftColor","diffuseRightColor","opacityParts","reflectionLeftColor","reflectionRightColor","emissiveLeftColor","emissiveRightColor","refractionLeftColor","refractionRightColor","vReflectionPosition","vReflectionSize","vRefractionPosition","vRefractionSize","logarithmicDepthConstant","vTangentSpaceParams","alphaCutOff","boneTextureWidth","morphTargetTextureInfo","morphTargetTextureIndices"],p=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler","morphTargets","oitDepthSampler","oitFrontColorSampler"],g=["Material","Scene","Mesh"],m={maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:r.NUM_MORPH_INFLUENCERS};this._eventInfo.fallbacks=u,this._eventInfo.fallbackRank=0,this._eventInfo.defines=r,this._eventInfo.uniforms=_,this._eventInfo.attributes=f,this._eventInfo.samplers=p,this._eventInfo.uniformBuffersNames=g,this._eventInfo.customCode=void 0,this._eventInfo.mesh=e,this._eventInfo.indexParameters=m,this._callbackPluginEventGeneric(128,this._eventInfo),ti.AddUniformsAndSamplers(_,p),qh.AddUniforms(_),Ne&&(Ne.PrepareUniforms(_,r),Ne.PrepareSamplers(p,r)),cg({uniformsNames:_,uniformBuffersNames:g,samplers:p,defines:r,maxSimultaneousLights:this._maxSimultaneousLights}),Xr(_);const b={};this.customShaderNameResolve&&(d=this.customShaderNameResolve(d,_,g,p,r,f,b));const I=r.toString(),T=t.effect;let x=n.getEngine().createEffect(d,{attributes:f,uniformsNames:_,uniformBuffersNames:g,samplers:p,defines:I,fallbacks:u,onCompiled:this.onCompiled,onError:this.onError,indexParameters:m,processFinalCode:b.processFinalCode,processCodeAfterIncludes:this._eventInfo.customCode,multiTarget:r.PREPASS,shaderLanguage:this._shaderLanguage,extraInitializationsAsync:this._shadersLoaded?void 0:async()=>{this._shaderLanguage===1?await Promise.all([Oe(()=>import("./default.vertex-Caa9iT2n.js"),__vite__mapDeps([20,21,22,23,24,25,26,27,3,4,5,6,7,8,9,10])),Oe(()=>import("./default.fragment-DzWBfowK.js"),__vite__mapDeps([28,21,29,26,30,31,3,4,5,6,7,8,9,10]))]):await Promise.all([Oe(()=>import("./default.vertex-B3P8Ow0L.js"),__vite__mapDeps([32,33,34,35,36,37,38,3,4,5,6,7,8,9,10])),Oe(()=>import("./default.fragment-BQ0cgw4g.js"),__vite__mapDeps([39,33,34,35,3,4,5,6,7,8,9,10]))]),this._shadersLoaded=!0}},o);if(this._eventInfo.customCode=void 0,x)if(this._onEffectCreatedObservable&&(Aa.effect=x,Aa.subMesh=t,this._onEffectCreatedObservable.notifyObservers(Aa)),this.allowShaderHotSwapping&&T&&!x.isReady()){if(x=T,r.markAsUnprocessed(),l=this.isFrozen,c)return r._areLightsDisposed=!0,!1}else n.resetCachedMaterial(),t.setEffect(x,r,this._materialContext)}return!t.effect||!t.effect.isReady()?!1:(r._renderId=n.getRenderId(),s._wasPreviouslyReady=!l,s._wasPreviouslyUsingInstances=i,this._checkScenePerformancePriority(),!0)}buildUniformLayout(){const e=this._uniformBuffer;e.addUniform("diffuseLeftColor",4),e.addUniform("diffuseRightColor",4),e.addUniform("opacityParts",4),e.addUniform("reflectionLeftColor",4),e.addUniform("reflectionRightColor",4),e.addUniform("refractionLeftColor",4),e.addUniform("refractionRightColor",4),e.addUniform("emissiveLeftColor",4),e.addUniform("emissiveRightColor",4),e.addUniform("vDiffuseInfos",2),e.addUniform("vAmbientInfos",2),e.addUniform("vOpacityInfos",2),e.addUniform("vReflectionInfos",2),e.addUniform("vReflectionPosition",3),e.addUniform("vReflectionSize",3),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vSpecularInfos",2),e.addUniform("vBumpInfos",3),e.addUniform("diffuseMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("reflectionMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("specularMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("pointSize",1),e.addUniform("alphaCutOff",1),e.addUniform("refractionMatrix",16),e.addUniform("vRefractionInfos",4),e.addUniform("vRefractionPosition",3),e.addUniform("vRefractionSize",3),e.addUniform("vSpecularColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("vDiffuseColor",4),e.addUniform("vAmbientColor",3),super.buildUniformLayout()}bindForSubMesh(e,t,i){var l;const s=this.getScene(),n=i.materialDefines;if(!n)return;const r=i.effect;if(!r)return;this._activeEffect=r,t.getMeshUniformBuffer().bindToEffect(r,"Mesh"),t.transferToEffect(e),this._uniformBuffer.bindToEffect(r,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,s,t,e,this.isFrozen),ti.Bind(s.getEngine().currentRenderPassId,this._activeEffect,t,e),this._eventInfo.subMesh=i,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),n.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));const o=this._mustRebind(s,r,i,t.visibility);Fc(t,r);const h=this._uniformBuffer;if(o){if(this.bindViewProjection(r),!h.useUbo||!this.isFrozen||!h.isSync||i._drawWrapper._forceRebindOnNextCall){if(ee.FresnelEnabled&&n.FRESNEL&&(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(h.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),h.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled&&h.updateColor4("opacityParts",new de(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),this.opacityFresnelParameters.power),this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(h.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),h.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(h.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),h.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(h.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),h.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))),s.texturesEnabled){if(this._diffuseTexture&&ee.DiffuseTextureEnabled&&(h.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),vs(this._diffuseTexture,h,"diffuse")),this._ambientTexture&&ee.AmbientTextureEnabled&&(h.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),vs(this._ambientTexture,h,"ambient")),this._opacityTexture&&ee.OpacityTextureEnabled&&(h.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),vs(this._opacityTexture,h,"opacity")),this._hasAlphaChannel()&&h.updateFloat("alphaCutOff",this.alphaCutOff),this._reflectionTexture&&ee.ReflectionTextureEnabled&&(h.updateFloat2("vReflectionInfos",this._reflectionTexture.level,this.roughness),h.updateMatrix("reflectionMatrix",this._reflectionTexture.getReflectionTextureMatrix()),this._reflectionTexture.boundingBoxSize)){const c=this._reflectionTexture;h.updateVector3("vReflectionPosition",c.boundingBoxPosition),h.updateVector3("vReflectionSize",c.boundingBoxSize)}if(this._emissiveTexture&&ee.EmissiveTextureEnabled&&(h.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),vs(this._emissiveTexture,h,"emissive")),this._lightmapTexture&&ee.LightmapTextureEnabled&&(h.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),vs(this._lightmapTexture,h,"lightmap")),this._specularTexture&&ee.SpecularTextureEnabled&&(h.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),vs(this._specularTexture,h,"specular")),this._bumpTexture&&s.getEngine().getCaps().standardDerivatives&&ee.BumpTextureEnabled&&(h.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),vs(this._bumpTexture,h,"bump"),s._mirroredCameraPosition?h.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):h.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&ee.RefractionTextureEnabled){let c=1;if(this._refractionTexture.isCube||(h.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(c=this._refractionTexture.depth)),h.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,c,this.invertRefractionY?-1:1),this._refractionTexture.boundingBoxSize){const u=this._refractionTexture;h.updateVector3("vRefractionPosition",u.boundingBoxPosition),h.updateVector3("vRefractionSize",u.boundingBoxSize)}}}this.pointsCloud&&h.updateFloat("pointSize",this.pointSize),h.updateColor4("vSpecularColor",this.specularColor,this.specularPower),h.updateColor3("vEmissiveColor",ee.EmissiveTextureEnabled?this.emissiveColor:de.BlackReadOnly),h.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha),s.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),h.updateColor3("vAmbientColor",this._globalAmbientColor)}s.texturesEnabled&&(this._diffuseTexture&&ee.DiffuseTextureEnabled&&r.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&ee.AmbientTextureEnabled&&r.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&ee.OpacityTextureEnabled&&r.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&ee.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?r.setTexture("reflectionCubeSampler",this._reflectionTexture):r.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&ee.EmissiveTextureEnabled&&r.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&ee.LightmapTextureEnabled&&r.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&ee.SpecularTextureEnabled&&r.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&s.getEngine().getCaps().standardDerivatives&&ee.BumpTextureEnabled&&r.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&ee.RefractionTextureEnabled&&(this._refractionTexture.isCube?r.setTexture("refractionCubeSampler",this._refractionTexture):r.setTexture("refraction2DSampler",this._refractionTexture))),this.getScene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(t)&&this.getScene().depthPeelingRenderer.bind(r),this._eventInfo.subMesh=i,this._callbackPluginEventBindForSubMesh(this._eventInfo),Yr(r,this,s),this.bindEyePosition(r)}else s.getEngine()._features.needToAlwaysBindUniformBuffers&&(this._needToBindSceneUbo=!0);(o||!this.isFrozen)&&(s.lightsEnabled&&!this._disableLighting&&$p(s,t,r,n,this._maxSimultaneousLights),(s.fogEnabled&&t.applyFog&&s.fogMode!==it.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture||t.receiveShadows||n.PREPASS)&&this.bindView(r),L0(s,t,r),n.NUM_MORPH_INFLUENCERS&&U0(t,r),n.BAKED_VERTEX_ANIMATION_TEXTURE&&((l=t.bakedVertexAnimationManager)==null||l.bind(r,n.INSTANCES)),this.useLogarithmicDepth&&B0(n,r,s),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._afterBind(t,this._activeEffect,i),h.update()}getAnimatables(){const e=super.getAnimatables();return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&e.push(this._diffuseTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._specularTexture&&this._specularTexture.animations&&this._specularTexture.animations.length>0&&e.push(this._specularTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),e}getActiveTextures(){const e=super.getActiveTextures();return this._diffuseTexture&&e.push(this._diffuseTexture),this._ambientTexture&&e.push(this._ambientTexture),this._opacityTexture&&e.push(this._opacityTexture),this._reflectionTexture&&e.push(this._reflectionTexture),this._emissiveTexture&&e.push(this._emissiveTexture),this._specularTexture&&e.push(this._specularTexture),this._bumpTexture&&e.push(this._bumpTexture),this._lightmapTexture&&e.push(this._lightmapTexture),this._refractionTexture&&e.push(this._refractionTexture),e}hasTexture(e){return!!(super.hasTexture(e)||this._diffuseTexture===e||this._ambientTexture===e||this._opacityTexture===e||this._reflectionTexture===e||this._emissiveTexture===e||this._specularTexture===e||this._bumpTexture===e||this._lightmapTexture===e||this._refractionTexture===e)}dispose(e,t){var i,s,n,r,o,h,l,c,u;t&&((i=this._diffuseTexture)==null||i.dispose(),(s=this._ambientTexture)==null||s.dispose(),(n=this._opacityTexture)==null||n.dispose(),(r=this._reflectionTexture)==null||r.dispose(),(o=this._emissiveTexture)==null||o.dispose(),(h=this._specularTexture)==null||h.dispose(),(l=this._bumpTexture)==null||l.dispose(),(c=this._lightmapTexture)==null||c.dispose(),(u=this._refractionTexture)==null||u.dispose()),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(e,t)}clone(e,t=!0,i=""){const s=Ae.Clone(()=>new ee(e,this.getScene()),this,{cloneTexturesOnlyOnce:t});return s.name=e,s.id=e,this.stencil.copyTo(s.stencil),this._clonePlugins(s,i),s}static Parse(e,t,i){const s=Ae.Parse(()=>new ee(e.name,t),e,t,i);return e.stencil&&s.stencil.parse(e.stencil,t,i),X._ParsePlugins(e,s,t,i),s}static get DiffuseTextureEnabled(){return De.DiffuseTextureEnabled}static set DiffuseTextureEnabled(e){De.DiffuseTextureEnabled=e}static get DetailTextureEnabled(){return De.DetailTextureEnabled}static set DetailTextureEnabled(e){De.DetailTextureEnabled=e}static get AmbientTextureEnabled(){return De.AmbientTextureEnabled}static set AmbientTextureEnabled(e){De.AmbientTextureEnabled=e}static get OpacityTextureEnabled(){return De.OpacityTextureEnabled}static set OpacityTextureEnabled(e){De.OpacityTextureEnabled=e}static get ReflectionTextureEnabled(){return De.ReflectionTextureEnabled}static set ReflectionTextureEnabled(e){De.ReflectionTextureEnabled=e}static get EmissiveTextureEnabled(){return De.EmissiveTextureEnabled}static set EmissiveTextureEnabled(e){De.EmissiveTextureEnabled=e}static get SpecularTextureEnabled(){return De.SpecularTextureEnabled}static set SpecularTextureEnabled(e){De.SpecularTextureEnabled=e}static get BumpTextureEnabled(){return De.BumpTextureEnabled}static set BumpTextureEnabled(e){De.BumpTextureEnabled=e}static get LightmapTextureEnabled(){return De.LightmapTextureEnabled}static set LightmapTextureEnabled(e){De.LightmapTextureEnabled=e}static get RefractionTextureEnabled(){return De.RefractionTextureEnabled}static set RefractionTextureEnabled(e){De.RefractionTextureEnabled=e}static get ColorGradingTextureEnabled(){return De.ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(e){De.ColorGradingTextureEnabled=e}static get FresnelEnabled(){return De.FresnelEnabled}static set FresnelEnabled(e){De.FresnelEnabled=e}}ee.ForceGLSL=!1;D([_i("diffuseTexture")],ee.prototype,"_diffuseTexture",void 0);D([je("_markAllSubMeshesAsTexturesAndMiscDirty")],ee.prototype,"diffuseTexture",void 0);D([_i("ambientTexture")],ee.prototype,"_ambientTexture",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"ambientTexture",void 0);D([_i("opacityTexture")],ee.prototype,"_opacityTexture",void 0);D([je("_markAllSubMeshesAsTexturesAndMiscDirty")],ee.prototype,"opacityTexture",void 0);D([_i("reflectionTexture")],ee.prototype,"_reflectionTexture",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"reflectionTexture",void 0);D([_i("emissiveTexture")],ee.prototype,"_emissiveTexture",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"emissiveTexture",void 0);D([_i("specularTexture")],ee.prototype,"_specularTexture",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"specularTexture",void 0);D([_i("bumpTexture")],ee.prototype,"_bumpTexture",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"bumpTexture",void 0);D([_i("lightmapTexture")],ee.prototype,"_lightmapTexture",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"lightmapTexture",void 0);D([_i("refractionTexture")],ee.prototype,"_refractionTexture",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"refractionTexture",void 0);D([ls("ambient")],ee.prototype,"ambientColor",void 0);D([ls("diffuse")],ee.prototype,"diffuseColor",void 0);D([ls("specular")],ee.prototype,"specularColor",void 0);D([ls("emissive")],ee.prototype,"emissiveColor",void 0);D([B()],ee.prototype,"specularPower",void 0);D([B("useAlphaFromDiffuseTexture")],ee.prototype,"_useAlphaFromDiffuseTexture",void 0);D([je("_markAllSubMeshesAsTexturesAndMiscDirty")],ee.prototype,"useAlphaFromDiffuseTexture",void 0);D([B("useEmissiveAsIllumination")],ee.prototype,"_useEmissiveAsIllumination",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"useEmissiveAsIllumination",void 0);D([B("linkEmissiveWithDiffuse")],ee.prototype,"_linkEmissiveWithDiffuse",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"linkEmissiveWithDiffuse",void 0);D([B("useSpecularOverAlpha")],ee.prototype,"_useSpecularOverAlpha",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"useSpecularOverAlpha",void 0);D([B("useReflectionOverAlpha")],ee.prototype,"_useReflectionOverAlpha",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"useReflectionOverAlpha",void 0);D([B("disableLighting")],ee.prototype,"_disableLighting",void 0);D([je("_markAllSubMeshesAsLightsDirty")],ee.prototype,"disableLighting",void 0);D([B("useObjectSpaceNormalMap")],ee.prototype,"_useObjectSpaceNormalMap",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"useObjectSpaceNormalMap",void 0);D([B("useParallax")],ee.prototype,"_useParallax",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"useParallax",void 0);D([B("useParallaxOcclusion")],ee.prototype,"_useParallaxOcclusion",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"useParallaxOcclusion",void 0);D([B()],ee.prototype,"parallaxScaleBias",void 0);D([B("roughness")],ee.prototype,"_roughness",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"roughness",void 0);D([B()],ee.prototype,"indexOfRefraction",void 0);D([B()],ee.prototype,"invertRefractionY",void 0);D([B()],ee.prototype,"alphaCutOff",void 0);D([B("useLightmapAsShadowmap")],ee.prototype,"_useLightmapAsShadowmap",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"useLightmapAsShadowmap",void 0);D([Kn("diffuseFresnelParameters")],ee.prototype,"_diffuseFresnelParameters",void 0);D([je("_markAllSubMeshesAsFresnelDirty")],ee.prototype,"diffuseFresnelParameters",void 0);D([Kn("opacityFresnelParameters")],ee.prototype,"_opacityFresnelParameters",void 0);D([je("_markAllSubMeshesAsFresnelAndMiscDirty")],ee.prototype,"opacityFresnelParameters",void 0);D([Kn("reflectionFresnelParameters")],ee.prototype,"_reflectionFresnelParameters",void 0);D([je("_markAllSubMeshesAsFresnelDirty")],ee.prototype,"reflectionFresnelParameters",void 0);D([Kn("refractionFresnelParameters")],ee.prototype,"_refractionFresnelParameters",void 0);D([je("_markAllSubMeshesAsFresnelDirty")],ee.prototype,"refractionFresnelParameters",void 0);D([Kn("emissiveFresnelParameters")],ee.prototype,"_emissiveFresnelParameters",void 0);D([je("_markAllSubMeshesAsFresnelDirty")],ee.prototype,"emissiveFresnelParameters",void 0);D([B("useReflectionFresnelFromSpecular")],ee.prototype,"_useReflectionFresnelFromSpecular",void 0);D([je("_markAllSubMeshesAsFresnelDirty")],ee.prototype,"useReflectionFresnelFromSpecular",void 0);D([B("useGlossinessFromSpecularMapAlpha")],ee.prototype,"_useGlossinessFromSpecularMapAlpha",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"useGlossinessFromSpecularMapAlpha",void 0);D([B("maxSimultaneousLights")],ee.prototype,"_maxSimultaneousLights",void 0);D([je("_markAllSubMeshesAsLightsDirty")],ee.prototype,"maxSimultaneousLights",void 0);D([B("invertNormalMapX")],ee.prototype,"_invertNormalMapX",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"invertNormalMapX",void 0);D([B("invertNormalMapY")],ee.prototype,"_invertNormalMapY",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"invertNormalMapY",void 0);D([B("twoSidedLighting")],ee.prototype,"_twoSidedLighting",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],ee.prototype,"twoSidedLighting",void 0);D([B("applyDecalMapAfterDetailMap")],ee.prototype,"_applyDecalMapAfterDetailMap",void 0);D([je("_markAllSubMeshesAsMiscDirty")],ee.prototype,"applyDecalMapAfterDetailMap",void 0);vt("BABYLON.StandardMaterial",ee);it.DefaultMaterialFactory=a=>new ee("default material",a);function Dg(a,e){const t=e.method||"GET";return new Promise((i,s)=>{const n=new Ft;n.addEventListener("readystatechange",()=>{if(n.readyState==4)if(n.status==200){const r={};if(e.responseHeaders)for(const o of e.responseHeaders)r[o]=n.getResponseHeader(o)||"";i({response:n.response,headerValues:r})}else s("Unable to fetch data from ".concat(a,". Error code: ").concat(n.status))}),n.open(t,a),n.send()})}var Zh;(function(a){a[a.Clean=0]="Clean",a[a.Stop=1]="Stop",a[a.Sync=2]="Sync",a[a.NoSync=3]="NoSync"})(Zh||(Zh={}));function Fg(a){return!!a.createPlugin}function Og(a){return!!a.name}const Vc=new Z,Wi={};let Ra=!1;function $r(){return Wi[".babylon"]}function Bg(a){for(const e in Wi){const t=Wi[e];if(t.mimeType===a)return t}}function Ka(a,e){const t=Wi[a];return t||(U.Warn("Unable to find a plugin to load "+a+" files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes"),e?$r():void 0)}function Lg(a){return!!Wi[a]}function Ng(a){for(const e in Wi){const t=Wi[e].plugin;if(t.canDirectLoad&&t.canDirectLoad(a))return Wi[e]}return $r()}function Ug(a){const e=a.indexOf("?");e!==-1&&(a=a.substring(0,e));const t=a.lastIndexOf(".");return a.substring(t,a.length).toLowerCase()}function kg(a){return a.substring(0,5)==="data:"?a.substring(5):null}function z0(a,e,t){let s="Unable to load from "+(a.rawData?"binary data":a.url);return e?s+=": ".concat(e):t&&(s+=": ".concat(t)),s}async function W0(a,e,t,i,s,n,r,o,h){var d;const l=kg(a.url);if(a.rawData&&!r)throw"When using ArrayBufferView to load data the file extension must be provided.";const c=!l&&!r?Ug(a.url):"";let u=r?Ka(r,!0):l?Ng(a.url):Ka(c,!1);if(!u&&c){if(a.url&&!a.url.startsWith("blob:")){const _=await Dg(a.url,{method:"HEAD",responseHeaders:["Content-Type"]}),p=_.headerValues?_.headerValues["Content-Type"]:"";p&&(u=Bg(p))}u||(u=$r())}if(!u)throw new Error("No plugin or fallback for ".concat(r!=null?r:a.url));if(((d=h==null?void 0:h[u.plugin.name])==null?void 0:d.enabled)===!1)throw new Error("The '".concat(u.plugin.name,"' plugin is disabled via the loader options passed to the loading operation."));if(a.rawData&&!u.isBinary)throw"Loading from ArrayBufferView can not be used with plugins that don't support binary loading.";return(_=>{if(Fg(u.plugin)){const g=u.plugin.createPlugin(h!=null?h:{});return g instanceof Promise?(g.then(_).catch(m=>{s("Error instantiating plugin.",m)}),null):(_(g),g)}else return _(u.plugin),u.plugin})(_=>{var y;if(!_)throw"The loader plugin corresponding to the '".concat(r,"' file type has not been found. If using es6, please import the plugin you wish to use before.");if(Vc.notifyObservers(_),l&&(_.canDirectLoad&&_.canDirectLoad(a.url)||!y0(a.url))){if(_.directLoad){const R=_.directLoad(e,l);R instanceof Promise?R.then(E=>{t(_,E)}).catch(E=>{s("Error in directLoad of _loadData: "+E,E)}):t(_,R)}else t(_,l);return}const p=u.isBinary,g=(R,E)=>{if(e.isDisposed){s("Scene has been disposed");return}t(_,R,E)};let m=null,b=!1;(y=_.onDisposeObservable)==null||y.add(()=>{b=!0,m&&(m.abort(),m=null),n()});const I=()=>{if(b)return;const R=(E,C)=>{s(E==null?void 0:E.statusText,C)};if(!_.loadFile&&a.rawData)throw"Plugin does not support loading ArrayBufferView.";m=_.loadFile?_.loadFile(e,a.rawData||a.file||a.url,a.rootUrl,g,i,p,R,o):e._loadFile(a.file||a.url,g,i,!0,p,R)},T=e.getEngine();let x=T.enableOfflineSupport;if(x){let R=!1;for(const E of e.disableOfflineSupportExceptionRules)if(E.test(a.url)){R=!0;break}x=!R}x&&ae.OfflineProviderFactory?e.offlineProvider=ae.OfflineProviderFactory(a.url,I,T.disableManifestCheck):I()})}function H0(a,e){let t,i,s=null,n=null;if(!e)t=a,i=J.GetFilename(a),a=J.GetFolderPath(a);else if(Og(e))t="file:".concat(e.name),i=e.name,s=e;else if(ArrayBuffer.isView(e))t="",i=g0(),n=e;else if(e.startsWith("data:"))t=e,i="";else if(a){const r=e;if(r.substring(0,1)==="/")return J.Error("Wrong sceneFilename parameter"),null;t=a+r,i=r}else t=e,i=J.GetFilename(e),a=J.GetFolderPath(e);return{url:t,rootUrl:a,name:i,file:s,rawData:n}}function Gc(a){if(typeof a.extensions=="string"){const e=a.extensions;Wi[e.toLowerCase()]={plugin:a,isBinary:!1}}else{const e=a.extensions;Object.keys(e).forEach(t=>{Wi[t.toLowerCase()]={plugin:a,isBinary:e[t].isBinary,mimeType:e[t].mimeType}})}}async function zc(a,e,t="",i=Ee.LastCreatedScene,s=null,n=null,r=null,o=null,h="",l={}){if(!i)return U.Error("No scene available to import mesh to"),null;const c=H0(e,t);if(!c)return null;const u={};i.addPendingData(u);const f=()=>{i.removePendingData(u)},d=(g,m)=>{const b=z0(c,g,m);r?r(i,b,new cs(b,Hs.SceneLoaderError,m)):U.Error(b),f()},_=n?g=>{try{n(g)}catch(m){d("Error in onProgress callback: "+m,m)}}:void 0,p=(g,m,b,I,T,x,y,R)=>{if(i.importedMeshesFiles.push(c.url),s)try{s(g,m,b,I,T,x,y,R)}catch(E){d("Error in onSuccess callback: "+E,E)}i.removePendingData(u)};return await W0(c,i,(g,m,b)=>{if(g.rewriteRootURL&&(c.rootUrl=g.rewriteRootURL(c.rootUrl,b)),g.importMesh){const I=g,T=[],x=[],y=[];if(!I.importMesh(a,i,m,c.rootUrl,T,x,y,d))return;i.loadingPluginName=g.name,p(T,x,y,[],[],[],[],[])}else g.importMeshAsync(a,i,m,c.rootUrl,_,c.name).then(T=>{i.loadingPluginName=g.name,p(T.meshes,T.particleSystems,T.skeletons,T.animationGroups,T.transformNodes,T.geometries,T.lights,T.spriteManagers)}).catch(T=>{d(T.message,T)})},_,d,f,o,h,l)}function Vg(a,e,t,i,s,n,r,o){return new Promise((h,l)=>{zc(a,e,t,i,(c,u,f,d,_,p,g,m)=>{h({meshes:c,particleSystems:u,skeletons:f,animationGroups:d,transformNodes:_,geometries:p,lights:g,spriteManagers:m})},s,(c,u,f)=>{l(f||new Error(u))},n,r,o)})}function Wc(a,e="",t=Ee.LastCreatedEngine,i=null,s=null,n=null,r=null,o="",h={}){if(!t){J.Error("No engine available");return}K0(a,e,new it(t),i,s,n,r,o,h)}function Gg(a,e,t,i,s,n,r){return new Promise((o,h)=>{Wc(a,e,t,l=>{o(l)},i,(l,c,u)=>{h(u||new Error(c))},s,n,r)})}async function K0(a,e="",t=Ee.LastCreatedScene,i=null,s=null,n=null,r=null,o="",h={}){if(!t)return U.Error("No scene available to append to"),null;const l=H0(a,e);if(!l)return null;const c={};t.addPendingData(c);const u=()=>{t.removePendingData(c)};Tt.ShowLoadingScreen&&!Ra&&(Ra=!0,t.getEngine().displayLoadingUI(),t.executeWhenReady(()=>{t.getEngine().hideLoadingUI(),Ra=!1}));const f=(p,g)=>{const m=z0(l,p,g);n?n(t,m,new cs(m,Hs.SceneLoaderError,g)):U.Error(m),u()},d=s?p=>{try{s(p)}catch(g){f("Error in onProgress callback",g)}}:void 0,_=()=>{if(i)try{i(t)}catch(p){f("Error in onSuccess callback",p)}t.removePendingData(c)};return await W0(l,t,(p,g)=>{if(p.load){if(!p.load(t,g,l.rootUrl,f))return;t.loadingPluginName=p.name,_()}else p.loadAsync(t,g,l.rootUrl,d,l.name).then(()=>{t.loadingPluginName=p.name,_()}).catch(b=>{f(b.message,b)})},d,f,u,r,o,h)}function zg(a,e,t,i,s,n,r){return new Promise((o,h)=>{K0(a,e,t,l=>{o(l)},i,(l,c,u)=>{h(u||new Error(c))},s,n,r)})}async function X0(a,e="",t=Ee.LastCreatedScene,i=null,s=null,n=null,r=null,o="",h={}){if(!t)return U.Error("No scene available to load asset container to"),null;const l=H0(a,e);if(!l)return null;const c={};t.addPendingData(c);const u=()=>{t.removePendingData(c)},f=(p,g)=>{const m=z0(l,p,g);n?n(t,m,new cs(m,Hs.SceneLoaderError,g)):U.Error(m),u()},d=s?p=>{try{s(p)}catch(g){f("Error in onProgress callback",g)}}:void 0,_=p=>{if(i)try{i(p)}catch(g){f("Error in onSuccess callback",g)}t.removePendingData(c)};return await W0(l,t,(p,g)=>{if(p.loadAssetContainer){const b=p.loadAssetContainer(t,g,l.rootUrl,f);if(!b)return;b.populateRootNodes(),t.loadingPluginName=p.name,_(b)}else p.loadAssetContainerAsync?p.loadAssetContainerAsync(t,g,l.rootUrl,d,l.name).then(b=>{b.populateRootNodes(),t.loadingPluginName=p.name,_(b)}).catch(b=>{f(b.message,b)}):f("LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.")},d,f,u,r,o,h)}function Wg(a,e,t,i,s,n,r){return new Promise((o,h)=>{X0(a,e,t,l=>{o(l)},i,(l,c,u)=>{h(u||new Error(c))},s,n,r)})}function Hc(a,e="",t=Ee.LastCreatedScene,i=!0,s=0,n=null,r=null,o=null,h=null,l=null,c="",u={}){if(!t){U.Error("No scene available to load animations to");return}if(i){for(const p of t.animatables)p.reset();t.stopAllAnimations(),t.animationGroups.slice().forEach(p=>{p.dispose()}),t.getNodes().forEach(p=>{p.animations&&(p.animations=[])})}else switch(s){case 0:t.animationGroups.slice().forEach(_=>{_.dispose()});break;case 1:t.animationGroups.forEach(_=>{_.stop()});break;case 2:t.animationGroups.forEach(_=>{_.reset(),_.restart()});break;case 3:break;default:U.Error("Unknown animation group loading mode value '"+s+"'");return}const f=t.animatables.length;X0(a,e,t,_=>{_.mergeAnimationsTo(t,t.animatables.slice(f),n),_.dispose(),t.onAnimationFileImportedObservable.notifyObservers(t),r&&r(t)},o,h,l,c,u)}function Hg(a,e,t,i,s,n,r,o,h,l){return new Promise((c,u)=>{Hc(a,e,t,i,s,n,f=>{c(f)},r,(f,d,_)=>{u(_||new Error(d))},o,h,l)})}class ks{static get ForceFullSceneLoadingForIncremental(){return Tt.ForceFullSceneLoadingForIncremental}static set ForceFullSceneLoadingForIncremental(e){Tt.ForceFullSceneLoadingForIncremental=e}static get ShowLoadingScreen(){return Tt.ShowLoadingScreen}static set ShowLoadingScreen(e){Tt.ShowLoadingScreen=e}static get loggingLevel(){return Tt.loggingLevel}static set loggingLevel(e){Tt.loggingLevel=e}static get CleanBoneMatrixWeights(){return Tt.CleanBoneMatrixWeights}static set CleanBoneMatrixWeights(e){Tt.CleanBoneMatrixWeights=e}static GetDefaultPlugin(){return $r()}static GetPluginForExtension(e){var t;return(t=Ka(e,!0))==null?void 0:t.plugin}static IsPluginForExtensionAvailable(e){return Lg(e)}static RegisterPlugin(e){Gc(e)}static ImportMesh(e,t,i,s,n,r,o,h,l){zc(e,t,i,s,n,r,o,h,l)}static ImportMeshAsync(e,t,i,s,n,r,o){return Vg(e,t,i,s,n,r,o)}static Load(e,t,i,s,n,r,o,h){Wc(e,t,i,s,n,r,o,h)}static LoadAsync(e,t,i,s,n,r){return Gg(e,t,i,s,n,r)}static Append(e,t,i,s,n,r,o,h){K0(e,t,i,s,n,r,o,h)}static AppendAsync(e,t,i,s,n,r){return zg(e,t,i,s,n,r)}static LoadAssetContainer(e,t,i,s,n,r,o,h){X0(e,t,i,s,n,r,o,h)}static LoadAssetContainerAsync(e,t,i,s,n,r){return Wg(e,t,i,s,n,r)}static ImportAnimations(e,t,i,s,n,r,o,h,l,c,u){Hc(e,t,i,s,n,r,o,h,l,c,u)}static ImportAnimationsAsync(e,t,i,s,n,r,o,h,l,c,u){return Hg(e,t,i,s,n,r,h,c,u)}}ks.NO_LOGGING=0;ks.MINIMAL_LOGGING=1;ks.SUMMARY_LOGGING=2;ks.DETAILED_LOGGING=3;ks.OnPluginActivatedObservable=Vc;class Zr extends mt{getClassName(){return"FxaaPostProcess"}constructor(e,t,i=null,s,n,r,o=0){super(e,"fxaa",["texelSize"],null,t,i,s||ie.BILINEAR_SAMPLINGMODE,n,r,null,o,"fxaa",void 0,!0);const h=this._getDefines();this.updateEffect(h),this.onApplyObservable.add(l=>{const c=this.texelSize;l.setFloat2("texelSize",c.x,c.y)})}_gatherImports(e,t){e?(this._webGPUReady=!0,t.push(Promise.all([Oe(()=>import("./fxaa.fragment-CKBSH8ak.js"),__vite__mapDeps([40,3,4,5,6,7,8,9,10])),Oe(()=>import("./fxaa.vertex-pl3gzfER.js"),__vite__mapDeps([41,3,4,5,6,7,8,9,10]))]))):t.push(Promise.all([Oe(()=>import("./fxaa.fragment-CQ-OctB5.js"),__vite__mapDeps([42,3,4,5,6,7,8,9,10])),Oe(()=>import("./fxaa.vertex-D11BDiUg.js"),__vite__mapDeps([43,3,4,5,6,7,8,9,10]))])),super._gatherImports(e,t)}_getDefines(){const e=this.getEngine();return e&&e.extractDriverInfo().toLowerCase().indexOf("mali")>-1?"#define MALI 1\n":null}static _Parse(e,t,i,s){return Ae.Parse(()=>new Zr(e.name,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable),e,i,s)}}vt("BABYLON.FxaaPostProcess",Zr);let Ds,Os=null;async function Kg(){return Os||(Os=new Promise((a,e)=>{let t,i=null;const s={preserveDrawingBuffer:!0,depth:!1,stencil:!1,alpha:!0,premultipliedAlpha:!1,antialias:!1,failIfMajorPerformanceCaveat:!1};Oe(async()=>{const{ThinEngine:n}=await Promise.resolve().then(()=>kd);return{ThinEngine:n}},void 0).then(({ThinEngine:n})=>{try{t=new OffscreenCanvas(100,100),i=new n(t,!1,s)}catch{t=document.createElement("canvas"),i=new n(t,!1,s)}Ee.Instances.pop(),Ee.OnEnginesDisposedObservable.add(o=>{i&&o!==i&&!i.isDisposed&&Ee.Instances.length===0&&j0()}),i.getCaps().parallelShaderCompile=void 0;const r=new tp(i);Oe(async()=>{const{passPixelShader:o}=await import("./pass.fragment-BkcfUm5b.js");return{passPixelShader:o}},__vite__mapDeps([19,3,4,5,6,7,8,9,10])).then(({passPixelShader:o})=>{if(!i){e("Engine is not defined");return}const h=new Kt({engine:i,name:o.name,fragmentShader:o.shader,samplerNames:["textureSampler"]});Ds={canvas:t,engine:i,renderer:r,wrapper:h},a(Ds)})}).catch(e)})),await Os}async function Y0(a,e,t,i,s="image/png",n,r){const o=await t.readPixels(0,0,a,e),h=new Uint8Array(o.buffer);Vs(a,e,h,i,s,n,!0,void 0,r)}function q0(a,e,t,i="image/png",s,n=!1,r=!1,o){return new Promise(h=>{Vs(a,e,t,l=>h(l),i,s,n,r,o)})}function Vs(a,e,t,i,s="image/png",n,r=!1,o=!1,h){Kg().then(l=>{if(l.engine.setSize(a,e,!0),t instanceof Float32Array){const u=new Uint8Array(t.length);let f=t.length;for(;f--;){const d=t[f];u[f]=Math.round(ht(d)*255)}t=u}const c=l.engine.createRawTexture(t,a,e,5,!1,!r,1);l.renderer.setViewport(),l.renderer.applyEffectWrapper(l.wrapper),l.wrapper.effect._bindTexture("textureSampler",c),l.renderer.draw(),o?J.ToBlob(l.canvas,u=>{const f=new FileReader;f.onload=d=>{const _=d.target.result;i&&i(_)},f.readAsArrayBuffer(u)},s,h):J.EncodeScreenshotCanvasData(l.canvas,i,s,n,h),c.dispose()})}function j0(){Ds?(Ds.wrapper.dispose(),Ds.renderer.dispose(),Ds.engine.dispose()):Os==null||Os.then(a=>{a.wrapper.dispose(),a.renderer.dispose(),a.engine.dispose()}),Os=null,Ds=null}const Xg={DumpData:Vs,DumpDataAsync:q0,DumpFramebuffer:Y0,Dispose:j0},Yg=()=>{J.DumpData=Vs,J.DumpDataAsync=q0,J.DumpFramebuffer=Y0};Yg();const qg=Object.freeze(Object.defineProperty({__proto__:null,Dispose:j0,DumpData:Vs,DumpDataAsync:q0,DumpFramebuffer:Y0,DumpTools:Xg},Symbol.toStringTag,{value:"Module"}));let ps=null;function Qr(a,e,t,i,s="image/png",n=!1,r){const{height:o,width:h}=Yc(a,e,t);if(!(o&&h)){U.Error("Invalid 'size' parameter !");return}ps||(ps=document.createElement("canvas")),ps.width=h,ps.height=o;const l=ps.getContext("2d"),c=a.getRenderWidth()/a.getRenderHeight();let u=h,f=u/c;f>o&&(f=o,u=f*c);const d=Math.max(0,h-u)/2,_=Math.max(0,o-f)/2;e.getScene().activeCamera!==e?Jr(a,e,t,g=>{if(n){const m=new Blob([g]);J.DownloadBlob(m),i&&i("")}else i&&i(g)},s,1,a.getCreationOptions().antialias,void 0,void 0,void 0,void 0,r):a.onEndFrameObservable.addOnce(()=>{const g=a.getRenderingCanvas();l&&g&&l.drawImage(g,d,_,u,f),ps&&(n?(J.EncodeScreenshotCanvasData(ps,void 0,s,void 0,r),i&&i("")):J.EncodeScreenshotCanvasData(ps,i,s,void 0,r))})}function Kc(a,e,t,i="image/png",s){return new Promise((n,r)=>{Qr(a,e,t,o=>{typeof o<"u"?n(o):r(new Error("Data is undefined"))},i,void 0,s)})}function jg(a,e,t,i,s="image/png",n){return new Promise(r=>{Qr(a,e,{width:t,height:i},()=>{r()},s,!0,n)})}function Jr(a,e,t,i,s="image/png",n=1,r=!1,o,h=!1,l=!1,c=!0,u,f){const{height:d,width:_,finalWidth:p,finalHeight:g}=Yc(a,e,t),m={width:_,height:d};if(!(d&&_)){U.Error("Invalid 'size' parameter !");return}const b={width:a.getRenderWidth(),height:a.getRenderHeight()};a.setSize(_,d);const I=e.getScene(),T=new us("screenShot",m,I,!1,!1,0,!1,ie.BILINEAR_SAMPLINGMODE,void 0,l,void 0,void 0,void 0,n);T.renderList=I.meshes.slice(),T.samples=n,T.renderSprites=h,T.activeCamera=e,T.forceLayerMaskCheck=c,f==null||f(T);const x=()=>{T.isReadyForRendering()&&e.isReady(!0)?(a.onEndFrameObservable.addOnce(()=>{p===_&&g===d?T.readPixels(void 0,void 0,void 0,!1).then(R=>{Vs(_,d,R,i,s,o,!0,void 0,u),T.dispose()}):(a.isWebGPU?Oe(()=>import("./pass.fragment-CM2j9WLA.js"),__vite__mapDeps([18,3,4,5,6,7,8,9,10])):Oe(()=>import("./pass.fragment-BkcfUm5b.js"),__vite__mapDeps([19,3,4,5,6,7,8,9,10]))).then(()=>ip("pass",T.getInternalTexture(),I,void 0,void 0,void 0,p,g).then(E=>{a._readTexturePixels(E,p,g,-1,0,null,!0,!1,0,0).then(C=>{Vs(p,g,C,i,s,o,!0,void 0,u),E.dispose()})}))}),I.incrementRenderId(),I.resetCachedMaterial(),T.render(!0),a.setSize(b.width,b.height),e.getProjectionMatrix(!0)):setTimeout(x,16)},y=()=>{I.incrementRenderId(),I.resetCachedMaterial(),x()};if(r){const R=new Zr("antialiasing",1,I.activeCamera);T.addPostProcess(R),R.onEffectCreatedObservable.addOnce(E=>{E.isReady()?y():E.onCompiled=()=>{y()}})}else y()}function Xc(a,e,t,i="image/png",s=1,n=!1,r,o=!1,h=!1,l=!0,c,u){return new Promise((f,d)=>{Jr(a,e,t,_=>{typeof _<"u"?f(_):d(new Error("Data is undefined"))},i,s,n,r,o,h,l,c,u)})}function Yc(a,e,t){let i=0,s=0,n=0,r=0;if(typeof t=="object"){const o=t.precision?Math.abs(t.precision):1;t.width&&t.height?(i=t.height*o,s=t.width*o):t.width&&!t.height?(s=t.width*o,i=Math.round(s/a.getAspectRatio(e))):t.height&&!t.width?(i=t.height*o,s=Math.round(i*a.getAspectRatio(e))):(s=Math.round(a.getRenderWidth()*o),i=Math.round(s/a.getAspectRatio(e))),t.finalWidth&&t.finalHeight?(r=t.finalHeight,n=t.finalWidth):t.finalWidth&&!t.finalHeight?(n=t.finalWidth,r=Math.round(n/a.getAspectRatio(e))):t.finalHeight&&!t.finalWidth?(r=t.finalHeight,n=Math.round(r*a.getAspectRatio(e))):(n=s,r=i)}else isNaN(t)||(i=t,s=t,n=t,r=t);return s&&(s=Math.floor(s)),i&&(i=Math.floor(i)),n&&(n=Math.floor(n)),r&&(r=Math.floor(r)),{height:i|0,width:s|0,finalWidth:n|0,finalHeight:r|0}}const $g={CreateScreenshot:Qr,CreateScreenshotAsync:Kc,CreateScreenshotWithResizeAsync:jg,CreateScreenshotUsingRenderTarget:Jr,CreateScreenshotUsingRenderTargetAsync:Xc},Zg=()=>{J.CreateScreenshot=Qr,J.CreateScreenshotAsync=Kc,J.CreateScreenshotUsingRenderTarget=Jr,J.CreateScreenshotUsingRenderTargetAsync=Xc};Zg();F._instancedMeshFactory=(a,e)=>{const t=new ea(a,e);if(e.instancedBuffers){t.instancedBuffers={};for(const i in e.instancedBuffers)t.instancedBuffers[i]=e.instancedBuffers[i]}return t};class ea extends Qe{constructor(e,t){super(e,t.getScene()),this._indexInSourceMeshInstanceArray=-1,this._distanceToCamera=0,t.addInstance(this),this._sourceMesh=t,this._unIndexed=t._unIndexed,this.position.copyFrom(t.position),this.rotation.copyFrom(t.rotation),this.scaling.copyFrom(t.scaling),t.rotationQuaternion&&(this.rotationQuaternion=t.rotationQuaternion.clone()),this.animations=t.animations.slice();for(const i of t.getAnimationRanges())i!=null&&this.createAnimationRange(i.name,i.from,i.to);this.infiniteDistance=t.infiniteDistance,this.setPivotMatrix(t.getPivotMatrix()),this.refreshBoundingInfo(!0,!0),this._syncSubMeshes()}getClassName(){return"InstancedMesh"}get lightSources(){return this._sourceMesh._lightSources}_resyncLightSources(){}_resyncLightSource(){}_removeLightSource(){}get receiveShadows(){return this._sourceMesh.receiveShadows}set receiveShadows(e){var t;((t=this._sourceMesh)==null?void 0:t.receiveShadows)!==e&&J.Warn("Setting receiveShadows on an instanced mesh has no effect")}get material(){return this._sourceMesh.material}set material(e){var t;((t=this._sourceMesh)==null?void 0:t.material)!==e&&J.Warn("Setting material on an instanced mesh has no effect")}get visibility(){return this._sourceMesh.visibility}set visibility(e){var t;((t=this._sourceMesh)==null?void 0:t.visibility)!==e&&J.Warn("Setting visibility on an instanced mesh has no effect")}get skeleton(){return this._sourceMesh.skeleton}set skeleton(e){var t;((t=this._sourceMesh)==null?void 0:t.skeleton)!==e&&J.Warn("Setting skeleton on an instanced mesh has no effect")}get renderingGroupId(){return this._sourceMesh.renderingGroupId}set renderingGroupId(e){!this._sourceMesh||e===this._sourceMesh.renderingGroupId||U.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene")}getTotalVertices(){return this._sourceMesh?this._sourceMesh.getTotalVertices():0}getTotalIndices(){return this._sourceMesh.getTotalIndices()}get sourceMesh(){return this._sourceMesh}createInstance(e){return this._sourceMesh.createInstance(e)}isReady(e=!1){return this._sourceMesh.isReady(e,!0)}getVerticesData(e,t,i){return this._sourceMesh.getVerticesData(e,t,i)}copyVerticesData(e,t){this._sourceMesh.copyVerticesData(e,t)}setVerticesData(e,t,i,s){return this.sourceMesh&&this.sourceMesh.setVerticesData(e,t,i,s),this.sourceMesh}updateVerticesData(e,t,i,s){return this.sourceMesh&&this.sourceMesh.updateVerticesData(e,t,i,s),this.sourceMesh}setIndices(e,t=null){return this.sourceMesh&&this.sourceMesh.setIndices(e,t),this.sourceMesh}isVerticesDataPresent(e){return this._sourceMesh.isVerticesDataPresent(e)}getIndices(){return this._sourceMesh.getIndices()}get _positions(){return this._sourceMesh._positions}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let i;typeof e=="object"?i=e:i={applySkeleton:e,applyMorph:t};const s=this._sourceMesh.geometry?this._sourceMesh.geometry.boundingBias:null;return this._refreshBoundingInfo(this._sourceMesh._getData(i,null,A.PositionKind),s),this}_preActivate(){return this._currentLOD&&this._currentLOD._preActivate(),this}_activate(e,t){if(super._activate(e,t),this._sourceMesh.subMeshes||U.Warn("Instances should only be created for meshes with geometry."),this._currentLOD){if(this._currentLOD._getWorldMatrixDeterminant()>=0!=this._getWorldMatrixDeterminant()>=0)return this._internalAbstractMeshDataInfo._actAsRegularMesh=!0,!0;if(this._internalAbstractMeshDataInfo._actAsRegularMesh=!1,this._currentLOD._registerInstanceForRenderId(this,e),t){if(!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!0,!0}else if(!this._currentLOD._internalAbstractMeshDataInfo._isActive)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances=!0,!0}return!1}_postActivate(){this._sourceMesh.edgesShareWithInstances&&this._sourceMesh._edgesRenderer&&this._sourceMesh._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup?(this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer),this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())):this._edgesRenderer&&this._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup&&this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer)}getWorldMatrix(){if(this._currentLOD&&this._currentLOD.billboardMode!==Te.BILLBOARDMODE_NONE&&this._currentLOD._masterMesh!==this){this._billboardWorldMatrix||(this._billboardWorldMatrix=new O);const e=this._currentLOD._masterMesh;return this._currentLOD._masterMesh=this,N.Vector3[7].copyFrom(this._currentLOD.position),this._currentLOD.position.set(0,0,0),this._billboardWorldMatrix.copyFrom(this._currentLOD.computeWorldMatrix(!0)),this._currentLOD.position.copyFrom(N.Vector3[7]),this._currentLOD._masterMesh=e,this._billboardWorldMatrix}return super.getWorldMatrix()}get isAnInstance(){return!0}getLOD(e){if(!e)return this;const t=this.sourceMesh.getLODLevels();if(!t||t.length===0)this._currentLOD=this.sourceMesh;else{const i=this.getBoundingInfo();this._currentLOD=this.sourceMesh.getLOD(e,i.boundingSphere)}return this._currentLOD}_preActivateForIntermediateRendering(e){return this.sourceMesh._preActivateForIntermediateRendering(e)}_syncSubMeshes(){if(this.releaseSubMeshes(),this._sourceMesh.subMeshes)for(let e=0;e(s.toArray(i,i.length),i),[]),this}setColor4(e,t){return this._checkUniform(e),this._colors4[e]=t,this}setColor4Array(e,t){return this._checkUniform(e),this._colors4Arrays[e]=t.reduce((i,s)=>(s.toArray(i,i.length),i),[]),this}setVector2(e,t){return this._checkUniform(e),this._vectors2[e]=t,this}setVector3(e,t){return this._checkUniform(e),this._vectors3[e]=t,this}setVector4(e,t){return this._checkUniform(e),this._vectors4[e]=t,this}setQuaternion(e,t){return this._checkUniform(e),this._quaternions[e]=t,this}setQuaternionArray(e,t){return this._checkUniform(e),this._quaternionsArrays[e]=t.reduce((i,s)=>(s.toArray(i,i.length),i),[]),this}setMatrix(e,t){return this._checkUniform(e),this._matrices[e]=t,this}setMatrices(e,t){this._checkUniform(e);const i=new Float32Array(t.length*16);for(let s=0;sn===e||n.startsWith(i));return s>=0&&this.options.defines.splice(s,1),(typeof t!="boolean"||t)&&this.options.defines.push(i+t),this}isReadyForSubMesh(e,t,i){return this.isReady(e,i,t)}isReady(e,t,i){var x,y,R;const s=i&&this._storeEffectOnSubMeshes;if(this.isFrozen){const E=s?i._drawWrapper:this._drawWrapper;if(E.effect&&E._wasPreviouslyReady&&E._wasPreviouslyUsingInstances===t)return!0}const n=this.getScene(),r=n.getEngine(),o=[],h=[],l=new G0;let c=this._shaderPath,u=this._options.uniforms,f=this._options.uniformBuffers,d=this._options.samplers;r.getCaps().multiview&&n.activeCamera&&n.activeCamera.outputRenderTarget&&n.activeCamera.outputRenderTarget.getViewCount()>1&&(this._multiview=!0,o.push("#define MULTIVIEW"),u.indexOf("viewProjection")!==-1&&u.indexOf("viewProjectionR")===-1&&u.push("viewProjectionR"));for(let E=0;E4&&(h.push(A.MatricesIndicesExtraKind),h.push(A.MatricesWeightsExtraKind));const E=e.skeleton;o.push("#define NUM_BONE_INFLUENCERS "+e.numBoneInfluencers),l.addCPUSkinningFallback(0,e),E.isUsingTextureForMatrices?(o.push("#define BONETEXTURE"),u.indexOf("boneTextureWidth")===-1&&u.push("boneTextureWidth"),this._options.samplers.indexOf("boneSampler")===-1&&this._options.samplers.push("boneSampler")):(o.push("#define BonesPerMesh "+(E.bones.length+1)),u.indexOf("mBones")===-1&&u.push("mBones"))}else o.push("#define NUM_BONE_INFLUENCERS 0");let _=0;const p=e?e.morphTargetManager:null;if(p){const E=p.supportsUVs&&o.indexOf("#define UV1")!==-1,C=p.supportsTangents&&o.indexOf("#define TANGENT")!==-1,S=p.supportsNormals&&o.indexOf("#define NORMAL")!==-1;_=p.numMaxInfluencers||p.numInfluencers,E&&o.push("#define MORPHTARGETS_UV"),C&&o.push("#define MORPHTARGETS_TANGENT"),S&&o.push("#define MORPHTARGETS_NORMAL"),_>0&&o.push("#define MORPHTARGETS"),p.isUsingTextureForTargets&&(o.push("#define MORPHTARGETS_TEXTURE"),u.indexOf("morphTargetTextureIndices")===-1&&u.push("morphTargetTextureIndices"),this._options.samplers.indexOf("morphTargets")===-1&&this._options.samplers.push("morphTargets")),o.push("#define NUM_MORPH_INFLUENCERS "+_);for(let w=0;w<_;w++)h.push(A.PositionKind+w),S&&h.push(A.NormalKind+w),C&&h.push(A.TangentKind+w),E&&h.push(A.UVKind+"_"+w);_>0&&(u=u.slice(),u.push("morphTargetInfluences"),u.push("morphTargetCount"),u.push("morphTargetTextureInfo"),u.push("morphTargetTextureIndices"))}else o.push("#define NUM_MORPH_INFLUENCERS 0");if(e){const E=e.bakedVertexAnimationManager;E&&E.isEnabled&&(o.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),u.indexOf("bakedVertexAnimationSettings")===-1&&u.push("bakedVertexAnimationSettings"),u.indexOf("bakedVertexAnimationTextureSizeInverted")===-1&&u.push("bakedVertexAnimationTextureSizeInverted"),u.indexOf("bakedVertexAnimationTime")===-1&&u.push("bakedVertexAnimationTime"),this._options.samplers.indexOf("bakedVertexAnimationTexture")===-1&&this._options.samplers.push("bakedVertexAnimationTexture")),Dc(h,e,o)}for(const E in this._textures)if(!this._textures[E].isReady())return!1;e&&this._shouldTurnAlphaTestOn(e)&&o.push("#define ALPHATEST"),this._options.useClipPlane!==!1&&(Xr(u),Mc(this,n,o)),n.fogEnabled&&(e!=null&&e.applyFog)&&n.fogMode!==it.FOGMODE_NONE&&(o.push("#define FOG"),u.indexOf("view")===-1&&u.push("view"),u.indexOf("vFogInfos")===-1&&u.push("vFogInfos"),u.indexOf("vFogColor")===-1&&u.push("vFogColor")),this._useLogarithmicDepth&&(o.push("#define LOGARITHMICDEPTH"),u.indexOf("logarithmicDepthConstant")===-1&&u.push("logarithmicDepthConstant")),this.customShaderNameResolve&&(u=u.slice(),f=f.slice(),d=d.slice(),c=this.customShaderNameResolve(this.name,u,f,d,o,h));const g=s?i._getDrawWrapper(void 0,!0):this._drawWrapper,m=(x=g==null?void 0:g.effect)!=null?x:null,b=(y=g==null?void 0:g.defines)!=null?y:null,I=o.join("\n");let T=m;return b!==I&&(T=r.createEffect(c,{attributes:h,uniformsNames:u,uniformBuffersNames:f,samplers:d,defines:I,fallbacks:l,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousMorphTargets:_},shaderLanguage:this._options.shaderLanguage,extraInitializationsAsync:this._options.extraInitializationsAsync},r),s?i.setEffect(T,I,this._materialContext):g&&g.setEffect(T,I),this._onEffectCreatedObservable&&(Ia.effect=T,Ia.subMesh=(R=i!=null?i:e==null?void 0:e.subMeshes[0])!=null?R:null,this._onEffectCreatedObservable.notifyObservers(Ia))),g._wasPreviouslyUsingInstances=!!t,T!=null&&T.isReady()?(m!==T&&n.resetCachedMaterial(),g._wasPreviouslyReady=!0,!0):!1}bindOnlyWorldMatrix(e,t){const i=this.getScene(),s=t!=null?t:this.getEffect();s&&(this._options.uniforms.indexOf("world")!==-1&&s.setMatrix("world",e),this._options.uniforms.indexOf("worldView")!==-1&&(e.multiplyToRef(i.getViewMatrix(),this._cachedWorldViewMatrix),s.setMatrix("worldView",this._cachedWorldViewMatrix)),this._options.uniforms.indexOf("worldViewProjection")!==-1&&(e.multiplyToRef(i.getTransformMatrix(),this._cachedWorldViewProjectionMatrix),s.setMatrix("worldViewProjection",this._cachedWorldViewProjectionMatrix)),this._options.uniforms.indexOf("view")!==-1&&s.setMatrix("view",i.getViewMatrix()))}bindForSubMesh(e,t,i){var s;this.bind(e,t,(s=i._drawWrapperOverride)==null?void 0:s.effect,i)}bind(e,t,i,s){var u;const n=s&&this._storeEffectOnSubMeshes,r=i!=null?i:n?s.effect:this.getEffect();if(!r)return;const o=this.getScene();this._activeEffect=r,this.bindOnlyWorldMatrix(e,i);const h=this._options.uniformBuffers;let l=!1;if(r&&h&&h.length>0&&o.getEngine().supportsUniformBuffers)for(let f=0;f0&&U0(t,r);const d=t.bakedVertexAnimationManager;if(d&&d.isEnabled){const _=n?s._drawWrapper:this._drawWrapper;(u=t.bakedVertexAnimationManager)==null||u.bind(r,!!_._wasPreviouslyUsingInstances)}}this._afterBind(t,r,s)}getActiveTextures(){const e=super.getActiveTextures();for(const t in this._textures)e.push(this._textures[t]);for(const t in this._textureArrays){const i=this._textureArrays[t];for(let s=0;snew os(e,this.getScene(),this._shaderPath,this._options,this._storeEffectOnSubMeshes),this);t.name=e,t.id=e,typeof t._shaderPath=="object"&&(t._shaderPath={...t._shaderPath}),this._options={...this._options},Object.keys(this._options).forEach(i=>{const s=this._options[i];Array.isArray(s)&&(this._options[i]=s.slice(0))}),this.stencil.copyTo(t.stencil);for(const i in this._textures)t.setTexture(i,this._textures[i]);for(const i in this._textureArrays)t.setTextureArray(i,this._textureArrays[i]);for(const i in this._externalTextures)t.setExternalTexture(i,this._externalTextures[i]);for(const i in this._ints)t.setInt(i,this._ints[i]);for(const i in this._uints)t.setUInt(i,this._uints[i]);for(const i in this._floats)t.setFloat(i,this._floats[i]);for(const i in this._floatsArrays)t.setFloats(i,this._floatsArrays[i]);for(const i in this._colors3)t.setColor3(i,this._colors3[i]);for(const i in this._colors3Arrays)t._colors3Arrays[i]=this._colors3Arrays[i];for(const i in this._colors4)t.setColor4(i,this._colors4[i]);for(const i in this._colors4Arrays)t._colors4Arrays[i]=this._colors4Arrays[i];for(const i in this._vectors2)t.setVector2(i,this._vectors2[i]);for(const i in this._vectors3)t.setVector3(i,this._vectors3[i]);for(const i in this._vectors4)t.setVector4(i,this._vectors4[i]);for(const i in this._quaternions)t.setQuaternion(i,this._quaternions[i]);for(const i in this._quaternionsArrays)t._quaternionsArrays[i]=this._quaternionsArrays[i];for(const i in this._matrices)t.setMatrix(i,this._matrices[i]);for(const i in this._matrixArrays)t._matrixArrays[i]=this._matrixArrays[i].slice();for(const i in this._matrices3x3)t.setMatrix3x3(i,this._matrices3x3[i]);for(const i in this._matrices2x2)t.setMatrix2x2(i,this._matrices2x2[i]);for(const i in this._vectors2Arrays)t.setArray2(i,this._vectors2Arrays[i]);for(const i in this._vectors3Arrays)t.setArray3(i,this._vectors3Arrays[i]);for(const i in this._vectors4Arrays)t.setArray4(i,this._vectors4Arrays[i]);for(const i in this._uniformBuffers)t.setUniformBuffer(i,this._uniformBuffers[i]);for(const i in this._textureSamplers)t.setTextureSampler(i,this._textureSamplers[i]);for(const i in this._storageBuffers)t.setStorageBuffer(i,this._storageBuffers[i]);return t}dispose(e,t,i){if(t){let s;for(s in this._textures)this._textures[s].dispose();for(s in this._textureArrays){const n=this._textureArrays[s];for(let r=0;rnew os(e.name,t,e.shaderPath,e.options,e.storeEffectOnSubMeshes),e,t,i);let n;e.stencil&&s.stencil.parse(e.stencil,t,i);for(n in e.textures)s.setTexture(n,ie.Parse(e.textures[n],t,i));for(n in e.textureArrays){const r=e.textureArrays[n],o=[];for(let h=0;h(l%3===0?o.push([h]):o[o.length-1].push(h),o),[]).map(o=>de.FromArray(o));s.setColor3Array(n,r)}for(n in e.colors4)s.setColor4(n,H.FromArray(e.colors4[n]));for(n in e.colors4Arrays){const r=e.colors4Arrays[n].reduce((o,h,l)=>(l%4===0?o.push([h]):o[o.length-1].push(h),o),[]).map(o=>H.FromArray(o));s.setColor4Array(n,r)}for(n in e.vectors2)s.setVector2(n,oe.FromArray(e.vectors2[n]));for(n in e.vectors3)s.setVector3(n,v.FromArray(e.vectors3[n]));for(n in e.vectors4)s.setVector4(n,Pe.FromArray(e.vectors4[n]));for(n in e.quaternions)s.setQuaternion(n,re.FromArray(e.quaternions[n]));for(n in e.matrices)s.setMatrix(n,O.FromArray(e.matrices[n]));for(n in e.matrixArray)s._matrixArrays[n]=new Float32Array(e.matrixArray[n]);for(n in e.matrices3x3)s.setMatrix3x3(n,e.matrices3x3[n]);for(n in e.matrices2x2)s.setMatrix2x2(n,e.matrices2x2[n]);for(n in e.vectors2Arrays)s.setArray2(n,e.vectors2Arrays[n]);for(n in e.vectors3Arrays)s.setArray3(n,e.vectors3Arrays[n]);for(n in e.vectors4Arrays)s.setArray4(n,e.vectors4Arrays[n]);for(n in e.quaternionsArrays)s.setArray4(n,e.quaternionsArrays[n]);return s}static ParseFromFileAsync(e,t,i,s=""){return new Promise((n,r)=>{const o=new Ft;o.addEventListener("readystatechange",()=>{if(o.readyState==4)if(o.status==200){const h=JSON.parse(o.responseText),l=this.Parse(h,i||Ee.LastCreatedScene,s);e&&(l.name=e),n(l)}else r("Unable to load the ShaderMaterial")}),o.open("GET",t),o.send()})}static ParseFromSnippetAsync(e,t,i=""){return new Promise((s,n)=>{const r=new Ft;r.addEventListener("readystatechange",()=>{if(r.readyState==4)if(r.status==200){const o=JSON.parse(JSON.parse(r.responseText).jsonPayload),h=JSON.parse(o.shaderMaterial),l=this.Parse(h,t||Ee.LastCreatedScene,i);l.snippetId=e,s(l)}else n("Unable to load the snippet "+e)}),r.open("GET",this.SnippetUrl+"/"+e.replace(/#/g,"/")),r.send()})}}os.SnippetUrl="https://snippet.babylonjs.com";os.CreateFromSnippetAsync=os.ParseFromSnippetAsync;vt("BABYLON.ShaderMaterial",os);F._LinesMeshParser=(a,e)=>Hi.Parse(a,e);class Hi extends F{_isShaderMaterial(e){return e.getClassName()==="ShaderMaterial"}constructor(e,t=null,i=null,s=null,n,r,o,h){super(e,t,i,s,n),this.useVertexColor=r,this.useVertexAlpha=o,this.color=new de(1,1,1),this.alpha=1,this._shaderLanguage=0,s&&(this.color=s.color.clone(),this.alpha=s.alpha,this.useVertexColor=s.useVertexColor,this.useVertexAlpha=s.useVertexAlpha),this.intersectionThreshold=.1;const l=[],c={attributes:[A.PositionKind],uniforms:["world","viewProjection"],needAlphaBlending:!0,defines:l,useClipPlane:null,shaderLanguage:0};o===!1?c.needAlphaBlending=!1:c.defines.push("#define VERTEXALPHA"),r?(c.defines.push("#define VERTEXCOLOR"),c.attributes.push(A.ColorKind)):(c.uniforms.push("color"),this._color4=new H),h?this.material=h:(this.getScene().getEngine().isWebGPU&&!Hi.ForceGLSL&&(this._shaderLanguage=1),c.shaderLanguage=this._shaderLanguage,c.extraInitializationsAsync=async()=>{this._shaderLanguage===1?await Promise.all([Oe(()=>import("./color.vertex-Ccg8Ge1R.js"),__vite__mapDeps([44,22,23,24,3,4,5,6,7,8,9,10])),Oe(()=>import("./color.fragment-DNkpzaOC.js"),__vite__mapDeps([45,29,30,3,4,5,6,7,8,9,10]))]):await Promise.all([Oe(()=>import("./color.vertex-BL9BK6Le.js"),__vite__mapDeps([46,36,38,3,4,5,6,7,8,9,10])),Oe(()=>import("./color.fragment-BjUREcw_.js"),__vite__mapDeps([47,3,4,5,6,7,8,9,10]))])},this.material=new os("colorShader",this.getScene(),"color",c,!1),this.material.doNotSerialize=!0)}isReady(){return this._lineMaterial.isReady(this,!!this._userInstancedBuffersStorage||this.hasThinInstances)?super.isReady():!1}getClassName(){return"LinesMesh"}get material(){return this._lineMaterial}set material(e){this._lineMaterial=e,this._lineMaterial.fillMode=X.LineListDrawMode}get checkCollisions(){return!1}set checkCollisions(e){}_bind(e,t){if(!this._geometry)return this;const i=this.isUnIndexed?null:this._geometry.getIndexBuffer();if(!this._userInstancedBuffersStorage||this.hasThinInstances?this._geometry._bind(t,i):this._geometry._bind(t,i,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects),!this.useVertexColor&&this._isShaderMaterial(this._lineMaterial)){const{r:s,g:n,b:r}=this.color;this._color4.set(s,n,r,this.alpha),this._lineMaterial.setColor4("color",this._color4)}return this}_draw(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;const s=this.getScene().getEngine();return this._unIndexed?s.drawArraysType(X.LineListDrawMode,e.verticesStart,e.verticesCount,i):s.drawElementsType(X.LineListDrawMode,e.indexStart,e.indexCount,i),this}dispose(e,t=!1,i){i||this._lineMaterial.dispose(!1,!1,!0),super.dispose(e)}clone(e,t=null,i){return new Hi(e,this.getScene(),t,this,i)}createInstance(e){const t=new qc(e,this);if(this.instancedBuffers){t.instancedBuffers={};for(const i in this.instancedBuffers)t.instancedBuffers[i]=this.instancedBuffers[i]}return t}serialize(e){super.serialize(e),e.color=this.color.asArray(),e.alpha=this.alpha}static Parse(e,t){const i=new Hi(e.name,t);return i.color=de.FromArray(e.color),i.alpha=e.alpha,i}}Hi.ForceGLSL=!1;class qc extends ea{constructor(e,t){super(e,t),this.intersectionThreshold=t.intersectionThreshold}getClassName(){return"InstancedLinesMesh"}}Qe.prototype.disableEdgesRendering=function(){return this._edgesRenderer&&(this._edgesRenderer.dispose(),this._edgesRenderer=null),this};Qe.prototype.enableEdgesRendering=function(a=.95,e=!1,t){return this.disableEdgesRendering(),this._edgesRenderer=new ta(this,a,e,!0,t),this};Object.defineProperty(Qe.prototype,"edgesRenderer",{get:function(){return this._edgesRenderer},enumerable:!0,configurable:!0});Hi.prototype.enableEdgesRendering=function(a=.95,e=!1){return this.disableEdgesRendering(),this._edgesRenderer=new Jg(this,a,e),this};qc.prototype.enableEdgesRendering=function(a=.95,e=!1){return Hi.prototype.enableEdgesRendering.apply(this,arguments),this};class Qg{constructor(){this.edges=[],this.edgesConnectedCount=0}}class ta{get linesPositions(){return this._linesPositions}get linesNormals(){return this._linesNormals}get linesIndices(){return this._linesIndices}get lineShader(){return this._lineShader}set lineShader(e){this._lineShader=e}static _GetShader(e,t){if(!e._edgeRenderLineShader){const i=new os("lineShader",e,"line",{attributes:["position","normal"],uniforms:["world","viewProjection","color","width","aspectRatio"],uniformBuffers:["Scene","Mesh"],shaderLanguage:t,extraInitializationsAsync:async()=>{t===1?await Promise.all([Oe(()=>import("./line.vertex-ChOZncX4.js"),__vite__mapDeps([48,23,26,27,3,4,5,6,7,8,9,10])),Oe(()=>import("./line.fragment-azBhzxfj.js"),__vite__mapDeps([49,29,26,31,3,4,5,6,7,8,9,10]))]):await Promise.all([Oe(()=>import("./line.vertex-DNyxgHBi.js"),__vite__mapDeps([50,34,3,4,5,6,7,8,9,10])),Oe(()=>import("./line.fragment-thDij4Gq.js"),__vite__mapDeps([51,3,4,5,6,7,8,9,10]))])}},!1);i.disableDepthWrite=!0,i.backFaceCulling=!1,i.checkReadyOnEveryCall=e.getEngine().isWebGPU,e._edgeRenderLineShader=i}return e._edgeRenderLineShader}get shaderLanguage(){return this._shaderLanguage}constructor(e,t=.95,i=!1,s=!0,n){var o;this.edgesWidthScalerForOrthographic=1e3,this.edgesWidthScalerForPerspective=50,this._linesPositions=new Array,this._linesNormals=new Array,this._linesIndices=new Array,this._buffers={},this._buffersForInstances={},this._checkVerticesInsteadOfIndices=!1,this.isEnabled=!0,this.customInstances=new Ut(32),this._shaderLanguage=0,this._source=e,this._checkVerticesInsteadOfIndices=i,this._options=n!=null?n:null,this._epsilon=t;const r=this._source.getScene().getEngine();r.isWebGPU&&(this._drawWrapper=new Xn(r),this._shaderLanguage=1),this._prepareRessources(),s&&((o=n==null?void 0:n.useAlternateEdgeFinder)==null||o?this._generateEdgesLinesAlternate():this._generateEdgesLines()),this._meshRebuildObserver=this._source.onRebuildObservable.add(()=>{this._rebuild()}),this._meshDisposeObserver=this._source.onDisposeObservable.add(()=>{this.dispose()})}_prepareRessources(){this._lineShader||(this._lineShader=ta._GetShader(this._source.getScene(),this._shaderLanguage))}_rebuild(){let e=this._buffers[A.PositionKind];e&&e._rebuild(),e=this._buffers[A.NormalKind],e&&e._rebuild();const i=this._source.getScene().getEngine();this._ib=i.createIndexBuffer(this._linesIndices)}dispose(){var t;this._source.onRebuildObservable.remove(this._meshRebuildObserver),this._source.onDisposeObservable.remove(this._meshDisposeObserver);let e=this._buffers[A.PositionKind];e&&(e.dispose(),this._buffers[A.PositionKind]=null),e=this._buffers[A.NormalKind],e&&(e.dispose(),this._buffers[A.NormalKind]=null),this._ib&&this._source.getScene().getEngine()._releaseBuffer(this._ib),this._lineShader.dispose(),(t=this._drawWrapper)==null||t.dispose()}_processEdgeForAdjacencies(e,t,i,s,n){return e===i&&t===s||e===s&&t===i?0:e===s&&t===n||e===n&&t===s?1:e===n&&t===i||e===i&&t===n?2:-1}_processEdgeForAdjacenciesWithVertices(e,t,i,s,n){return e.equalsWithEpsilon(i,1e-10)&&t.equalsWithEpsilon(s,1e-10)||e.equalsWithEpsilon(s,1e-10)&&t.equalsWithEpsilon(i,1e-10)?0:e.equalsWithEpsilon(s,1e-10)&&t.equalsWithEpsilon(n,1e-10)||e.equalsWithEpsilon(n,1e-10)&&t.equalsWithEpsilon(s,1e-10)?1:e.equalsWithEpsilon(n,1e-10)&&t.equalsWithEpsilon(i,1e-10)||e.equalsWithEpsilon(i,1e-10)&&t.equalsWithEpsilon(n,1e-10)?2:-1}_checkEdge(e,t,i,s,n){let r;t===void 0?r=!0:r=v.Dot(i[e],i[t]){S>=0&&C.push(S);for(let w=0;w=e[0].length&&e[1].length>=e[2].length?r=1:e[2].length>=e[0].length&&e[2].length>=e[1].length&&(r=2);for(let E=0;E<3;++E)E===r?e[E].sort((C,S)=>C[1]S[1]?1:0):e[E].sort((C,S)=>C[1]>S[1]?-1:C[1]=r+1;--E)n(e[E%3],h,E!==r+2?s[i[t+(E+1)%3]]:-1);const c=h.length,u=0,f=0;i.push(s[i[t+r]],o[0],h[0]),i.push(s[i[t+(r+1)%3]],h[c-1],o[l-1]);const d=l<=c,_=d?l:c,p=d?c:l,g=d?l-1:c-1,m=d?0:1;let b=l+c-2,I=d?u:f,T=d?f:u;const x=d?o:h,y=d?h:o;let R=0;for(;b-- >0;){m?i.push(x[I],y[T]):i.push(y[T],x[I]),R+=_;let E;R>=p&&IR){const w=y;y=R,R=w}const C=y+"_"+R,S=o[C];S?S.done||(v.Dot(T,S.normal)0||this._source.hasThinInstances)}render(){const e=this._source.getScene(),t=this._lineShader._getDrawWrapper();if(this._drawWrapper&&this._lineShader._setDrawWrapper(this._drawWrapper),!this.isReady()||!e.activeCamera){this._lineShader._setDrawWrapper(t);return}const i=this._source.hasInstances&&this.customInstances.length>0,s=i||this._source.hasThinInstances;let n=0;if(s)if(this._buffersForInstances.world0=this._source.getVertexBuffer("world0"),this._buffersForInstances.world1=this._source.getVertexBuffer("world1"),this._buffersForInstances.world2=this._source.getVertexBuffer("world2"),this._buffersForInstances.world3=this._source.getVertexBuffer("world3"),i){const o=this._source._instanceDataStorage;if(n=this.customInstances.length,!o.instancesData){this._source.getScene()._activeMeshesFrozen||this.customInstances.reset();return}if(!o.isFrozen){let h=0;for(let l=0;l=0?c.substring(0,u):c;f=f.toLowerCase();const d=u>=0?c.substring(u+1).trim():"";if(f==="newmtl")h&&this.materials.push(h),e._blockEntityCollection=!!s,h=new ee(d,e),h._parentContainer=s,e._blockEntityCollection=!1;else if(f==="kd"&&h)o=d.split(r,3).map(parseFloat),h.diffuseColor=de.FromArray(o);else if(f==="ka"&&h)o=d.split(r,3).map(parseFloat),h.ambientColor=de.FromArray(o);else if(f==="ks"&&h)o=d.split(r,3).map(parseFloat),h.specularColor=de.FromArray(o);else if(f==="ke"&&h)o=d.split(r,3).map(parseFloat),h.emissiveColor=de.FromArray(o);else if(f==="ns"&&h)h.specularPower=parseFloat(d);else if(f==="d"&&h)h.alpha=parseFloat(d);else if(f==="map_ka"&&h)h.ambientTexture=Si._GetTexture(i,d,e);else if(f==="map_kd"&&h)h.diffuseTexture=Si._GetTexture(i,d,e);else if(f==="map_ks"&&h)h.specularTexture=Si._GetTexture(i,d,e);else if(f!=="map_ns")if(f==="map_bump"&&h){const _=d.split(r),p=_.indexOf("-bm");let g=null;p>=0&&(g=_[p+1],_.splice(p,2)),h.bumpTexture=Si._GetTexture(i,_.join(" "),e),h.bumpTexture&&g!==null&&(h.bumpTexture.level=parseFloat(g))}else f==="map_d"&&h&&(h.opacityTexture=Si._GetTexture(i,d,e))}h&&this.materials.push(h)}static _GetTexture(e,t,i){if(!t)return null;let s=e;if(e==="file:"){let n=t.lastIndexOf("\\");n===-1&&(n=t.lastIndexOf("/")),n>-1?s+=t.substring(n+1):s+=t}else s+=t;return new ie(s,i,!1,Si.INVERT_TEXTURE_Y)}}Si.INVERT_TEXTURE_Y=!0;class He{constructor(e,t,i){this._positions=[],this._normals=[],this._uvs=[],this._colors=[],this._extColors=[],this._meshesFromObj=[],this._indicesForBabylon=[],this._wrappedPositionForBabylon=[],this._wrappedUvsForBabylon=[],this._wrappedColorsForBabylon=[],this._wrappedNormalsForBabylon=[],this._tuplePosNorm=[],this._curPositionInIndices=0,this._hasMeshes=!1,this._unwrappedPositionsForBabylon=[],this._unwrappedColorsForBabylon=[],this._unwrappedNormalsForBabylon=[],this._unwrappedUVForBabylon=[],this._triangles=[],this._materialNameFromObj="",this._objMeshName="",this._increment=1,this._isFirstMaterial=!0,this._grayColor=new H(.5,.5,.5,1),this._hasLineData=!1,this._materialToUse=e,this._babylonMeshesArray=t,this._loadingOptions=i}_isInArray(e,t){e[t[0]]||(e[t[0]]={normals:[],idx:[]});const i=e[t[0]].normals.indexOf(t[1]);return i===-1?-1:e[t[0]].idx[i]}_isInArrayUV(e,t){e[t[0]]||(e[t[0]]={normals:[],idx:[],uv:[]});const i=e[t[0]].normals.indexOf(t[1]);return i!=1&&t[2]===e[t[0]].uv[i]?e[t[0]].idx[i]:-1}_setData(e,t,i,s,n,r,o){let h;this._loadingOptions.optimizeWithUV?h=this._isInArrayUV(this._tuplePosNorm,[e,i,t]):h=this._isInArray(this._tuplePosNorm,[e,i]),h===-1?(this._indicesForBabylon.push(this._wrappedPositionForBabylon.length),this._wrappedPositionForBabylon.push(s),n=n!=null?n:new oe(0,0),this._wrappedUvsForBabylon.push(n),this._wrappedNormalsForBabylon.push(r),o!==void 0&&this._wrappedColorsForBabylon.push(o),this._tuplePosNorm[e].normals.push(i),this._tuplePosNorm[e].idx.push(this._curPositionInIndices++),this._loadingOptions.optimizeWithUV&&this._tuplePosNorm[e].uv.push(t)):this._indicesForBabylon.push(h)}_unwrapData(){try{for(let e=0;e0&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._unwrapData(),this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._handledMesh.indices=this._indicesForBabylon.slice(),this._handledMesh.positions=this._unwrappedPositionsForBabylon.slice(),this._handledMesh.normals=this._unwrappedNormalsForBabylon.slice(),this._handledMesh.uvs=this._unwrappedUVForBabylon.slice(),this._handledMesh.hasLines=this._hasLineData,this._loadingOptions.importVertexColors&&(this._handledMesh.colors=this._unwrappedColorsForBabylon.slice()),this._indicesForBabylon.length=0,this._unwrappedPositionsForBabylon.length=0,this._unwrappedColorsForBabylon.length=0,this._unwrappedNormalsForBabylon.length=0,this._unwrappedUVForBabylon.length=0,this._hasLineData=!1)}_optimizeNormals(e){const t=e.getVerticesData(A.PositionKind),i=e.getVerticesData(A.NormalKind),s={};if(!t||!i)return;for(let r=0;rthis._triangles.push(f[0],f[d],f[d+1]),this._handednessSign=1):i.useRightHandedSystem?(this._pushTriangle=(f,d)=>this._triangles.push(f[0],f[d+1],f[d]),this._handednessSign=1):(this._pushTriangle=(f,d)=>this._triangles.push(f[0],f[d],f[d+1]),this._handednessSign=-1);const r=t.split("\n"),o=[];let h=[];o.push(h);for(let f=0;f=7){const p=parseFloat(_[4]),g=parseFloat(_[5]),m=parseFloat(_[6]);this._colors.push(new H(p>1?p/255:p,g>1?g/255:g,m>1?m/255:m,_.length===7||_[7]===void 0?1:parseFloat(_[7])))}else this._colors.push(this._grayColor)}else if((_=He.NormalPattern.exec(d))!==null)this._normals.push(new v(parseFloat(_[1]),parseFloat(_[2]),parseFloat(_[3])));else if((_=He.UVPattern.exec(d))!==null)this._uvs.push(new oe(parseFloat(_[1])*this._loadingOptions.UVScaling.x,parseFloat(_[2])*this._loadingOptions.UVScaling.y));else if((_=He.FacePattern3.exec(d))!==null)this._setDataForCurrentFaceWithPattern3(_[1].trim().split(" "),1);else if((_=He.FacePattern4.exec(d))!==null)this._setDataForCurrentFaceWithPattern4(_[1].trim().split(" "),1);else if((_=He.FacePattern5.exec(d))!==null)this._setDataForCurrentFaceWithPattern5(_[1].trim().split(" "),1);else if((_=He.FacePattern2.exec(d))!==null)this._setDataForCurrentFaceWithPattern2(_[1].trim().split(" "),1);else if((_=He.FacePattern1.exec(d))!==null)this._setDataForCurrentFaceWithPattern1(_[1].trim().split(" "),1);else if((_=He.LinePattern1.exec(d))!==null)this._setDataForCurrentFaceWithPattern1(_[1].trim().split(" "),0),this._hasLineData=!0;else if((_=He.LinePattern2.exec(d))!==null)this._setDataForCurrentFaceWithPattern2(_[1].trim().split(" "),0),this._hasLineData=!0;else if(_=He._GetZbrushMRGB(d,!this._loadingOptions.importVertexColors))_.forEach(p=>{this._extColors.push(p)});else if((_=He.LinePattern3.exec(d))!==null)this._setDataForCurrentFaceWithPattern3(_[1].trim().split(" "),0),this._hasLineData=!0;else if(He.GroupDescriptor.test(d)||He.ObjectDescriptor.test(d)){const p={name:d.substring(2).trim(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:He.ObjectDescriptor.test(d)};this._addPreviousObjMesh(),this._meshesFromObj.push(p),this._hasMeshes=!0,this._isFirstMaterial=!0,this._increment=1}else if(He.UseMtlDescriptor.test(d)){if(this._materialNameFromObj=d.substring(7).trim(),!this._isFirstMaterial||!this._hasMeshes){this._addPreviousObjMesh();const p={name:(this._objMeshName||"mesh")+"_mm"+this._increment.toString(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:!1};this._increment++,this._meshesFromObj.push(p),this._hasMeshes=!0}this._hasMeshes&&this._isFirstMaterial&&(this._meshesFromObj[this._meshesFromObj.length-1].materialName=this._materialNameFromObj,this._isFirstMaterial=!1)}else He.MtlLibGroupDescriptor.test(d)?n(d.substring(7).trim()):He.SmoothDescriptor.test(d)||U.Log("Unhandled expression at line : "+d)}if(this._hasMeshes&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData(),this._handledMesh.indices=this._indicesForBabylon,this._handledMesh.positions=this._unwrappedPositionsForBabylon,this._handledMesh.normals=this._unwrappedNormalsForBabylon,this._handledMesh.uvs=this._unwrappedUVForBabylon,this._handledMesh.hasLines=this._hasLineData,this._loadingOptions.importVertexColors&&(this._handledMesh.colors=this._unwrappedColorsForBabylon)),!this._hasMeshes){let f=null;if(this._indicesForBabylon.length)this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData();else{for(const d of this._positions)this._unwrappedPositionsForBabylon.push(d.x,d.y,d.z);if(this._normals.length)for(const d of this._normals)this._unwrappedNormalsForBabylon.push(d.x,d.y,d.z);if(this._uvs.length)for(const d of this._uvs)this._unwrappedUVForBabylon.push(d.x,d.y);if(this._extColors.length)for(const d of this._extColors)this._unwrappedColorsForBabylon.push(d.r,d.g,d.b,d.a);else if(this._colors.length)for(const d of this._colors)this._unwrappedColorsForBabylon.push(d.r,d.g,d.b,d.a);this._materialNameFromObj||(f=new ee(Nt.RandomId(),i),f.pointsCloud=!0,this._materialNameFromObj=f.name,this._normals.length||(f.disableLighting=!0,f.emissiveColor=de.White()))}this._meshesFromObj.push({name:Nt.RandomId(),indices:this._indicesForBabylon,positions:this._unwrappedPositionsForBabylon,colors:this._unwrappedColorsForBabylon,normals:this._unwrappedNormalsForBabylon,uvs:this._unwrappedUVForBabylon,materialName:this._materialNameFromObj,directMaterial:f,isObject:!0,hasLines:this._hasLineData})}for(let f=0;f=0;--p)if(this._meshesFromObj[p].isObject&&this._meshesFromObj[p]._babylonMesh){d.parent=this._meshesFromObj[p]._babylonMesh;break}}if(this._materialToUse.push(this._meshesFromObj[f].materialName),this._handledMesh.hasLines&&((c=d._internalMetadata)!=null||(d._internalMetadata={}),d._internalMetadata._isLine=!0),((u=this._handledMesh.positions)==null?void 0:u.length)===0){this._babylonMeshesArray.push(d);continue}const _=new j;if(_.uvs=this._handledMesh.uvs,_.indices=this._handledMesh.indices,_.positions=this._handledMesh.positions,this._loadingOptions.computeNormals){const p=new Array;j.ComputeNormals(this._handledMesh.positions,this._handledMesh.indices,p),_.normals=p}else _.normals=this._handledMesh.normals;this._loadingOptions.importVertexColors&&(_.colors=this._handledMesh.colors),_.applyToMesh(d),this._loadingOptions.invertY&&(d.scaling.y*=-1),this._loadingOptions.optimizeNormals&&this._optimizeNormals(d),this._babylonMeshesArray.push(d),this._handledMesh.directMaterial&&(d.material=this._handledMesh.directMaterial)}}}He.ObjectDescriptor=/^o/;He.GroupDescriptor=/^g/;He.MtlLibGroupDescriptor=/^mtllib /;He.UseMtlDescriptor=/^usemtl /;He.SmoothDescriptor=/^s /;He.VertexPattern=/^v(\s+[\d|.|+|\-|e|E]+){3,7}/;He.NormalPattern=/^vn(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/;He.UVPattern=/^vt(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/;He.FacePattern1=/^f\s+(([\d]{1,}[\s]?){3,})+/;He.FacePattern2=/^f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;He.FacePattern3=/^f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/;He.FacePattern4=/^f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/;He.FacePattern5=/^f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/;He.LinePattern1=/^l\s+(([\d]{1,}[\s]?){2,})+/;He.LinePattern2=/^l\s+((([\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;He.LinePattern3=/^l\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){2,})+)/;class jc{constructor(){this.rootNodes=[],this.cameras=[],this.lights=[],this.meshes=[],this.skeletons=[],this.particleSystems=[],this.animations=[],this.animationGroups=[],this.multiMaterials=[],this.materials=[],this.morphTargetManagers=[],this.geometries=[],this.transformNodes=[],this.actionManagers=[],this.textures=[],this._environmentTexture=null,this.postProcesses=[],this.sounds=null,this.effectLayers=[],this.layers=[],this.reflectionProbes=[]}get environmentTexture(){return this._environmentTexture}set environmentTexture(e){this._environmentTexture=e}getNodes(){let e=[];return e=e.concat(this.meshes),e=e.concat(this.lights),e=e.concat(this.cameras),e=e.concat(this.transformNodes),this.skeletons.forEach(t=>e=e.concat(t.bones)),e}}class e1 extends jc{}class t1{constructor(){this.rootNodes=[],this.skeletons=[],this.animationGroups=[]}dispose(){this.rootNodes.slice(0).forEach(e=>{e.dispose()}),this.rootNodes.length=0,this.skeletons.slice(0).forEach(e=>{e.dispose()}),this.skeletons.length=0,this.animationGroups.slice(0).forEach(e=>{e.dispose()}),this.animationGroups.length=0}}class i1 extends jc{constructor(e){super(),this._wasAddedToScene=!1,e=e||Ee.LastCreatedScene,e&&(this.scene=e,this.proceduralTextures=[],e.onDisposeObservable.add(()=>{this._wasAddedToScene||this.dispose()}),this._onContextRestoredObserver=e.getEngine().onContextRestoredObservable.add(()=>{for(const t of this.geometries)t._rebuild();for(const t of this.meshes)t._rebuild();for(const t of this.particleSystems)t.rebuild();for(const t of this.textures)t._rebuild()}))}_topologicalSort(e){const t=new Map;for(const o of e)t.set(o.uniqueId,o);const i={dependsOn:new Map,dependedBy:new Map};for(const o of e){const h=o.uniqueId;i.dependsOn.set(h,new Set),i.dependedBy.set(h,new Set)}for(const o of e){const h=o.uniqueId,l=i.dependsOn.get(h);if(o instanceof ea){const u=o.sourceMesh;t.has(u.uniqueId)&&(l.add(u.uniqueId),i.dependedBy.get(u.uniqueId).add(h))}const c=i.dependedBy.get(h);for(const u of o.getDescendants()){const f=u.uniqueId;t.has(f)&&(c.add(f),i.dependsOn.get(f).add(h))}}const s=[],n=[];for(const o of e){const h=o.uniqueId;i.dependsOn.get(h).size===0&&(n.push(o),t.delete(h))}const r=n;for(;r.length>0;){const o=r.shift();s.push(o);const h=i.dependedBy.get(o.uniqueId);for(const l of Array.from(h.values())){const c=i.dependsOn.get(l);c.delete(o.uniqueId),c.size===0&&t.get(l)&&(r.push(t.get(l)),t.delete(l))}}return t.size>0&&(U.Error("SceneSerializer._topologicalSort: There were unvisited nodes:"),t.forEach(o=>U.Error(o.name))),s}_addNodeAndDescendantsToList(e,t,i,s){if(!(!i||s&&!s(i)||t.has(i.uniqueId))){e.push(i),t.add(i.uniqueId);for(const n of i.getDescendants(!0))this._addNodeAndDescendantsToList(e,t,n,s)}}_isNodeInContainer(e){return e instanceof Qe&&this.meshes.indexOf(e)!==-1||e instanceof Te&&this.transformNodes.indexOf(e)!==-1||e instanceof Fe&&this.lights.indexOf(e)!==-1||e instanceof ve&&this.cameras.indexOf(e)!==-1}_isValidHierarchy(){for(const e of this.meshes)if(e.parent&&!this._isNodeInContainer(e.parent))return U.Warn("Node ".concat(e.name," has a parent that is not in the container.")),!1;for(const e of this.transformNodes)if(e.parent&&!this._isNodeInContainer(e.parent))return U.Warn("Node ".concat(e.name," has a parent that is not in the container.")),!1;for(const e of this.lights)if(e.parent&&!this._isNodeInContainer(e.parent))return U.Warn("Node ".concat(e.name," has a parent that is not in the container.")),!1;for(const e of this.cameras)if(e.parent&&!this._isNodeInContainer(e.parent))return U.Warn("Node ".concat(e.name," has a parent that is not in the container.")),!1;return!0}instantiateModelsToScene(e,t=!1,i){this._isValidHierarchy()||J.Warn("SceneSerializer.InstantiateModelsToScene: The Asset Container hierarchy is not valid.");const s={},n={},r=new t1,o=[],h=[],l={doNotInstantiate:!0,...i},c=(p,g)=>{if(s[p.uniqueId]=g.uniqueId,n[g.uniqueId]=g,e&&(g.name=e(p.name)),g instanceof F){const m=g;if(m.morphTargetManager){const b=p.morphTargetManager;m.morphTargetManager=b.clone();for(let I=0;I{if(c(p,g),p.parent){const m=s[p.parent.uniqueId],b=n[m];b?g.parent=b:g.parent=p.parent}if(g.position&&p.position&&g.position.copyFrom(p.position),g.rotationQuaternion&&p.rotationQuaternion&&g.rotationQuaternion.copyFrom(p.rotationQuaternion),g.rotation&&p.rotation&&g.rotation.copyFrom(p.rotation),g.scaling&&p.scaling&&g.scaling.copyFrom(p.scaling),g.material){const m=g;if(m.material)if(t){const b=p.material;if(h.indexOf(b)===-1){let I=b.clone(e?e(b.name):"Clone of "+b.name);if(h.push(b),s[b.uniqueId]=I.uniqueId,n[I.uniqueId]=I,b.getClassName()==="MultiMaterial"){const T=b;for(const x of T.subMaterials)x&&(I=x.clone(e?e(x.name):"Clone of "+x.name),h.push(x),s[x.uniqueId]=I.uniqueId,n[I.uniqueId]=I);T.subMaterials=T.subMaterials.map(x=>x&&n[s[x.uniqueId]])}}m.getClassName()!=="InstancedMesh"&&(m.material=n[s[b.uniqueId]])}else m.material.getClassName()==="MultiMaterial"?this.scene.multiMaterials.indexOf(m.material)===-1&&this.scene.addMultiMaterial(m.material):this.scene.materials.indexOf(m.material)===-1&&this.scene.addMaterial(m.material)}g.parent===null&&r.rootNodes.push(g)};return d.forEach(p=>{if(p.getClassName()==="InstancedMesh"){const g=p,m=g.sourceMesh,b=s[m.uniqueId],T=(typeof b=="number"?n[b]:m).createInstance(g.name);_(g,T)}else{let g=!0;p.getClassName()==="TransformNode"||p.getClassName()==="Node"||p.skeleton||!p.getTotalVertices||p.getTotalVertices()===0?g=!1:l.doNotInstantiate&&(typeof l.doNotInstantiate=="function"?g=!l.doNotInstantiate(p):g=!l.doNotInstantiate);const m=g?p.createInstance("instance of ".concat(p.name)):p.clone("Clone of ".concat(p.name),null,!0);if(!m)throw new Error("Could not clone or instantiate node on Asset Container ".concat(p.name));_(p,m)}}),this.skeletons.forEach(p=>{if(l.predicate&&!l.predicate(p))return;const g=p.clone(e?e(p.name):"Clone of "+p.name);for(const m of this.meshes)if(m.skeleton===p&&!m.isAnInstance){const b=n[s[m.uniqueId]];if(!b||b.isAnInstance||(b.skeleton=g,o.indexOf(g)!==-1))continue;o.push(g);for(const I of g.bones)I._linkedTransformNode&&(I._linkedTransformNode=n[s[I._linkedTransformNode.uniqueId]])}r.skeletons.push(g)}),this.animationGroups.forEach(p=>{if(l.predicate&&!l.predicate(p))return;const g=p.clone(e?e(p.name):"Clone of "+p.name,m=>n[s[m.uniqueId]]||m);r.animationGroups.push(g)}),r}addAllToScene(){if(!this._wasAddedToScene){this._isValidHierarchy()||J.Warn("SceneSerializer.addAllToScene: The Asset Container hierarchy is not valid."),this._wasAddedToScene=!0,this.addToScene(null),this.environmentTexture&&(this.scene.environmentTexture=this.environmentTexture);for(const e of this.scene._serializableComponents)e.addFromContainer(this);this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null}}addToScene(e=null){const t=[];this.cameras.forEach(i=>{e&&!e(i)||(this.scene.addCamera(i),t.push(i))}),this.lights.forEach(i=>{e&&!e(i)||(this.scene.addLight(i),t.push(i))}),this.meshes.forEach(i=>{e&&!e(i)||(this.scene.addMesh(i),t.push(i))}),this.skeletons.forEach(i=>{e&&!e(i)||this.scene.addSkeleton(i)}),this.animations.forEach(i=>{e&&!e(i)||this.scene.addAnimation(i)}),this.animationGroups.forEach(i=>{e&&!e(i)||this.scene.addAnimationGroup(i)}),this.multiMaterials.forEach(i=>{e&&!e(i)||this.scene.addMultiMaterial(i)}),this.materials.forEach(i=>{e&&!e(i)||this.scene.addMaterial(i)}),this.morphTargetManagers.forEach(i=>{e&&!e(i)||this.scene.addMorphTargetManager(i)}),this.geometries.forEach(i=>{e&&!e(i)||this.scene.addGeometry(i)}),this.transformNodes.forEach(i=>{e&&!e(i)||(this.scene.addTransformNode(i),t.push(i))}),this.actionManagers.forEach(i=>{e&&!e(i)||this.scene.addActionManager(i)}),this.textures.forEach(i=>{e&&!e(i)||this.scene.addTexture(i)}),this.reflectionProbes.forEach(i=>{e&&!e(i)||this.scene.addReflectionProbe(i)});for(const i of t)i.parent&&this.scene.getNodes().indexOf(i.parent)===-1&&(i.setParent?i.setParent(null):i.parent=null)}removeAllFromScene(){this._isValidHierarchy()||J.Warn("SceneSerializer.removeAllFromScene: The Asset Container hierarchy is not valid."),this._wasAddedToScene=!1,this.removeFromScene(null),this.environmentTexture===this.scene.environmentTexture&&(this.scene.environmentTexture=null);for(const e of this.scene._serializableComponents)e.removeFromContainer(this)}removeFromScene(e=null){this.cameras.forEach(t=>{e&&!e(t)||this.scene.removeCamera(t)}),this.lights.forEach(t=>{e&&!e(t)||this.scene.removeLight(t)}),this.meshes.forEach(t=>{e&&!e(t)||this.scene.removeMesh(t,!0)}),this.skeletons.forEach(t=>{e&&!e(t)||this.scene.removeSkeleton(t)}),this.animations.forEach(t=>{e&&!e(t)||this.scene.removeAnimation(t)}),this.animationGroups.forEach(t=>{e&&!e(t)||this.scene.removeAnimationGroup(t)}),this.multiMaterials.forEach(t=>{e&&!e(t)||this.scene.removeMultiMaterial(t)}),this.materials.forEach(t=>{e&&!e(t)||this.scene.removeMaterial(t)}),this.morphTargetManagers.forEach(t=>{e&&!e(t)||this.scene.removeMorphTargetManager(t)}),this.geometries.forEach(t=>{e&&!e(t)||this.scene.removeGeometry(t)}),this.transformNodes.forEach(t=>{e&&!e(t)||this.scene.removeTransformNode(t)}),this.actionManagers.forEach(t=>{e&&!e(t)||this.scene.removeActionManager(t)}),this.textures.forEach(t=>{e&&!e(t)||this.scene.removeTexture(t)}),this.reflectionProbes.forEach(t=>{e&&!e(t)||this.scene.removeReflectionProbe(t)})}dispose(){this.cameras.slice(0).forEach(e=>{e.dispose()}),this.cameras.length=0,this.lights.slice(0).forEach(e=>{e.dispose()}),this.lights.length=0,this.meshes.slice(0).forEach(e=>{e.dispose()}),this.meshes.length=0,this.skeletons.slice(0).forEach(e=>{e.dispose()}),this.skeletons.length=0,this.animationGroups.slice(0).forEach(e=>{e.dispose()}),this.animationGroups.length=0,this.multiMaterials.slice(0).forEach(e=>{e.dispose()}),this.multiMaterials.length=0,this.materials.slice(0).forEach(e=>{e.dispose()}),this.materials.length=0,this.geometries.slice(0).forEach(e=>{e.dispose()}),this.geometries.length=0,this.transformNodes.slice(0).forEach(e=>{e.dispose()}),this.transformNodes.length=0,this.actionManagers.slice(0).forEach(e=>{e.dispose()}),this.actionManagers.length=0,this.textures.slice(0).forEach(e=>{e.dispose()}),this.textures.length=0,this.reflectionProbes.slice(0).forEach(e=>{e.dispose()}),this.reflectionProbes.length=0,this.morphTargetManagers.slice(0).forEach(e=>{e.dispose()}),this.morphTargetManagers.length=0,this.environmentTexture&&(this.environmentTexture.dispose(),this.environmentTexture=null);for(const e of this.scene._serializableComponents)e.removeFromContainer(this,!0);this._onContextRestoredObserver&&(this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null)}_moveAssets(e,t,i){if(!(!e||!t))for(const s of e){let n=!0;if(i){for(const r of i)if(s===r){n=!1;break}}n&&(t.push(s),s._parentContainer=this)}}moveAllFromScene(e){this._wasAddedToScene=!1,e===void 0&&(e=new e1);for(const t in this)Object.prototype.hasOwnProperty.call(this,t)&&(this[t]=this[t]||(t==="_environmentTexture"?null:[]),this._moveAssets(this.scene[t],this[t],e[t]));this.environmentTexture=this.scene.environmentTexture,this.removeAllFromScene()}createRootMesh(){const e=new F("assetContainerRootMesh",this.scene);return this.meshes.forEach(t=>{t.parent||e.addChild(t)}),this.meshes.unshift(e),e}mergeAnimationsTo(e=Ee.LastCreatedScene,t,i=null){if(!e)return U.Error("No scene available to merge animations to"),[];const s=i||(o=>{let h=null;const l=o.animations.length?o.animations[0].targetProperty:"",c=o.name.split(".").join("").split("_primitive")[0];switch(l){case"position":case"rotationQuaternion":h=e.getTransformNodeByName(o.name)||e.getTransformNodeByName(c);break;case"influence":h=e.getMorphTargetByName(o.name)||e.getMorphTargetByName(c);break;default:h=e.getNodeByName(o.name)||e.getNodeByName(c)}return h});this.getNodes().forEach(o=>{const h=s(o);if(h!==null){for(const l of o.animations){const c=h.animations.filter(u=>u.targetProperty===l.targetProperty);for(const u of c){const f=h.animations.indexOf(u,0);f>-1&&h.animations.splice(f,1)}}h.animations=h.animations.concat(o.animations)}});const r=[];return this.animationGroups.slice().forEach(o=>{r.push(o.clone(o.name,s)),o.animatables.forEach(h=>{h.stop()})}),t.forEach(o=>{const h=s(o.target);h&&(e.beginAnimation(h,o.fromFrame,o.toFrame,o.loopAnimation,o.speedRatio,o.onAnimationEnd?o.onAnimationEnd:void 0,void 0,!0,void 0,o.onAnimationLoop?o.onAnimationLoop:void 0),e.stopAnimation(o.target))}),r}populateRootNodes(){this.rootNodes.length=0,this.meshes.forEach(e=>{!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e)}),this.transformNodes.forEach(e=>{!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e)}),this.lights.forEach(e=>{!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e)}),this.cameras.forEach(e=>{!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e)})}addAllAssetsToContainer(e){if(!e)return;const t=[],i=new Set;for(t.push(e);t.length>0;){const s=t.pop();if(s instanceof F?(s.geometry&&this.geometries.indexOf(s.geometry)===-1&&this.geometries.push(s.geometry),this.meshes.push(s)):s instanceof Te?this.transformNodes.push(s):s instanceof Fe?this.lights.push(s):s instanceof ve&&this.cameras.push(s),s instanceof Qe){if(s.material&&this.materials.indexOf(s.material)===-1){this.materials.push(s.material);for(const n of s.material.getActiveTextures())this.textures.indexOf(n)===-1&&this.textures.push(n)}s.skeleton&&this.skeletons.indexOf(s.skeleton)===-1&&this.skeletons.push(s.skeleton),s.morphTargetManager&&this.morphTargetManagers.indexOf(s.morphTargetManager)===-1&&this.morphTargetManagers.push(s.morphTargetManager)}for(const n of s.getChildren())i.has(n)||t.push(n);i.add(s)}this.populateRootNodes()}}const Qh={name:"obj",extensions:".obj"};class xt{static get INVERT_TEXTURE_Y(){return Si.INVERT_TEXTURE_Y}static set INVERT_TEXTURE_Y(e){Si.INVERT_TEXTURE_Y=e}constructor(e){this.name=Qh.name,this.extensions=Qh.extensions,this._assetContainer=null,this._loadingOptions=e||xt._DefaultLoadingOptions}static get _DefaultLoadingOptions(){return{computeNormals:xt.COMPUTE_NORMALS,optimizeNormals:xt.OPTIMIZE_NORMALS,importVertexColors:xt.IMPORT_VERTEX_COLORS,invertY:xt.INVERT_Y,invertTextureY:xt.INVERT_TEXTURE_Y,UVScaling:xt.UV_SCALING,materialLoadingFailsSilently:xt.MATERIAL_LOADING_FAILS_SILENTLY,optimizeWithUV:xt.OPTIMIZE_WITH_UV,skipMaterials:xt.SKIP_MATERIALS,useLegacyBehavior:xt.USE_LEGACY_BEHAVIOR}}_loadMTL(e,t,i,s){const n=t+e;J.LoadFile(n,i,void 0,void 0,!1,(r,o)=>{s(n,o)})}createPlugin(){return new xt(xt._DefaultLoadingOptions)}canDirectLoad(){return!1}importMeshAsync(e,t,i,s){return this._parseSolid(e,t,i,s).then(n=>({meshes:n,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}))}loadAsync(e,t,i){return this.importMeshAsync(null,e,t,i).then(()=>{})}loadAssetContainerAsync(e,t,i){const s=new i1(e);return this._assetContainer=s,this.importMeshAsync(null,e,t,i).then(n=>(n.meshes.forEach(r=>s.meshes.push(r)),n.meshes.forEach(r=>{const o=r.material;o&&s.materials.indexOf(o)==-1&&(s.materials.push(o),o.getActiveTextures().forEach(l=>{s.textures.indexOf(l)==-1&&s.textures.push(l)}))}),this._assetContainer=null,s)).catch(n=>{throw this._assetContainer=null,n})}_parseSolid(e,t,i,s){let n="";const r=new Si,o=[],h=[];i=i.replace(/#.*$/gm,"").trim(),new He(o,h,this._loadingOptions).parse(e,i,t,this._assetContainer,u=>{n=u});const c=[];return n!==""&&!this._loadingOptions.skipMaterials&&c.push(new Promise((u,f)=>{this._loadMTL(n,s,d=>{try{r.parseMTL(t,d,s,this._assetContainer);for(let _=0;_-1;)g.push(m),p=m+1;if(m===-1&&g.length===0)r.materials[_].dispose();else for(let b=0;b{J.Warn("Error downloading MTL file: '".concat(n,"'")),this._loadingOptions.materialLoadingFailsSilently?u():f(_)})})),Promise.all(c).then(()=>{const u=f=>{var d,_;return!!((_=(d=f._internalMetadata)==null?void 0:d._isLine)!=null&&_)};return h.forEach(f=>{var d,_;if(u(f)){let p=(d=f.material)!=null?d:new ee(f.name+"_line",t);p.getBindedMeshes().filter(m=>!u(m)).length>0&&(p=(_=p.clone(p.name+"_line"))!=null?_:p),p.wireframe=!0,f.material=p,f._internalMetadata&&(f._internalMetadata._isLine=void 0)}}),h})}}xt.OPTIMIZE_WITH_UV=!0;xt.INVERT_Y=!1;xt.IMPORT_VERTEX_COLORS=!1;xt.COMPUTE_NORMALS=!1;xt.OPTIMIZE_NORMALS=!1;xt.UV_SCALING=new oe(1,1);xt.SKIP_MATERIALS=!1;xt.MATERIAL_LOADING_FAILS_SILENTLY=!0;xt.USE_LEGACY_BEHAVIOR=!1;Gc(new xt);class Ue{constructor(e,t,i=Number.MAX_VALUE,s=Le){this.origin=e,this.direction=t,this.length=i,this.epsilon=s}clone(){return new Ue(this.origin.clone(),this.direction.clone(),this.length)}intersectsBoxMinMax(e,t,i=0){const s=Ue._TmpVector3[0].copyFromFloats(e.x-i,e.y-i,e.z-i),n=Ue._TmpVector3[1].copyFromFloats(t.x+i,t.y+i,t.z+i);let r=0,o=Number.MAX_VALUE,h,l,c,u;if(Math.abs(this.direction.x)<1e-7){if(this.origin.xn.x)return!1}else if(h=1/this.direction.x,l=(s.x-this.origin.x)*h,c=(n.x-this.origin.x)*h,c===-1/0&&(c=1/0),l>c&&(u=l,l=c,c=u),r=Math.max(l,r),o=Math.min(c,o),r>o)return!1;if(Math.abs(this.direction.y)<1e-7){if(this.origin.yn.y)return!1}else if(h=1/this.direction.y,l=(s.y-this.origin.y)*h,c=(n.y-this.origin.y)*h,c===-1/0&&(c=1/0),l>c&&(u=l,l=c,c=u),r=Math.max(l,r),o=Math.min(c,o),r>o)return!1;if(Math.abs(this.direction.z)<1e-7){if(this.origin.zn.z)return!1}else if(h=1/this.direction.z,l=(s.z-this.origin.z)*h,c=(n.z-this.origin.z)*h,c===-1/0&&(c=1/0),l>c&&(u=l,l=c,c=u),r=Math.max(l,r),o=Math.min(c,o),r>o)return!1;return!0}intersectsBox(e,t=0){return this.intersectsBoxMinMax(e.minimum,e.maximum,t)}intersectsSphere(e,t=0){const i=e.center.x-this.origin.x,s=e.center.y-this.origin.y,n=e.center.z-this.origin.z,r=i*i+s*s+n*n,o=e.radius+t,h=o*o;if(r<=h)return!0;const l=i*this.direction.x+s*this.direction.y+n*this.direction.z;return l<0?!1:r-l*l<=h}intersectsTriangle(e,t,i){const s=Ue._TmpVector3[0],n=Ue._TmpVector3[1],r=Ue._TmpVector3[2],o=Ue._TmpVector3[3],h=Ue._TmpVector3[4];t.subtractToRef(e,s),i.subtractToRef(e,n),v.CrossToRef(this.direction,n,r);const l=v.Dot(s,r);if(l===0)return null;const c=1/l;this.origin.subtractToRef(e,o);const u=v.Dot(o,r)*c;if(u<-this.epsilon||u>1+this.epsilon)return null;v.CrossToRef(o,s,h);const f=v.Dot(this.direction,h)*c;if(f<-this.epsilon||u+f>1+this.epsilon)return null;const d=v.Dot(n,h)*c;return d>this.length?null:new za(1-u-f,u,d)}intersectsPlane(e){let t;const i=v.Dot(e.normal,this.direction);if(Math.abs(i)<999999997475243e-21)return null;{const s=v.Dot(e.normal,this.origin);return t=(-e.d-s)/i,t<0?t<-999999997475243e-21?null:0:t}}intersectsAxis(e,t=0){switch(e){case"y":{const i=(this.origin.y-t)/this.direction.y;return i>0?null:new v(this.origin.x+this.direction.x*-i,t,this.origin.z+this.direction.z*-i)}case"x":{const i=(this.origin.x-t)/this.direction.x;return i>0?null:new v(t,this.origin.y+this.direction.y*-i,this.origin.z+this.direction.z*-i)}case"z":{const i=(this.origin.z-t)/this.direction.z;return i>0?null:new v(this.origin.x+this.direction.x*-i,this.origin.y+this.direction.y*-i,t)}default:return null}}intersectsMesh(e,t,i,s=!1,n,r=!1){const o=N.Matrix[0];return e.getWorldMatrix().invertToRef(o),this._tmpRay?Ue.TransformToRef(this,o,this._tmpRay):this._tmpRay=Ue.Transform(this,o),e.intersects(this._tmpRay,t,i,s,n,r)}intersectsMeshes(e,t,i){i?i.length=0:i=[];for(let s=0;st.distance?1:0}intersectionSegment(e,t,i){const s=this.origin,n=N.Vector3[0],r=N.Vector3[1],o=N.Vector3[2],h=N.Vector3[3];t.subtractToRef(e,n),this.direction.scaleToRef(Ue._Rayl,o),s.addToRef(o,r),e.subtractToRef(s,h);const l=v.Dot(n,n),c=v.Dot(n,o),u=v.Dot(o,o),f=v.Dot(n,h),d=v.Dot(o,h),_=l*u-c*c;let p,g=_,m,b=_;_g&&(p=g,m=d+c,b=u)),m<0?(m=0,-f<0?p=0:-f>l?p=g:(p=-f,g=l)):m>b&&(m=b,-f+c<0?p=0:-f+c>l?p=g:(p=-f+c,g=l));const I=Math.abs(p)0&&T<=this.length&&R.lengthSquared()=a.distance?null:l}function $0(a,e,t,i,s,n){let r=null;const o=!!(a.activeCameras&&a.activeCameras.length>1&&a.cameraToUseForPointers!==a.activeCamera),h=a.cameraToUseForPointers||a.activeCamera,l=Zc;for(let c=0;c1&&a.cameraToUseForPointers!==a.activeCamera),r=a.cameraToUseForPointers||a.activeCamera,o=Zc;for(let h=0;h(a._tempPickingRay||(a._tempPickingRay=Ue.Zero()),sa(a,e,t,o,a._tempPickingRay,n||null),a._tempPickingRay),i,s,!0);return r&&(r.ray=ia(a,e,t,O.Identity(),n||null)),r}function r1(a,e,t,i,s,n,r,o=!1){const h=$0(a,(l,c)=>(a._tempPickingRay||(a._tempPickingRay=Ue.Zero()),sa(a,e,t,l,a._tempPickingRay,n||null,!1,c),a._tempPickingRay),i,s,!1,r);return h&&(h.ray=ia(a,e,t,O.Identity(),n||null)),h}function a1(a,e,t,i,s){const n=$0(a,r=>(a._pickWithRayInverseMatrix||(a._pickWithRayInverseMatrix=O.Identity()),r.invertToRef(a._pickWithRayInverseMatrix),a._cachedRayForTransform||(a._cachedRayForTransform=Ue.Zero()),Ue.TransformToRef(e,a._pickWithRayInverseMatrix,a._cachedRayForTransform),a._cachedRayForTransform),t,i,!1,s);return n&&(n.ray=e),n}function o1(a,e,t,i,s,n){return Qc(a,r=>ia(a,e,t,r,s||null),i,n)}function h1(a,e,t,i){return Qc(a,s=>(a._pickWithRayInverseMatrix||(a._pickWithRayInverseMatrix=O.Identity()),s.invertToRef(a._pickWithRayInverseMatrix),a._cachedRayForTransform||(a._cachedRayForTransform=Ue.Zero()),Ue.TransformToRef(e,a._pickWithRayInverseMatrix,a._cachedRayForTransform),a._cachedRayForTransform),t,i)}function Jh(a,e,t=100,i,s){i||(i=a.getWorldMatrix()),e.length=t,s?e.origin.copyFrom(s):e.origin.copyFrom(a.position);const n=N.Vector3[2];n.set(0,0,a._scene.useRightHandedSystem?-1:1);const r=N.Vector3[3];return v.TransformNormalToRef(n,i,r),v.NormalizeToRef(r,e.direction),e}function l1(a,e){e&&(e.prototype.getForwardRay=function(t=100,i,s){return Jh(this,new Ue(v.Zero(),v.Zero(),t),t,i,s)},e.prototype.getForwardRayToRef=function(t,i=100,s,n){return Jh(this,t,i,s,n)}),a&&(O0._IsPickingAvailable=!0,a.prototype.createPickingRay=function(t,i,s,n,r=!1){return ia(this,t,i,s,n,r)})}l1(it,ve);it.prototype.createPickingRayToRef=function(a,e,t,i,s,n=!1,r=!1){return sa(this,a,e,t,i,s,n,r)};it.prototype.createPickingRayInCameraSpace=function(a,e,t){return s1(this,a,e,t)};it.prototype.createPickingRayInCameraSpaceToRef=function(a,e,t,i){return $c(this,a,e,t,i)};it.prototype.pickWithBoundingInfo=function(a,e,t,i,s){return n1(this,a,e,t,i,s)};it.prototype.pick=function(a,e,t,i,s,n,r=!1){return r1(this,a,e,t,i,s,n,r)};it.prototype.pickWithRay=function(a,e,t,i){return a1(this,a,e,t,i)};it.prototype.multiPick=function(a,e,t,i,s){return o1(this,a,e,t,i,s)};it.prototype.multiPickWithRay=function(a,e,t){return h1(this,a,e,t)};class un{constructor(e,t,i,s=""){var h,l;this.defines="",this.onCompiled=null,this.onError=null,this.uniqueId=0,this.onCompileObservable=new Z,this.onErrorObservable=new Z,this.onBindObservable=new Z,this._wasPreviouslyReady=!1,this._isReady=!1,this._compilationError="",this._key="",this._computeSourceCodeOverride="",this._pipelineContext=null,this._computeSourceCode="",this._rawComputeSourceCode="",this._shaderLanguage=1,this.name=e,this._key=s,this._engine=i,this.uniqueId=un._UniqueIdSeed++,this.defines=(h=t.defines)!=null?h:"",this.onError=t.onError,this.onCompiled=t.onCompiled,this._entryPoint=(l=t.entryPoint)!=null?l:"main",this._shaderStore=Me.GetShadersStore(this._shaderLanguage),this._shaderRepository=Me.GetShadersRepository(this._shaderLanguage),this._includeShaderStore=Me.GetIncludesShadersStore(this._shaderLanguage);let n;const r=St()?this._engine.getHostDocument():null;typeof e=="string"?n=e:e.computeSource?n="source:"+e.computeSource:e.computeElement?n=(r==null?void 0:r.getElementById(e.computeElement))||e.computeElement:n=e.compute||e;const o={defines:this.defines.split("\n"),indexParameters:void 0,isFragment:!1,shouldUseHighPrecisionShader:!1,processor:null,supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:this._shaderRepository,includesShadersStore:this._includeShaderStore,version:(this._engine.version*100).toString(),platformName:this._engine.shaderPlatformName,processingContext:null,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,processCodeAfterIncludes:(c,u,f)=>{if(!f)return u;for(const d of f){const p=d.replace("#define","").replace(";","").trim().split(" ");if(p.length===2){const g=p[0],m=p[1];(!isNaN(parseInt(m))||!isNaN(parseFloat(m)))&&(u="const ".concat(g," = ").concat(m,";\n")+u)}}return u}};this._loadShader(n,"Compute","",c=>{f0(o),Id(c,o,u=>{this._rawComputeSourceCode=c,t.processFinalCode&&(u=t.processFinalCode(u));const f=d0(u,"",o);this._useFinalCode(f.vertexCode,e)},this._engine)})}_useFinalCode(e,t){if(t){const i=t.computeElement||t.compute||t.spectorName||t;this._computeSourceCode="//#define SHADER_NAME compute:"+i+"\n"+e}else this._computeSourceCode=e;this._prepareEffect()}get key(){return this._key}isReady(){try{return this._isReadyInternal()}catch{return!1}}_isReadyInternal(){return this._isReady?!0:this._pipelineContext?this._pipelineContext.isReady:!1}getEngine(){return this._engine}getPipelineContext(){return this._pipelineContext}getCompilationError(){return this._compilationError}executeWhenCompiled(e){if(this.isReady()){e(this);return}this.onCompileObservable.add(t=>{e(t)}),(!this._pipelineContext||this._pipelineContext.isAsync)&&setTimeout(()=>{this._checkIsReady(null)},16)}_checkIsReady(e){try{if(this._isReadyInternal())return}catch(t){this._processCompilationErrors(t,e);return}setTimeout(()=>{this._checkIsReady(e)},16)}_loadShader(e,t,i,s){if(typeof HTMLElement<"u"&&e instanceof HTMLElement){const r=h0(e);s(r);return}if(e.substring(0,7)==="source:"){s(e.substring(7));return}if(e.substring(0,7)==="base64:"){const r=window.atob(e.substring(7));s(r);return}if(this._shaderStore[e+t+"Shader"]){s(this._shaderStore[e+t+"Shader"]);return}if(i&&this._shaderStore[e+i+"Shader"]){s(this._shaderStore[e+i+"Shader"]);return}let n;e[0]==="."||e[0]==="/"||e.indexOf("http")>-1?n=e:n=this._shaderRepository+e,this._engine._loadFile(n+"."+t.toLowerCase()+".fx",s)}get computeSourceCode(){var e,t;return this._computeSourceCodeOverride?this._computeSourceCodeOverride:(t=(e=this._pipelineContext)==null?void 0:e._getComputeShaderCode())!=null?t:this._computeSourceCode}get rawComputeSourceCode(){return this._rawComputeSourceCode}_prepareEffect(){const e=this.defines,t=this._pipelineContext;this._isReady=!1;try{const i=this._engine;this._pipelineContext=i.createComputePipelineContext(),this._pipelineContext._name=this._key,i._prepareComputePipelineContext(this._pipelineContext,this._computeSourceCodeOverride?this._computeSourceCodeOverride:this._computeSourceCode,this._rawComputeSourceCode,this._computeSourceCodeOverride?null:e,this._entryPoint),i._executeWhenComputeStateIsCompiled(this._pipelineContext,s=>{if(s&&s.numErrors>0){this._processCompilationErrors(s,t);return}this._compilationError="",this._isReady=!0,this.onCompiled&&this.onCompiled(this),this.onCompileObservable.notifyObservers(this),this.onCompileObservable.clear(),t&&this.getEngine()._deleteComputePipelineContext(t)}),this._pipelineContext.isAsync&&this._checkIsReady(t)}catch(i){this._processCompilationErrors(i,t)}}_processCompilationErrors(e,t=null){var i;if(this._compilationError="",U.Error("Unable to compile compute effect:"),this.defines&&U.Error("Defines:\n"+this.defines),un.LogShaderCodeOnCompilationError){const s=(i=this._pipelineContext)==null?void 0:i._getComputeShaderCode();s&&(U.Error("Compute code:"),U.Error(s))}if(typeof e=="string")this._compilationError=e,U.Error("Error: "+this._compilationError);else for(const s of e.messages){let n="";s.line!==void 0&&(n+="Line "+s.line+", "),s.offset!==void 0&&(n+="Offset "+s.offset+", "),s.length!==void 0&&(n+="Length "+s.length+", "),n+=s.type+": "+s.text,this._compilationError&&(this._compilationError+="\n"),this._compilationError+=n,U.Error(n)}t&&(this._pipelineContext=t,this._isReady=!0),this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this)}dispose(){this._pipelineContext&&this._pipelineContext.dispose(),this._engine._releaseComputeEffect(this)}static RegisterShader(e,t){Me.GetShadersStore(1)["".concat(e,"ComputeShader")]=t}}un._UniqueIdSeed=0;un.LogShaderCodeOnCompilationError=!0;class na{getBindGroups(e,t,i){if(!i)throw new Error("WebGPUComputeContext.getBindGroups: bindingsMapping is required until browsers support reflection for wgsl shaders!");if(this._bindGroups.length===0){const s=this._bindGroupEntries.length>0;for(const n in e){const r=e[n],o=i[n],h=o.group,l=o.binding,c=r.type,u=r.object;let f=r.indexInGroupEntries,d=this._bindGroupEntries[h];switch(d||(d=this._bindGroupEntries[h]=[]),c){case 5:{const _=u;f!==void 0&&s?d[f].resource=this._cacheSampler.getSampler(_):(r.indexInGroupEntries=d.length,d.push({binding:l,resource:this._cacheSampler.getSampler(_)}));break}case 0:case 4:{const _=u,p=_._texture._hardwareTexture;f!==void 0&&s?(c===0&&(d[f++].resource=this._cacheSampler.getSampler(_._texture)),d[f].resource=p.view):(r.indexInGroupEntries=d.length,c===0&&d.push({binding:l-1,resource:this._cacheSampler.getSampler(_._texture)}),d.push({binding:l,resource:p.view}));break}case 1:{const _=u,p=_._texture._hardwareTexture;p.textureAdditionalUsages&8||U.Error("computeDispatch: The texture (name=".concat(_.name,", uniqueId=").concat(_.uniqueId,") is not a storage texture!"),50),f!==void 0&&s?d[f].resource=p.viewForWriting:(r.indexInGroupEntries=d.length,d.push({binding:l,resource:p.viewForWriting}));break}case 6:{const p=u.underlyingResource;f!==void 0&&s?d[f].resource=this._device.importExternalTexture({source:p}):(r.indexInGroupEntries=d.length,d.push({binding:l,resource:this._device.importExternalTexture({source:p})}));break}case 2:case 3:case 7:{const _=c===7?u:u.getBuffer(),p=_.underlyingResource;f!==void 0&&s?(d[f].resource.buffer=p,d[f].resource.size=_.capacity):(r.indexInGroupEntries=d.length,d.push({binding:l,resource:{buffer:p,offset:0,size:_.capacity}}));break}}}for(let n=0;n0&&f.dispatchWorkgroups(i,s,n),f.end(),l&&(this._timestampQuery.endPass(this._timestampIndex,l),this._timestampIndex+=2)};Ye.prototype.releaseComputeEffects=function(){for(const a in this._compiledComputeEffects){const e=this._compiledComputeEffects[a].getPipelineContext();this._deleteComputePipelineContext(e)}this._compiledComputeEffects={}};Ye.prototype._prepareComputePipelineContext=function(a,e,t,i,s){const n=a;this.dbgShowShaderCode&&(U.Log(i),U.Log(e)),n.sources={compute:e,rawCompute:t},n.stage=this._createComputePipelineStageDescriptor(e,i,s)};Ye.prototype._releaseComputeEffect=function(a){this._compiledComputeEffects[a._key]&&(delete this._compiledComputeEffects[a._key],this._deleteComputePipelineContext(a.getPipelineContext()))};Ye.prototype._rebuildComputeEffects=function(){for(const a in this._compiledComputeEffects){const e=this._compiledComputeEffects[a];e._pipelineContext=null,e._wasPreviouslyReady=!1,e._prepareEffect()}};Ye.prototype._executeWhenComputeStateIsCompiled=function(a,e){a.stage.module.getCompilationInfo().then(t=>{const i={numErrors:0,messages:[]};for(const s of t.messages)s.type==="error"&&i.numErrors++,i.messages.push({type:s.type,text:s.message,line:s.lineNum,column:s.linePos,length:s.length,offset:s.offset});e(i)})};Ye.prototype._deleteComputePipelineContext=function(a){a&&a.dispose()};Ye.prototype._createComputePipelineStageDescriptor=function(a,e,t){return e?e="//"+e.split("\n").join("\n//")+"\n":e="",{module:this._device.createShaderModule({code:e+a}),entryPoint:t}};Ye.prototype._debugPushGroup=function(a,e){this._options.enableGPUDebugMarkers&&(e===0||e===1?(e===1&&(this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._endCurrentRenderPass()),this._renderEncoder.pushDebugGroup(a)):this._currentRenderPass?(this._currentRenderPass.pushDebugGroup(a),this._debugStackRenderPass.push(a)):this._pendingDebugCommands.push(["push",a,e]))};Ye.prototype._debugPopGroup=function(a){this._options.enableGPUDebugMarkers&&(a===0||a===1?(a===1&&(this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._endCurrentRenderPass()),this._renderEncoder.popDebugGroup()):this._currentRenderPass?(this._currentRenderPass.popDebugGroup(),this._debugStackRenderPass.pop()):this._pendingDebugCommands.push(["pop",null,a]))};Ye.prototype._debugInsertMarker=function(a,e){this._options.enableGPUDebugMarkers&&(e===0||e===1?(e===1&&(this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._endCurrentRenderPass()),this._renderEncoder.insertDebugMarker(a)):this._currentRenderPass?this._currentRenderPass.insertDebugMarker(a):this._pendingDebugCommands.push(["insert",a,e]))};Ye.prototype._debugFlushPendingCommands=function(){if(this._debugStackRenderPass.length!==0){const a=this._debugStackRenderPass.slice();this._debugStackRenderPass.length=0;for(let e=0;e{this._textureHelper.updateTexture(n,a,a.width,a.height,a.depth,i.format,0,0,!t,!1,0,0),a.generateMipMaps&&this._generateMipmaps(a),a.isReady=!0}).catch(()=>{a.isReady=!0})};var f1={value:()=>{}};function Jc(){for(var a=0,e=arguments.length,t={},i;a=0&&(i=t.slice(s+1),t=t.slice(0,s)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:i}})}gr.prototype=Jc.prototype={constructor:gr,on:function(a,e){var t=this._,i=d1(a+"",t),s,n=-1,r=i.length;if(arguments.length<2){for(;++n0)for(var t=new Array(s),i=0,s,n;i=0&&(e=a.slice(0,t))!=="xmlns"&&(a=a.slice(t+1)),il.hasOwnProperty(e)?{space:il[e],local:a}:a}function p1(a){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===Xa&&e.documentElement.namespaceURI===Xa?e.createElement(a):e.createElementNS(t,a)}}function g1(a){return function(){return this.ownerDocument.createElementNS(a.space,a.local)}}function Z0(a){var e=ra(a);return(e.local?g1:p1)(e)}function m1(){}function Q0(a){return a==null?m1:function(){return this.querySelector(a)}}function v1(a){typeof a!="function"&&(a=Q0(a));for(var e=this._groups,t=e.length,i=new Array(t),s=0;s=I&&(I=b+1);!(x=g[I])&&++I<_;);T._next=x||null}}return r=new di(r,i),r._enter=o,r._exit=h,r}function U1(a){return typeof a=="object"&&"length"in a?a:Array.from(a)}function k1(){return new di(this._exit||this._groups.map(su),this._parents)}function V1(a,e,t){var i=this.enter(),s=this,n=this.exit();return typeof a=="function"?(i=a(i),i&&(i=i.selection())):i=i.append(a+""),e!=null&&(s=e(s),s&&(s=s.selection())),t==null?n.remove():t(n),i&&s?i.merge(s).order():s}function G1(a){for(var e=a.selection?a.selection():a,t=this._groups,i=e._groups,s=t.length,n=i.length,r=Math.min(s,n),o=new Array(s),h=0;h=0;)(r=i[s])&&(n&&r.compareDocumentPosition(n)^4&&n.parentNode.insertBefore(r,n),n=r);return this}function W1(a){a||(a=H1);function e(u,f){return u&&f?a(u.__data__,f.__data__):!u-!f}for(var t=this._groups,i=t.length,s=new Array(i),n=0;ne?1:a>=e?0:NaN}function K1(){var a=arguments[0];return arguments[0]=this,a.apply(null,arguments),this}function X1(){return Array.from(this)}function Y1(){for(var a=this._groups,e=0,t=a.length;e1?this.each((e==null?nm:typeof e=="function"?am:rm)(a,e,t==null?"":t)):fn(this.node(),a)}function fn(a,e){return a.style.getPropertyValue(e)||nu(a).getComputedStyle(a,null).getPropertyValue(e)}function hm(a){return function(){delete this[a]}}function lm(a,e){return function(){this[a]=e}}function cm(a,e){return function(){var t=e.apply(this,arguments);t==null?delete this[a]:this[a]=t}}function um(a,e){return arguments.length>1?this.each((e==null?hm:typeof e=="function"?cm:lm)(a,e)):this.node()[a]}function ru(a){return a.trim().split(/^|\s+/)}function J0(a){return a.classList||new au(a)}function au(a){this._node=a,this._names=ru(a.getAttribute("class")||"")}au.prototype={add:function(a){var e=this._names.indexOf(a);e<0&&(this._names.push(a),this._node.setAttribute("class",this._names.join(" ")))},remove:function(a){var e=this._names.indexOf(a);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(a){return this._names.indexOf(a)>=0}};function ou(a,e){for(var t=J0(a),i=-1,s=e.length;++i=0&&(t=e.slice(i+1),e=e.slice(0,i)),{type:e,name:t}})}function km(a){return function(){var e=this.__on;if(e){for(var t=0,i=-1,s=e.length,n;t>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?lr(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?lr(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=jm.exec(a))?new ai(e[1],e[2],e[3],1):(e=$m.exec(a))?new ai(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Zm.exec(a))?lr(e[1],e[2],e[3],e[4]):(e=Qm.exec(a))?lr(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Jm.exec(a))?ll(e[1],e[2]/100,e[3]/100,1):(e=e2.exec(a))?ll(e[1],e[2]/100,e[3]/100,e[4]):sl.hasOwnProperty(a)?al(sl[a]):a==="transparent"?new ai(NaN,NaN,NaN,0):null}function al(a){return new ai(a>>16&255,a>>8&255,a&255,1)}function lr(a,e,t,i){return i<=0&&(a=e=t=NaN),new ai(a,e,t,i)}function s2(a){return a instanceof Jn||(a=Gn(a)),a?(a=a.rgb(),new ai(a.r,a.g,a.b,a.opacity)):new ai}function Ya(a,e,t,i){return arguments.length===1?s2(a):new ai(a,e,t,i==null?1:i)}function ai(a,e,t,i){this.r=+a,this.g=+e,this.b=+t,this.opacity=+i}eo(ai,Ya,fu(Jn,{brighter(a){return a=a==null?Dr:Math.pow(Dr,a),new ai(this.r*a,this.g*a,this.b*a,this.opacity)},darker(a){return a=a==null?kn:Math.pow(kn,a),new ai(this.r*a,this.g*a,this.b*a,this.opacity)},rgb(){return this},clamp(){return new ai(Us(this.r),Us(this.g),Us(this.b),Fr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ol,formatHex:ol,formatHex8:n2,formatRgb:hl,toString:hl}));function ol(){return"#".concat(Bs(this.r)).concat(Bs(this.g)).concat(Bs(this.b))}function n2(){return"#".concat(Bs(this.r)).concat(Bs(this.g)).concat(Bs(this.b)).concat(Bs((isNaN(this.opacity)?1:this.opacity)*255))}function hl(){const a=Fr(this.opacity);return"".concat(a===1?"rgb(":"rgba(").concat(Us(this.r),", ").concat(Us(this.g),", ").concat(Us(this.b)).concat(a===1?")":", ".concat(a,")"))}function Fr(a){return isNaN(a)?1:Math.max(0,Math.min(1,a))}function Us(a){return Math.max(0,Math.min(255,Math.round(a)||0))}function Bs(a){return a=Us(a),(a<16?"0":"")+a.toString(16)}function ll(a,e,t,i){return i<=0?a=e=t=NaN:t<=0||t>=1?a=e=NaN:e<=0&&(a=NaN),new Mi(a,e,t,i)}function du(a){if(a instanceof Mi)return new Mi(a.h,a.s,a.l,a.opacity);if(a instanceof Jn||(a=Gn(a)),!a)return new Mi;if(a instanceof Mi)return a;a=a.rgb();var e=a.r/255,t=a.g/255,i=a.b/255,s=Math.min(e,t,i),n=Math.max(e,t,i),r=NaN,o=n-s,h=(n+s)/2;return o?(e===n?r=(t-i)/o+(t0&&h<1?0:r,new Mi(r,o,h,a.opacity)}function r2(a,e,t,i){return arguments.length===1?du(a):new Mi(a,e,t,i==null?1:i)}function Mi(a,e,t,i){this.h=+a,this.s=+e,this.l=+t,this.opacity=+i}eo(Mi,r2,fu(Jn,{brighter(a){return a=a==null?Dr:Math.pow(Dr,a),new Mi(this.h,this.s,this.l*a,this.opacity)},darker(a){return a=a==null?kn:Math.pow(kn,a),new Mi(this.h,this.s,this.l*a,this.opacity)},rgb(){var a=this.h%360+(this.h<0)*360,e=isNaN(a)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,s=2*t-i;return new ai(Ea(a>=240?a-240:a+120,s,i),Ea(a,s,i),Ea(a<120?a+240:a-120,s,i),this.opacity)},clamp(){return new Mi(cl(this.h),cr(this.s),cr(this.l),Fr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const a=Fr(this.opacity);return"".concat(a===1?"hsl(":"hsla(").concat(cl(this.h),", ").concat(cr(this.s)*100,"%, ").concat(cr(this.l)*100,"%").concat(a===1?")":", ".concat(a,")"))}}));function cl(a){return a=(a||0)%360,a<0?a+360:a}function cr(a){return Math.max(0,Math.min(1,a||0))}function Ea(a,e,t){return(a<60?e+(t-e)*a/60:a<180?t:a<240?e+(t-e)*(240-a)/60:e)*255}const _u=a=>()=>a;function a2(a,e){return function(t){return a+t*e}}function o2(a,e,t){return a=Math.pow(a,t),e=Math.pow(e,t)-a,t=1/t,function(i){return Math.pow(a+i*e,t)}}function h2(a){return(a=+a)==1?pu:function(e,t){return t-e?o2(e,t,a):_u(isNaN(e)?t:e)}}function pu(a,e){var t=e-a;return t?a2(a,t):_u(isNaN(a)?e:a)}const ul=function a(e){var t=h2(e);function i(s,n){var r=t((s=Ya(s)).r,(n=Ya(n)).r),o=t(s.g,n.g),h=t(s.b,n.b),l=pu(s.opacity,n.opacity);return function(c){return s.r=r(c),s.g=o(c),s.b=h(c),s.opacity=l(c),s+""}}return i.gamma=a,i}(1);function bs(a,e){return a=+a,e=+e,function(t){return a*(1-t)+e*t}}var qa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ca=new RegExp(qa.source,"g");function l2(a){return function(){return a}}function c2(a){return function(e){return a(e)+""}}function u2(a,e){var t=qa.lastIndex=Ca.lastIndex=0,i,s,n,r=-1,o=[],h=[];for(a=a+"",e=e+"";(i=qa.exec(a))&&(s=Ca.exec(e));)(n=s.index)>t&&(n=e.slice(t,n),o[r]?o[r]+=n:o[++r]=n),(i=i[0])===(s=s[0])?o[r]?o[r]+=s:o[++r]=s:(o[++r]=null,h.push({i:r,x:bs(i,s)})),t=Ca.lastIndex;return t180?c+=360:c-l>180&&(l+=360),f.push({i:u.push(s(u)+"rotate(",null,i)-2,x:bs(l,c)})):c&&u.push(s(u)+"rotate("+c+i)}function o(l,c,u,f){l!==c?f.push({i:u.push(s(u)+"skewX(",null,i)-2,x:bs(l,c)}):c&&u.push(s(u)+"skewX("+c+i)}function h(l,c,u,f,d,_){if(l!==u||c!==f){var p=d.push(s(d)+"scale(",null,",",null,")");_.push({i:p-4,x:bs(l,u)},{i:p-2,x:bs(c,f)})}else(u!==1||f!==1)&&d.push(s(d)+"scale("+u+","+f+")")}return function(l,c){var u=[],f=[];return l=a(l),c=a(c),n(l.translateX,l.translateY,c.translateX,c.translateY,u,f),r(l.rotate,c.rotate,u,f),o(l.skewX,c.skewX,u,f),h(l.scaleX,l.scaleY,c.scaleX,c.scaleY,u,f),l=c=null,function(d){for(var _=-1,p=f.length,g;++_=0&&a._call.call(void 0,e),a=a._next;--dn}function dl(){Gs=(Br=zn.now())+aa,dn=An=0;try{m2()}finally{dn=0,b2(),Gs=0}}function v2(){var a=zn.now(),e=a-Br;e>vu&&(aa-=e,Br=a)}function b2(){for(var a,e=Or,t,i=1/0;e;)e._call?(i>e._time&&(i=e._time),a=e,e=e._next):(t=e._next,e._next=null,e=a?a._next=t:Or=t);Rn=a,$a(i)}function $a(a){if(!dn){An&&(An=clearTimeout(An));var e=a-Gs;e>24?(a<1/0&&(An=setTimeout(dl,a-zn.now()-aa)),yn&&(yn=clearInterval(yn))):(yn||(Br=zn.now(),yn=setInterval(v2,vu)),dn=1,bu(dl))}}function _l(a,e,t){var i=new Lr;return e=e==null?0:+e,i.restart(s=>{i.stop(),a(s+e)},e,t),i}var x2=Jc("start","end","cancel","interrupt"),y2=[],yu=0,pl=1,Za=2,mr=3,gl=4,Qa=5,vr=6;function oa(a,e,t,i,s,n){var r=a.__transition;if(!r)a.__transition={};else if(t in r)return;T2(a,t,{name:e,index:i,group:s,on:x2,tween:y2,time:n.time,delay:n.delay,duration:n.duration,ease:n.ease,timer:null,state:yu})}function io(a,e){var t=Oi(a,e);if(t.state>yu)throw new Error("too late; already scheduled");return t}function Xi(a,e){var t=Oi(a,e);if(t.state>mr)throw new Error("too late; already running");return t}function Oi(a,e){var t=a.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function T2(a,e,t){var i=a.__transition,s;i[e]=t,t.timer=xu(n,0,t.time);function n(l){t.state=pl,t.timer.restart(r,t.delay,t.time),t.delay<=l&&r(l-t.delay)}function r(l){var c,u,f,d;if(t.state!==pl)return h();for(c in i)if(d=i[c],d.name===t.name){if(d.state===mr)return _l(r);d.state===gl?(d.state=vr,d.timer.stop(),d.on.call("interrupt",a,a.__data__,d.index,d.group),delete i[c]):+cZa&&i.state=0&&(e=e.slice(0,t)),!e||e==="start"})}function J2(a,e,t){var i,s,n=Q2(e)?io:Xi;return function(){var r=n(this,a),o=r.on;o!==i&&(s=(i=o).copy()).on(e,t),r.on=s}}function ev(a,e){var t=this._id;return arguments.length<2?Oi(this.node(),t).on.on(a):this.each(J2(t,a,e))}function tv(a){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==a)return;e&&e.removeChild(this)}}function iv(){return this.on("end.remove",tv(this._id))}function sv(a){var e=this._name,t=this._id;typeof a!="function"&&(a=Q0(a));for(var i=this._groups,s=i.length,n=new Array(s),r=0;rn?n:Math.floor(r);const o=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE,h=a.uvs,l=a.colors,c=[],u=[],f=[],d=[],_=[],p=[],g=[],m=[];let b;const I=[],T=[];let x,y,R;if(e.length<2){const Q=[],be=[];for(y=0;y0&&(G=w[R].subtract(w[R-1]).length(),L=G+g[x],_[x].push(L),g[x]=L),R++;i&&(R--,c.push(w[0].x,w[0].y,w[0].z),G=w[R].subtract(w[0]).length(),L=G+g[x],_[x].push(L),g[x]=L),I[x]=P+C,T[x]=E,E+=P+C}let W,K,ce=null,$=null;for(y=0;y{let _=i[0].length;const p=o;let g=0;const m=p._originalBuilderSideOrientation===F.DOUBLESIDE?2:1;for(let b=1;b<=m;++b)for(let I=0;Izs(a,{pathArray:e,closeArray:t,closePath:i,offset:s,updatable:r,sideOrientation:o,instance:h},n);function Eu(a){const e=[],t=[],i=[],s=[],n=a.radius||.5,r=a.tessellation||64,o=a.arc&&(a.arc<=0||a.arc>1)?1:a.arc||1,h=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE;e.push(0,0,0),s.push(.5,.5);const l=Math.PI*2*o,c=o===1?l/r:l/(r-1);let u=0;for(let _=0;_Cu(a,{radius:e,tessellation:t,sideOrientation:n,updatable:s},i);F._GroundMeshParser=(a,e)=>er.Parse(a,e);class er extends F{constructor(e,t){super(e,t),this.generateOctree=!1}getClassName(){return"GroundMesh"}get subdivisions(){return Math.min(this._subdivisionsX,this._subdivisionsY)}get subdivisionsX(){return this._subdivisionsX}get subdivisionsY(){return this._subdivisionsY}optimize(e,t=32){this._subdivisionsX=e,this._subdivisionsY=e,this.subdivide(e);const i=this;i.createOrUpdateSubmeshesOctree&&i.createOrUpdateSubmeshesOctree(t)}getHeightAtCoordinates(e,t){const i=this.getWorldMatrix(),s=N.Matrix[5];i.invertToRef(s);const n=N.Vector3[8];if(v.TransformCoordinatesFromFloatsToRef(e,0,t,s,n),e=n.x,t=n.z,e=this._maxX||t<=this._minZ||t>this._maxZ)return this.position.y;(!this._heightQuads||this._heightQuads.length==0)&&(this._initHeightQuads(),this._computeHeightQuads());const r=this._getFacetAt(e,t),o=-(r.x*e+r.z*t+r.w)/r.y;return v.TransformCoordinatesFromFloatsToRef(0,o,0,i,n),n.y}getNormalAtCoordinates(e,t){const i=new v(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,i),i}getNormalAtCoordinatesToRef(e,t,i){const s=this.getWorldMatrix(),n=N.Matrix[5];s.invertToRef(n);const r=N.Vector3[8];if(v.TransformCoordinatesFromFloatsToRef(e,0,t,n,r),e=r.x,t=r.z,ethis._maxX||tthis._maxZ)return this;(!this._heightQuads||this._heightQuads.length==0)&&(this._initHeightQuads(),this._computeHeightQuads());const o=this._getFacetAt(e,t);return v.TransformNormalFromFloatsToRef(o.x,o.y,o.z,s,i),this}updateCoordinateHeights(){return(!this._heightQuads||this._heightQuads.length==0)&&this._initHeightQuads(),this._computeHeightQuads(),this}_getFacetAt(e,t){const i=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),s=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),n=this._heightQuads[s*this._subdivisionsX+i];let r;return ta.maxHeight){l=!0;const u=a.maxHeight;a.maxHeight=a.minHeight,a.minHeight=u}for(n=0;n<=a.subdivisions;n++)for(r=0;r<=a.subdivisions;r++){const u=new v(r*a.width/a.subdivisions-a.width/2,0,(a.subdivisions-n)*a.height/a.subdivisions-a.height/2),f=(u.x+a.width/2)/a.width*(a.bufferWidth-1)|0,d=(1-(u.z+a.height/2)/a.height)*(a.bufferHeight-1)|0,_=(f+d*a.bufferWidth)*4;let p=a.buffer[_]/255,g=a.buffer[_+1]/255,m=a.buffer[_+2]/255;const b=a.buffer[_+3]/255;l&&(p=1-p,g=1-g,m=1-m);const I=p*o.r+g*o.g+m*o.b;b>=h?u.y=a.minHeight+(a.maxHeight-a.minHeight)*I:u.y=a.minHeight-Le,a.heightBuffer&&(a.heightBuffer[n*(a.subdivisions+1)+r]=u.y),t.push(u.x,u.y,u.z),i.push(0,0,0),s.push(r/a.subdivisions,1-n/a.subdivisions)}for(n=0;n=a.minHeight,g=t[f*3+1]>=a.minHeight,m=t[d*3+1]>=a.minHeight;p&&g&&m&&(e.push(u),e.push(f),e.push(d)),t[_*3+1]>=a.minHeight&&p&&m&&(e.push(_),e.push(u),e.push(d))}j.ComputeNormals(t,e,i);const c=new j;return c.indices=e,c.positions=t,c.normals=i,c.uvs=s,c}function wu(a,e={},t){const i=new er(a,t);return i._setReady(!1),i._subdivisionsX=e.subdivisionsX||e.subdivisions||1,i._subdivisionsY=e.subdivisionsY||e.subdivisions||1,i._width=e.width||1,i._height=e.height||1,i._maxX=i._width/2,i._maxZ=i._height/2,i._minX=-i._maxX,i._minZ=-i._maxZ,Su(e).applyToMesh(i,e.updatable),i._setReady(!0),i}function Du(a,e,t=null){const i=new F(a,t);return Mu(e).applyToMesh(i,e.updatable),i}function Fu(a,e,t={},i=null){const s=t.width||10,n=t.height||10,r=t.subdivisions||1,o=t.minHeight||0,h=t.maxHeight||1,l=t.colorFilter||new de(.3,.59,.11),c=t.alphaFilter||0,u=t.updatable,f=t.onReady;i=i||Ee.LastCreatedScene;const d=new er(a,i);d._subdivisionsX=r,d._subdivisionsY=r,d._width=s,d._height=n,d._maxX=d._width/2,d._maxZ=d._height/2,d._minX=-d._maxX,d._minZ=-d._maxZ,d._setReady(!1);let _;t.passHeightBufferInCallback&&(_=new Float32Array((r+1)*(r+1)));const p=(g,m,b)=>{Pu({width:s,height:n,subdivisions:r,minHeight:o,maxHeight:h,colorFilter:l,buffer:g,bufferWidth:m,bufferHeight:b,alphaFilter:c,heightBuffer:_}).applyToMesh(d,u),f&&f(d,_),d._setReady(!0)};if(typeof e=="string"){const g=m=>{const b=m.width,I=m.height;if(i.isDisposed)return;const T=i==null?void 0:i.getEngine().resizeImageBitmap(m,b,I);p(T,b,I)};J.LoadImage(e,g,t.onError?t.onError:()=>{},i.offlineProvider)}else p(e.data,e.width,e.height);return d}j.CreateGround=Su;j.CreateTiledGround=Mu;j.CreateGroundFromHeightMap=Pu;F.CreateGround=(a,e,t,i,s,n)=>wu(a,{width:e,height:t,subdivisions:i,updatable:n},s);F.CreateTiledGround=(a,e,t,i,s,n,r,o,h)=>Du(a,{xmin:e,zmin:t,xmax:i,zmax:s,subdivisions:n,precision:r,updatable:h},o);F.CreateGroundFromHeightMap=(a,e,t,i,s,n,r,o,h,l,c)=>Fu(a,e,{width:t,height:i,subdivisions:s,minHeight:n,maxHeight:r,updatable:h,onReady:l,alphaFilter:c},o);function Ou(a){let t=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23];const i=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],s=[];let n=[];const r=a.width||a.size||1,o=a.height||a.size||1,h=a.depth||a.size||1,l=a.wrap||!1;let c=a.topBaseAt===void 0?1:a.topBaseAt,u=a.bottomBaseAt===void 0?0:a.bottomBaseAt;c=(c+4)%4,u=(u+4)%4;const f=[2,0,3,1],d=[2,0,1,3];let _=f[c],p=d[u],g=[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,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,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,1];if(l){t=[2,3,0,2,0,1,4,5,6,4,6,7,9,10,11,9,11,8,12,14,15,12,13,14],g=[-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,1,1,-1,1,-1,-1,1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1];let R=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],E=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]];const C=[17,18,19,16],S=[22,23,20,21];for(;_>0;)R.unshift(R.pop()),C.unshift(C.pop()),_--;for(;p>0;)E.unshift(E.pop()),S.unshift(S.pop()),p--;R=R.flat(),E=E.flat(),g=g.concat(R).concat(E),t.push(C[0],C[2],C[3],C[0],C[1],C[2]),t.push(S[0],S[2],S[3],S[0],S[1],S[2])}const m=[r/2,o/2,h/2];n=g.reduce((R,E,C)=>R.concat(E*m[C%3]),[]);const b=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE,I=a.faceUV||new Array(6),T=a.faceColors,x=[];for(let R=0;R<6;R++)I[R]===void 0&&(I[R]=new Pe(0,0,1,1)),T&&T[R]===void 0&&(T[R]=new H(1,1,1,1));for(let R=0;R<6;R++)if(s.push(I[R].z,I[R].w),s.push(I[R].x,I[R].w),s.push(I[R].x,I[R].y),s.push(I[R].z,I[R].y),T)for(let E=0;E<4;E++)x.push(T[R].r,T[R].g,T[R].b,T[R].a);j._ComputeSides(b,n,t,i,s,a.frontUVs,a.backUVs);const y=new j;if(y.indices=t,y.positions=n,y.normals=i,y.uvs=s,T){const R=b===j.DOUBLESIDE?x.concat(x):x;y.colors=R}return y}function Bu(a,e={},t=null){const i=new F(a,t);return e.sideOrientation=F._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,Ou(e).applyToMesh(i,e.updatable),i}j.CreateBox=Ou;F.CreateBox=(a,e,t=null,i,s)=>Bu(a,{size:e,sideOrientation:s,updatable:i},t);function Mn(a){const e=a.pattern||F.NO_FLIP,t=a.tileWidth||a.tileSize||1,i=a.tileHeight||a.tileSize||1,s=a.alignHorizontal||0,n=a.alignVertical||0,r=a.width||a.size||1,o=Math.floor(r/t);let h=r-o*t;const l=a.height||a.size||1,c=Math.floor(l/i);let u=l-c*i;const f=t*o/2,d=i*c/2;let _=0,p=0,g=0,m=0,b=0,I=0;if(h>0||u>0){switch(g=-f,m=-d,b=f,I=d,s){case F.CENTER:h/=2,g-=h,b+=h;break;case F.LEFT:b+=h,_=-h/2;break;case F.RIGHT:g-=h,_=h/2;break}switch(n){case F.CENTER:u/=2,m-=u,I+=u;break;case F.BOTTOM:I+=u,p=-u/2;break;case F.TOP:m-=u,p=u/2;break}}const T=[],x=[],y=[];y[0]=[0,0,1,0,1,1,0,1],y[1]=[0,0,1,0,1,1,0,1],(e===F.ROTATE_TILE||e===F.ROTATE_ROW)&&(y[1]=[1,1,0,1,0,0,1,0]),(e===F.FLIP_TILE||e===F.FLIP_ROW)&&(y[1]=[1,0,0,0,0,1,1,1]),(e===F.FLIP_N_ROTATE_TILE||e===F.FLIP_N_ROTATE_ROW)&&(y[1]=[0,1,1,1,1,0,0,0]);let R=[];const E=[],C=[];let S=0;for(let L=0;L0||u>0){const L=u>0&&(n===F.CENTER||n===F.TOP),W=u>0&&(n===F.CENTER||n===F.BOTTOM),K=h>0&&(s===F.CENTER||s===F.RIGHT),ce=h>0&&(s===F.CENTER||s===F.LEFT);let $=[],z,k,M,V;if(L&&K&&(T.push(g+_,m+p,0),T.push(-f+_,m+p,0),T.push(-f+_,m+u+p,0),T.push(g+_,m+u+p,0),C.push(S,S+1,S+3,S+1,S+2,S+3),S+=4,z=1-h/t,k=1-u/i,M=1,V=1,$=[z,k,M,k,M,V,z,V],e===F.ROTATE_ROW&&($=[1-z,1-k,1-M,1-k,1-M,1-V,1-z,1-V]),e===F.FLIP_ROW&&($=[1-z,k,1-M,k,1-M,V,1-z,V]),e===F.FLIP_N_ROTATE_ROW&&($=[z,1-k,M,1-k,M,1-V,z,1-V]),R=R.concat($),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),x.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),L&&ce&&(T.push(f+_,m+p,0),T.push(b+_,m+p,0),T.push(b+_,m+u+p,0),T.push(f+_,m+u+p,0),C.push(S,S+1,S+3,S+1,S+2,S+3),S+=4,z=0,k=1-u/i,M=h/t,V=1,$=[z,k,M,k,M,V,z,V],(e===F.ROTATE_ROW||e===F.ROTATE_TILE&&o%2===0)&&($=[1-z,1-k,1-M,1-k,1-M,1-V,1-z,1-V]),(e===F.FLIP_ROW||e===F.FLIP_TILE&&o%2===0)&&($=[1-z,k,1-M,k,1-M,V,1-z,V]),(e===F.FLIP_N_ROTATE_ROW||e===F.FLIP_N_ROTATE_TILE&&o%2===0)&&($=[z,1-k,M,1-k,M,1-V,z,1-V]),R=R.concat($),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),x.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),W&&K&&(T.push(g+_,d+p,0),T.push(-f+_,d+p,0),T.push(-f+_,I+p,0),T.push(g+_,I+p,0),C.push(S,S+1,S+3,S+1,S+2,S+3),S+=4,z=1-h/t,k=0,M=1,V=u/i,$=[z,k,M,k,M,V,z,V],(e===F.ROTATE_ROW&&c%2===1||e===F.ROTATE_TILE&&c%1===0)&&($=[1-z,1-k,1-M,1-k,1-M,1-V,1-z,1-V]),(e===F.FLIP_ROW&&c%2===1||e===F.FLIP_TILE&&c%2===0)&&($=[1-z,k,1-M,k,1-M,V,1-z,V]),(e===F.FLIP_N_ROTATE_ROW&&c%2===1||e===F.FLIP_N_ROTATE_TILE&&c%2===0)&&($=[z,1-k,M,1-k,M,1-V,z,1-V]),R=R.concat($),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),x.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),W&&ce&&(T.push(f+_,d+p,0),T.push(b+_,d+p,0),T.push(b+_,I+p,0),T.push(f+_,I+p,0),C.push(S,S+1,S+3,S+1,S+2,S+3),S+=4,z=0,k=0,M=h/t,V=u/i,$=[z,k,M,k,M,V,z,V],(e===F.ROTATE_ROW&&c%2===1||e===F.ROTATE_TILE&&(c+o)%2===1)&&($=[1-z,1-k,1-M,1-k,1-M,1-V,1-z,1-V]),(e===F.FLIP_ROW&&c%2===1||e===F.FLIP_TILE&&(c+o)%2===1)&&($=[1-z,k,1-M,k,1-M,V,1-z,V]),(e===F.FLIP_N_ROTATE_ROW&&c%2===1||e===F.FLIP_N_ROTATE_TILE&&(c+o)%2===1)&&($=[z,1-k,M,1-k,M,1-V,z,1-V]),R=R.concat($),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),x.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),L){const q=[];z=0,k=1-u/i,M=1,V=1,q[0]=[z,k,M,k,M,V,z,V],q[1]=[z,k,M,k,M,V,z,V],(e===F.ROTATE_TILE||e===F.ROTATE_ROW)&&(q[1]=[1-z,1-k,1-M,1-k,1-M,1-V,1-z,1-V]),(e===F.FLIP_TILE||e===F.FLIP_ROW)&&(q[1]=[1-z,k,1-M,k,1-M,V,1-z,V]),(e===F.FLIP_N_ROTATE_TILE||e===F.FLIP_N_ROTATE_ROW)&&(q[1]=[z,1-k,M,1-k,M,1-V,z,1-V]);for(let he=0;heq+w)),w+=R[M].length,i)for(let q=0;q<4;q++)y.push(i[M].r,i[M].g,i[M].b,i[M].a)}const P=new v(0,0,p),G=O.RotationY(Math.PI);b=R[0].map(M=>v.TransformNormal(M,G).add(P)).map(M=>[M.x,M.y,M.z]).reduce((M,V)=>M.concat(V),[]),I=E[0].map(M=>v.TransformNormal(M,G)).map(M=>[M.x,M.y,M.z]).reduce((M,V)=>M.concat(V),[]),b=b.concat(R[1].map(M=>M.subtract(P)).map(M=>[M.x,M.y,M.z]).reduce((M,V)=>M.concat(V),[])),I=I.concat(E[1].map(M=>[M.x,M.y,M.z]).reduce((M,V)=>M.concat(V),[]));const L=new v(d,0,0),W=O.RotationY(-Math.PI/2);b=b.concat(R[2].map(M=>v.TransformNormal(M,W).add(L)).map(M=>[M.x,M.y,M.z]).reduce((M,V)=>M.concat(V),[])),I=I.concat(E[2].map(M=>v.TransformNormal(M,W)).map(M=>[M.x,M.y,M.z]).reduce((M,V)=>M.concat(V),[]));const K=O.RotationY(Math.PI/2);b=b.concat(R[3].map(M=>v.TransformNormal(M,K).subtract(L)).map(M=>[M.x,M.y,M.z]).reduce((M,V)=>M.concat(V),[])),I=I.concat(E[3].map(M=>v.TransformNormal(M,K)).map(M=>[M.x,M.y,M.z]).reduce((M,V)=>M.concat(V),[]));const ce=new v(0,_,0),$=O.RotationX(Math.PI/2);b=b.concat(R[4].map(M=>v.TransformNormal(M,$).add(ce)).map(M=>[M.x,M.y,M.z]).reduce((M,V)=>M.concat(V),[])),I=I.concat(E[4].map(M=>v.TransformNormal(M,$)).map(M=>[M.x,M.y,M.z]).reduce((M,V)=>M.concat(V),[]));const z=O.RotationX(-Math.PI/2);b=b.concat(R[5].map(M=>v.TransformNormal(M,z).subtract(ce)).map(M=>[M.x,M.y,M.z]).reduce((M,V)=>M.concat(V),[])),I=I.concat(E[5].map(M=>v.TransformNormal(M,z)).map(M=>[M.x,M.y,M.z]).reduce((M,V)=>M.concat(V),[])),j._ComputeSides(f,b,x,I,T);const k=new j;if(k.indices=x,k.positions=b,k.normals=I,k.uvs=T,i){const M=f===j.DOUBLESIDE?y.concat(y):y;k.colors=M}return k}function Mv(a,e,t=null){const i=new F(a,t);return e.sideOrientation=F._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,Lu(e).applyToMesh(i,e.updatable),i}j.CreateTiledBox=Lu;function Nu(a){const e=(a.segments||32)|0,t=a.diameterX||a.diameter||1,i=a.diameterY||a.diameter||1,s=a.diameterZ||a.diameter||1,n=a.arc&&(a.arc<=0||a.arc>1)?1:a.arc||1,r=a.slice&&a.slice<=0?1:a.slice||1,o=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE,h=!!a.dedupTopBottomIndices,l=new v(t/2,i/2,s/2),c=2+e,u=2*c,f=[],d=[],_=[],p=[];for(let m=0;m<=c;m++){const b=m/c,I=b*Math.PI*r;for(let T=0;T<=u;T++){const x=T/u,y=x*Math.PI*2*n,R=O.RotationZ(-I),E=O.RotationY(y),C=v.TransformCoordinates(v.Up(),R),S=v.TransformCoordinates(C,E),w=S.multiply(l),P=S.divide(l).normalize();d.push(w.x,w.y,w.z),_.push(P.x,P.y,P.z),p.push(x,b)}if(m>0){const T=d.length/3;for(let x=T-2*(u+1);x+u+21&&(f.push(x),f.push(x+1),f.push(x+u+1)),(mUu(a,{segments:e,diameterX:t,diameterY:t,diameterZ:t,sideOrientation:n,updatable:s},i);function ku(a){const e=a.height||2;let t=a.diameterTop===0?0:a.diameterTop||a.diameter||1,i=a.diameterBottom===0?0:a.diameterBottom||a.diameter||1;t=t||1e-5,i=i||1e-5;const s=(a.tessellation||24)|0,n=(a.subdivisions||1)|0,r=!!a.hasRings,o=!!a.enclose,h=a.cap===0?0:a.cap||F.CAP_ALL,l=a.arc&&(a.arc<=0||a.arc>1)?1:a.arc||1,c=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE,u=a.faceUV||new Array(3),f=a.faceColors,d=l!==1&&o?2:0,_=r?n:1,p=2+(1+d)*_;let g;for(g=0;g{const me=ue?t/2:i/2;if(me===0)return;let ne,Ie,Se;const Q=ue?u[p-1]:u[0];let be=null;f&&(be=ue?f[p-1]:f[0]);const Be=b.length/3,ze=ue?e/2:-e/2,Ke=new v(0,ze,0);b.push(Ke.x,Ke.y,Ke.z),I.push(0,ue?1:-1,0);const Rt=Q.y+(Q.w-Q.y)*.5;T.push(Q.x+(Q.z-Q.x)*.5,Rt),be&&x.push(be.r,be.g,be.b,be.a);const Ct=new oe(.5,.5);for(Se=0;Se<=s;Se++){ne=Math.PI*2*Se*l/s;const Ge=Math.cos(-ne),Jt=Math.sin(-ne);Ie=new v(Ge*me,ze,Jt*me);const Wt=new oe(Ge*Ct.x+.5,Jt*Ct.y+.5);b.push(Ie.x,Ie.y,Ie.z),I.push(0,ue?1:-1,0);const ji=Q.y+(Q.w-Q.y)*Wt.y;T.push(Q.x+(Q.z-Q.x)*Wt.x,ji),be&&x.push(be.r,be.g,be.b,be.a)}for(Se=0;Se((r===void 0||!(r instanceof it))&&(r!==void 0&&(h=o||F.DEFAULTSIDE,o=r),r=n,n=1),Vu(a,{height:e,diameterTop:t,diameterBottom:i,tessellation:s,subdivisions:n,sideOrientation:h,updatable:o},r));function Gu(a){const e=[],t=[],i=[],s=[],n=a.diameter||1,r=a.thickness||.5,o=(a.tessellation||16)|0,h=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE,l=o+1;for(let u=0;u<=o;u++){const f=u/o,d=u*Math.PI*2/o-Math.PI/2,_=O.Translation(n/2,0,0).multiply(O.RotationY(d));for(let p=0;p<=o;p++){const g=1-p/o,m=p*Math.PI*2/o+Math.PI,b=Math.cos(m),I=Math.sin(m);let T=new v(b,I,0),x=T.scale(r/2);const y=new oe(f,g);x=v.TransformCoordinates(x,_),T=v.TransformNormal(T,_),t.push(x.x,x.y,x.z),i.push(T.x,T.y,T.z),s.push(y.x,y.y);const R=(u+1)%l,E=(p+1)%l;e.push(u*l+p),e.push(u*l+E),e.push(R*l+p),e.push(u*l+E),e.push(R*l+E),e.push(R*l+p)}}j._ComputeSides(h,t,e,i,s,a.frontUVs,a.backUVs);const c=new j;return c.indices=e,c.positions=t,c.normals=i,c.uvs=s,c}function zu(a,e={},t){const i=new F(a,t);return e.sideOrientation=F._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,Gu(e).applyToMesh(i,e.updatable),i}j.CreateTorus=Gu;F.CreateTorus=(a,e,t,i,s,n,r)=>zu(a,{diameter:e,thickness:t,tessellation:i,sideOrientation:r,updatable:n},s);function Wu(a){const e=[],t=[],i=[],s=[],n=a.radius||2,r=a.tube||.5,o=a.radialSegments||32,h=a.tubularSegments||32,l=a.p||2,c=a.q||3,u=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE,f=g=>{const m=Math.cos(g),b=Math.sin(g),I=c/l*g,T=Math.cos(I),x=n*(2+T)*.5*m,y=n*(2+T)*b*.5,R=n*Math.sin(I)*.5;return new v(x,y,R)};let d,_;for(d=0;d<=o;d++){const m=d%o/o*2*l*Math.PI,b=f(m),I=f(m+.01),T=I.subtract(b);let x=I.add(b);const y=v.Cross(T,x);for(x=v.Cross(y,T),y.normalize(),x.normalize(),_=0;_Hu(a,{radius:e,tube:t,radialSegments:i,tubularSegments:s,p:n,q:r,sideOrientation:l,updatable:h},o);function Ku(a){const e=[],t=[],i=a.lines,s=a.colors,n=[];let r=0;for(let h=0;h0&&(e.push(r-1),e.push(r)),r++}}const o=new j;return o.indices=e,o.positions=t,s&&(o.colors=n),o}function Xu(a){const e=a.dashSize||3,t=a.gapSize||1,i=a.dashNb||200,s=a.points,n=[],r=[],o=v.Zero();let h=0,l=0,c=0,u=0,f=0,d=0,_=0;for(_=0;_{const u=v.Zero(),f=c.length/6;let d=0,_=0,p=0,g=0,m=0,b=0,I=0,T=0;for(I=0;Iqu(a,{points:e,updatable:i,instance:s},t);F.CreateDashedLines=(a,e,t,i,s,n=null,r,o)=>ju(a,{points:e,dashSize:t,gapSize:i,dashNb:s,updatable:r,instance:o},n);class Pv extends oe{constructor(e,t){super(e.x,e.y),this.index=t}}class Sa{constructor(){this.elements=[]}add(e){const t=[];return e.forEach(i=>{const s=new Pv(i,this.elements.length);t.push(s),this.elements.push(s)}),t}computeBounds(){const e=new oe(this.elements[0].x,this.elements[0].y),t=new oe(this.elements[0].x,this.elements[0].y);return this.elements.forEach(i=>{i.xt.x&&(t.x=i.x),i.yt.y&&(t.y=i.y)}),{min:e,max:t,width:t.x-e.x,height:t.y-e.y}}}class wv{_addToepoint(e){for(const t of e)this._epoints.push(t.x,t.y)}constructor(e,t,i,s=earcut){this._points=new Sa,this._outlinepoints=new Sa,this._holes=new Array,this._epoints=new Array,this._eholes=new Array,this.bjsEarcut=s,this._name=e,this._scene=i||Ee.LastCreatedScene;let n;t instanceof Gr?n=t.getPoints():n=t,this._addToepoint(n),this._points.add(n),this._outlinepoints.add(n),typeof this.bjsEarcut>"u"&&U.Warn("Earcut was not found, the polygon will not be built.")}addHole(e){this._points.add(e);const t=new Sa;return t.add(e),this._holes.push(t),this._eholes.push(this._epoints.length/2),this._addToepoint(e),this}build(e=!1,t=0,i=2){const s=new F(this._name,this._scene),n=this.buildVertexData(t,i);return s.setVerticesData(A.PositionKind,n.positions,e),s.setVerticesData(A.NormalKind,n.normals,e),s.setVerticesData(A.UVKind,n.uvs,e),s.setIndices(n.indices),s}buildVertexData(e=0,t=2){const i=new j,s=[],n=[],r=[],o=this._points.computeBounds();this._points.elements.forEach(c=>{s.push(0,1,0),n.push(c.x,0,c.y),r.push((c.x-o.min.x)/o.width,(c.y-o.min.y)/o.height)});const h=[],l=this.bjsEarcut(this._epoints,this._eholes,2);for(let c=0;c0){const c=n.length/3;this._points.elements.forEach(f=>{s.push(0,-1,0),n.push(f.x,-e,f.y),r.push(1-(f.x-o.min.x)/o.width,1-(f.y-o.min.y)/o.height)});const u=h.length;for(let f=0;f{this._addSide(n,s,r,h,o,f,e,!0,t)})}return i.indices=h,i.positions=n,i.normals=s,i.uvs=r,i}_addSide(e,t,i,s,n,r,o,h,l){let c=e.length/3,u=0;for(let f=0;fl?Rl?Eno(a,{shape:e,holes:i,updatable:s,sideOrientation:n},t,r);F.ExtrudePolygon=(a,e,t,i,s,n,r,o=earcut)=>ro(a,{shape:e,holes:s,depth:t,updatable:n,sideOrientation:r},i,o);function Zu(a,e,t=null){const i=e.path,s=e.shape,n=e.scale||1,r=e.rotation||0,o=e.cap===0?0:e.cap||F.NO_CAP,h=e.updatable,l=F._GetDefaultSideOrientation(e.sideOrientation),c=e.instance||null,u=e.invertUV||!1,f=e.closeShape||!1,d=e.closePath||!1;return Ju(a,s,i,n,r,null,null,d,f,o,!1,t,!!h,l,c,u,e.frontUVs||null,e.backUVs||null,e.firstNormal||null,!!e.adjustFrame)}function Qu(a,e,t=null){const i=e.path,s=e.shape,n=e.scaleFunction||(()=>1),r=e.rotationFunction||(()=>0),o=e.closePath||e.ribbonCloseArray||!1,h=e.closeShape||e.ribbonClosePath||!1,l=e.cap===0?0:e.cap||F.NO_CAP,c=e.updatable,u=e.firstNormal||null,f=e.adjustFrame||!1,d=F._GetDefaultSideOrientation(e.sideOrientation),_=e.instance,p=e.invertUV||!1;return Ju(a,s,i,null,null,n,r,o,h,l,!0,t,!!c,d,_||null,p,e.frontUVs||null,e.backUVs||null,u,f)}function Ju(a,e,t,i,s,n,r,o,h,l,c,u,f,d,_,p,g,m,b,I){const T=(C,S,w,P,G,L,W,K,ce,$,z)=>{const k=w.getTangents(),M=w.getNormals(),V=w.getBinormals(),q=w.getDistances();if(z){for(let Q=0;Q0){let be=k[Q-1];v.Dot(be,k[Q])<0&&k[Q].scaleInPlace(-1),be=M[Q-1],v.Dot(be,M[Q])<0&&M[Q].scaleInPlace(-1),be=V[Q-1],v.Dot(be,V[Q])<0&&V[Q].scaleInPlace(-1)}}let he=0;const pe=()=>G!==null?G:1,ue=$&&K?K:()=>L!==null?L:0,me=$&&W?W:pe;let ne=ce===F.NO_CAP||ce===F.CAP_END?0:2;const Ie=N.Matrix[0];for(let Q=0;Q{const be=Array(),Be=v.Zero();let ze;for(ze=0;ze3?0:l,y=T(e,t,x,R,i,s,n,r,l,c,I);const E=zs(a,{pathArray:y,closeArray:o,closePath:h,updatable:f,sideOrientation:d,invertUV:p,frontUVs:g||void 0,backUVs:m||void 0},u);return E._creationDataStorage.pathArray=y,E._creationDataStorage.path3D=x,E._creationDataStorage.cap=l,E}F.ExtrudeShape=(a,e,t,i,s,n,r=null,o,h,l)=>{const c={shape:e,path:t,scale:i,rotation:s,cap:n===0?0:n||F.NO_CAP,sideOrientation:h,instance:l,updatable:o};return Zu(a,c,r)};F.ExtrudeShapeCustom=(a,e,t,i,s,n,r,o,h,l,c,u)=>{const f={shape:e,path:t,scaleFunction:i,rotationFunction:s,ribbonCloseArray:n,ribbonClosePath:r,cap:o===0?0:o||F.NO_CAP,sideOrientation:c,instance:u,updatable:l};return Qu(a,f,h)};function ef(a,e,t=null){const i=e.arc?e.arc<=0||e.arc>1?1:e.arc:1,s=e.closed===void 0?!0:e.closed,n=e.shape,r=e.radius||1,o=e.tessellation||64,h=e.clip||0,l=e.updatable,c=F._GetDefaultSideOrientation(e.sideOrientation),u=e.cap||F.NO_CAP,f=Math.PI*2,d=[],_=e.invertUV||!1;let p=0,g=0;const m=f/o*i;let b,I;for(p=0;p<=o-h;p++){for(I=[],(u==F.CAP_START||u==F.CAP_ALL)&&(I.push(new v(0,n[0].y,0)),I.push(new v(Math.cos(p*m)*n[0].x*r,n[0].y,Math.sin(p*m)*n[0].x*r))),g=0;gef(a,{shape:e,radius:t,tessellation:i,sideOrientation:r,updatable:n},s);function tf(a){const e=[],t=[],i=[],s=[],n=a.width||a.size||1,r=a.height||a.size||1,o=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE,h=n/2,l=r/2;t.push(-h,-l,0),i.push(0,0,-1),s.push(0,0),t.push(h,-l,0),i.push(0,0,-1),s.push(1,0),t.push(h,l,0),i.push(0,0,-1),s.push(1,1),t.push(-h,l,0),i.push(0,0,-1),s.push(0,1),e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),j._ComputeSides(o,t,e,i,s,a.frontUVs,a.backUVs);const c=new j;return c.indices=e,c.positions=t,c.normals=i,c.uvs=s,c}function sf(a,e={},t=null){const i=new F(a,t);return e.sideOrientation=F._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,tf(e).applyToMesh(i,e.updatable),e.sourcePlane&&(i.translate(e.sourcePlane.normal,-e.sourcePlane.d),i.setDirection(e.sourcePlane.normal.scale(-1))),i}j.CreatePlane=tf;F.CreatePlane=(a,e,t,i,s)=>sf(a,{size:e,width:e,height:e,sideOrientation:s,updatable:i},t);function nf(a,e,t=null){const i=e.path;let s=e.instance,n=1;e.radius!==void 0?n=e.radius:s&&(n=s._creationDataStorage.radius);const r=e.tessellation||64,o=e.radiusFunction||null;let h=e.cap||F.NO_CAP;const l=e.invertUV||!1,c=e.updatable,u=F._GetDefaultSideOrientation(e.sideOrientation);e.arc=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1;const f=(m,b,I,T,x,y,R,E)=>{const C=b.getTangents(),S=b.getNormals(),w=b.getDistances(),G=Math.PI*2/x*E,W=y||(()=>T);let K,ce,$,z;const k=N.Matrix[0];let M=R===F.NO_CAP||R===F.CAP_END?0:2;for(let q=0;q{const pe=Array();for(let se=0;se3?0:h,_=f(i,d,p,n,r,o,h,e.arc);const g=zs(a,{pathArray:_,closePath:!0,closeArray:!1,updatable:c,sideOrientation:u,invertUV:l,frontUVs:e.frontUVs,backUVs:e.backUVs},t);return g._creationDataStorage.pathArray=_,g._creationDataStorage.path3D=d,g._creationDataStorage.tessellation=r,g._creationDataStorage.cap=h,g._creationDataStorage.arc=e.arc,g._creationDataStorage.radius=n,g}F.CreateTube=(a,e,t,i,s,n,r,o,h,l)=>nf(a,{path:e,radius:t,tessellation:i,radiusFunction:s,arc:1,cap:n,updatable:o,sideOrientation:h,instance:l},r);function rf(a){const e=[];e[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},e[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},e[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},e[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},e[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},e[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},e[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},e[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},e[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},e[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},e[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},e[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},e[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},e[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},e[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.969981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};const t=a.type&&(a.type<0||a.type>=e.length)?0:a.type||0,i=a.size,s=a.sizeX||i||1,n=a.sizeY||i||1,r=a.sizeZ||i||1,o=a.custom||e[t],h=o.face.length,l=a.faceUV||new Array(h),c=a.faceColors,u=a.flat===void 0?!0:a.flat,f=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE,d=[],_=[],p=[],g=[],m=[];let b=0,I=0;const T=[];let x=0,y=0,R,E,C,S,w,P;if(u)for(y=0;yao(a,e,t);function af(a){const e=a.sideOrientation||j.DEFAULTSIDE,t=a.radius||1,i=a.flat===void 0?!0:a.flat,s=(a.subdivisions||4)|0,n=a.radiusX||t,r=a.radiusY||t,o=a.radiusZ||t,h=(1+Math.sqrt(5))/2,l=[-1,h,-0,1,h,0,-1,-h,0,1,-h,0,0,-1,-h,0,1,-h,0,-1,h,0,1,h,h,0,1,h,0,-1,-h,0,1,-h,0,-1],c=[0,11,5,0,5,1,0,1,7,0,7,10,12,22,23,1,5,20,5,11,4,23,22,13,22,18,6,7,1,8,14,21,4,14,4,2,16,13,6,15,6,19,3,8,9,4,21,5,13,17,23,6,13,22,19,6,18,9,8,1],u=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],f=[5,1,3,1,6,4,0,0,5,3,4,2,2,2,4,0,2,0,1,1,6,0,6,2,0,4,3,3,4,4,3,1,4,2,4,4,0,2,1,1,2,2,3,3,1,3,2,4],d=138/1024,_=239/1024,p=60/1024,g=26/1024,m=-40/1024,b=20/1024,I=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],T=[],x=[],y=[],R=[];let E=0;const C=new Array(3),S=new Array(3);let w;for(w=0;w<3;w++)C[w]=v.Zero(),S[w]=oe.Zero();for(let G=0;G<20;G++){for(w=0;w<3;w++){const W=c[3*G+w];C[w].copyFromFloats(l[3*u[W]],l[3*u[W]+1],l[3*u[W]+2]),C[w].normalize(),S[w].copyFromFloats(f[2*W]*d+p+I[G]*m,f[2*W+1]*_+g+I[G]*b)}const L=(W,K,ce,$)=>{const z=v.Lerp(C[0],C[2],K/s),k=v.Lerp(C[1],C[2],K/s),M=s===K?C[2]:v.Lerp(z,k,W/(s-K));M.normalize();let V;if(i){const se=v.Lerp(C[0],C[2],$/s),ue=v.Lerp(C[1],C[2],$/s);V=v.Lerp(se,ue,ce/(s-$))}else V=new v(M.x,M.y,M.z);V.x/=n,V.y/=r,V.z/=o,V.normalize();const q=oe.Lerp(S[0],S[2],K/s),he=oe.Lerp(S[1],S[2],K/s),pe=s===K?S[2]:oe.Lerp(q,he,W/(s-K));x.push(M.x*n,M.y*r,M.z*o),y.push(V.x,V.y,V.z),R.push(pe.x,pe.y),T.push(E),E++};for(let W=0;Wof(a,e,t);const Dv=new v(1,0,0),Fv=new v(-1,0,0),Ov=new v(0,1,0),Bv=new v(0,-1,0),Lv=new v(0,0,1),Nv=new v(0,0,-1);class Nr{constructor(e=v.Zero(),t=v.Up(),i=oe.Zero(),s=0,n=0,r=null,o=null,h=null,l=null){this.position=e,this.normal=t,this.uv=i,this.vertexIdx=s,this.vertexIdxForBones=n,this.localPositionOverride=r,this.localNormalOverride=o,this.matrixIndicesOverride=h,this.matrixWeightsOverride=l}clone(){var e,t,i,s;return new Nr(this.position.clone(),this.normal.clone(),this.uv.clone(),this.vertexIdx,this.vertexIdxForBones,(e=this.localPositionOverride)==null?void 0:e.slice(),(t=this.localNormalOverride)==null?void 0:t.slice(),(i=this.matrixIndicesOverride)==null?void 0:i.slice(),(s=this.matrixWeightsOverride)==null?void 0:s.slice())}}function hf(a,e,t){var K,ce,$,z;const i=!!e.skeleton,s=t.localMode||i,n=e.getIndices(),r=i?e.getPositionData(!0,!0):e.getVerticesData(A.PositionKind),o=i?e.getNormalsData(!0,!0):e.getVerticesData(A.NormalKind),h=s?i?e.getVerticesData(A.PositionKind):r:null,l=s?i?e.getVerticesData(A.NormalKind):o:null,c=e.getVerticesData(A.UVKind),u=i?e.getVerticesData(A.MatricesIndicesKind):null,f=i?e.getVerticesData(A.MatricesWeightsKind):null,d=i?e.getVerticesData(A.MatricesIndicesExtraKind):null,_=i?e.getVerticesData(A.MatricesWeightsExtraKind):null,p=t.position||v.Zero();let g=t.normal||v.Up();const m=t.size||v.One(),b=t.angle||0;if(!g){const k=new v(0,0,1),M=e.getScene().activeCamera,V=v.TransformCoordinates(k,M.getWorldMatrix());g=M.globalPosition.subtract(V)}const I=-Math.atan2(g.z,g.x)-Math.PI/2,T=Math.sqrt(g.x*g.x+g.z*g.z),x=Math.atan2(g.y,T),y=new j;y.indices=[],y.positions=[],y.normals=[],y.uvs=[],y.matricesIndices=i?[]:null,y.matricesWeights=i?[]:null,y.matricesIndicesExtra=d?[]:null,y.matricesWeightsExtra=_?[]:null;let R=0;const E=(k,M)=>{const V=new Nr;if(!n||!r||!o)return V;const q=n[k];if(V.vertexIdx=q*3,V.vertexIdxForBones=q*4,V.position=new v(r[q*3],r[q*3+1],r[q*3+2]),v.TransformCoordinatesToRef(V.position,M,V.position),V.normal=new v(o[q*3],o[q*3+1],o[q*3+2]),v.TransformNormalToRef(V.normal,M,V.normal),t.captureUVS&&c){const he=c[q*2+1];V.uv=new oe(c[q*2],he)}return V},C=[0,0,0,0],S=(k,M)=>{if(k.length===0)return k;const V=.5*Math.abs(v.Dot(m,M)),q=(se,ue,me,ne)=>{for(let Ie=0;Ie{var Vt,Yt,$i,tr,ho,lo,co,uo,fo,_o,po,go,mo,vo,bo,xo;const me=v.GetClipFactor(se.position,ue.position,M,V);let ne=C,Ie=C;if(u&&f){const mn=se.matrixIndicesOverride?0:se.vertexIdxForBones,ua=(Vt=se.matrixIndicesOverride)!=null?Vt:u,yo=(Yt=se.matrixWeightsOverride)!=null?Yt:f,fa=ue.matrixIndicesOverride?0:ue.vertexIdxForBones,To=($i=ue.matrixIndicesOverride)!=null?$i:u,Ao=(tr=ue.matrixWeightsOverride)!=null?tr:f;ne=[0,0,0,0],Ie=[0,0,0,0];let Es=0;for(let Ai=0;Ai<4;++Ai)if(yo[mn+Ai]>0){const vn=q(To,ua[mn+Ai],fa,4);ne[Es]=ua[mn+Ai],Ie[Es]=Rr(yo[mn+Ai],vn>=0?Ao[vn]:0,me),Es++}for(let Ai=0;Ai<4&&Es<4;++Ai){const vn=To[fa+Ai];q(ua,vn,mn,4)===-1&&(ne[Es]=vn,Ie[Es]=Rr(0,Ao[fa+Ai],me),Es++)}const ir=Ie[0]+Ie[1]+Ie[2]+Ie[3];Ie[0]/=ir,Ie[1]/=ir,Ie[2]/=ir,Ie[3]/=ir}const Se=se.localPositionOverride?se.localPositionOverride[0]:(ho=h==null?void 0:h[se.vertexIdx])!=null?ho:0,Q=se.localPositionOverride?se.localPositionOverride[1]:(lo=h==null?void 0:h[se.vertexIdx+1])!=null?lo:0,be=se.localPositionOverride?se.localPositionOverride[2]:(co=h==null?void 0:h[se.vertexIdx+2])!=null?co:0,Be=ue.localPositionOverride?ue.localPositionOverride[0]:(uo=h==null?void 0:h[ue.vertexIdx])!=null?uo:0,ze=ue.localPositionOverride?ue.localPositionOverride[1]:(fo=h==null?void 0:h[ue.vertexIdx+1])!=null?fo:0,Ke=ue.localPositionOverride?ue.localPositionOverride[2]:(_o=h==null?void 0:h[ue.vertexIdx+2])!=null?_o:0,Rt=se.localNormalOverride?se.localNormalOverride[0]:(po=l==null?void 0:l[se.vertexIdx])!=null?po:0,Ct=se.localNormalOverride?se.localNormalOverride[1]:(go=l==null?void 0:l[se.vertexIdx+1])!=null?go:0,Ge=se.localNormalOverride?se.localNormalOverride[2]:(mo=l==null?void 0:l[se.vertexIdx+2])!=null?mo:0,Jt=ue.localNormalOverride?ue.localNormalOverride[0]:(vo=l==null?void 0:l[ue.vertexIdx])!=null?vo:0,Wt=ue.localNormalOverride?ue.localNormalOverride[1]:(bo=l==null?void 0:l[ue.vertexIdx+1])!=null?bo:0,ji=ue.localNormalOverride?ue.localNormalOverride[2]:(xo=l==null?void 0:l[ue.vertexIdx+2])!=null?xo:0,Is=Rt+(Jt-Rt)*me,Ti=Ct+(Wt-Ct)*me,Ht=Ge+(ji-Ge)*me,oi=Math.sqrt(Is*Is+Ti*Ti+Ht*Ht);return new Nr(v.Lerp(se.position,ue.position,me),v.Lerp(se.normal,ue.normal,me).normalize(),oe.Lerp(se.uv,ue.uv,me),-1,-1,h?[Se+(Be-Se)*me,Q+(ze-Q)*me,be+(Ke-be)*me]:null,l?[Is/oi,Ti/oi,Ht/oi]:null,ne,Ie)};let pe=null;k.length>3&&(pe=[]);for(let se=0;se0,Ke=be>0,Rt=Be>0;switch(ue=(ze?1:0)+(Ke?1:0)+(Rt?1:0),ue){case 0:k.length>3?(pe.push(k[se]),pe.push(k[se+1]),pe.push(k[se+2])):pe=k;break;case 1:if(pe=pe!=null?pe:new Array,ze&&(me=k[se+1],ne=k[se+2],Ie=he(k[se],me),Se=he(k[se],ne)),Ke){me=k[se],ne=k[se+2],Ie=he(k[se+1],me),Se=he(k[se+1],ne),pe.push(Ie),pe.push(ne.clone()),pe.push(me.clone()),pe.push(ne.clone()),pe.push(Ie.clone()),pe.push(Se);break}Rt&&(me=k[se],ne=k[se+1],Ie=he(k[se+2],me),Se=he(k[se+2],ne)),me&&ne&&Ie&&Se&&(pe.push(me.clone()),pe.push(ne.clone()),pe.push(Ie),pe.push(Se),pe.push(Ie.clone()),pe.push(ne.clone()));break;case 2:pe=pe!=null?pe:new Array,ze||(me=k[se].clone(),ne=he(me,k[se+1]),Ie=he(me,k[se+2]),pe.push(me),pe.push(ne),pe.push(Ie)),Ke||(me=k[se+1].clone(),ne=he(me,k[se+2]),Ie=he(me,k[se]),pe.push(me),pe.push(ne),pe.push(Ie)),Rt||(me=k[se+2].clone(),ne=he(me,k[se]),Ie=he(me,k[se+1]),pe.push(me),pe.push(ne),pe.push(Ie));break}}return pe},w=e instanceof F?e:null,P=w==null?void 0:w._thinInstanceDataStorage.matrixData,G=(w==null?void 0:w.thinInstanceCount)||1,L=N.Matrix[0];L.copyFrom(O.IdentityReadOnly);for(let k=0;khf(a,e,{position:t,normal:i,size:s,angle:n});function lf(a={subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){const e=Math.max(a.subdivisions?a.subdivisions:2,1)|0,t=Math.max(a.tessellation?a.tessellation:16,3)|0,i=Math.max(a.height?a.height:1,0),s=Math.max(a.radius?a.radius:.25,0),n=Math.max(a.capSubdivisions?a.capSubdivisions:6,1)|0,r=t,o=e,h=Math.max(a.radiusTop?a.radiusTop:s,0),l=Math.max(a.radiusBottom?a.radiusBottom:s,0),c=i-(h+l),u=0,f=2*Math.PI,d=Math.max(a.topCapSubdivisions?a.topCapSubdivisions:n,1),_=Math.max(a.bottomCapSubdivisions?a.bottomCapSubdivisions:n,1),p=Math.acos((l-h)/i);let g=[];const m=[],b=[],I=[];let T=0;const x=[],y=c*.5,R=Math.PI*.5;let E,C;const S=v.Zero(),w=v.Zero(),P=Math.cos(p),G=Math.sin(p),L=new oe(h*G,y+h*P).subtract(new oe(l*G,-y+l*P)).length(),W=h*p+L+l*(R-p);let K=0;for(C=0;C<=d;C++){const k=[],M=R-p*(C/d);K+=h*p/d;const V=Math.cos(M),q=Math.sin(M),he=V*h;for(E=0;E<=r;E++){const pe=E/r,se=pe*f+u,ue=Math.sin(se),me=Math.cos(se);w.x=he*ue,w.y=y+q*h,w.z=he*me,m.push(w.x,w.y,w.z),S.set(V*ue,q,V*me),b.push(S.x,S.y,S.z),I.push(pe,1-K/W),k.push(T),T++}x.push(k)}const ce=i-h-l+P*h-P*l,$=G*(l-h)/ce;for(C=1;C<=o;C++){const k=[];K+=L/o;const M=G*(C*(l-h)/o+h);for(E=0;E<=r;E++){const V=E/r,q=V*f+u,he=Math.sin(q),pe=Math.cos(q);w.x=M*he,w.y=y+P*h-C*ce/o,w.z=M*pe,m.push(w.x,w.y,w.z),S.set(he,$,pe).normalize(),b.push(S.x,S.y,S.z),I.push(V,1-K/W),k.push(T),T++}x.push(k)}for(C=1;C<=_;C++){const k=[],M=R-p-(Math.PI-p)*(C/_);K+=l*p/_;const V=Math.cos(M),q=Math.sin(M),he=V*l;for(E=0;E<=r;E++){const pe=E/r,se=pe*f+u,ue=Math.sin(se),me=Math.cos(se);w.x=he*ue,w.y=-y+q*l,w.z=he*me,m.push(w.x,w.y,w.z),S.set(V*ue,q,V*me),b.push(S.x,S.y,S.z),I.push(pe,1-K/W),k.push(T),T++}x.push(k)}for(E=0;Ecf(a,e,t);j.CreateCapsule=lf;class at{constructor(e=0,t=0){this.x=e,this.y=t,e!==Math.floor(e)&&(e=Math.floor(e),U.Warn("x is not an integer, floor(x) used")),t!==Math.floor(t)&&(t=Math.floor(t),U.Warn("y is not an integer, floor(y) used"))}clone(){return new at(this.x,this.y)}rotate60About(e){const t=this.x;return this.x=e.x+e.y-this.y,this.y=t+this.y-e.x,this}rotateNeg60About(e){const t=this.x;return this.x=t+this.y-e.y,this.y=e.x+e.y-t,this}rotate120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),U.Warn("m not an integer only floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),U.Warn("n not an integer only floor(n) used"));const i=this.x;return this.x=e-i-this.y,this.y=t+i,this}rotateNeg120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),U.Warn("m is not an integer, floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),U.Warn("n is not an integer, floor(n) used"));const i=this.x;return this.x=this.y-t,this.y=e+t-i-this.y,this}toCartesianOrigin(e,t){const i=v.Zero();return i.x=e.x+2*this.x*t+this.y*t,i.y=e.y+Math.sqrt(3)*this.y*t,i}static Zero(){return new at(0,0)}}class uf{constructor(){this.cartesian=[],this.vertices=[],this.max=[],this.min=[],this.closestTo=[],this.innerFacets=[],this.isoVecsABOB=[],this.isoVecsOBOA=[],this.isoVecsBAOA=[],this.vertexTypes=[],this.IDATA=new Ja("icosahedron","Regular",[[0,yt,-1],[-yt,1,0],[-1,0,-yt],[1,0,-yt],[yt,1,0],[0,yt,1],[-1,0,yt],[-yt,-1,0],[0,-yt,-1],[yt,-1,0],[1,0,yt],[0,-yt,1]],[[0,2,1],[0,3,2],[0,4,3],[0,5,4],[0,1,5],[7,6,1],[8,7,2],[9,8,3],[10,9,4],[6,10,5],[2,7,1],[3,8,2],[4,9,3],[5,10,4],[1,6,5],[11,6,7],[11,7,8],[11,8,9],[11,9,10],[11,10,6]])}setIndices(){let e=12;const t={},i=this.m,s=this.n;let n=i,r=1,o=0;s!==0&&(n=Ba(i,s)),r=i/n,o=s/n;let h,l,c,u,f;const d=at.Zero(),_=new at(i,s),p=new at(-s,i+s),g=at.Zero(),m=at.Zero(),b=at.Zero();let I=[],T,x,y,R;const E=[],C=this.vertByDist,S=(w,P,G,L)=>{T=w+"|"+G,x=P+"|"+L,T in t||x in t?T in t&&!(x in t)?t[x]=t[T]:x in t&&!(T in t)&&(t[T]=t[x]):(t[T]=e,t[x]=e,e++),C[G][0]>2?E[t[T]]=[-C[G][0],C[G][1],t[T]]:E[t[T]]=[I[C[G][0]],C[G][1],t[T]]};this.IDATA.edgematch=[[1,"B"],[2,"B"],[3,"B"],[4,"B"],[0,"B"],[10,"O",14,"A"],[11,"O",10,"A"],[12,"O",11,"A"],[13,"O",12,"A"],[14,"O",13,"A"],[0,"O"],[1,"O"],[2,"O"],[3,"O"],[4,"O"],[19,"B",5,"A"],[15,"B",6,"A"],[16,"B",7,"A"],[17,"B",8,"A"],[18,"B",9,"A"]];for(let w=0;w<20;w++){if(I=this.IDATA.face[w],c=I[2],u=I[1],f=I[0],y=d.x+"|"+d.y,T=w+"|"+y,T in t||(t[T]=c,E[c]=[I[C[y][0]],C[y][1]]),y=_.x+"|"+_.y,T=w+"|"+y,T in t||(t[T]=u,E[u]=[I[C[y][0]],C[y][1]]),y=p.x+"|"+p.y,T=w+"|"+y,T in t||(t[T]=f,E[f]=[I[C[y][0]],C[y][1]]),h=this.IDATA.edgematch[w][0],l=this.IDATA.edgematch[w][1],l==="B")for(let P=1;P2?E[t[T]]=[-C[y][0],C[y][1],t[T]]:E[t[T]]=[I[C[y][0]],C[y][1],t[T]])}this.closestTo=E,this.vecToidx=t}calcCoeffs(){const e=this.m,t=this.n,i=Math.sqrt(3)/3,s=e*e+t*t+e*t;this.coau=(e+t)/s,this.cobu=-t/s,this.coav=-i*(e-t)/s,this.cobv=i*(2*e+t)/s}createInnerFacets(){const e=this.m,t=this.n;for(let i=0;i0&&s0){const x=Ba(e,t),y=e/x,R=t/x;for(let C=1;Cx.x-y.x),i.sort((x,y)=>x.y-y.y);const o=new Array(e+t+1),h=new Array(e+t+1);for(let x=0;x{const R=x.clone();return y==="A"&&R.rotateNeg120(e,t),y==="B"&&R.rotate120(e,t),R.x<0?R.y:R.x+R.y},d=[],_=[],p=[],g=[],m={},b=[];let I=-1,T=-1;for(let x=0;xx[2]-y[2]),b.sort((x,y)=>x[3]-y[3]),b.sort((x,y)=>x[1]-y[1]),b.sort((x,y)=>x[0]-y[0]);for(let x=0;xt.vecToidx[e+s]))}mapABOBtoDATA(e,t){const i=t.IDATA.edgematch[e][0];for(let s=0;s-1?i[r][1]>0&&t[i[r][0]].push([r,i[r][1]]):t[12].push([r,i[r][0]]);const s=[];for(let r=0;r<12;r++)s[r]=r;let n=12;for(let r=0;r<12;r++){t[r].sort((o,h)=>o[1]-h[1]);for(let o=0;or[3]-o[3]);for(let r=0;r0;)n=t[h],this.face[n].indexOf(o)>-1?(r=(this.face[n].indexOf(o)+1)%3,o=this.face[n][r],i.push(o),s.push(n),t.splice(h,1),h=0):h++;return this.adjacentFaces.push(i),s}toGoldbergPolyhedronData(){const e=new Ja("GeoDual","Goldberg",[],[]);e.name="GD dual";const t=this.vertex.length,i=new Array(t);for(let l=0;l{s=0,n=0,r=0,o=this.face[c];for(let u=0;u<3;u++)h=this.vertex[o[u]],s+=h[0],n+=h[1],r+=h[2];e.vertex[c]=[s/3,n/3,r/3]});return e}static BuildGeodesicData(e){const t=new ha("Geodesic-m-n","Geodesic",[[0,yt,-1],[-yt,1,0],[-1,0,-yt],[1,0,-yt],[yt,1,0],[0,yt,1],[-1,0,yt],[-yt,-1,0],[0,-yt,-1],[yt,-1,0],[1,0,yt],[0,-yt,1]],[]);e.setIndices(),e.calcCoeffs(),e.createInnerFacets(),e.edgeVecsABOB(),e.mapABOBtoOBOA(),e.mapABOBtoBAOA();for(let s=0;si){const l=s;s=i,i=l,U.Warn("n > m therefore m and n swapped")}const n=new uf;n.build(i,s);const o={custom:ha.BuildGeodesicData(n),size:e.size,sizeX:e.sizeX,sizeY:e.sizeY,sizeZ:e.sizeZ,faceUV:e.faceUV,faceColors:e.faceColors,flat:e.flat,updatable:e.updatable,sideOrientation:e.sideOrientation,frontUVs:e.frontUVs,backUVs:e.backUVs};return ao(a,o,t)}F._GoldbergMeshParser=(a,e)=>la.Parse(a,e);class la extends F{constructor(){super(...arguments),this.goldbergData={faceColors:[],faceCenters:[],faceZaxis:[],faceXaxis:[],faceYaxis:[],nbSharedFaces:0,nbUnsharedFaces:0,nbFaces:0,nbFacesAtPole:0,adjacentFaces:[]}}relatedGoldbergFace(e,t){return t===void 0?(e>this.goldbergData.nbUnsharedFaces-1&&(U.Warn("Maximum number of unshared faces used"),e=this.goldbergData.nbUnsharedFaces-1),this.goldbergData.nbUnsharedFaces+e):(e>11&&(U.Warn("Last pole used"),e=11),t>this.goldbergData.nbFacesAtPole-1&&(U.Warn("Maximum number of faces at a pole used"),t=this.goldbergData.nbFacesAtPole-1),12+e*this.goldbergData.nbFacesAtPole+t)}_changeGoldbergFaceColors(e){for(let i=0;i1&&(u=1),l.push(u,f);for(let d=0;d<6;d++)u=r.x+o*Math.cos(h+d*Math.PI/3),f=r.y+o*Math.sin(h+d*Math.PI/3),u<0&&(u=0),u>1&&(u=1),c.push(u,f);for(let d=s;dH.FromArray(n)),i.faceCenters=i.faceCenters.map(n=>v.FromArray(n)),i.faceZaxis=i.faceZaxis.map(n=>v.FromArray(n)),i.faceXaxis=i.faceXaxis.map(n=>v.FromArray(n)),i.faceYaxis=i.faceYaxis.map(n=>v.FromArray(n));const s=new la(e.name,t);return s.goldbergData=i,s}}function kv(a,e){const t=a.size,i=a.sizeX||t||1,s=a.sizeY||t||1,n=a.sizeZ||t||1,r=a.sideOrientation===0?0:a.sideOrientation||j.DEFAULTSIDE,o=[],h=[],l=[],c=[];let u=1/0,f=-1/0,d=1/0,_=-1/0;for(let m=0;mo){const _=h;h=o,o=_,U.Warn("n > m therefore m and n swapped")}const l=new uf;l.build(o,h);const c=ha.BuildGeodesicData(l),u=c.toGoldbergPolyhedronData(),f=new la(a,t);e.sideOrientation=F._GetDefaultSideOrientation(e.sideOrientation),f._originalBuilderSideOrientation=e.sideOrientation,kv(e,u).applyToMesh(f,e.updatable),f.goldbergData.nbSharedFaces=c.sharedNodes,f.goldbergData.nbUnsharedFaces=c.poleNodes,f.goldbergData.adjacentFaces=c.adjacentFaces,f.goldbergData.nbFaces=f.goldbergData.nbSharedFaces+f.goldbergData.nbUnsharedFaces,f.goldbergData.nbFacesAtPole=(f.goldbergData.nbUnsharedFaces-12)/12;for(let _=0;_0?this._holes.push(e):this._paths.push(e);if(!this._paths.length&&this._holes.length){const e=this._holes;this._holes=this._paths,this._paths=e}this._tempPaths.length=0}get paths(){return this._paths}get holes(){return this._holes}}function zv(a,e,t,i,s,n){const r=n.glyphs[a]||n.glyphs["?"];if(!r)return null;const o=new Gv(s);if(r.o){const h=r.o.split(" ");for(let l=0,c=h.length;l=this._thinInstanceDataStorage.instancesCount)return!1;const i=this._thinInstanceDataStorage.matrixData;return e.copyToArray(i,a*16),this._thinInstanceDataStorage.worldMatrices&&(this._thinInstanceDataStorage.worldMatrices[a]=e),t&&(this.thinInstanceBufferUpdated("matrix"),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)),!0};F.prototype.thinInstanceSetAttributeAt=function(a,e,t,i=!0){return a===A.ColorKind&&(a=A.ColorInstanceKind),!this._userThinInstanceBuffersStorage||!this._userThinInstanceBuffersStorage.data[a]||e>=this._thinInstanceDataStorage.instancesCount?!1:(this._thinInstanceUpdateBufferSize(a,0),this._userThinInstanceBuffersStorage.data[a].set(t,e*this._userThinInstanceBuffersStorage.strides[a]),i&&this.thinInstanceBufferUpdated(a),!0)};Object.defineProperty(F.prototype,"thinInstanceCount",{get:function(){return this._thinInstanceDataStorage.instancesCount},set:function(a){var i,s;const e=(s=this._thinInstanceDataStorage.matrixData)!=null?s:(i=this.source)==null?void 0:i._thinInstanceDataStorage.matrixData,t=e?e.length/16:0;a<=t&&(this._thinInstanceDataStorage.instancesCount=a)},enumerable:!0,configurable:!0});F.prototype._thinInstanceCreateMatrixBuffer=function(a,e,t=!0){const i=new ln(this.getEngine(),e,!t,16,!1,!0);for(let s=0;s<4;s++)this.setVerticesBuffer(i.createVertexBuffer(a+s,s*4,4));return i};F.prototype.thinInstanceSetBuffer=function(a,e,t=0,i=!0){var s,n,r;t=t||16,a==="matrix"?((s=this._thinInstanceDataStorage.matrixBuffer)==null||s.dispose(),this._thinInstanceDataStorage.matrixBuffer=null,this._thinInstanceDataStorage.matrixBufferSize=e?e.length:32*t,this._thinInstanceDataStorage.matrixData=e,this._thinInstanceDataStorage.worldMatrices=null,e!==null?(this._thinInstanceDataStorage.instancesCount=e.length/t,this._thinInstanceDataStorage.matrixBuffer=this._thinInstanceCreateMatrixBuffer("world",e,i),this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1)):(this._thinInstanceDataStorage.instancesCount=0,this.doNotSyncBoundingInfo||this.refreshBoundingInfo())):a==="previousMatrix"?((n=this._thinInstanceDataStorage.previousMatrixBuffer)==null||n.dispose(),this._thinInstanceDataStorage.previousMatrixBuffer=null,this._thinInstanceDataStorage.previousMatrixData=e,e!==null&&(this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",e,i))):(a===A.ColorKind&&(a=A.ColorInstanceKind),e===null?(r=this._userThinInstanceBuffersStorage)!=null&&r.data[a]&&(this.removeVerticesData(a),delete this._userThinInstanceBuffersStorage.data[a],delete this._userThinInstanceBuffersStorage.strides[a],delete this._userThinInstanceBuffersStorage.sizes[a],delete this._userThinInstanceBuffersStorage.vertexBuffers[a]):(this._thinInstanceInitializeUserStorage(),this._userThinInstanceBuffersStorage.data[a]=e,this._userThinInstanceBuffersStorage.strides[a]=t,this._userThinInstanceBuffersStorage.sizes[a]=e.length,this._userThinInstanceBuffersStorage.vertexBuffers[a]=new A(this.getEngine(),e,a,!i,!1,t,!0),this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[a])))};F.prototype.thinInstanceBufferUpdated=function(a){var e,t,i;a==="matrix"?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.matrixBuffer&&!this._thinInstanceDataStorage.matrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(a),(e=this._thinInstanceDataStorage.matrixBuffer)==null||e.updateDirectly(this._thinInstanceDataStorage.matrixData,0,this._thinInstanceDataStorage.instancesCount)):a==="previousMatrix"?(this.thinInstanceAllowAutomaticStaticBufferRecreation&&this._thinInstanceDataStorage.previousMatrixBuffer&&!this._thinInstanceDataStorage.previousMatrixBuffer.isUpdatable()&&this._thinInstanceRecreateBuffer(a),(t=this._thinInstanceDataStorage.previousMatrixBuffer)==null||t.updateDirectly(this._thinInstanceDataStorage.previousMatrixData,0,this._thinInstanceDataStorage.instancesCount)):(a===A.ColorKind&&(a=A.ColorInstanceKind),(i=this._userThinInstanceBuffersStorage)!=null&&i.vertexBuffers[a]&&(this.thinInstanceAllowAutomaticStaticBufferRecreation&&!this._userThinInstanceBuffersStorage.vertexBuffers[a].isUpdatable()&&this._thinInstanceRecreateBuffer(a),this._userThinInstanceBuffersStorage.vertexBuffers[a].updateDirectly(this._userThinInstanceBuffersStorage.data[a],0)))};F.prototype.thinInstancePartialBufferUpdate=function(a,e,t){var i;a==="matrix"?this._thinInstanceDataStorage.matrixBuffer&&this._thinInstanceDataStorage.matrixBuffer.updateDirectly(e,t):(a===A.ColorKind&&(a=A.ColorInstanceKind),(i=this._userThinInstanceBuffersStorage)!=null&&i.vertexBuffers[a]&&this._userThinInstanceBuffersStorage.vertexBuffers[a].updateDirectly(e,t))};F.prototype.thinInstanceGetWorldMatrices=function(){if(!this._thinInstanceDataStorage.matrixData||!this._thinInstanceDataStorage.matrixBuffer)return[];const a=this._thinInstanceDataStorage.matrixData;if(!this._thinInstanceDataStorage.worldMatrices){this._thinInstanceDataStorage.worldMatrices=[];for(let e=0;eimport("./kernelBlur.fragment-BJnJE4Wi.js"),__vite__mapDeps([52,53,3,4,5,6,7,8,9,10])),Oe(()=>import("./kernelBlur.vertex-SB8k7aXt.js"),__vite__mapDeps([54,53,3,4,5,6,7,8,9,10]))]))):t.push(Promise.all([Oe(()=>import("./kernelBlur.fragment-CAduVWsS.js"),__vite__mapDeps([55,56,3,4,5,6,7,8,9,10])),Oe(()=>import("./kernelBlur.vertex-Dciph_cp.js"),__vite__mapDeps([57,56,3,4,5,6,7,8,9,10]))]))}constructor(e,t=null,i,s,n){const r=!!(n!=null&&n.blockCompilation);super({...n,name:e,engine:t||le.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:si.FragmentUrl,uniforms:si.Uniforms,samplers:si.Samplers,vertexUrl:si.VertexUrl,blockCompilation:!0}),this._packedFloat=!1,this._staticDefines="",this.textureWidth=0,this.textureHeight=0,this.options.blockCompilation=r,i!==void 0&&(this.direction=i),s!==void 0&&(this.kernel=s)}set kernel(e){this._idealKernel!==e&&(e=Math.max(e,1),this._idealKernel=e,this._kernel=this._nearestBestKernel(e),this.options.blockCompilation||this._updateParameters())}get kernel(){return this._idealKernel}set packedFloat(e){this._packedFloat!==e&&(this._packedFloat=e,this.options.blockCompilation||this._updateParameters())}get packedFloat(){return this._packedFloat}bind(){super.bind(),this._drawWrapper.effect.setFloat2("delta",1/this.textureWidth*this.direction.x,1/this.textureHeight*this.direction.y)}_updateParameters(e,t){const i=this._kernel,s=(i-1)/2;let n=[],r=[],o=0;for(let g=0;g0)return Math.max(i,3);return Math.max(t,3)}_gaussianWeight(e){const t=.3333333333333333,i=Math.sqrt(2*Math.PI)*t,s=-(e*e/(2*t*t));return 1/i*Math.exp(s)}_glslFloat(e,t=8){return e.toFixed(t).replace(/0+$/,"")}}si.VertexUrl="kernelBlur";si.FragmentUrl="kernelBlur";si.Uniforms=["delta","direction"];si.Samplers=["circleOfConfusionSampler"];class As extends mt{get direction(){return this._effectWrapper.direction}set direction(e){this._effectWrapper.direction=e}set kernel(e){this._effectWrapper.kernel=e}get kernel(){return this._effectWrapper.kernel}set packedFloat(e){this._effectWrapper.packedFloat=e}get packedFloat(){return this._effectWrapper.packedFloat}getClassName(){return"BlurPostProcess"}constructor(e,t,i,s,n=null,r=ie.BILINEAR_SAMPLINGMODE,o,h,l=0,c="",u=!1,f=5){const d=typeof s=="number"?u:!!s.blockCompilation,_={uniforms:si.Uniforms,samplers:si.Samplers,size:typeof s=="number"?s:void 0,camera:n,samplingMode:r,engine:o,reusable:h,textureType:l,vertexUrl:si.VertexUrl,indexParameters:{varyingCount:0,depCount:0},textureFormat:f,defines:c,...s,blockCompilation:!0};super(e,si.FragmentUrl,{effectWrapper:typeof s=="number"||!s.effectWrapper?new si(e,o,void 0,void 0,_):void 0,..._}),this._effectWrapper.options.blockCompilation=d,this.direction=t,this.onApplyObservable.add(()=>{this._effectWrapper.textureWidth=this._outputTexture?this._outputTexture.width:this.width,this._effectWrapper.textureHeight=this._outputTexture?this._outputTexture.height:this.height}),this.kernel=i}updateEffect(e=null,t=null,i=null,s,n,r){this._effectWrapper._updateParameters(n,r)}static _Parse(e,t,i,s){return Ae.Parse(()=>new As(e.name,e.direction,e.kernel,e.options,t,e.renderTargetSamplingMode,i.getEngine(),e.reusable,e.textureType,void 0,!1),e,i,s)}}D([tc()],As.prototype,"direction",null);D([B()],As.prototype,"kernel",null);D([B()],As.prototype,"packedFloat",null);vt("BABYLON.BlurPostProcess",As);class xi{get camera(){return this._effectLayerOptions.camera}get renderingGroupId(){return this._effectLayerOptions.renderingGroupId}set renderingGroupId(e){this._effectLayerOptions.renderingGroupId=e}get mainTexture(){return this._mainTexture}get shaderLanguage(){return this._shaderLanguage}setMaterialForRendering(e,t){if(this._mainTexture.setMaterialForRendering(e,t),Array.isArray(e))for(let i=0;i{if((i||t===0)&&e.subMeshes)for(let s=0;s{this.onBeforeRenderMainTextureObservable.notifyObservers(this);let n;const r=this._scene.getEngine();if(s.length){for(r.setColorWrite(!1),n=0;n{e.clear(this.neutralColor,!0,!0,!0)}),this._scene.getBoundingBoxRenderer){const e=this._scene.getBoundingBoxRenderer().enabled;this._mainTexture.onBeforeBindObservable.add(()=>{this._scene.getBoundingBoxRenderer().enabled=!this.disableBoundingBoxesFromEffectLayer&&e}),this._mainTexture.onAfterUnbindObservable.add(()=>{this._scene.getBoundingBoxRenderer().enabled=e})}}_addCustomEffectDefines(e){}_isReady(e,t,i){var I;const s=this._scene.getEngine(),n=e.getMesh(),r=(I=n._internalAbstractMeshDataInfo._materialForRenderPass)==null?void 0:I[s.currentRenderPassId];if(r)return r.isReadyForSubMesh(n,e,t);const o=e.getMaterial();if(!o)return!1;if(this._useMeshMaterial(e.getRenderingMesh()))return o.isReadyForSubMesh(e.getMesh(),e,t);const h=[],l=[A.PositionKind];let c=!1,u=!1;if(o){const T=o.needAlphaTesting(),x=o.getAlphaTestTexture(),y=x&&x.hasAlpha&&(o.useAlphaFromDiffuseTexture||o._useAlphaFromAlbedoTexture);x&&(T||y)&&(h.push("#define DIFFUSE"),n.isVerticesDataPresent(A.UV2Kind)&&x.coordinatesIndex===1?(h.push("#define DIFFUSEUV2"),u=!0):n.isVerticesDataPresent(A.UVKind)&&(h.push("#define DIFFUSEUV1"),c=!0),T&&(h.push("#define ALPHATEST"),h.push("#define ALPHATESTVALUE 0.4")),x.gammaSpace||h.push("#define DIFFUSE_ISLINEAR"));const R=o.opacityTexture;R&&(h.push("#define OPACITY"),n.isVerticesDataPresent(A.UV2Kind)&&R.coordinatesIndex===1?(h.push("#define OPACITYUV2"),u=!0):n.isVerticesDataPresent(A.UVKind)&&(h.push("#define OPACITYUV1"),c=!0))}i&&(h.push("#define EMISSIVE"),n.isVerticesDataPresent(A.UV2Kind)&&i.coordinatesIndex===1?(h.push("#define EMISSIVEUV2"),u=!0):n.isVerticesDataPresent(A.UVKind)&&(h.push("#define EMISSIVEUV1"),c=!0),i.gammaSpace||h.push("#define EMISSIVE_ISLINEAR")),n.useVertexColors&&n.isVerticesDataPresent(A.ColorKind)&&n.hasVertexAlpha&&o.transparencyMode!==X.MATERIAL_OPAQUE&&(l.push(A.ColorKind),h.push("#define VERTEXALPHA")),c&&(l.push(A.UVKind),h.push("#define UV1")),u&&(l.push(A.UV2Kind),h.push("#define UV2"));const f=new G0;if(n.useBones&&n.computeBonesUsingShaders){l.push(A.MatricesIndicesKind),l.push(A.MatricesWeightsKind),n.numBoneInfluencers>4&&(l.push(A.MatricesIndicesExtraKind),l.push(A.MatricesWeightsExtraKind)),h.push("#define NUM_BONE_INFLUENCERS "+n.numBoneInfluencers);const T=n.skeleton;T&&T.isUsingTextureForMatrices?h.push("#define BONETEXTURE"):h.push("#define BonesPerMesh "+(T?T.bones.length+1:0)),n.numBoneInfluencers>0&&f.addCPUSkinningFallback(0,n)}else h.push("#define NUM_BONE_INFLUENCERS 0");const d=n.morphTargetManager;let _=0;d&&(_=d.numMaxInfluencers||d.numInfluencers,_>0&&(h.push("#define MORPHTARGETS"),h.push("#define NUM_MORPH_INFLUENCERS "+_),d.isUsingTextureForTargets&&h.push("#define MORPHTARGETS_TEXTURE"),qp(l,n,_))),t&&(h.push("#define INSTANCES"),N0(l),e.getRenderingMesh().hasThinInstances&&h.push("#define THIN_INSTANCES")),Mc(o,this._scene,h),this._addCustomEffectDefines(h);const p=e._getDrawWrapper(void 0,!0),g=p.defines,m=h.join("\n");if(g!==m){const T=["world","mBones","viewProjection","glowColor","morphTargetInfluences","morphTargetCount","boneTextureWidth","diffuseMatrix","emissiveMatrix","opacityMatrix","opacityIntensity","morphTargetTextureInfo","morphTargetTextureIndices","glowIntensity"];Xr(T),p.setEffect(this._engine.createEffect("glowMapGeneration",l,T,["diffuseSampler","emissiveSampler","opacitySampler","boneSampler","morphTargets"],m,f,void 0,void 0,{maxSimultaneousMorphTargets:_},this._shaderLanguage,this._shadersLoaded?void 0:async()=>{await this._importShadersAsync(),this._shadersLoaded=!0}),m)}const b=p.effect.isReady();return this._arePostProcessAndMergeReady()&&b}async _importShadersAsync(){this._shaderLanguage===1?await Promise.all([Oe(()=>import("./glowMapGeneration.vertex-O7p-xSBA.js"),__vite__mapDeps([58,22,25,23,3,4,5,6,7,8,9,10])),Oe(()=>import("./glowMapGeneration.fragment-CfLBq-Y2.js"),__vite__mapDeps([59,29,3,4,5,6,7,8,9,10]))]):await Promise.all([Oe(()=>import("./glowMapGeneration.vertex-BcKlBU7O.js"),__vite__mapDeps([60,36,37,3,4,5,6,7,8,9,10])),Oe(()=>import("./glowMapGeneration.fragment-C2VnGqtj.js"),__vite__mapDeps([61,35,3,4,5,6,7,8,9,10]))])}_arePostProcessAndMergeReady(){let e=!0;for(let i=0;ib.setMatrix("world",T))}else this._mainTexture.resetRefreshCounter();this.onAfterRenderMeshToEffect.notifyObservers(s)}_useMeshMaterial(e){return!1}_rebuild(){const e=this._vertexBuffers[A.PositionKind];e&&e._rebuild(),this._generateIndexBuffer()}_disposeTextureAndPostProcesses(){this._mainTexture.dispose();for(let e=0;e-1&&this._scene.effectLayers.splice(t,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onBeforeRenderMainTextureObservable.clear(),this.onBeforeComposeObservable.clear(),this.onBeforeRenderMeshToEffect.clear(),this.onAfterRenderMeshToEffect.clear(),this.onAfterComposeObservable.clear(),this.onSizeChangedObservable.clear()}getClassName(){return"EffectLayer"}static Parse(e,t,i){return J.Instantiate(e.customType).Parse(e,t,i)}}xi.ForceGLSL=!1;xi._SceneComponentInitialization=a=>{throw ye("EffectLayerSceneComponent")};D([B()],xi.prototype,"name",void 0);D([p0()],xi.prototype,"neutralColor",void 0);D([B()],xi.prototype,"isEnabled",void 0);D([e_()],xi.prototype,"camera",null);D([B()],xi.prototype,"renderingGroupId",null);D([B()],xi.prototype,"disableBoundingBoxesFromEffectLayer",void 0);it.prototype.getHighlightLayerByName=function(a){var e;for(let t=0;t<((e=this.effectLayers)==null?void 0:e.length);t++)if(this.effectLayers[t].name===a&&this.effectLayers[t].getEffectName()===kt.EffectName)return this.effectLayers[t];return null};class ml extends mt{constructor(e,t,i,s,n,r=ie.BILINEAR_SAMPLINGMODE,o,h){super(e,"glowBlurPostProcess",["screenSize","direction","blurWidth"],null,s,n,r,o,h),this.direction=t,this.kernel=i,this.onApplyObservable.add(l=>{l.setFloat2("screenSize",this.width,this.height),l.setVector2("direction",this.direction),l.setFloat("blurWidth",this.kernel)})}_gatherImports(e,t){e?(this._webGPUReady=!0,t.push(Oe(()=>import("./glowBlurPostProcess.fragment-D0h3Yhq8.js"),__vite__mapDeps([62,3,4,5,6,7,8,9,10])))):t.push(Oe(()=>import("./glowBlurPostProcess.fragment-BmYiq-YF.js"),__vite__mapDeps([63,3,4,5,6,7,8,9,10]))),super._gatherImports(e,t)}}class kt extends xi{set blurHorizontalSize(e){this._horizontalBlurPostprocess.kernel=e,this._options.blurHorizontalSize=e}set blurVerticalSize(e){this._verticalBlurPostprocess.kernel=e,this._options.blurVerticalSize=e}get blurHorizontalSize(){return this._horizontalBlurPostprocess.kernel}get blurVerticalSize(){return this._verticalBlurPostprocess.kernel}constructor(e,t,i){super(e,t,i!==void 0?!!i.forceGLSL:!1),this.name=e,this.innerGlow=!0,this.outerGlow=!0,this.onBeforeBlurObservable=new Z,this.onAfterBlurObservable=new Z,this._instanceGlowingMeshStencilReference=kt.GlowingMeshStencilReference++,this._meshes={},this._excludedMeshes={},this.neutralColor=kt.NeutralColor,this._engine.isStencilEnable||U.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }"),this._options={mainTextureRatio:.5,blurTextureSizeRatio:.5,blurHorizontalSize:1,blurVerticalSize:1,alphaBlendingMode:2,camera:null,renderingGroupId:-1,mainTextureType:0,forceGLSL:!1,...i},this._init({alphaBlendingMode:this._options.alphaBlendingMode,camera:this._options.camera,mainTextureFixedSize:this._options.mainTextureFixedSize,mainTextureRatio:this._options.mainTextureRatio,renderingGroupId:this._options.renderingGroupId,mainTextureType:this._options.mainTextureType}),this._shouldRender=!1}async _importShadersAsync(){this._shaderLanguage===1?await Promise.all([Oe(()=>import("./glowMapMerge.fragment-z1wsxOL6.js"),__vite__mapDeps([64,3,4,5,6,7,8,9,10])),Oe(()=>import("./glowMapMerge.vertex-BOpN3rPY.js"),__vite__mapDeps([65,3,4,5,6,7,8,9,10])),Oe(()=>import("./glowBlurPostProcess.fragment-D0h3Yhq8.js"),__vite__mapDeps([62,3,4,5,6,7,8,9,10]))]):await Promise.all([Oe(()=>import("./glowMapMerge.fragment-C9pBmOul.js"),__vite__mapDeps([66,3,4,5,6,7,8,9,10])),Oe(()=>import("./glowMapMerge.vertex-CYvG5BDv.js"),__vite__mapDeps([67,3,4,5,6,7,8,9,10])),Oe(()=>import("./glowBlurPostProcess.fragment-BmYiq-YF.js"),__vite__mapDeps([63,3,4,5,6,7,8,9,10]))]),await super._importShadersAsync()}getEffectName(){return kt.EffectName}_numInternalDraws(){return 2}_createMergeEffect(){return this._engine.createEffect("glowMapMerge",[A.PositionKind],["offset"],["textureSampler"],this._options.isStroke?"#define STROKE \n":void 0,void 0,void 0,void 0,void 0,this._shaderLanguage,this._shadersLoaded?void 0:async()=>{await this._importShadersAsync(),this._shadersLoaded=!0})}_createTextureAndPostProcesses(){let e=this._mainTextureDesiredSize.width*this._options.blurTextureSizeRatio,t=this._mainTextureDesiredSize.height*this._options.blurTextureSizeRatio;e=this._engine.needPOTTextures?fi(e,this._maxSize):e,t=this._engine.needPOTTextures?fi(t,this._maxSize):t;let i=0;if(this._engine.getCaps().textureHalfFloatRender?i=2:i=0,this._blurTexture=new us("HighlightLayerBlurRTT",{width:e,height:t},this._scene,!1,!0,i),this._blurTexture.wrapU=ie.CLAMP_ADDRESSMODE,this._blurTexture.wrapV=ie.CLAMP_ADDRESSMODE,this._blurTexture.anisotropicFilteringLevel=16,this._blurTexture.updateSamplingMode(ie.TRILINEAR_SAMPLINGMODE),this._blurTexture.renderParticles=!1,this._blurTexture.ignoreCameraViewport=!0,this._textures=[this._blurTexture],this._options.alphaBlendingMode===2)this._downSamplePostprocess=new Yn("HighlightLayerPPP",this._options.blurTextureSizeRatio,null,ie.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._downSamplePostprocess.externalTextureSamplerBinding=!0,this._downSamplePostprocess.onApplyObservable.add(s=>{s.setTexture("textureSampler",this._mainTexture)}),this._horizontalBlurPostprocess=new ml("HighlightLayerHBP",new oe(1,0),this._options.blurHorizontalSize,1,null,ie.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._horizontalBlurPostprocess.onApplyObservable.add(s=>{s.setFloat2("screenSize",e,t)}),this._verticalBlurPostprocess=new ml("HighlightLayerVBP",new oe(0,1),this._options.blurVerticalSize,1,null,ie.BILINEAR_SAMPLINGMODE,this._scene.getEngine()),this._verticalBlurPostprocess.onApplyObservable.add(s=>{s.setFloat2("screenSize",e,t)}),this._postProcesses=[this._downSamplePostprocess,this._horizontalBlurPostprocess,this._verticalBlurPostprocess];else{this._horizontalBlurPostprocess=new As("HighlightLayerHBP",new oe(1,0),this._options.blurHorizontalSize/2,{width:e,height:t},null,ie.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,i);const s=this._horizontalBlurPostprocess;s.width=e,s.height=t,s.externalTextureSamplerBinding=!0,s.onApplyObservable.add(n=>{n.setTexture("textureSampler",this._mainTexture)}),this._verticalBlurPostprocess=new As("HighlightLayerVBP",new oe(0,1),this._options.blurVerticalSize/2,{width:e,height:t},null,ie.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,i),this._postProcesses=[this._horizontalBlurPostprocess,this._verticalBlurPostprocess]}this._mainTexture.onAfterUnbindObservable.add(()=>{this.onBeforeBlurObservable.notifyObservers(this);const s=this._blurTexture.renderTarget;s&&(this._scene.postProcessManager.directRender(this._postProcesses,s,!0),this._engine.unBindFramebuffer(s,!0)),this.onAfterBlurObservable.notifyObservers(this)}),this._postProcesses.map(s=>{s.autoClear=!1})}needStencil(){return!0}isReady(e,t){const i=e.getMaterial(),s=e.getRenderingMesh();if(!i||!s||!this._meshes)return!1;let n=null;const r=this._meshes[s.uniqueId];return r&&r.glowEmissiveOnly&&i&&(n=i.emissiveTexture),super._isReady(e,t,n)}_internalRender(e,t){e.setTexture("textureSampler",this._blurTexture);const i=this._engine;i.cacheStencilState(),i.setStencilOperationPass(7681),i.setStencilOperationFail(7680),i.setStencilOperationDepthFail(7680),i.setStencilMask(0),i.setStencilBuffer(!0),i.setStencilFunctionReference(this._instanceGlowingMeshStencilReference),this.outerGlow&&t===0&&(e.setFloat("offset",0),i.setStencilFunction(517),i.drawElementsType(X.TriangleFillMode,0,6)),this.innerGlow&&t===1&&(e.setFloat("offset",1),i.setStencilFunction(514),i.drawElementsType(X.TriangleFillMode,0,6)),i.restoreStencilState()}shouldRender(){return super.shouldRender()?!!this._meshes:!1}_shouldRenderMesh(e){return!(this._excludedMeshes&&this._excludedMeshes[e.uniqueId]||!super.hasMesh(e))}_canRenderMesh(e,t){return!0}_addCustomEffectDefines(e){e.push("#define HIGHLIGHT")}_setEmissiveTextureAndColor(e,t,i){const s=this._meshes[e.uniqueId];s?this._emissiveTextureAndColor.color.set(s.color.r,s.color.g,s.color.b,1):this._emissiveTextureAndColor.color.set(this.neutralColor.r,this.neutralColor.g,this.neutralColor.b,this.neutralColor.a),s&&s.glowEmissiveOnly&&i?(this._emissiveTextureAndColor.texture=i.emissiveTexture,this._emissiveTextureAndColor.color.set(1,1,1,1)):this._emissiveTextureAndColor.texture=null}addExcludedMesh(e){if(!this._excludedMeshes)return;if(!this._excludedMeshes[e.uniqueId]){const i={mesh:e,beforeBind:null,afterRender:null,stencilState:!1};i.beforeBind=e.onBeforeBindObservable.add(s=>{i.stencilState=s.getEngine().getStencilBuffer(),s.getEngine().setStencilBuffer(!1)}),i.afterRender=e.onAfterRenderObservable.add(s=>{s.getEngine().setStencilBuffer(i.stencilState)}),this._excludedMeshes[e.uniqueId]=i}}removeExcludedMesh(e){if(!this._excludedMeshes)return;const t=this._excludedMeshes[e.uniqueId];t&&(t.beforeBind&&e.onBeforeBindObservable.remove(t.beforeBind),t.afterRender&&e.onAfterRenderObservable.remove(t.afterRender)),this._excludedMeshes[e.uniqueId]=null}hasMesh(e){return!this._meshes||!super.hasMesh(e)?!1:this._meshes[e.uniqueId]!==void 0&&this._meshes[e.uniqueId]!==null}addMesh(e,t,i=!1){if(!this._meshes)return;const s=this._meshes[e.uniqueId];s?s.color=t:(this._meshes[e.uniqueId]={mesh:e,color:t,observerHighlight:e.onBeforeBindObservable.add(n=>{this.isEnabled&&(this._excludedMeshes&&this._excludedMeshes[n.uniqueId]?this._defaultStencilReference(n):n.getScene().getEngine().setStencilFunctionReference(this._instanceGlowingMeshStencilReference))}),observerDefault:e.onAfterRenderObservable.add(n=>{this.isEnabled&&this._defaultStencilReference(n)}),glowEmissiveOnly:i},e.onDisposeObservable.add(()=>{this._disposeMesh(e)})),this._shouldRender=!0}removeMesh(e){if(!this._meshes)return;const t=this._meshes[e.uniqueId];t&&(t.observerHighlight&&e.onBeforeBindObservable.remove(t.observerHighlight),t.observerDefault&&e.onAfterRenderObservable.remove(t.observerDefault),delete this._meshes[e.uniqueId]),this._shouldRender=!1;for(const i in this._meshes)if(this._meshes[i]){this._shouldRender=!0;break}}removeAllMeshes(){if(this._meshes){for(const e in this._meshes)if(Object.prototype.hasOwnProperty.call(this._meshes,e)){const t=this._meshes[e];t&&this.removeMesh(t.mesh)}}}_defaultStencilReference(e){e.getScene().getEngine().setStencilFunctionReference(kt.NormalMeshStencilReference)}_disposeMesh(e){this.removeMesh(e),this.removeExcludedMesh(e)}dispose(){if(this._meshes){for(const e in this._meshes){const t=this._meshes[e];t&&t.mesh&&(t.observerHighlight&&t.mesh.onBeforeBindObservable.remove(t.observerHighlight),t.observerDefault&&t.mesh.onAfterRenderObservable.remove(t.observerDefault))}this._meshes=null}if(this._excludedMeshes){for(const e in this._excludedMeshes){const t=this._excludedMeshes[e];t&&(t.beforeBind&&t.mesh.onBeforeBindObservable.remove(t.beforeBind),t.afterRender&&t.mesh.onAfterRenderObservable.remove(t.afterRender))}this._excludedMeshes=null}super.dispose()}getClassName(){return"HighlightLayer"}serialize(){const e=Ae.Serialize(this);if(e.customType="BABYLON.HighlightLayer",e.meshes=[],this._meshes)for(const t in this._meshes){const i=this._meshes[t];i&&e.meshes.push({glowEmissiveOnly:i.glowEmissiveOnly,color:i.color.asArray(),meshId:i.mesh.id})}if(e.excludedMeshes=[],this._excludedMeshes)for(const t in this._excludedMeshes){const i=this._excludedMeshes[t];i&&e.excludedMeshes.push(i.mesh.id)}return e}static Parse(e,t,i){const s=Ae.Parse(()=>new kt(e.name,t,e.options),e,t,i);let n;for(n=0;nnew zt(e,this.getScene()),this)}serialize(){const e=super.serialize();return e.customType="BABYLON.GridMaterial",e}getClassName(){return"GridMaterial"}static Parse(e,t,i){return Ae.Parse(()=>new zt(e.name,t),e,t,i)}}D([ls()],zt.prototype,"mainColor",void 0);D([ls()],zt.prototype,"lineColor",void 0);D([B()],zt.prototype,"gridRatio",void 0);D([yi()],zt.prototype,"gridOffset",void 0);D([B()],zt.prototype,"majorUnitFrequency",void 0);D([B()],zt.prototype,"minorUnitVisibility",void 0);D([B()],zt.prototype,"opacity",void 0);D([B()],zt.prototype,"antialias",void 0);D([B()],zt.prototype,"preMultiplyAlpha",void 0);D([B()],zt.prototype,"useMaxLine",void 0);D([_i("opacityTexture")],zt.prototype,"_opacityTexture",void 0);D([je("_markAllSubMeshesAsTexturesDirty")],zt.prototype,"opacityTexture",void 0);vt("BABYLON.GridMaterial",zt);we.prototype.createDynamicTexture=function(a,e,t,i){const s=new ft(this,4);return s.baseWidth=a,s.baseHeight=e,t&&(a=this.needPOTTextures?fi(a,this._caps.maxTextureSize):a,e=this.needPOTTextures?fi(e,this._caps.maxTextureSize):e),s.width=a,s.height=e,s.isReady=!1,s.generateMipMaps=t,s.samplingMode=i,this.updateTextureSamplingMode(i,s),this._internalTexturesCache.push(s),s};we.prototype.updateDynamicTexture=function(a,e,t,i=!1,s,n=!1,r=!1){if(!a)return;const o=this._gl,h=o.TEXTURE_2D,l=this._bindTextureDirectly(h,a,!0,n);this._unpackFlipY(t===void 0?a.invertY:t),i&&o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);const c=this._getWebGLTextureType(a.type),u=this._getInternalFormat(s||a.format),f=this._getRGBABufferInternalSizedFormat(a.type,u);o.texImage2D(h,0,f,u,c,e),a.generateMipMaps&&o.generateMipmap(h),l||this._bindTextureDirectly(h,null),i&&o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),s&&(a.format=s),a._dynamicTextureSource=e,a._premulAlpha=i,a.invertY=t||!1,a.isReady=!0};class Wn extends ie{constructor(e,t,i,s=!1,n=3,r=5,o){const h=!i||i._isScene,l=h?i:i==null?void 0:i.scene,c=h?!s:i;super(null,l,c,o,n,void 0,void 0,void 0,void 0,r),this.name=e,this.wrapU=ie.CLAMP_ADDRESSMODE,this.wrapV=ie.CLAMP_ADDRESSMODE,this._generateMipMaps=s;const u=this._getEngine();if(!u)return;if(t.getContext)this._canvas=t,this._ownCanvas=!1,this._texture=u.createDynamicTexture(this._canvas.width,this._canvas.height,s,n);else{this._canvas=u.createCanvas(1,1),this._ownCanvas=!0;const d=t;d.width||d.width===0?this._texture=u.createDynamicTexture(d.width,d.height,s,n):this._texture=u.createDynamicTexture(t,t,s,n)}const f=this.getSize();this._canvas.width!==f.width&&(this._canvas.width=f.width),this._canvas.height!==f.height&&(this._canvas.height=f.height),this._context=this._canvas.getContext("2d")}getClassName(){return"DynamicTexture"}get canRescale(){return!0}_recreate(e){this._canvas.width=e.width,this._canvas.height=e.height,this.releaseInternalTexture(),this._texture=this._getEngine().createDynamicTexture(e.width,e.height,this._generateMipMaps,this.samplingMode)}scale(e){const t=this.getSize();t.width*=e,t.height*=e,this._recreate(t)}scaleTo(e,t){const i=this.getSize();i.width=e,i.height=t,this._recreate(i)}getContext(){return this._context}clear(e){const t=this.getSize();e&&(this._context.fillStyle=e),this._context.clearRect(0,0,t.width,t.height)}update(e,t=!1,i=!1){this._getEngine().updateDynamicTexture(this._texture,this._canvas,e===void 0?!0:e,t,this._format||void 0,void 0,i)}drawText(e,t,i,s,n,r,o,h=!0){const l=this.getSize();if(r&&(this._context.fillStyle=r,this._context.fillRect(0,0,l.width,l.height)),this._context.font=s,t==null){const c=this._context.measureText(e);t=(l.width-c.width)/2}if(i==null){const c=parseInt(s.replace(/\D/g,""));i=l.height/2+c/3.65}this._context.fillStyle=n||"",this._context.fillText(e,t,i),h&&this.update(o)}dispose(){var e,t;super.dispose(),this._ownCanvas&&((t=(e=this._canvas)==null?void 0:e.remove)==null||t.call(e)),this._canvas=null,this._context=null}clone(){const e=this.getScene();if(!e)return this;const t=this.getSize(),i=new Wn(this.name,t,e,this._generateMipMaps);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.wrapU=this.wrapU,i.wrapV=this.wrapV,i}serialize(){const e=this.getScene();e&&!e.isReady()&&U.Warn("The scene must be ready before serializing the dynamic texture");const t=super.serialize();return Wn._IsCanvasElement(this._canvas)&&(t.base64String=this._canvas.toDataURL()),t.invertY=this._invertY,t.samplingMode=this.samplingMode,t}static _IsCanvasElement(e){return e.toDataURL!==void 0}_rebuild(){this.update()}}bt.AddNodeConstructor("Light_Type_3",(a,e)=>()=>new _n(a,v.Zero(),e));class _n extends Fe{constructor(e,t,i){super(e,i),this.groundColor=new de(0,0,0),this.direction=t||v.Up()}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightGround",3),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}getClassName(){return"HemisphericLight"}setDirectionToTarget(e){return this.direction=v.Normalize(e.subtract(v.Zero())),this.direction}getShadowGenerator(){return null}transferToEffect(e,t){const i=v.Normalize(this.direction);return this._uniformBuffer.updateFloat4("vLightData",i.x,i.y,i.z,0,t),this._uniformBuffer.updateColor3("vLightGround",this.groundColor.scale(this.intensity),t),this}transferToNodeMaterialEffect(e,t){const i=v.Normalize(this.direction);return e.setFloat3(t,i.x,i.y,i.z),this}computeWorldMatrix(){return this._worldMatrix||(this._worldMatrix=O.Identity()),this._worldMatrix}getTypeID(){return Fe.LIGHTTYPEID_HEMISPHERICLIGHT}prepareLightSpecificDefines(e,t){e["HEMILIGHT"+t]=!0}}D([ls()],_n.prototype,"groundColor",void 0);D([yi()],_n.prototype,"direction",void 0);vt("BABYLON.HemisphericLight",_n);function It(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */It=()=>a;var a={},e=Object.prototype,t=e.hasOwnProperty,i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",n=i.asyncIterator||"@@asyncIterator",r=i.toStringTag||"@@toStringTag";function o(S,w,P){return Object.defineProperty(S,w,{value:P,enumerable:!0,configurable:!0,writable:!0}),S[w]}try{o({},"")}catch{o=(w,P,G)=>w[P]=G}function h(S,w,P,G){var L=w&&w.prototype instanceof u?w:u,W=Object.create(L.prototype),K=new R(G||[]);return W._invoke=((ce,$,z)=>{var k="suspendedStart";return(M,V)=>{if(k==="executing")throw new Error("Generator is already running");if(k==="completed"){if(M==="throw")throw V;return C()}for(z.method=M,z.arg=V;;){var q=z.delegate;if(q){var he=T(q,z);if(he){if(he===c)continue;return he}}if(z.method==="next")z.sent=z._sent=z.arg;else if(z.method==="throw"){if(k==="suspendedStart")throw k="completed",z.arg;z.dispatchException(z.arg)}else z.method==="return"&&z.abrupt("return",z.arg);k="executing";var pe=l(ce,$,z);if(pe.type==="normal"){if(k=z.done?"completed":"suspendedYield",pe.arg===c)continue;return{value:pe.arg,done:z.done}}pe.type==="throw"&&(k="completed",z.method="throw",z.arg=pe.arg)}}})(S,P,K),W}function l(S,w,P){try{return{type:"normal",arg:S.call(w,P)}}catch(G){return{type:"throw",arg:G}}}a.wrap=h;var c={};function u(){}function f(){}function d(){}var _={};o(_,s,function(){return this});var p=Object.getPrototypeOf,g=p&&p(p(E([])));g&&g!==e&&t.call(g,s)&&(_=g);var m=d.prototype=u.prototype=Object.create(_);function b(S){["next","throw","return"].forEach(function(w){o(S,w,function(P){return this._invoke(w,P)})})}function I(S,w){function P(L,W,K,ce){var $=l(S[L],S,W);if($.type!=="throw"){var z=$.arg,k=z.value;return k&&typeof k=="object"&&t.call(k,"__await")?w.resolve(k.__await).then(M=>{P("next",M,K,ce)},M=>{P("throw",M,K,ce)}):w.resolve(k).then(M=>{z.value=M,K(z)},M=>P("throw",M,K,ce))}ce($.arg)}var G;this._invoke=(L,W)=>{function K(){return new w((ce,$)=>{P(L,W,ce,$)})}return G=G?G.then(K,K):K()}}function T(S,w){var P=S.iterator[w.method];if(P===void 0){if(w.delegate=null,w.method==="throw"){if(S.iterator.return&&(w.method="return",w.arg=void 0,T(S,w),w.method==="throw"))return c;w.method="throw",w.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var G=l(P,S.iterator,w.arg);if(G.type==="throw")return w.method="throw",w.arg=G.arg,w.delegate=null,c;var L=G.arg;return L?L.done?(w[S.resultName]=L.value,w.next=S.nextLoc,w.method!=="return"&&(w.method="next",w.arg=void 0),w.delegate=null,c):L:(w.method="throw",w.arg=new TypeError("iterator result is not an object"),w.delegate=null,c)}function x(S){var w={tryLoc:S[0]};1 in S&&(w.catchLoc=S[1]),2 in S&&(w.finallyLoc=S[2],w.afterLoc=S[3]),this.tryEntries.push(w)}function y(S){var w=S.completion||{};w.type="normal",delete w.arg,S.completion=w}function R(S){this.tryEntries=[{tryLoc:"root"}],S.forEach(x,this),this.reset(!0)}function E(S){if(S){var w=S[s];if(w)return w.call(S);if(typeof S.next=="function")return S;if(!isNaN(S.length)){var P=-1,G=function L(){for(;++P{var w=typeof S=="function"&&S.constructor;return!!w&&(w===f||(w.displayName||w.name)==="GeneratorFunction")},a.mark=S=>(Object.setPrototypeOf?Object.setPrototypeOf(S,d):(S.__proto__=d,o(S,r,"GeneratorFunction")),S.prototype=Object.create(m),S),a.awrap=S=>({__await:S}),b(I.prototype),o(I.prototype,n,function(){return this}),a.AsyncIterator=I,a.async=(S,w,P,G,L)=>{L===void 0&&(L=Promise);var W=new I(h(S,w,P,G),L);return a.isGeneratorFunction(w)?W:W.next().then(K=>K.done?K.value:W.next())},b(m),o(m,r,"Generator"),o(m,s,function(){return this}),o(m,"toString",()=>"[object Generator]"),a.keys=S=>{var w=[];for(var P in S)w.push(P);return w.reverse(),function G(){for(;w.length;){var L=w.pop();if(L in S)return G.value=L,G.done=!1,G}return G.done=!0,G}},a.values=E,R.prototype={constructor:R,reset:function(S){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(y),!S)for(var w in this)w.charAt(0)==="t"&&t.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=void 0)},stop:function(){this.done=!0;var S=this.tryEntries[0].completion;if(S.type==="throw")throw S.arg;return this.rval},dispatchException:function(S){if(this.done)throw S;var w=this;function P($,z){return W.type="throw",W.arg=S,w.next=$,z&&(w.method="next",w.arg=void 0),!!z}for(var G=this.tryEntries.length-1;G>=0;--G){var L=this.tryEntries[G],W=L.completion;if(L.tryLoc==="root")return P("end");if(L.tryLoc<=this.prev){var K=t.call(L,"catchLoc"),ce=t.call(L,"finallyLoc");if(K&&ce){if(this.prev=0;--P){var G=this.tryEntries[P];if(G.tryLoc<=this.prev&&t.call(G,"finallyLoc")&&this.prev=0;--w){var P=this.tryEntries[w];if(P.finallyLoc===S)return this.complete(P.completion,P.afterLoc),y(P),c}},catch:function(S){for(var w=this.tryEntries.length-1;w>=0;--w){var P=this.tryEntries[w];if(P.tryLoc===S){var G=P.completion;if(G.type==="throw"){var L=G.arg;y(P)}return L}}throw new Error("illegal catch attempt")},delegateYield:function(S,w,P){return this.delegate={iterator:E(S),resultName:w,nextLoc:P},this.method==="next"&&(this.arg=void 0),c}},a}function e0(a){return e0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=>typeof e:e=>e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e,e0(a)}function vl(a,e,t,i,s,n,r){try{var o=a[n](r),h=o.value}catch(l){return void t(l)}o.done?e(h):Promise.resolve(h).then(i,s)}function Gi(a){return function(){var e=this,t=arguments;return new Promise((i,s)=>{var n=a.apply(e,t);function r(h){vl(n,i,s,r,o,"next",h)}function o(h){vl(n,i,s,r,o,"throw",h)}r(void 0)})}}function Mt(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function bl(a,e){for(var t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],()=>{})),!0}catch{return!1}}();return function(){var t,i=Ur(a);if(e){var s=Ur(this).constructor;t=Reflect.construct(i,arguments,s)}else t=i.apply(this,arguments);return Rb(this,t)}}function xl(a,e){return function(t){if(Array.isArray(t))return t}(a)||function(t,i){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var n,r,o=[],h=!0,l=!1;try{for(s=s.call(t);!(h=(n=s.next()).done)&&(o.push(n.value),!i||o.length!==i);h=!0);}catch(c){l=!0,r=c}finally{try{h||s.return==null||s.return()}finally{if(l)throw r}}return o}}(a,e)||oo(a,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yl(a){return function(e){if(Array.isArray(e))return i0(e)}(a)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(a)||oo(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oo(a,e){if(a){if(typeof a=="string")return i0(a,e);var t=Object.prototype.toString.call(a).slice(8,-1);return t==="Object"&&a.constructor&&(t=a.constructor.name),t==="Map"||t==="Set"?Array.from(a):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i0(a,e):void 0}}function i0(a,e){(e==null||e>a.length)&&(e=a.length);for(var t=0,i=new Array(e);tsetTimeout(a)).then(()=>Date.now())}var Ib=Math.PI/2,Eb=new v(2,2,2),Tl=function(){function a(){Mt(this,a),this.tool=0,this.start=v.Zero(),this.end=v.Zero(),this.extruding=!1,this.gcodeLineNumber=0,this.gcodeFilePosition=0,this.color=null,this.feedRate=0,this.layerHeight=0,this.isPerimeter=!1}return Pt(a,[{key:"length",value:function(){return v.Distance(this.start,this.end)}},{key:"renderLine",value:function(e){var t=[this.start,this.end],i=Zt.CreateLines("lines",t,e);i.enableEdgesRendering(),i.edgesWidth=10,i.edgesColor=new H(1,1,0,1)}},{key:"renderLinev4",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:.4,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.layerHeight===0&&(this.layerHeight=this.start.y);var i={},s=this.length()+t,n=this.start.add(this.end).divide(Eb),r=this.end.subtract(this.start),o=Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2)+Math.pow(r.z,2)),h=Math.atan2(r.z,r.x),l=Math.acos(r.y/o);return i.matrix=O.Compose(new v(s,this.layerHeight,e),re.FromEulerVector(new v(0,-h,Ib-l)),n),i.color=this.color,i.props={gcodeLineNumber:this.gcodeLineNumber,gcodeFilePosition:this.gcodeFilePosition,originalColor:this.color},i}},{key:"renderParticle",value:function(e){e.position.x=this.start.x,e.position.y=this.start.y,e.position.z=this.start.z,e.color=this.color}},{key:"getPoints",value:function(){return{points:[this.start,this.end],colors:[this.color,this.color]}}},{key:"getColor",value:function(){return this.extruding?new H(1,1,1,1):new H(1,0,0,1)}},{key:"getVoxelSegments",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3?arguments[3]:void 0,n=new Array,r=v.Distance(this.start,this.end);if(!(r<.1)){var o=Math.round(100*(r/(e/2)-1))/100,h=Math.atan2(this.end.z-this.start.z,this.end.x-this.start.x);s&&(this.start.y-=e/2,this.end.y-=e/2);var l=this.start.clone(),c=0;n.push(l.clone());var u=e/2*Math.cos(h),f=e/2*Math.sin(h),d=0;for(o!==0&&(d=(this.end.y-this.start.y)/o);ce)for(var _=l.x-i;_<=l.x+i;_+=e)for(var p=l.z-i;pt&&s){for(var g=[],m=0;m5e4||this.currentFilePositionthis.scrubDistance&&e>=t-1e3&&e<=i+1e3}},{key:"getTransparentValue",value:function(){return this.vertexAlpha?this.transparentValue:0}},{key:"canUpdateColor",value:function(){return this.colorMode==ts.Color&&!this.hasMixing}},{key:"forceDraw",value:function(){this.timeStamp=0}}]),a}(),Cb=function(a){Yi(t,ca);var e=qi(t);function t(i,s,n,r,o,h){var l;return Mt(this,t),(l=e.call(this,i,s,n,r,o)).meshIndex=h!=null?h:0,l.lostInSpace=O.Identity().setTranslation(new v(1e4,1e4,1e4)),l.additiveColor=new H(0,1,0,.8),l}return Pt(t,[{key:"buildBox",value:function(){if(this.solidMat)try{this.solidMat.dispose(),this.solidMat=null}catch{console.warn("nothing to dispose")}if(this.transparentMat)try{this.transparentMat.dispose(),this.transparentMat=null}catch{console.warn("nothing to dispose")}var i=Zt.CreateBox("box",{width:1,height:1,depth:1,sideOrientation:F.FRONTSIDE},this.scene);return this.material=new ee("mat",this.scene),this.material.specularColor=this.specularColor,i.material=this.material,this.vertexAlpha&&(i.hasVertexAlpha=!0,i.material.forceDepthWrite=!0,i.material.alpha=.99),i}},{key:"render",value:function(i){for(var s=this,n=new Array(i.length),r=0,o=new Array(i.length),h=0;h.5&&_[L+3]<1){_[L+3]+=.02;var W=10*(_[L+3]-.9);_[L]=s.lerp(s.progressColor.r,n[P].color.r,W),_[L+1]=s.lerp(s.progressColor.g,n[P].color.g,W),_[L+2]=s.lerp(s.progressColor.b,n[P].color.b,W),S=!0}_[L+3]>=1&&!p[P]&&(n[P].color.toArray(_,L),_[L+3]=1,p[P]=!0,S=!0)}}else o[P]<=s.currentFilePosition?(n[P].color.toArray(_,L),n[P].matrix.copyToArray(d,16*P),_[L+3]=1,p[P]=!0):(s.getTransparentValue()===0?s.lostInSpace.copyToArray(d,16*P):n[P].matrix.copyToArray(d,16*P),_[L+3]=s.getTransparentValue(),p[P]=!1)}S&&b.thinInstanceBufferUpdated("color"),w&&(b.thinInstanceBufferUpdated("matrix"),b.thinInstanceRefreshBoundingInfo())};if(i.length!==0){var T=i[0].gcodeFilePosition,x=i.slice(-1)[0].gcodeFilePosition,y=0,R=!1,E=!1;this.timeStamp=Date.now();var C=function(){if(!(s.isLoading||Date.now()-s.timeStamp<200)){if(s.timeStamp=Date.now(),s.doScrub(y,T,x)||s.forceRedraw){R=!0,s.forceRedraw=!1,y=0;for(var S=0;S=T-3e4&&s.currentFilePosition<=x+3e4?(R=!1,E&&b.unfreezeWorldMatrix(),I()):E||(b.freezeWorldMatrix(),E=!0);y=s.currentFilePosition}};this.renderFuncs.push(C),this.scene.registerBeforeRender(C)}}}]),t}(),Sb=function(a){Yi(t,ca);var e=qi(t);function t(i,s,n,r,o,h){var l;return Mt(this,t),(l=e.call(this,i,s,n,r,o)).meshIndex=h!=null?h:0,l.lostInSpace=O.Identity().setTranslation(new v(1e4,1e4,1e4)),l.additiveColor=new H(0,1,0,.8),l}return Pt(t,[{key:"buildCylinder",value:function(){if(this.solidMat)try{this.solidMat.dispose(),this.solidMat=null}catch{console.warn("nothing to dispose")}if(this.transparentMat)try{this.transparentMat.dispose(),this.transparentMat=null}catch{console.warn("nothing to dispose")}var i=Zt.CreateCylinder("box",{height:1,diameter:1},this.scene);return i.locallyTranslate(new v(0,0,0)),i.rotate(new v(0,0,1),Math.PI/2,ci.WORLD),i.bakeCurrentTransformIntoVertices(),this.material=new ee("mat",this.scene),this.material.specularColor=this.specularColor,i.material=this.material,this.vertexAlpha&&(i.hasVertexAlpha=!0,i.material.forceDepthWrite=!0,i.material.alpha=.99),i}},{key:"render",value:function(i){for(var s=this,n=new Array(i.length),r=0,o=new Array(i.length),h=0;h.5&&_[L+3]<1){_[L+3]+=.02;var W=10*(_[L+3]-.9);_[L]=s.lerp(s.progressColor.r,n[P].color.r,W),_[L+1]=s.lerp(s.progressColor.g,n[P].color.g,W),_[L+2]=s.lerp(s.progressColor.b,n[P].color.b,W)}_[L+3]>=1&&!p[P]&&(n[P].color.toArray(_,L),_[L+3]=1,p[P]=!0,S=!0)}}else o[P]<=s.currentFilePosition?(n[P].color.toArray(_,L),n[P].matrix.copyToArray(d,G),_[L+3]=1,p[P]=!0):(s.getTransparentValue()===0?s.lostInSpace.copyToArray(d,G):n[P].matrix.copyToArray(d,G),_[L+3]=s.getTransparentValue(),p[P]=!1)}S&&b.thinInstanceBufferUpdated("color"),w&&(b.thinInstanceBufferUpdated("matrix"),b.thinInstanceRefreshBoundingInfo())};if(i.length!==0){var T=i[0].gcodeFilePosition,x=i.slice(-1)[0].gcodeFilePosition,y=0,R=!1,E=!1;this.timeStamp=Date.now();var C=function(){if(!(s.isLoading||Date.now()-s.timeStamp<200)){if(s.timeStamp=Date.now(),s.doScrub(y,T,x)||s.forceRedraw){R=!0,s.forceRedraw=!1,y=0;for(var S=0;S=T-3e4&&s.currentFilePosition<=x+3e4?(R=!1,E&&b.unfreezeWorldMatrix(),I()):E||(E=!0,b.freezeWorldMatrix());y=s.currentFilePosition}};this.renderFuncs.push(C),this.scene.registerBeforeRender(C)}}}]),t}(),Mb=Pt(function a(e,t){Mt(this,a),this.filePosition=e,this.add=t,this.complete=!1}),df=function(a){Yi(i,ca);var e,t=qi(i);function i(s,n,r,o,h,l,c){var u;return Mt(this,i),(u=t.call(this,s,n,r,o,h)).voxelWidth=parseFloat(l),u.voxelHeight=parseFloat(c),u.solidMat,u.transparentMat,u.hasSubtractive=!1,u.lostInSpace=O.Identity().setTranslation(new v(1e4,1e4,1e4)),u.clearColor=new H(1,0,0,0),u.additiveColor=new H(0,1,0,.8),u.subtractiveColor=new H(1,0,0,.8),u}return Pt(i,[{key:"buildBox",value:function(){if(this.solidMat)try{this.solidMat.dispose(),this.solidMat=null}catch{}if(this.transparentMat)try{this.transparentMat.dispose(),this.transparentMat=null}catch{}var s=Zt.CreateBox("box",{width:this.voxelWidth,height:this.voxelHeight,depth:this.voxelWidth},this.scene);return s.hasVertexAlpha=!0,s.updateFacetData=!0,this.material=new ee("mat",this.scene),this.material.needDepthPrePass=!0,this.material.forceDepthWrite=!0,this.material.backFaceCulling=!1,s.material=this.material,s}},{key:"render",value:(e=Gi(It().mark(function s(n){var r,o,h,l,c,u,f,d,_,p,g,m,b,I,T,x,y,R,E,C,S,w=this;return It().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:for(this.isLoading=!0,r=parseInt(300/this.voxelWidth)+1,o=r,h=parseInt(300/this.voxelHeight)+1,l=new Array(o),c=0;c<=h;c++)l[c]=new Object;u=0,f=new Date,d=0;case 10:if(!(d5e3)){P.next=57;break}return f=new Date,this.loadingProgressCallback(d/n.length,"Generating Voxel Map..."),P.next=57,kr();case 57:b++,P.next=22;break;case 60:d++,P.next=10;break;case 63:this.loadingProgressCallback(d/n.length,"Rendering Voxel..."),C=It().mark(function G(L){var W,K,ce,$,z,k,M,V,q,he,pe,se,ue,me,ne,Ie,Se,Q,be,Be,ze,Ke,Rt,Ct,Ge,Jt,Wt,ji,Is;return It().wrap(Ti=>{for(;;)switch(Ti.prev=Ti.next){case 0:if(W=[],l[L]!==void 0){Ti.next=3;break}return Ti.abrupt("return","continue");case 3:for(K=999999999999,ce=-999999999999,$=[],z=0,k=Object.entries(l[L]);zce&&(ce=ne.voxelEvents[0].filePosition),(se=$).push.apply(se,yl(ne.voxelEvents.map(Ht=>Ht.filePosition))),ne.color.a=1,(Ie={matrix:O.Identity(),color:ne.color.clone(),voxelEvents:ne.voxelEvents,lastDrawnCount:0}).matrix.setTranslation(new v(V*w.voxelWidth,L*w.voxelHeight,me*w.voxelWidth)),W.push(Ie);for(Se=0,$=$.sort((Ht,oi)=>Ht-oi),$=yl(new Set($)),W.length,l[L]=null,(Q=w.buildBox()).alphaIndex=L,Q.renderingGroupId=1,be=new Float32Array(16*W.length),Be=new Float32Array(4*W.length),ze=0;ze{for(var Ht=!1,oi=!1,Vt=0;Vttr.filePositionCt&&$i.filePosition<=w.currentFilePosition&&(Yt.lastDrawnCount=0,w.hasSubtractive&&Yt.matrix.copyToArray(be,16*Vt)),Jt&&(Yt.lastDrawnCount=i.drawDelay),Yt.lastDrawnCount=Ct&&$i.filePosition<=w.currentFilePosition&&(Yt.lastDrawnCount=0),Jt&&(Yt.lastDrawnCount=i.drawDelay),Yt.lastDrawnCount{if(!(w.isLoading||Date.now()-ji<200)){if(ji=Date.now(),w.doScrub(Ct,K,ce)||Ge||w.forceRedraw){Se=0,Jt=!0,w.forceRedraw=!1;for(var Ht=0;HtVt.complete=!1);Rt(),Ge=!1}else if(Se<$.length-1&&$[Se]w.currentFilePosition));oi++);}else Wt<10&&(Wt++,Rt());Ct=w.currentFilePosition}},w.loadingProgressCallback&&w.loadingProgressCallback(L/u,"Rendering Voxels..."),w.renderFuncs.push(Is),w.scene.registerBeforeRender(Is),!(new Date-f>1e3)){Ti.next=36;break}return f=new Date,Ti.next=36,kr();case 36:case"end":return Ti.stop()}},G,this)}),S=0;case 67:if(!(Sz===!1);W<=S;W++){var K=8*W;if(h[W]||s.travels&&s.persistTravels){if(l[W])continue;s.progressMode||C[K+3]<=.5?(C[K]=s.progressColor.r,C[K+1]=s.progressColor.g,C[K+2]=s.progressColor.b,C[K+3]=.9,C[K+4]=s.progressColor.r,C[K+5]=s.progressColor.g,C[K+6]=s.progressColor.b,C[K+7]=.9):C[K+3]<1?(C[K+3]+=.02,C[K+7]+=.02):C[K+3]>=1&&(C[K]=o[W][0].r,C[K+1]=o[W][0].g,C[K+2]=o[W][0].b,C[K+3]=1,C[K+4]=o[W][1].r,C[K+5]=o[W][1].g,C[K+6]=o[W][1].b,C[K+7]=1,l[W]=!0)}else{if(l[W])continue;C[K+3]===0?(C[K]=1,C[K+1]=0,C[K+2]=0,C[K+3]=.9,C[K+4]=1,C[K+5]=0,C[K+6]=0,C[K+7]=.9):C[K+3]<1?(C[K+3]+=.02,C[K+7]+=.02):(C[K+3]=1e-4,C[K+7]=1e-4,l[W]=!0)}x=W}for(var ce=S;ce=m-3e4&&s.currentFilePosition<=b+3e4&&(T=!1,y());I=s.currentFilePosition}};this.renderFuncs.push(E),this.scene.registerBeforeRender(E)}}]),t}(),Xs=function(){function a(){Mt(this,a),ff(this,"unknownFeatureColor",new H(.5,.5,.5,1)),this.feature=null,this.perimeter=!0,this.support=!1,this.missingFeatures=[]}return Pt(a,[{key:"isTypeComment",value:function(e){return!1}},{key:"getFeatureColor",value:function(e){return new H(1,1,1,1)}},{key:"isPerimeter",value:function(){return this.perimeter}},{key:"isSupport",value:function(){return this.support}},{key:"processComments",value:function(e,t){}},{key:"reportMissingFeature",value:function(e){this.missingFeatures.includes(e)||(console.error("Missing feature ".concat(e)),this.missingFeatures.push(e))}}]),a}(),Pb=function(a){Yi(t,Xs);var e=qi(t);function t(){var i;return Mt(this,t),(i=e.call(this)).featureList={Perimeter:{color:new H(1,.9,.3,1),perimeter:!1,support:!1},"External perimeter":{color:new H(1,.5,.2,1),perimeter:!0,support:!1},"Internal infill":{color:new H(.59,.19,.16,1),perimeter:!1,support:!1},"Solid infill":{color:new H(.59,.19,.8,1),perimeter:!1,support:!1},"Top solid infill":{color:new H(.95,.25,.25,1),perimeter:!0,support:!1},"Bridge infill":{color:new H(.3,.5,.73,1),perimeter:!1,support:!1},"Gap fill":{color:new H(1,1,1,1),perimeter:!1,support:!1},Skirt:{color:new H(0,.53,.43,1),perimeter:!1,support:!1},"Skirt/Brim":{color:new H(0,.53,.43,1),perimeter:!1,support:!1},"Supported material":{color:new H(0,1,0,1),perimeter:!1,support:!0},"Supported material interface":{color:new H(0,.5,0,1),perimeter:!1,support:!0},Custom:{color:new H(.5,.5,.5,1),perimeter:!1,support:!1},Unknown:{color:new H(.5,.5,.5,1),perimeter:!1,support:!1},"Support material":{color:new H(.5,.5,.5,1),perimeter:!1,support:!0},"Support material interface":{color:new H(.5,.5,.5,1),perimeter:!1,support:!0},"Overhang perimeter":{color:new H(.5,.5,.5,1),perimeter:!0,support:!1},"Wipe tower":{color:new H(.5,.5,.5,1),perimeter:!0,support:!1}},i}return Pt(t,[{key:"isTypeComment",value:function(i){return!!i.trim().startsWith(";TYPE:")&&(this.feature=i.substring(6).trim(),!0)}},{key:"getFeatureColor",value:function(){if(Object.prototype.hasOwnProperty.call(this.featureList,this.feature))try{return this.featureList[this.feature].color}catch{this.reportMissingFeature(this.feature)}return this.unknownFeatureColor}},{key:"isPerimeter",value:function(){try{return this.featureList[this.feature].perimeter}catch{return this.reportMissingFeature(this.feature),!0}}},{key:"isSupport",value:function(){try{return this.featureList[this.feature].support}catch{return this.reportMissingFeature(this.feature),!1}}},{key:"processComments",value:function(i,s){try{for(var n=i.length-350;n{},this.hasSpindle=!1,this.voxelWidth=1,this.voxelHeight=1,this.forceVoxels=!1,this.renderInstances=new Array,this.meshIndex=0,this.highQualityExtrusion=!1,this.perimeterOnly=!1,this.lastUpdate=Date.now(),this.g1AsExtrusion=!1,this.firstGCodeByte=0,this.lastGCodeByte=0,this.zBelt=!1,this.gantryAngle=45*Math.PI/180,this.hyp=Math.cos(this.gantryAngle),this.adj=Math.tan(this.gantryAngle),this.currentZ=0,this.beltLength=100,this.nozzleStartPosition=new v(0,0,0),this.nozzlePosition=new v(0,0,0),this.nozzleFeedRate=0,this.firmwareRetraction=!1,this.inches=!1,this.fixRadius=!1,this.csysContainers=new Array,this.lastCommand="G0",this.arcPlane="XY",this.workplaceOffsets=[new v(0,0,0),new v(0,0,0)],this.currentWorkplace=0,this.progressMode=!1,this.transparentValue=.25,this.hasMixing=!1,this.renderAnimation=!0}var e,t,i,s,n;return Pt(a,[{key:"doUpdate",value:function(){this.lastUpdate=Date.now()}},{key:"setProgressColor",value:function(r){var o=this;this.progressColor=H.FromHexString(r.padEnd(9,"F")),this.renderInstances.forEach(h=>h.progressColor=o.progressColor)}},{key:"getMaxHeight",value:function(){return this.maxHeight+1}},{key:"getMinHeight",value:function(){return this.minHeight}},{key:"setRenderQualitySettings",value:function(r,o){if(this.forceVoxels)return this.renderVersion=Ss.Voxel,this.meshBreakPoint=Rl,void(this.lines=new Array(Rl));this.lines=new Array(1.5*this.meshBreakPoint),o===void 0&&(o=1);var h=0,l=this.forceWireMode?2:1,c=2;switch(this.refreshTime=5e3,this.everyNthRow=1,this.renderTravels=!0,o){case 1:l=2,this.refreshTime=3e4,h=25e3,c=50,this.renderTravels=!1;break;case 2:l=2,this.refreshTime=3e4,h=5e5,c=10,this.renderTravels=!1;break;case 3:h=1e6,c=3;break;case 4:h=15e6,c=2;break;case 5:h=25e6;break;default:return this.renderVersion=Ss.Block,void(this.everyNthRow=1)}for(var u=l;u<4;u++){var f=void 0;switch(u){case 1:f=24;break;case 2:f=2;break;case 3:f=1}for(var d=this.everyNthRow;d<=c;d++)if(this.debug&&console.log("Mode: "+u+" NRow: "+d+" vertexcount: "+r*f/d),r*f/d0&&(_.extruding=!0,this.maxHeight=this.currentPosition.y);break;case"F":if(this.currentFeedRate=Number(m.substring(1)),_.feedRate=this.currentFeedRate,this.currentFeedRate>this.maxFeedRate&&(this.maxFeedRate=this.currentFeedRate),this.currentFeedRate=1?this.maxFeedColor:b<=0?this.minFeedColor:H.Lerp(this.minFeedColor,this.maxFeedColor,b)}}}if(this.zBelt&&(this.beltLength=this.currentPosition.z1&&_.extruding&&(this.currentPosition.y>this.currentZ&&(this.currentRowIdx++,this.currentRowIdx%3==0&&this.currentRowIdx++,this.currentZ=this.currentPosition.y),this.currentRowIdx%this.everyNthRow==0&&this.currentRowIdx>2)))){var I=this.hasSpindle&&c[0]==="G1",T=this.g1AsExtrusion||_.length()>=this.lineLengthTolerance;l&&(this.renderedLines.push(_),_.extruding&&this.lastZExtrusionthis.currentLayerHeight&&!this.isSupport&&p&&(this.previousLayerHeight=this.currentLayerHeight,this.currentLayerHeight=this.currentPosition.y)):this.renderTravels&&!_.extruding&&(_.color=new H(1,0,0,1),this.travels.push(_)),this.zBelt?_.layerHeight=Math.abs(this.currentLayerHeight-this.previousLayerHeight):this.g1AsExtrusion?_.layerHeight=1:_.layerHeight=this.currentLayerHeight-this.previousLayerHeight)}}},{key:"g2g3",value:function(r,o,h,l){var c=this,u=r.split(/(?=[GXYZIJKFREUVAB])/),f=r.indexOf("E")>0||this.g1AsExtrusion,d=u.filter(g=>g==="G2"||g==="G02"),_={position:this.currentPosition.clone(),points:[]};try{_=function(g,m,b,I,T,x,y){for(var R=new v(m.x,m.z,m.y),E=R.clone(),C=0,S=0,w=0,P=g.some(ji=>ji.includes("G2")),G=0;G=0)q=Math.sqrt(V/M);else if(V<-.02*Math.pow(w,2)){if(!T)return console.error("G2/G3: Radius too small"),{position:{x:E.x,y:E.z,z:E.y},points:[]};var he=Math.sqrt(Math.pow(z/2,2)+Math.pow(k/2,2));V=Math.pow(he,2)-M/4,q=Math.sqrt(V/M)}(P&&w<0||!P&&w>0)&&(q=-q),C=z/2+k*q,S=k/2-z*q}else if(C===0&&S===0)return{position:R.clone(),points:[]};var pe,se=R[W]===E[W]&&R[K]===E[K],ue=R[W]+C,me=R[K]+S,ne=Math.sqrt(C*C+S*S),Ie=Math.atan2(-S,-C),Se=Math.atan2(E[K]-me,E[W]-ue);se?pe=2*Math.PI:(pe=P?Ie-Se:Se-Ie)<0&&(pe+=2*Math.PI);var Q=ne*pe/I;Q<1&&(Q=1);var be=pe/Q;be*=P?-1:1;for(var Be=new Array,ze=(E[ce]-R[ce])/Q,Ke=R[W],Rt=R[K],Ct=R[ce],Ge=Ie,Jt=0;Jt{var b=new Tl;b.tool=c.currentTool,b.gcodeLineNumber=o,b.gcodeFilePosition=h,b.feedRate=c.currentFeedRate,b.isPerimeter=c.slicer.isPerimeter(),c.g1AsExtrusion?b.layerHeight=1:b.layerHeight=c.currentLayerHeight-c.previousLayerHeight,b.start=p.clone(),b.end=new v(g.x,g.y,g.z),b.extruding=f,b.color=f?c.currentColor.clone():new H(1,0,0,1),c.debug&&(b.color=d?new H(0,1,1,1):new H(1,1,0,1),m===0&&(b.color=new H(0,1,0,1))),p=b.end.clone(),c.debug&&console.log(b),l&&(c.renderedLines.push(b),b.extruding?c.lines[c.linesIndex++]=b:c.travels.push(b))}),this.currentPosition=new v(p.x,p.y,p.z),this.currentPosition.y>this.currentLayerHeight&&!this.isSupport&&(this.previousLayerHeight=this.currentLayerHeight,this.currentLayerHeight=this.currentPosition.y)}},{key:"m567",value:function(r){var o=r.split(/(?=[PE])/),h=[1,1,1];if(this.colorMode!==ts.Feed){for(var l=1;l0&&(this.firstGCodeByte=f),this.lastGCodeByte=f,this.processLine(_,d,f,p)),!(Date.now()-this.timeStamp>10)){g.next=33;break}return this.loadingProgressCallback&&this.loadingProgressCallback(f/o.length,"Loading File..."),g.next=32,kr();case 32:this.timeStamp=g.sent;case 33:this.doUpdate(),g.next=19;break;case 36:if(this.layerDictionary.push(o.length),!this.renderTravels){g.next=40;break}return g.next=40,this.createTravelLines(this.scene);case 40:this.loadingProgressCallback&&this.loadingProgressCallback(1),o={};case 42:case"end":return g.stop()}},r,this)})),function(r,o,h){return n.apply(this,arguments)})},{key:"loadingComplete",value:function(){this.renderInstances.forEach(r=>r.isLoading=!1),this.updateFilePosition(Number.MAX_VALUE-1),this.updateFilePosition(Number.MAX_VALUE)}},{key:"processLine",value:(s=Gi(It().mark(function r(o,h,l){var c,u,f,d,_,p,g,m,b,I,T,x,y,R=arguments;return It().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(c=!(R.length>3&&R[3]!==void 0)||R[3],(u=o.indexOf(";"))>-1&&(o=o.substring(0,u-1).trim()),o=o.toUpperCase(),(d=o.match(/[GM]+[0-9.]+/g))===null&&o.match(/[XYZ]+[+-]?[0-9.]+/g)!==null&&(d=this.lastCommand),_=o.trim().split(/[GM]+[0-9.]+/g),!d){E.next=62;break}p=0;case 9:if(!(pC.trim()==="X")&&(this.currentPosition.x=this.workplaceOffsets[this.currentWorkplace].x),f.some(C=>C.trim()==="Y")&&(this.currentPosition.z=this.workplaceOffsets[this.currentWorkplace].y),f.some(C=>C.trim()==="Z")&&(this.currentPosition.y=this.workplaceOffsets[this.currentWorkplace].z)),E.abrupt("break",56);case 32:return E.abrupt("break",56);case 33:return this.currentWorkplace=54-Number(d[p].substring(1)),this.currentPosition=this.workplaceOffsets[this.currentWorkplace].clone(),E.abrupt("break",56);case 36:return this.currentWorkplace=10*(58.6-Number(d[p].substring(1))),this.currentPosition=this.workplaceOffsets[this.currentWorkplace].clone(),E.abrupt("break",56);case 39:return this.absolute=!0,E.abrupt("break",56);case 41:return this.absolute=!1,E.abrupt("break",56);case 43:return E.abrupt("break",56);case 44:return this.hasSpindle=!0,E.abrupt("break",56);case 46:return g=o.split(/(?=[SM])/),(m=(m=g.filter(C=>C.startsWith("S")))[0]?Number(m[0].substring(1)):0)>0&&(this.hasSpindle=!0),E.abrupt("break",56);case 51:return this.hasMixing=!0,this.m567(o),E.abrupt("break",56);case 54:try{this.currentTool++,this.currentTool>=this.tools.length&&(this.currentTool=0),this.colorMode!==ts.Feed&&(this.currentColor=this.tools[this.currentTool].color.clone())}catch(C){console.log(C)}return E.abrupt("break",56);case 56:this.lastCommand=d;case 57:p++,E.next=9;break;case 60:E.next=64;break;case 62:o.startsWith("T")&&(b=Number.parseInt(o.substring(1),10),isNaN(b)||(this.currentPosition.z+=10,this.currentTool=b,this.currentTool>=this.tools.length?this.currentTool=this.currentTool%this.tools.length:b<0&&(this.currentTool=0),this.colorMode!==ts.Feed&&((y=Number(o.substring(1))%this.extruderCount)<0&&(y=0),this.currentColor=(I=(T=this.tools[y])===null||T===void 0||(x=T.color)===null||x===void 0?void 0:x.clone())!==null&&I!==void 0?I:new de(1,0,0)))),this.debug;case 64:if(!(this.linesIndex>=this.meshBreakPoint)){E.next=71;break}return E.next=67,this.createMesh(this.scene);case 67:return E.next=69,kr();case 69:this.doUpdate(),this.meshIndex++;case 71:case"end":return E.stop()}},r,this)})),function(r,o,h){return s.apply(this,arguments)})},{key:"createMesh",value:(i=Gi(It().mark(function r(o){var h,l,c;return It().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(this.zBelt&&(h=this.lines[this.linesIndex-1].layerHeight,this.lines.forEach(f=>{f.layerHeight=h})),this.renderVersion===Ss.Line||this.renderVersion===Ss.Point?l=new Al(o,this.specularColor,this.loadingProgressCallback,this.renderFuncs,this.tools,this.meshIndex):this.renderVersion===Ss.Block?l=this.highQualityExtrusion?new Sb(o,this.specularColor,this.loadingProgressCallback,this.renderFuncs,this.tools,this.meshIndex):new Cb(o,this.specularColor,this.loadingProgressCallback,this.renderFuncs,this.tools,this.meshIndex):this.renderVersion===Ss.Voxel&&(l=new df(o,this.specularColor,this.loadingProgressCallback,this.renderFuncs,this.tools,this.voxelWidth,this.voxelHeight)),l.progressColor=this.progressColor,l.vertexAlpha=this.vertexAlpha,l.g1AsExtrusion=this.g1AsExtrusion,l.progressMode=this.progressMode,l.transparentValue=this.transparentValue,l.hasMixing=this.hasMixing,l.colorMode=this.colorMode,l.renderAnimation=this.renderAnimation,l.persistTravels=this.persistTravels,this.renderInstances.push(l),!((c=this.lines.slice(0,this.linesIndex-1))!=null&&c.length>0)){u.next=16;break}return u.next=16,l.render(c);case 16:this.linesIndex=0;case 17:case"end":return u.stop()}},r,this)})),function(r){return i.apply(this,arguments)})},{key:"chunk",value:function(r,o){for(var h=[],l=0,c=r.length;lh.updateFilePosition(r));try{rr+5);o++)this.currentLineNumber=this.renderedLines[o].gcodeLineNumber,this.nozzleStartPosition=this.renderedLines[o].start,this.nozzlePosition=this.renderedLines[o].end,this.nozzleFeedRate=this.renderedLines[o].feedRate,this.lastFilePositionIndex=o;this.doUpdate()}},{key:"updateFilePositionIndex",value:function(r){var o=this;r>=this.renderedLines.length||(this.currentLineNumber=this.renderedLines[r].gcodeLineNumber,this.nozzleStartPosition=this.renderedLines[r].start,this.nozzlePosition=this.renderedLines[r].end,this.nozzleFeedRate=this.renderedLines[r].feedRate,this.lastFilePositionIndex=r,this.renderInstances.forEach(h=>h.updateFilePosition(o.renderedLines[r].gcodeFilePosition)),this.doUpdate())}},{key:"doFinalPass",value:function(){var r=this;this.liveTracking=!0,this.gcodeFilePosition=Number.MAX_VALUE,setTimeout(()=>{r.liveTracking=!1},this.refreshTime+200)}},{key:"updateMesh",value:function(){this.renderVersion===1?console.log("Version 1"):this.renderVersion===2&&console.log("Version 2")}},{key:"unregisterEvents",value:function(){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:s0.Extruder,l=new fr;l.color=H.FromHexString(r.padEnd(9,"F")),l.updateDarkerValue(),l.diameter=o,l.toolType=h,this.tools.push(l)}},{key:"updateTool",value:function(r,o,h){h{if(h.material!==null&&Object.prototype.hasOwnProperty.call(h.material,"specularColor"))try{h.material.specularColor=o}catch(l){console.error(l)}}),this.scene&&this.scene.render(!0,!0)}},{key:"g1AsExtrusion",value:function(r){this.g1AsExtrusion=r}},{key:"cancel",value:(e=Gi(It().mark(function r(){return It().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return this.cancelLoad=!0,o.next=3,this.pauseProcessing();case 3:case"end":return o.stop()}},r,this)})),function(){return e.apply(this,arguments)})},{key:"setZBeltAngle",value:function(r){this.gantryAngle=(90-r)*Math.PI/180,this.hyp=Math.cos(this.gantryAngle),this.adj=Math.tan(this.gantryAngle)}},{key:"setTransparencyValue",value:function(r){this.transparentValue=r,this.renderInstances.forEach(o=>{o.transparentValue=r})}},{key:"setRenderAnimation",value:function(r){var o=this;this.renderAnimation=r,this.renderInstances.forEach(h=>h.renderAnimation=o.renderAnimation)}},{key:"setTravelPersistence",value:function(r){var o=this;this.persistTravels=r,this.renderInstances.forEach(h=>{h.persistTravels=o.persistTravels})}}]),a}(),Il=0,Ub=1,kb=function(){function a(e){Mt(this,a),this.buildVolume={x:{min:0,max:100},y:{min:0,max:100},z:{min:0,max:100}};var t=localStorage.getItem("buildVolume");t!==null&&(this.buildVolume=JSON.parse(t)),this.renderMode=Number.parseInt(localStorage.getItem("renderBedMode"),10),this.renderMode||(this.renderMode=Il),this.bedMesh,this.isDelta=!1,this.scene=e,this.registerClipIgnore=()=>{},this.bedLineColor="#0000FF",this.getBedColor()||this.setBedColor("#0000FF"),this.planeMaterial=this.buildGridMaterial(),this.boxMaterial=new ee("bedBoxMaterial",this.scene),this.boxMaterial.alpha=0,this.debug=!1}return Pt(a,[{key:"setRenderMode",value:function(e){this.renderMode=e,localStorage.setItem("renderBedMode",this.renderMode),this.bedMesh&&(this.scene.removeMesh(this.bedMesh),this.bedMesh.dispose(!1,!0)),this.buildBed(),this.scene.render()}},{key:"buildBed",value:function(){if(!(this.renderMode>1||this.debug)){if(this.bedMesh&&this.bedMesh.isDisposed()&&(this.bedMesh=null),this.bedMesh)return this.bedMesh;switch(this.renderMode){case Il:this.buildFlatBed();break;case Ub:this.buildBox()}return this.bedMesh}}},{key:"setDelta",value:function(e){this.isDelta=e,this.setRenderMode(this.renderMode)}},{key:"buildFlatBed",value:function(){var e=this.getCenter(),t=this.getSize();if(this.isDelta){var i=Math.abs(this.buildVolume.x.max-this.buildVolume.x.min)/2;this.bedMesh=Zt.CreateDisc("BuildPlate",{radius:i},this.scene),this.bedMesh.rotationQuaternion=re.RotationAxis(new v(1,0,0),Math.PI/2),this.bedMesh.material=this.planeMaterial}else{var s=t.x,n=t.y;this.bedMesh=Zt.CreatePlane("BuildPlate",{width:s,height:n},this.scene),this.bedMesh.material=this.planeMaterial,this.bedMesh.rotationQuaternion=re.RotationAxis(new v(1,0,0),Math.PI/2),this.bedMesh.translate(new v(e.x,0,e.y),1,ci.WORLD)}this.registerClipIgnore(this.bedMesh)}},{key:"getCenter",value:function(){return{x:(this.buildVolume.x.max+this.buildVolume.x.min)/2,y:(this.buildVolume.y.max+this.buildVolume.y.min)/2,z:(this.buildVolume.z.max+this.buildVolume.z.min)/2}}},{key:"getSize",value:function(){return{x:Math.abs(this.buildVolume.x.max-this.buildVolume.x.min),y:Math.abs(this.buildVolume.y.max-this.buildVolume.y.min),z:Math.abs(this.buildVolume.z.max-this.buildVolume.z.min)}}},{key:"buildBox",value:function(){var e=this,t=this.getSize(),i=this.getCenter();if(this.isDelta)this.bedMesh=Zt.CreateCylinder("bed",{diameterTop:t.x,diameterBottom:t.x,height:t.z},this.scene),this.bedMesh.position.x=i.x,this.bedMesh.position.y=i.z,this.bedMesh.position.z=i.x,this.bedMesh.alpha=0,this.bedMesh.diffuseColor=new H(0,0,0,0),this.bedMesh.isPickable=!1,this.bedMesh.enableEdgesRendering(void 0,!0),this.bedMesh.renderingGroupId=2,this.scene.setRenderingAutoClearDepthStencil(2,!1,!1,!1),new kt("hl",this.scene,{isStroke:!0,blurTextureSizeRatio:3}).addMesh(this.bedMesh,this.getBedColor4()),this.bedMesh.onBeforeRenderObservable.add(()=>{e.scene.getEngine().setColorWrite(!1)}),this.bedMesh.onAfterRenderObservable.add(()=>{e.scene.getEngine().setColorWrite(!0)}),this.registerClipIgnore(this.bedMesh);else{this.bedMesh=Zt.CreateBox("bed",{width:t.x,depth:t.y,height:t.z},this.scene);var s=this.getCenter();this.bedMesh.position.x=s.x-this.buildVolume.x.min,this.bedMesh.position.y=s.z-this.buildVolume.z.min,this.bedMesh.position.z=s.y-this.buildVolume.y.min,this.bedMesh.diffuseColor=new H(0,0,0,0),this.bedMesh.enableEdgesRendering(),this.bedMesh.edgesWidth=100,this.bedMesh.material=this.boxMaterial,this.bedMesh.isPickable=!1,this.bedMesh.edgesColor=this.getBedColor4(),this.registerClipIgnore(this.bedMesh)}}},{key:"setVisibility",value:function(e){this.bedMesh&&this.bedMesh.setEnabled(e)}},{key:"commitBedSize",value:function(){localStorage.setItem("buildVolume",JSON.stringify(this.buildVolume)),this.setRenderMode(this.renderMode)}},{key:"buildGridMaterial",value:function(){var e=new zt("bedMaterial",this.scene);return e.mainColor=new H(0,0,0,0),e.lineColor=de.FromHexString(this.getBedColor()),e.gridRatio=5,e.opacity=.8,e.majorUnitFrequency=10,e.minorUnitVisibility=.6,e.gridOffset=new v(0,0,0),e}},{key:"getBedColor",value:function(){return localStorage.getItem("bedLineColor")}},{key:"setBedColor",value:function(e){localStorage.setItem("bedLineColor",e),this.renderMode>1||this.planeMaterial&&(this.planeMaterial=this.buildGridMaterial(),this.dispose(),this.buildBed(),this.scene.render())}},{key:"getBedColor4",value:function(){return H.FromHexString(this.getBedColor().padEnd(9,"F"))}},{key:"dispose",value:function(){this.bedMesh&&!this.bedMesh.isDisposed&&this.bedMesh.dispose(!1,!0)}}]),a}(),Vb=function(){function a(e){Mt(this,a),this.scene=e,this.checkerBoard="iVBORw0KGgoAAAANSUhEUgAAAQEAAAEBCAIAAAD3joeqAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALnSURBVHhe7dZBEYQwFAVBWBtogAv+IhIEsZd4yGG6L/lPwFRl31jqPM/neeZghd98oUoD1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjTAHUaoE4D1GmAOg1QpwHqNECdBqjb7/ueJyscxzHGmIMV9u/75skK7/te1zUHK/gLUacB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA9RpgDoNUKcB6jRAnQao0wB1GqBOA7Rt2x+drw1hSNi5LQAAAABJRU5ErkJggg==",this.xmark="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPQAAADPCAMAAAD1TAyiAAAAkFBMVEX39/eZAAD8//+TAACWAACRAAD4+vr5/PyaAAD39fX18vLy6enr29v18PDm0dG1Y2PewMDYtbWuUFDkzc2jLy+iKSnLlpbRpKS/enrIjo6hJCTbu7u8dHSxWFi4a2vEh4eoOzudEhKdEBDPn5+pQUHq2dmsSUmnODjUqqqhJye0YGCeGRnIk5OrTEy6b2+fHh7/wUBWAAAIiElEQVR4nO2d2ULbOhRF4yNFijNAQiCBMoShhBTo7f//3bUc2kLIIOnsI6ut90v7hLS8ZCVWZJ1Op02bNm3atGnTps0fGGOsizGm6Z4kiiHqDMeT+Wo1vxwPS6IGwI2lqt3qqlf/WPH2DZnpYqnVz3SL5cXUpuWumnucL66Xp1WW14v5UUlWsDlDw0VPaV28i9aqWAyTYRsqJ8fVRdfrXlT/VP9/nvTFOkDDY/UB+Be4uhmSUKMbXRgsis990EqfD0Q6YMvz7cjrZs9Ledm2v7MLVQdG+EFO07udyC7q5UhaNk2KPV3QxSW6A/TQ3Yfs0n0QpTblsTrQgRvsRyhdHWiwln0lSG0Hp3tHWi37dASkpkMX+Y36WIzaDvVBZjeZD2HUXp5r6nMhajPw64C+R7mmC09mMeqK2cNzTX2HoaaJN7MQtRn0PJkr6q+ITy4zCGAWmc2st2dYB2gZ0GIhMJvZR3/PdQcu2a7tKkg0nrqatwM70Otz2yx7gU2Cqe1jcPuaO6/QLFQ0ljrcs2t/wJvBTXiTSGr7GMHMVW0uI0TjqKM8u+ZHnFbpOK5VDHWcZ9f6ijWBxzVaU7MXr2I9V+N7ybjk5ihudNfUJ8wHPZrGMlfUjPFt5/HQheZRc5gLNY5vmv5jNMyjpinjehf6Nf6mpu8c6Io6+r5mea5afo6/qc0Lp2WGa57nKreMmYzXcrRrpucqvXjmzsHVwMPUEa7Znqt2m4SOoeZ7Lopuo9CFvg38GYDGbM88aP4ld9SdEGoIc6HimeOesTYT5JrGgNFVJR6aviJUF/rJ2zXGc1F8Y3w5iX3I2oi3a5RnfR3/OW0fMNC+rlGeC71gfCPjf2D+7IXPbAZjLtSE8UBdgkx7ucYx81bJ6BpHfdrf3xGKXJraljPOuk3sGtm26LO9s1nQr0eHmprx1vvDl713d+V0DzVdYubtOsw1YHrFXf/K9c4RThMgM+dpuk4fdlMXe1wj7+dK9BFzTZI4y2SfssM11DPrm8lb7OG9HiEd2uYa67lQ/D0YZgjt0RbXWM+FmiF+oF5B+6RfNqZWCv4xeP/f5yyPvevVObZXdx+oaQ69pkXB/MnyV7+usdTvXWMnSjdzo3ZLWjD1b9doz2qM2xBgT2So0Z670P2hMq7hnsF7YiVc5+25pvbbH+qbajbL3bML3YBd++++9IqaSmzRBFOHbAP0iAwznhoZKeacqeWY86WWZM6VWpY5T2ppZrf5JjdqeWb4kyY7WvyFsJra9z2WJNGwZ8kD1Bm5TsWck2vcmoEHdSau03muqbNwndJzTZ2B67Se86BO7bmmvgCv3YZmmJ456B3Mv4a5YdcNMTfpWjfG3KDrBpkbc90oc0OuG2ZuwLVuntnrNBAo8/2geWZHndB1xZzHeWAJXWfDnNB1RszJXGfFnMj1xm6V5pPAtdaZMeN3Unxmzs2zC3gP3CfmL8gjqGARpd6zg7jZCFLrL5kyC1Jn69kF+U7Ce+Z8PbuIuM7as4uA68w9u9AEu2uoKJ6yZ+4Yc4Zl1qs0p88yYvpPaNMqd2pTQl/5WEf4GFZuTAn37AJ5LUMqIp5dMnYt5NlF5Upt+kKeXbp5jnCxsb1Olq7N6Ickc5auTf+LLHOGrsU9u2TmOoFnF/WaEXUSzzX1RTbUiTzX1Lm4Tua5ps7DdVLmTKjNwKeEwN9F7X+cPo666fvaDO5TMzfuOqSEAJKacQgVgLkBzzW1VMEPH+ZGPDdK3ZjnBqltc54bo7bD5J9VjVPHH7P+51JXnptPYuoMPLskpc7Cs4u6SUadiWcXwWJsm8xNo75LItfRJUFkksQ1HWXFnMR1dswJXGfILO46S2Zh15ky1+WL/jlmV75IiJoYNZXEo05E9l0hymN86Cb2cVzENU3BR6bNRi9garhrQOmXD+nOCL3cpNGu8Z4Jv0kF/Mkl4Nn9WTP6hqVG/gpgJTyvqbGuu2PYCDfg5+d32yjQrgvU2y2mDzy4v9jY9Ai+rzXqtgbWpXDZ2C5jRmfIP9/lHl3/xow9f/vTRmasa1Ydz9+BlioouvNPncK6ZlcpcKFz6OjbtmHdjDAlquog7urAkvIHssVz3UgJpOaVJK5Dr0DRWz3X1B0cNauC0jr2HtWZnZ5rapxr/vjGVcza47luCOeaU8izDi1ww27/Szc46i63+AjdYjriccw6jJpTh7lOH1ag7fAx6yhq9cCbyWC3tNdx+qZzC6keytxwZUGvi3oep286iK/5mvmrtcV8SnuXTTB0wm+QC42ZvEPKJli+azY04ot3WHkMvuscoEPLY7Af37kTGQC6G1zih+tazXkfWfx7OqasEbNUFffLiZ0xoeNKOfEK+XSZx/1YZkm+2PJVLNcvzG+hzG9k8SW76Dm6Yf6jZcmB5pQpi6fmLyJwCqzzSrNFU6s+k5kzfWtmOTqKK9AFWBiMv6k1uyRIHDViCZheIpkBJUFiRjigUG3V8CxukEHKoES4hqz1d0YxN7UClX4Jdq2vMEVbIw44xpW7CS3adM+eutcpg5lRnl3CCn50p6Af5W1otXdsWaOQ0hfAoyLoJui2Rpdy8neNfaUj6K1w+JHjvq6xm4HNwB9aomwCLXxuMPSrO/bRc4QJHS3vc+Qu/vVi67f/V/eEjtOn8YEzCLREoVo79Dj5QP8QO6LY9vcuK6jlQGKbux08HRpiail47KOhy7tdHVB6RTItG7P/o0OrC6GW32JpdaY+Dzet7mcduXoNNL7fja1u5SstWju90kr/vtG0Vur6siPasDUPxVZsrV6kBtjHGLJHDzdf77RL7/Z6Ni7l26Vy/qQ2prTqai8nJllBEGOJyr5LSWTTnB1r6XH2vVBK1RdbqW7veT6gHGqgiKa61J3H8fzi9fX1YjIedFJd7sZjjF3H/CPAbdq0adOmTZs2bbD5H8lJpKRvNiuNAAAAAElFTkSuQmCC",this.buildObjectMeshes=new Array,this.labels=new Array,this.labelSVGS=new Array,this.baseMaterial=null,this.highlightMaterial=null,this.cancelledMaterial=null,this.cancelledHighlightMaterial=null,this.showCancelObjects=!1,this.objectCallback=null,this.renderFailedCallback=null,this.labelCallback=null,this.registerClipIgnore=null,this.getMaxHeight=null,this.alphaLevel=.5,this.observableControls=null,this.showLabel=localStorage.getItem("showObjectLabels"),this.showLabel===null?this.showLabel=!0:this.showLabel=JSON.parse(this.showLabel),this.rebuildMaterials()}return Pt(a,[{key:"setBuildMaterial",value:function(e,t,i){i||(i=this.alphaLevel);var s=new ee(e,this.scene);return s.diffuseColor=t,s.specularColor=new de(0,0,0),s.alpha=i,s.needAlphaTesting=()=>!0,s.separateCullingPass=!0,s.backFaceCulling=!0,s}},{key:"rebuildMaterials",value:function(){this.baseMaterial=this.setBuildMaterial("BuildObjectBaseMaterial",new H(.1,.5,.1),.25),this.highlightMaterial=this.setBuildMaterial("BuildObjectHighlightMateria",new de(.8,.8,.8)),this.cancelledMaterial=this.setBuildMaterial("BuildObjectHighlightMateria",new de(1,0,0),.4),this.cancelledHighlightMaterial=this.setBuildMaterial("BuildObjectHighlightMateria",new de(1,1,0),.6);var e=ie.CreateFromBase64String(this.xmark,"checkerboard",this.scene);this.cancelledMaterial.diffuseTexture=e,this.cancelledHighlightMaterial.diffuseTexture=e}},{key:"loadObjectBoundaries",value:function(e){if(this.rebuildMaterials(),this.buildObjectMeshes.length>0){for(var t=0;twindow.URL.revokeObjectURL(o)),this.buildObjectMeshes=new Array,this.labels=new Array}if(e)for(var i=0;i'+r],{type:"image/svg+xml"}),h=window.URL.createObjectURL(o);this.labelSVGS.push(h);var l=Zt.CreatePlane("TextPlane",{width:i,height:8},this.scene);return l.material=new ee("TextPlaneMaterial",this.scene),l.material.backFaceCulling=!1,l.material.specularColor=new de(0,0,0),l.material.diffuseTexture=new ie(h,this.scene),l.material.diffuseTexture.hasAlpha=!0,l.billboardMode=7,this.registerClipIgnore(l),l}},{key:"buildObservables",value:function(){var e=this;if(!this.observableControls){var t=0,i=!1,s=0;this.observableControls=this.scene.onPointerObservable.add(n=>{var r=n.pickInfo;switch(n.type){case Ce.POINTERDOWN:i=!0,s=Date.now();break;case Ce.POINTERUP:if(i=!1,Date.now()-s>200)return;e.handleClick(r);break;case Ce.POINTERMOVE:if(i||Date.now()-t<100)return;t=Date.now(),e.handlePointerMove(r)}})}}},{key:"clearObservables",value:function(){this.observableControls&&(this.scene.onPointerObservable.remove(this.observableControls),this.observableControls=null)}},{key:"showObjectSelection",value:function(e){this.showCancelObjects=e,this.buildObjectMeshes.forEach(t=>t.setEnabled(e)),e?this.buildObservables():this.clearObservables()}},{key:"setObjectTexture",value:function(e){e.metadata&&(e.metadata.cancelled?(e.material=this.cancelledMaterial,e.enableEdgesRendering(),e.edgesWidth=15,e.edgesColor=new H(1,0,0,1)):(e.material=this.baseMaterial,e.enableEdgesRendering(),e.edgesWidth=15,e.edgesColor=new H(0,1,0,1)))}},{key:"handleClick",value:function(e){this.showCancelObjects&&e.hit&&e.pickedMesh&&e.pickedMesh.name.includes("OBJECTMESH")&&this.objectCallback&&this.objectCallback(e.pickedMesh.metadata)}},{key:"handlePointerMove",value:function(e){var t=this;this.showCancelObjects&&(this.buildObjectMeshes.forEach(i=>t.setObjectTexture(i)),e.hit&&e.pickedMesh&&e.pickedMesh.name.includes("OBJECTMESH")?(e.pickedMesh.material=e.pickedMesh.metadata.cancelled?this.cancelledHighlightMaterial:this.highlightMaterial,this.labelCallback&&this.labelCallback(e.pickedMesh.metadata.name)):this.labelCallback&&this.labelCallback(""))}},{key:"showLabels",value:function(e){localStorage.setItem("showObjectLabels",e),this.showLabel=e,this.labels.forEach(t=>t.setEnabled(e))}}]),a}(),Gb=function(){function a(e){Mt(this,a),this.visible=localStorage.getItem("axesVisible"),this.visible===null?this.visible=!0:this.visible=JSON.parse(this.visible),this.scene=e,this.registerClipIgnore=()=>{},this.axesMesh=null,this.axesMeshPosition=null,this.size=50,this.debug=!1}return Pt(a,[{key:"show",value:function(e){localStorage.setItem("axesVisible",e),this.axesMesh&&this.axesMesh.setEnabled(e),this.scene.render()}},{key:"makeTextPlane",value:function(e,t,i){var s=new Wn("DynamicTexture",50,this.scene,!0);s.hasAlpha=!0,s.drawText(e,5,40,"bold 36px Arial",t,"transparent",!0);var n=F.CreatePlane("TextPlane",i,this.scene,!0);return n.material=new ee("TextPlaneMaterial",this.scene),n.material.backFaceCulling=!1,n.material.specularColor=new de(0,0,0),n.material.diffuseTexture=s,n}},{key:"resize",value:function(e){this.size=e,this.axesMesh.dispose(!1,!0),this.render()}},{key:"render",value:function(e){var t=this;if(!this.debug)if(!this.axesMesh||this.axesMesh.isDisposed()){this.axesMesh=new F("axis",this.scene),this.registerClipIgnore(this.axesMesh);var i=F.CreateLines("axisX",[v.Zero(),new v(this.size,0,0),new v(.95*this.size,.05*this.size,0),new v(this.size,0,0),new v(.95*this.size,-.05*this.size,0)],this.scene);i.color=new de(1,0,0),i.parent=this.axesMesh;var s=this.makeTextPlane("X","red",this.size/10);s.billboardMode=7,s.position=new v(.9*this.size,.05*this.size,0),s.parent=this.axesMesh;var n=F.CreateLines("axisZ",[v.Zero(),new v(0,0,this.size),new v(0,-.05*this.size,.95*this.size),new v(0,0,this.size),new v(0,.05*this.size,.95*this.size)],this.scene);n.color=new de(0,1,0),n.parent=this.axesMesh;var r=this.makeTextPlane("Y","green",this.size/10);r.billboardMode=7,r.position=new v(0,.05*this.size,.9*this.size),r.parent=this.axesMesh;var o=F.CreateLines("axisY",[v.Zero(),new v(0,this.size,0),new v(-.05*this.size,.95*this.size,0),new v(0,this.size,0),new v(.05*this.size,.95*this.size,0)],this.scene);o.color=new de(0,0,1),o.parent=this.axesMesh;var h=this.makeTextPlane("Z","blue",this.size/10);h.billboardMode=7,h.position=new v(0,.9*this.size,-.05*this.size),h.parent=this.axesMesh,this.axesMesh.setEnabled(this.visible),this.axesMesh.getChildren().forEach(l=>t.registerClipIgnore(l)),e&&(this.axesMesh.position=e)}else e&&(this.axesMesh.position=e)}},{key:"dispose",value:function(){this.axesMesh&&this.axesMesh.dispose(!1,!0)}}]),a}(),Ze=null;function Zs(a,e,t){var i=function(s,n,r,o,h,l){var c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:75,u=uu("svg").attr("width",400).attr("height",300);u.append("rect").attr("x",0).attr("y",0).attr("width",400).attr("height",300).attr("fill","#333333"),u.append("text").attr("x",200).attr("y",150).attr("font-family","Roboto").attr("font-size",c+"px").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("fill",o).attr("stroke",r).attr("stroke-width",2).attr("text-rendering","optimizeLegibility").text(n);var f=u.attr("title","test2").attr("version",1.1).attr("xmlns","http://www.w3.org/2000/svg").node(),d='',_=new XMLSerializer().serializeToString(f),p=new Blob([d+_],{type:"image/svg+xml"}),g=window.URL.createObjectURL(p),m=Zt.CreatePlane("TextPlane",{width:h,height:l},s);return m.material=new ee("TextPlaneMaterial",s),m.material.backFaceCulling=!1,m.material.specularColor=new de(0,0,0),m.material.diffuseTexture=new ie(g,s),m.material.diffuseTexture.hasAlpha=!1,m}(a,e,"white","white",6,6,90);i.name=e,i.lookAt(t),i.position=t.scale(-3),e==="Top"&&i.rotate(Gt.Z,Math.PI/2,ci.LOCAL),e==="Bottom"&&i.rotate(Gt.Z,-Math.PI/2,ci.LOCAL),i.metadata={x:Math.sign(t.x),y:Math.sign(t.y),z:Math.sign(t.z)},i.isPickable=!0}function gs(a,e,t){var i=Zt.CreateSphere(e,{diameter:1.1},a),s=v.Zero();s.x=t.x-.25*Math.sign(t.x),s.y=t.y-.1*Math.sign(t.y),s.z=t.z-.25*Math.sign(t.z),i.metadata={x:-1*Math.sign(t.x),y:-1*Math.sign(t.y),z:-1*Math.sign(t.z)},i.position=s,i.isPickable=!0}var n0,Ma=null;function pi(a,e,t){Ma||((Ma=new ee("edgematerial",a)).diffuseColor=new de(.5,.5,.5));var i=Zt.CreateBox(e,{width:.35,height:5.8,depth:.35},a),s=v.Zero();t.y!==0&&(i.rotate(Gt.Z,Math.PI/2,ci.WORLD),t.x!==0&&i.rotate(Gt.Y,Math.PI/2,ci.WORLD),i.bakeCurrentTransformIntoVertices()),s.x=t.x-Math.sign(t.x),s.y=t.y-Math.sign(t.y),s.z=t.z-Math.sign(t.z),i.metadata={x:-1*Math.sign(t.x),y:-1*Math.sign(t.y),z:-1*Math.sign(t.z)},i.position=s,i.material=Ma}function zb(a,e,t){(Ze=new it(a)).autoClear=!1;var i=new tt("camera1",5*Math.PI/8,5*Math.PI/8,13,new v(0,0,0),Ze);i.viewport=new on(.85,.85,.15,.15),i.viewport.toGlobal(200,200),e.afterRender=()=>{Ze.render(),i.alpha=t.alpha,i.beta=t.beta,i.radius=15},new _n("light1",new v(0,1,0),Ze).intensity=.8,new _n("light2",new v(-1,-.5,0),Ze).intensity=.8;var s=3.9;pi(Ze,"FrontLeft",new v(-3.9,0,-3.9)),pi(Ze,"BackLeft",new v(-3.9,0,s)),pi(Ze,"BackRight",new v(s,0,s)),pi(Ze,"FrontRight",new v(s,0,-3.9)),pi(Ze,"TopFront",new v(0,s,-3.9)),pi(Ze,"TopBack",new v(0,s,s)),pi(Ze,"TopLeft",new v(-3.9,s,0)),pi(Ze,"TopRight",new v(s,s,0)),pi(Ze,"BottomFront",new v(0,-3.9,-3.9)),pi(Ze,"BottomBack",new v(0,-3.9,s)),pi(Ze,"BottomLeft",new v(-3.9,-3.9,0)),pi(Ze,"BottomRight",new v(s,-3.9,0)),gs(Ze,"FrontTopLeft",new v(-3,3,-3)),gs(Ze,"FrontTopRight",new v(3,3,-3)),gs(Ze,"BackTopLeft",new v(-3,3,3)),gs(Ze,"BackTopRight",new v(3,3,3)),gs(Ze,"FrontBottomLeft",new v(-3,-3,-3)),gs(Ze,"FrontBottomRight",new v(3,-3,-3)),gs(Ze,"BackBottomLeft",new v(-3,-3,3)),gs(Ze,"BackBottomRight",new v(3,-3,3)),Zs(Ze,"Front",new v(0,0,1)),Zs(Ze,"Right",new v(-1,0,0)),Zs(Ze,"Back",new v(0,0,-1)),Zs(Ze,"Left",new v(1,0,0)),Zs(Ze,"Top",new v(0,-1,0)),Zs(Ze,"Bottom",new v(0,1,0)),Ze.onPointerDown=(n,r)=>{r.distance>0&&n0&&(n0(r.pickedMesh.metadata),Ze.render(!0))}}var Wb=function(){function a(e){Mt(this,a),this.visible=!0,this.scene=e,this.workplacePoints=[],this.workplaceMeshes=[],this.registerClipIgnore=()=>{}}return Pt(a,[{key:"setOffsets",value:function(e){this.workplacePoints=e,this.render()}},{key:"makeTextPlane",value:function(e,t,i){var s=new Wn("DynamicTexture",50,this.scene,!0);s.hasAlpha=!0,s.drawText(e,5,40,"bold 36px Arial",t,"transparent",!0);var n=F.CreatePlane("TextPlane",i,this.scene,!0);return n.material=new ee("TextPlaneMaterial",this.scene),n.material.backFaceCulling=!1,n.material.specularColor=new de(0,0,0),n.material.diffuseTexture=s,n}},{key:"render",value:function(){if(this.workplaceMeshes.length>0){for(var e=0;e{},this.simulationStopped=()=>{},this.simLine=v.Zero(),this.isMMS=!1}var e,t,i,s;return Pt(a,[{key:"getMaxHeight",value:function(){return this.maxHeight}},{key:"getMinHeight",value:function(){return this.minHeight}},{key:"setCameraType",value:function(n){this.scene.activeCamera=n?this.orbitCamera:this.flyCamera}},{key:"setZClipPlane",value:function(n,r){this.zTopClipValue=-n,this.zBottomClipValue=r,r>n&&(this.zTopClipValue=r+1),this.scene.clipPlane=new Xt(0,1,0,this.zTopClipValue),this.scene.clipPlane2=new Xt(0,-1,0,this.zBottomClipValue),this.scene.render()}},{key:"isArcRotateCameraStopped",value:function(n){return n.inertialAlphaOffset===0&&n.inertialBetaOffset===0&&n.inertialRadiusOffset===0&&n.inertialPanningX===0&&n.inertialPanningY===0}},{key:"init",value:(s=Gi(It().mark(function n(r){var o,h,l=this;return It().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return r===void 0&&(r=!1),console.info("GCode Viewer - Sindarius - ".concat("3.7.16"," ")),c.next=4,Ye.IsSupportedAsync;case 4:if(!c.sent||!r){c.next=13;break}return console.log("WebGPU Supported"),this.engine=new Ye(this.canvas,{doNotHandleContextLost:!0}),c.next=10,this.engine.initAsync();case 10:console.log(this.engine),c.next=15;break;case 13:console.log("WebGPU Not Supported"),this.engine=new le(this.canvas,!0,{doNotHandleContextLost:!0});case 15:this.engine.enableOfflineSupport=!1,this.engine.setHardwareScalingLevel(1/window.devicePixelRatio),this.scene=new it(this.engine),this.scene.performancePriority=Ha.BackwardCompatible,this.debug,this.scene.clearColor=de.FromHexString(this.getBackgroundColor()),this.bed=new kb(this.scene),this.bed.registerClipIgnore=u=>{l.registerClipIgnore(u)},o=this.bed.getCenter(),this.orbitCamera=new tt("Camera",Math.PI/2,2.356194,250,new v(o.x,-2,o.y),this.scene),this.orbitCamera.attachControl(!1),this.orbitCamera.invertRotation=!1,this.orbitCamera.attachControl(this.canvas,!1),this.orbitCamera.maxZ=1e5,this.orbitCamera.lowerRadiusLimit=5,this.updateCameraInertiaProperties(),(h=new jr("light2",new v(0,1,-1),this.scene)).diffuse=new de(1,1,1),h.specular=new de(1,1,1),this.engine.runRenderLoop(()=>{if(!document.hidden){if(l.simulation){if(l.pause)return}else if(l.pause||Date.now()-l.gcodeProcessor.lastUpdate>l.renderTimeout&&l.isArcRotateCameraStopped(l.orbitCamera))return;if(l.simulation)try{l.runSimulation(),l.gcodeProcessor.doUpdate()}catch{l.simulation=!1,l.simulationStopped()}l.scene.render(!0),h.position=l.scene.cameras[0].position}}),this.buildObjects=new Vb(this.scene),this.buildObjects.getMaxHeight=()=>l.gcodeProcessor.getMaxHeight(),this.buildObjects.registerClipIgnore=u=>{l.registerClipIgnore(u)},this.bed.buildBed(),this.axes=new Gb(this.scene),this.axes.registerClipIgnore=u=>{l.registerClipIgnore(u)},this.axes.render(),this.workplace=new Wb(this.scene),this.workplace.registerClipIgnore=u=>{l.registerClipIgnore(u)},this.workplace.setOffsets(this.gcodeProcessor.workplaceOffsets),this.workplace.render(),this.resetCamera(),zb(this.engine,this.scene,this.orbitCamera),n0=u=>{console.log("viewbox callback",u),l.setViewboxCameraPosition(u)},setTimeout(()=>{l.forceRender()},1e3);case 50:case"end":return c.stop()}},n,this)})),function(n){return s.apply(this,arguments)})},{key:"setViewboxCameraPosition",value:function(n){var r=this.bed.getCenter(),o=this.bed.getSize();this.scene.activeCamera.radius=1.5*o.x,this.scene.activeCamera.target=new v(r.x,r.z,r.y);var h=v.Zero(),l=(n.x===0?1:0)+(n.y===0?1:0)+(n.z===0?1:0)==2?1.75:1.35;switch(n.x){case 1:h.x=r.x-o.x*l;break;case 0:h.x=r.x;break;case-1:h.x=r.x+o.x*l}switch(n.y){case 1:h.y=r.z-o.z*l;break;case 0:h.y=r.z;break;case-1:h.y=r.z+o.z*l}switch(n.z){case 1:h.z=r.y-o.y*l;break;case 0:h.z=r.y;break;case-1:h.z=r.y+o.y*l}n.x===0&&n.z===0?(this.scene.activeCamera.target=new v(r.x,0,r.y),this.scene.activeCamera.position=h,this.scene.activeCamera.alpha=3*Math.PI/2):this.scene.activeCamera.position=h,this.scene.render(!0),this.scene.render(!0)}},{key:"resize",value:function(){this.engine.resize(),this.scene.render(!0)}},{key:"refreshUI",value:function(){setTimeout(()=>{},0)}},{key:"resetCamera",value:function(){var n=this.bed.getCenter(),r=this.bed.getSize();this.bed.isDelta?(this.scene.activeCamera.radius=n.x,this.scene.activeCamera.target=new v(n.x,-2,n.y),this.scene.activeCamera.position=new v(-r.x,r.z,-r.x)):(this.scene.activeCamera.radius=3*n.x,this.scene.activeCamera.target=new v(n.x,-2,n.y),this.scene.activeCamera.position=new v(-r.x/2,r.z,-r.y/2)),this.scene.render(!0),this.scene.render(!0)}},{key:"lastLoadFailed",value:function(){return!!localStorage&&localStorage.getItem(this.lastLoadKey)==="true"}},{key:"setLoadFlag",value:function(){localStorage&&localStorage.setItem(this.lastLoadKey,"true")}},{key:"clearLoadFlag",value:function(){localStorage&&(localStorage.setItem(this.lastLoadKey,""),localStorage.removeItem(this.lastLoadKey))}},{key:"processFile",value:(i=Gi(It().mark(function n(r){return It().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:this.clearScene(),this.refreshUI(),r?(this.fileData=r,this.fileSize=r.length):(this.fileData=0,this.fileSize=0),this.fileDataArray=[];try{this.fileData===null&&this.fileData===""||(this.fileDataArray=this.fileData.split("\n"))}catch{this.fileDataArray=[]}return this.gcodeProcessor.setProgressColor(this.getProgressColor()),this.gcodeProcessor.scene=this.scene,this.lastLoadFailed()&&(console.error("Last rendering failed dropping to SBC quality"),this.updateRenderQuality(1),this.clearLoadFlag()),this.setLoadFlag(),o.next=11,this.gcodeProcessor.processGcodeFile(r,this.renderQuality);case 11:return this.clearLoadFlag(),o.next=14,this.gcodeProcessor.createMesh(this.scene);case 14:this.gcodeProcessor.loadingComplete(),this.maxHeight=this.gcodeProcessor.getMaxHeight(),this.minHeight=this.gcodeProcessor.getMinHeight(),this.toggleTravels(this.travelVisible),this.setCursorVisiblity(this.toolCursorVisible),this.gcodeProcessor.zBelt&&(this.bed.buildVolume.y.min=this.gcodeProcessor.beltLength,this.bed.buildVolume.y.max=0,this.bed.dispose(),this.bed.buildBed());case 20:case"end":return o.stop()}},n,this)})),function(n){return i.apply(this,arguments)})},{key:"toggleTravels",value:function(n){var r,o=function(l,c){var u=typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(!u){if(Array.isArray(l)||(u=oo(l))||c){u&&(l=u);var f=0,d=()=>{};return{s:d,n:()=>f>=l.length?{done:!0}:{done:!1,value:l[f++]},e:m=>{throw m},f:d}}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 _,p=!0,g=!1;return{s:()=>{u=u.call(l)},n:()=>{var m=u.next();return p=m.done,m},e:m=>{g=!0,_=m},f:()=>{try{p||u.return==null||u.return()}finally{if(g)throw _}}}}(this.scene.meshes);try{for(o.s();!(r=o.n()).done;){var h=r.value;h.name==="travels"&&(h.isVisible=n)}}catch(l){o.e(l)}finally{o.f()}this.travelVisible=n,this.scene.render(!0)}},{key:"getProgressColor",value:function(){var n=localStorage.getItem("progressColor");return n===null&&(n="#FFFFFF"),n}},{key:"setProgressColor",value:function(n){localStorage.setItem("progressColor",n),this.gcodeProcessor.setProgressColor(n)}},{key:"getBackgroundColor",value:function(){var n=localStorage.getItem("sceneBackgroundColor");return n===null&&(n="#000000"),n}},{key:"setBackgroundColor",value:function(n){this.scene!==null&&this.scene!==void 0&&(n.length>7&&(n=n.substring(0,7)),this.scene.clearColor=de.FromHexString(n),this.scene.render()),localStorage.setItem("sceneBackgroundColor",n)}},{key:"clearScene",value:function(n){this.fileData&&n&&(this.fileData=""),this.gcodeProcessor.unregisterEvents();for(var r=this.scene.meshes.length-1;r>=0;r--){var o=this.scene.meshes[r];o&&this.debug&&console.log("Disposing ".concat(o.name)),this.scene.removeMesh(o),o&&typeof o.dispose=="function"&&o.dispose(!1,!0)}for(var h=this.scene.materials.length-1;h>=0;h--){var l=this.scene.materials[h];l.name==="solidMaterial"&&(l&&this.debug&&console.log("Disposing ".concat(l.name)),this.scene.removeMaterial(l),l&&typeof l.dispose=="function"&&l.dispose(!1,!0))}this.toolCursor&&(this.toolCursor.dispose(!1,!0),this.toolCursor=void 0),this.buildtoolCursor(),this.bed.buildBed(),this.axes.render(),this.workplace.render()}},{key:"reload",value:(t=Gi(It().mark(function n(){return It().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return this.clearScene(),r.next=3,this.processFile(this.fileData);case 3:case"end":return r.stop()}},n,this)})),function(){return t.apply(this,arguments)})},{key:"getRenderMode",value:function(){return this.gcodeProcessor.renderMode}},{key:"setCursorVisiblity",value:function(n){this.scene!==void 0&&(this.toolCursor===void 0&&this.buildtoolCursor(),this.toolCursorMesh.isVisible=n,this.toolCursorVisible=n,this.scene.render())}},{key:"updateToolPosition",value:function(n){var r=0,o=0,h=0;if(this.buildtoolCursor(),n instanceof v)r=n.x,o=n.z,h=n.y;else for(var l=0;l{r.scene.clipPlane=null,r.scene.clipPlane2=null}),n.onAfterRenderObservable.add(()=>{r.scene.clipPlane=new Xt(0,1,0,r.zTopClipValue),r.scene.clipPlane2=new Xt(0,-1,0,r.zBottomClipValue)}))}},{key:"updateCameraInertiaProperties",value:function(){this.cameraInertia?(this.orbitCamera.speed=2,this.orbitCamera.inertia=.9,this.orbitCamera.panningInertia=.9,this.orbitCamera.inputs.attached.keyboard.angularSpeed=.005,this.orbitCamera.inputs.attached.keyboard.zoomingSensibility=2,this.orbitCamera.inputs.attached.keyboard.panningSensibility=2,this.orbitCamera.angularSensibilityX=1e3,this.orbitCamera.angularSensibilityY=1e3,this.orbitCamera.panningSensibility=10,this.orbitCamera.wheelPrecision=1):(this.orbitCamera.speed=500,this.orbitCamera.inertia=0,this.orbitCamera.panningInertia=0,this.orbitCamera.inputs.attached.keyboard.angularSpeed=.05,this.orbitCamera.inputs.attached.keyboard.zoomingSensibility=.5,this.orbitCamera.inputs.attached.keyboard.panningSensibility=.5,this.orbitCamera.angularSensibilityX=200,this.orbitCamera.angularSensibilityY=200,this.orbitCamera.panningSensibility=2,this.orbitCamera.wheelPrecision=.25)}},{key:"setCameraInertia",value:function(n){this.cameraInertia=n,localStorage.setItem("cameraInertia",n),this.updateCameraInertiaProperties()}},{key:"forceRender",value:function(){this.scene&&this.scene.render(!0)}},{key:"getLayers",value:function(){return this.gcodeProcessor.layerDictionary}},{key:"getGCodeLine",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5;try{var r=Math.max(0,this.gcodeProcessor.currentLineNumber-n),o=Math.min(this.gcodeProcessor.currentLineNumber,this.fileDataArray.length-1);return this.fileDataArray.slice(r,o).join("\r\n").trim()}catch{return""}}},{key:"getGCodeLineNumber",value:function(){return this.gcodeProcessor.currentLineNumber}},{key:"goToGCodeLine",value:function(n){}},{key:"simulateToolPosition",value:function(){this.updateToolPosition(this.gcodeProcessor.nozzlePosition)}},{key:"setZBelt",value:function(n,r){this.gcodeProcessor.zBelt=n,n&&(this.gcodeProcessor.setZBeltAngle(r),this.toolCursorMesh.rotate(Gt.X,Math.PI/2-r*Math.PI/180,ci.LOCAL))}},{key:"setWorkplaceVisiblity",value:function(n){this.workplace.visible=n,this.workplace.setOffsets(this.gcodeProcessor.workplaceOffsets),this.workplace.render(),this.scene.render()}},{key:"startSimulation",value:function(){this.gcodeProcessor.lastFilePositionIndex>=this.gcodeProcessor.renderedLines.length-1&&this.gcodeProcessor.updateFilePositionIndex(1),this.simulation=!0,this.gcodeProcessor.doUpdate()}},{key:"stopSimulation",value:function(){this.simulation=!1,this.simulationStopped()}},{key:"clamp",value:function(n,r,o){return Math.min(Math.max(n,r),o)}},{key:"runSimulation",value:function(){if(this.gcodeProcessor.renderedLines.length!==0){if(this.gcodeProcessor.lastFilePositionIndex>=this.gcodeProcessor.renderedLines.length-1&&(this.simulation=!1,this.simulationStopped()),this.simulationCurrentLine!=this.gcodeProcessor.renderedLines[this.gcodeProcessor.lastFilePositionIndex]){this.simulationCurrentLine=this.gcodeProcessor.renderedLines[this.gcodeProcessor.lastFilePositionIndex],this.updateToolPosition(this.simulationCurrentLine.start),this.simulationLastUpdate=0;var n=this.isMMS?this.simulationCurrentLine.feedRate:this.simulationCurrentLine.feedRate/60;this.simulationTimeToMove=this.simulationCurrentLine.length()/n*1e3,this.simulationUpdatePosition(this.simulationCurrentLine.gcodeFilePosition)}this.simLine=this.simulationCurrentLine.start.clone(),this.simulationLastUpdate+=this.engine.getDeltaTime()*this.simulationMultiplier*this.scene.getAnimationRatio();var r=this.clamp(this.simulationLastUpdate/this.simulationTimeToMove,0,1);if(v.LerpToRef(this.simulationCurrentLine.start,this.simulationCurrentLine.end,r,this.simLine),this.updateToolPosition(this.simLine),this.simulationLastUpdate>=this.simulationTimeToMove||this.simulationTimeToMove==1/0||this.simulationTimeToMove==0){var o=this.simulationMultiplier>10?this.simulationMultiplier:1,h=this.scene.getAnimationRatio();h>3&&(o+=~~h),this.gcodeProcessor.updateFilePositionIndex(this.gcodeProcessor.lastFilePositionIndex+o)}}}},{key:"getCameraPosition",value:function(){return this.scene.cameras[0].position}},{key:"getCameraTarget",value:function(){return this.scene.cameras[0].target}},{key:"setCameraPosition",value:function(n,r,o){var h=Number(n),l=Number(r),c=Number(o);h!==NaN&&l!==NaN&&c!==NaN&&(this.scene.activeCamera.position=new v(Number(n),Number(o),Number(r)),this.forceRender())}},{key:"setCameraTarget",value:function(n,r,o){var h=Number(n),l=Number(r),c=Number(o);h!==NaN&&l!==NaN&&c!==NaN&&(this.scene.activeCamera.target=new v(Number(n),Number(o),Number(r)),this.forceRender())}},{key:"createScreenshot",value:(e=Gi(It().mark(function n(){var r,o,h,l,c=arguments;return It().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return r=c.length>0&&c[0]!==void 0?c[0]:1920,o=c.length>1&&c[1]!==void 0?c[1]:1080,h=this.scene.clearColor,this.scene.clearColor=new H(0,0,0,0),this.displayViewBox(!1),this.gcodeProcessor.forceRender(),this.gcodeProcessor.doUpdate(),this.scene.render(!0,!0),this.scene.onAfterRenderObservable.addOnce(()=>{}),u.next=13,$g.CreateScreenshotAsync(this.engine,this.scene.activeCamera,{width:r,height:o});case 13:return l=u.sent,this.scene.clearColor=h,u.abrupt("return",l);case 16:case"end":return u.stop()}},n,this)})),function(){return e.apply(this,arguments)})},{key:"displayViewBox",value:function(n){(function(r){Ze.meshes.forEach(o=>{o.setEnabled(r)})})(n)}}]),a}(),Kb=Object.defineProperty,Xb=Object.getOwnPropertyDescriptor,Je=(a,e,t,i)=>{for(var s=i>1?void 0:i?Xb(e,t):e,n=a.length-1,r;n>=0;n--)(r=a[n])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&Kb(e,t,s),s};let Y=null,$e=class extends El(Cl){constructor(){super(...arguments),this.mdiReloadAlert=Mf,this.mdiCameraRetake=Pf,this.mdiToggleSwitch=wf,this.mdiToggleSwitchOffOutline=Df,this.mdiClose=Ff,this.mdiCog=Of,this.mdiVideo3d=Bf,this.mdiPlay=Lf,this.mdiPause=Nf,this.mdiFastForward=Uf,this.mdiBroom=kf,this.mdiSelectionRemove=Vf,this.formatFilesize=Gf,this.isBusy=!1,this.loading=!1,this.loadingPercent=0,this.tracking=!1,this.loadedFile=null,this.reloadRequired=!1,this.fileSize=0,this.renderQuality=this.renderQualities[2],this.scrubPosition=0,this.scrubPlaying=!1,this.scrubSpeed=1,this.scrubInterval=void 0,this.scrubFileSize=0,this.downloadSnackbar={status:!1,filename:"",percent:0,speed:0,total:0,cancelTokenSource:{}},this.excludeObject={bool:!1,name:""},this.fileData="",this.colorModes=[{text:"Extruder",value:0},{text:"Feed Rate",value:1},{text:"Feature",value:2}]}get renderQualities(){return[{label:this.$t("GCodeViewer.Low"),value:2},{label:this.$t("GCodeViewer.Medium"),value:3},{label:this.$t("GCodeViewer.High"),value:4},{label:this.$t("GCodeViewer.Ultra"),value:5},{label:this.$t("GCodeViewer.Max"),value:6}]}async mounted(){var e,t,i,s;this.loadedFile=(t=(e=this.$store.state.gcodeviewer)==null?void 0:e.loadedFileBackup)!=null?t:null,Y=(s=(i=this.$store.state.gcodeviewer)==null?void 0:i.viewerBackup)!=null?s:null,await this.init(),this.loadedFile!==null&&(this.scrubFileSize=Y.fileSize),Y&&(this.fileData=Y.fileData)}beforeDestroy(){Y&&(Y.gcodeProcessor.loadingProgressCallback=null,this.$store.dispatch("gcodeviewer/setLoadedFileBackup",this.loadedFile),this.$store.dispatch("gcodeviewer/setViewerBackup",Y)),this.scrubPlaying=!1,this.scrubInterval&&(clearInterval(this.scrubInterval),this.scrubInterval=void 0)}handleResize(){this.$nextTick(()=>{Y==null||Y.resize()})}get panelTitle(){let e=this.$t("GCodeViewer.Title").toString();return this.loadedFile&&(e+=": ".concat(this.loadedFile)),e}get filePosition(){return this.printerIsPrinting?this.$store.state.printer.virtual_sdcard.file_position:0}get sdCardFilePath(){var e,t;return(t=(e=this.$store.state.printer.print_stats)==null?void 0:e.filename)!=null?t:""}get livePosition(){var e,t;return(t=(e=this.$store.state.printer.motion_report)==null?void 0:e.live_position)!=null?t:[0,0,0,0]}get gcodeOffset(){var e,t,i;return(i=(t=(e=this.$store.state.printer)==null?void 0:e.gcode_move)==null?void 0:t.homing_origin)!=null?i:[0,0,0]}get currentPosition(){return[this.livePosition[0]-this.gcodeOffset[0],this.livePosition[1]-this.gcodeOffset[1],this.livePosition[2]-this.gcodeOffset[2],this.livePosition[3]]}get showTrackingButton(){return this.printerIsPrinting&&this.sdCardFilePath===this.loadedFile}get printing_objects(){var e,t,i;return(i=(t=(e=this.$store.state.printer)==null?void 0:e.exclude_object)==null?void 0:t.objects)!=null?i:[]}printing_objectsChanged(){this.refreshPrintingObjects()}get excluded_objects(){var e,t;return(t=(e=this.$store.state.printer.exclude_object)==null?void 0:e.excluded_objects)!=null?t:[]}excluded_objectsChanged(){this.refreshPrintingObjects()}get nozzle_diameter(){var e,t,i,s;return(s=(i=(t=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:t.extruder)==null?void 0:i.nozzle_diameter)!=null?s:.4}async init(){var t,i,s,n,r;let e=(i=(t=this.$store.state.gcodeviewer)==null?void 0:t.canvasBackup)!=null?i:null;e===null?(e=document.createElement("canvas"),e.className="viewer",this.viewerCanvasContainer.appendChild(e),await this.$store.dispatch("gcodeviewer/setCanvasBackup",e)):(this.viewerCanvasContainer.appendChild(e),Y!=null&&Y.gcodeProcessor&&Y.gcodeProcessor.updateFilePosition(Y==null?void 0:Y.fileSize)),Y===null&&await this.viewerInit(e),this.registerProgressCallback(),(s=this.$route.query)!=null&&s.filename&&this.loadedFile!==((r=(n=this.$route.query)==null?void 0:n.filename)==null?void 0:r.toString())&&(await this.sleep(1e3),await this.loadFile(this.$route.query.filename.toString()))}async viewerInit(e){Y=new Hb(e),await Y.init(),Y.setBackgroundColor(this.backgroundColor),Y.bed.setBedColor(this.gridColor),Y.setCursorVisiblity(this.showCursor),Y.setZClipPlane(1e6,-1e6),Y.axes.show(this.showAxes),Y.bed.setDelta(this.kinematics.includes("delta")),this.bedMaxSize!==null&&(Y.bed.buildVolume.x.max=this.bedMaxSize[0],Y.bed.buildVolume.y.max=this.bedMaxSize[1],Y.bed.buildVolume.z.max=this.bedMaxSize[2]),this.bedMinSize!==null&&(Y.bed.buildVolume.x.min=this.bedMinSize[0],Y.bed.buildVolume.y.min=this.bedMinSize[1],Y.bed.buildVolume.z.min=this.bedMinSize[2]),Y.gcodeProcessor.useHighQualityExtrusion(this.hdRendering),Y.gcodeProcessor.updateForceWireMode(this.forceLineRendering||this.cncMode),Y.gcodeProcessor.setAlpha(this.transparency),Y.gcodeProcessor.setVoxelMode(this.voxelMode),Y.gcodeProcessor.voxelWidth=this.voxelWidth,Y.gcodeProcessor.voxelHeight=this.voxelHeight,Y.gcodeProcessor.useSpecularColor(this.specularLighting),Y.gcodeProcessor.setLiveTracking(!1),Y.gcodeProcessor.g1AsExtrusion=this.cncMode,Y.buildObjects.objectCallback=this.objectCallback,this.loadToolColors(this.extruderColors),Y.lastLoadFailed()&&(this.renderQuality=this.renderQualities[0],Y.updateRenderQuality(1),Y.clearLoadFlag())}registerProgressCallback(){Y!==null&&(Y.gcodeProcessor.loadingProgressCallback=e=>{this.loadingPercent=Math.ceil(e*100),this.loading=this.loadingPercent<=99})}async cancelRendering(){Y!==null&&(Y.gcodeProcessor.cancelLoad=!0,await this.sleep(1e3))}clearLoadedFile(){Y!==null&&(this.scrubPlaying=!1,this.scrubFileSize=0,Y.clearScene(!0),this.loadedFile=null,this.tracking=!1)}chooseFile(){this.isBusy||this.fileInput.click()}finishLoad(){this.loading=!1,Y.setCursorVisiblity(this.showCursor),this.refreshPrintingObjects(),this.scrubFileSize=Y.fileSize,Y.gcodeProcessor.updateFilePosition(Y.fileSize)}refreshPrintingObjects(){if(this.loadedFile!==this.sdCardFilePath||this.printing_objects.length===0)return;let e=[];this.printing_objects.forEach(t=>{const i=t.polygon.map(n=>n[0]),s=t.polygon.map(n=>n[1]);e.push({cancelled:this.excluded_objects.includes(t.name),name:t.name,x:[Math.min(...i),Math.max(...i)],y:[Math.min(...s),Math.max(...s)]})}),Y==null||Y.buildObjects.loadObjectBoundaries(e),Y==null||Y.buildObjects.showObjectSelection(this.showObjectSelection)}async fileSelected(e){var i,s;const t=new FileReader;t.addEventListener("load",async n=>{if(!n||!n.target)return;const r=n.target.result;typeof r=="string"&&(this.fileSize=r.length,await Y.processFile(r),this.fileData=Y.fileData),this.finishLoad()}),this.tracking=!1,(i=e.target.files)!=null&&i.length&&(this.loadedFile=(s=e==null?void 0:e.target)==null?void 0:s.files[0].name,t.readAsText(e.target.files[0])),e.target.value=""}async loadFile(e){this.downloadSnackbar.status=!0,this.downloadSnackbar.speed=0,this.downloadSnackbar.filename=e.startsWith("gcodes/")?e.slice(7):e;const t=Co.CancelToken;this.downloadSnackbar.cancelTokenSource=t.source();const i=await Co.get(this.apiUrl+"/server/files/"+zf(e),{cancelToken:this.downloadSnackbar.cancelTokenSource.token,responseType:"blob",onDownloadProgress:s=>{var n,r,o;this.downloadSnackbar.percent=((n=s.progress)!=null?n:0)*100,this.downloadSnackbar.speed=(r=s.rate)!=null?r:0,this.downloadSnackbar.total=(o=s.total)!=null?o:0}}).then(s=>s.data.text()).catch(s=>{window.console.error(s.message)});this.downloadSnackbar.status=!1,this.loadedFile=this.downloadSnackbar.filename,Y.updateRenderQuality(this.renderQuality.value),await Y.processFile(i),this.fileData=Y.fileData,this.loadingPercent=100,this.finishLoad(),this.scrubFileSize=Y.fileSize}cancelDownload(){this.downloadSnackbar.cancelTokenSource.cancel("User canceled download gcode file")}async sleep(e){await new Promise(t=>setTimeout(t,e))}async loadCurrentFile(){await this.loadFile("gcodes/"+this.sdCardFilePath),this.loadedFile=this.sdCardFilePath}async reloadViewer(){this.loading&&(Y.gcodeProcessor.cancelLoad=!0,await this.sleep(1e3)),this.reloadRequired=!1,this.loading=!0,this.loadingPercent=0,await Y.reload(),this.fileData=Y.fileData,this.loadingPercent=100,this.finishLoad()}resetCamera(){Y.resetCamera()}setReloadRequiredFlag(){this.loadedFile&&this.loadedFile!=""&&(this.reloadRequired=!0)}async renderQualityChanged(e){Y&&Y.renderQuality!==e&&(Y.updateRenderQuality(e),await this.reloadViewer())}currentPositionChanged(e){if(!Y||!this.tracking||this.scrubPlaying)return;const t=[{axes:"X",position:e[0]},{axes:"Y",position:e[1]},{axes:"Z",position:e[2]}];Y.updateToolPosition(t)}filePositionChanged(e){if(!Y||!this.tracking||this.scrubPlaying)return;const t=350;if(e>0&&this.printerIsPrinting&&this.tracking&&e>t){Y.gcodeProcessor.updateFilePosition(e-t),this.scrubPosition=e-t;return}Y.gcodeProcessor.updateFilePosition(Y.fileSize)}async trackingChanged(e){if(Y!==null){if(e){this.scrubPlaying=!1,Y.gcodeProcessor.updateFilePosition(0),Y==null||Y.forceRender();return}Y.gcodeProcessor.setLiveTracking(!1),await this.reloadViewer()}}printerIsPrintingChanged(){this.tracking=!1}get showCursor(){var e;return(e=this.$store.state.gui.gcodeViewer.showCursor)!=null?e:!1}set showCursor(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.showCursor",value:e})}showCursorChanged(e){Y==null||Y.setCursorVisiblity(e)}get showTravelMoves(){var e;return(e=this.$store.state.gui.gcodeViewer.showTravelMoves)!=null?e:!1}set showTravelMoves(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.showTravelMoves",value:e})}get showGCode(){var e;return(e=this.$store.state.gui.gcodeViewer.showGCode)!=null?e:!1}set showGCode(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.showGCode",value:e}),e&&Y&&(this.fileData=Y.fileData),this.handleResize()}showTravelMovesChanged(e){Y==null||Y.toggleTravels(e)}get showObjectSelection(){var e;return(e=this.$store.state.gui.gcodeViewer.showObjectSelection)!=null?e:!1}set showObjectSelection(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.showObjectSelection",value:e})}showObjectSelectionChanged(e){Y==null||Y.buildObjects.showObjectSelection(e)}get hdRendering(){return this.$store.state.gui.gcodeViewer.hdRendering}set hdRendering(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.hdRendering",value:e})}async hdRenderingChanged(e){Y!==null&&(Y.gcodeProcessor.useHighQualityExtrusion(e),await this.reloadViewer())}get forceLineRendering(){return this.$store.state.gui.gcodeViewer.forceLineRendering}set forceLineRendering(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.forceLineRendering",value:e})}async forceLineRenderingChanged(e){Y!==null&&(Y.gcodeProcessor.updateForceWireMode(e||this.cncMode),await this.reloadViewer())}get transparency(){return this.$store.state.gui.gcodeViewer.transparency}set transparency(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.transparency",value:e})}async transparencyChanged(e){Y!==null&&(Y.gcodeProcessor.setAlpha(e),await this.reloadViewer())}get voxelMode(){return this.$store.state.gui.gcodeViewer.voxelMode}set voxelMode(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.voxelMode",value:e})}async voxelModeChanged(e){Y!==null&&(Y.gcodeProcessor.setVoxelMode(e),Y.gcodeProcessor.voxelWidth=this.voxelWidth,Y.gcodeProcessor.voxelHeight=this.voxelHeight,await this.reloadViewer())}get voxelWidth(){var e;return(e=this.$store.state.gui.gcodeViewer.voxelWidth)!=null?e:1}set voxelWidth(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.voxelWidth",value:e})}get voxelHeight(){var e;return(e=this.$store.state.gui.gcodeViewer.voxelHeight)!=null?e:1}set voxelHeight(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.voxelHeight",value:e})}get specularLighting(){return this.$store.state.gui.gcodeViewer.specularLighting}set specularLighting(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.specularLighting",value:e})}async specularLightingChanged(e){Y!==null&&Y.gcodeProcessor.useSpecularColor(e)}get cncMode(){return this.$store.state.gui.gcodeViewer.cncMode}set cncMode(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.cncMode",value:e}),Y.gcodeProcessor.g1AsExtrusion=e,Y.gcodeProcessor.updateForceWireMode(this.forceLineRendering||e),this.reloadViewer()}get extruderColors(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.extruderColors)!=null?t:!1}loadToolColors(e){Y&&e.length&&(Y.gcodeProcessor.resetTools(),e.forEach(t=>{Y.gcodeProcessor.addTool(t,this.nozzle_diameter)}),this.setReloadRequiredFlag())}extruderColorsChanged(e){Y&&e&&e.length&&(this.loadToolColors(e),this.setReloadRequiredFlag())}get colorMode(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.colorMode)!=null?t:2}set colorMode(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.colorMode",value:e}),Y&&Y.gcodeProcessor.colorMode!==e&&(Y.gcodeProcessor.setColorMode(e),this.reloadViewer())}get backgroundColor(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.backgroundColor)!=null?t:"#121212"}backgroundColorChanged(e){Y!==null&&Y.setBackgroundColor(e)}get gridColor(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.gridColor)!=null?t:"#B3B3B3"}gridColorChanged(e){Y!==null&&Y.bed.setBedColor(e)}get showAxes(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.showAxes)!=null?t:!0}showAxesChanged(e){Y!==null&&Y.axes.show(e)}get minFeed(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.minFeed)!=null?t:20}minFeedChanged(e){Y!==null&&Y.gcodeProcessor.updateColorRate(e*60,this.maxFeed*60)}get maxFeed(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.maxFeed)!=null?t:100}maxFeedChanged(e){Y!==null&&Y.gcodeProcessor.updateColorRate(this.minFeed*60,e*60)}get minFeedColor(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.minFeedColor)!=null?t:"#0000FF"}minFeedColorUpdated(e){Y!==null&&(Y.gcodeProcessor.updateMinFeedColor(e),this.setReloadRequiredFlag())}get maxFeedColor(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.maxFeedColor)!=null?t:"#FF0000"}maxFeedColorUpdated(e){Y!==null&&(Y.gcodeProcessor.updateMaxFeedColor(e),this.setReloadRequiredFlag())}get kinematics(){var e,t,i,s,n,r,o,h;return(h=(o=(i=(t=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:t.printer)==null?void 0:i.kinematics)!=null?o:(r=(n=(s=this.$store.state.gui)==null?void 0:s.gcodeViewer)==null?void 0:n.klipperCache)==null?void 0:r.kinematics)!=null?h:""}get bedMaxSize(){var e,t,i,s,n,r;return(r=(n=(e=this.$store.state.printer.toolhead)==null?void 0:e.axis_maximum)!=null?n:(s=(i=(t=this.$store.state.gui)==null?void 0:t.gcodeViewer)==null?void 0:i.klipperCache)==null?void 0:s.axis_maximum)!=null?r:null}get bedMinSize(){var e,t,i,s,n,r;return(r=(n=(e=this.$store.state.printer.toolhead)==null?void 0:e.axis_minimum)!=null?n:(s=(i=(t=this.$store.state.gui)==null?void 0:t.gcodeViewer)==null?void 0:i.klipperCache)==null?void 0:s.axis_minimum)!=null?r:null}kinematicsChanged(e){Y===null||!e||Y.bed.setDelta(e.includes("delta"))}bedMinSizeChanged(e){e===null||Y===null||Y.bed===null||(Y.bed.buildVolume.x.min=e[0],Y.bed.buildVolume.y.min=e[1],Y.bed.buildVolume.z.min=e[2])}bedMaxSizeChanged(e){e===null||Y===null||Y.bed===null||(Y.bed.buildVolume.x.max=e[0],Y.bed.buildVolume.y.max=e[1],Y.bed.buildVolume.z.max=e[2])}get progressColor(){var e,t;return(t=(e=this.$store.state.gui.gcodeViewer)==null?void 0:e.progressColor)!=null?t:"#FFFFFF"}progressColorChanged(e){Y==null||Y.setProgressColor(e)}scrubPlayingChanged(e){if(!e){this.scrubInterval&&clearInterval(this.scrubInterval),this.scrubPlaying=!1,this.scrubInterval=void 0;return}this.scrubInterval&&(clearInterval(this.scrubInterval),this.scrubInterval=void 0),this.scrubPlaying=!0,this.scrubPosition>=this.scrubFileSize&&(this.scrubPosition=0),Y.gcodeProcessor.updateFilePosition(this.scrubPosition-3e4),this.scrubInterval=setInterval(()=>{this.scrubPosition+=100*this.scrubSpeed,Y.gcodeProcessor.updateFilePosition(this.scrubPosition),Y.simulateToolPosition(),(this.tracking||this.scrubPosition>=this.scrubFileSize)&&(this.scrubPlaying=!1)},200)}get showScrubber(){return!this.tracking&&this.scrubFileSize>0}updateScrubPosition(e){Y===null||this.tracking||(Y.gcodeProcessor.updateFilePosition(e),Y.simulateToolPosition())}fastForward(){this.scrubPosition=this.scrubFileSize,Y.gcodeProcessor.updateFilePosition(this.scrubPosition)}objectCallback(e){var t;(e==null?void 0:e.cancelled)===!1&&(this.excludeObject.name=(t=e.name)!=null?t:"UNKNOWN",this.excludeObject.bool=!0)}cancelObject(){this.$socket.emit("printer.gcode.script",{script:"EXCLUDE_OBJECT NAME="+this.excludeObject.name}),this.excludeObject.bool=!1}};Je([Vr({type:String,default:"",required:!1})],$e.prototype,"filename",2);Je([Sl("fileInput")],$e.prototype,"fileInput",2);Je([Sl("viewerCanvasContainer")],$e.prototype,"viewerCanvasContainer",2);Je([Ml(200)],$e.prototype,"handleResize",1);Je([nt("printing_objects")],$e.prototype,"printing_objectsChanged",1);Je([nt("excluded_objects")],$e.prototype,"excluded_objectsChanged",1);Je([nt("renderQuality")],$e.prototype,"renderQualityChanged",1);Je([nt("currentPosition")],$e.prototype,"currentPositionChanged",1);Je([nt("filePosition")],$e.prototype,"filePositionChanged",1);Je([nt("tracking")],$e.prototype,"trackingChanged",1);Je([nt("printerIsPrinting")],$e.prototype,"printerIsPrintingChanged",1);Je([nt("showCursor")],$e.prototype,"showCursorChanged",1);Je([nt("showTravelMoves")],$e.prototype,"showTravelMovesChanged",1);Je([nt("showObjectSelection")],$e.prototype,"showObjectSelectionChanged",1);Je([nt("hdRendering")],$e.prototype,"hdRenderingChanged",1);Je([nt("forceLineRendering")],$e.prototype,"forceLineRenderingChanged",1);Je([nt("transparency")],$e.prototype,"transparencyChanged",1);Je([nt("voxelMode")],$e.prototype,"voxelModeChanged",1);Je([nt("specularLighting")],$e.prototype,"specularLightingChanged",1);Je([nt("extruderColors")],$e.prototype,"extruderColorsChanged",1);Je([nt("backgroundColor")],$e.prototype,"backgroundColorChanged",1);Je([nt("gridColor")],$e.prototype,"gridColorChanged",1);Je([nt("showAxes")],$e.prototype,"showAxesChanged",1);Je([nt("minFeed")],$e.prototype,"minFeedChanged",1);Je([nt("maxFeed")],$e.prototype,"maxFeedChanged",1);Je([nt("minFeedColor")],$e.prototype,"minFeedColorUpdated",1);Je([nt("maxFeedColor")],$e.prototype,"maxFeedColorUpdated",1);Je([nt("kinematics",{immediate:!0})],$e.prototype,"kinematicsChanged",1);Je([nt("bedMinSize",{deep:!0,immediate:!0})],$e.prototype,"bedMinSizeChanged",1);Je([nt("bedMaxSize",{deep:!0,immediate:!0})],$e.prototype,"bedMaxSizeChanged",1);Je([nt("progressColor")],$e.prototype,"progressColorChanged",1);Je([nt("scrubPlaying")],$e.prototype,"scrubPlayingChanged",1);Je([Ml(200),nt("scrubPosition")],$e.prototype,"updateScrubPosition",1);$e=Je([a0({components:{Panel:Pl,CodeStream:wl}})],$e);var Yb=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(Pl,{attrs:{title:e.panelTitle,icon:e.mdiVideo3d,"card-class":"gcode-viewer-panel","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(Bt,{directives:[{name:"show",rawName:"v-show",value:e.reloadRequired,expression:"reloadRequired"}],staticClass:"ml-3",attrs:{icon:e.$vuetify.breakpoint.xs,text:e.$vuetify.breakpoint.smAndUp,tile:"",color:"info"},on:{click:e.reloadViewer}},[t("span",{staticClass:"d-none d-sm-block"},[e._v(e._s(e.$t("GCodeViewer.ReloadRequired")))]),t(Ri,{staticClass:"d-sm-none"},[e._v(e._s(e.mdiReloadAlert))])],1),t(Bt,{attrs:{icon:"",tile:""},on:{click:e.resetCamera}},[t(Ri,[e._v(e._s(e.mdiCameraRetake))])],1)]},proxy:!0}])},[t(Ro,[t(sr,{class:e.showScrubber?"withScrubber":""},[t(ds,{attrs:{cols:e.showGCode?8:12}},[t("div",{ref:"viewerCanvasContainer"})]),t(ds,{directives:[{name:"show",rawName:"v-show",value:e.showGCode,expression:"showGCode"}],attrs:{cols:"4"}},[t("div",{staticClass:"viewer"},[t(wl,{ref:"gcodestream",attrs:{shown:e.showGCode,currentline:e.scrubPosition,document:e.fileData,"is-simulating":!e.printerIsPrinting},on:{"update:currentline":function(i){e.scrubPosition=i}}})],1)])],1),t(sr,{directives:[{name:"show",rawName:"v-show",value:e.showScrubber,expression:"showScrubber"}],staticClass:"scrubber"},[t(ds,{staticClass:"pt-0"},[t(gf,{attrs:{hint:e.scrubPosition+"/"+e.scrubFileSize,max:e.scrubFileSize,dense:"",min:"0","persistent-hint":""},model:{value:e.scrubPosition,callback:function(i){e.scrubPosition=i},expression:"scrubPosition"}})],1),t(ds,{staticClass:"col-auto pt-0 text-center"},[t(Bt,{staticClass:"px-2 minwidth-0",attrs:{color:"primary"},on:{click:function(i){e.scrubPlaying=!e.scrubPlaying}}},[e.scrubPlaying?t(Ri,[e._v(e._s(e.mdiPause))]):t(Ri,[e._v(e._s(e.mdiPlay))])],1),t(Bt,{staticClass:"px-2 minwidth-0 mx-3",attrs:{color:"primary"},on:{click:e.fastForward}},[t(Ri,[e._v(e._s(e.mdiFastForward))])],1),t(mf,{staticClass:"mt-3 mt-sm-0",attrs:{dense:"",mandatory:"",rounded:""},model:{value:e.scrubSpeed,callback:function(i){e.scrubSpeed=i},expression:"scrubSpeed"}},[t(Bt,{attrs:{value:1}},[e._v("1x")]),t(Bt,{attrs:{value:2}},[e._v("2x")]),t(Bt,{attrs:{value:5}},[e._v("5x")]),t(Bt,{attrs:{value:10}},[e._v("10x")]),t(Bt,{attrs:{value:20}},[e._v("20x")])],1)],1)],1),t(sr,{staticClass:"mt-0 d-flex align-top"},[t(ds,[t(sr,[t(ds,{staticClass:"d-flex align-content-space-around justify-center flex-wrap flex-md-nowrap col-12 col-md-4",attrs:{"order-md":"2"}},[e.loadedFile===null?[e.sdCardFilePath!==""&&e.sdCardFilePath!==e.loadedFile?t(Bt,{staticClass:"mr-3",on:{click:e.loadCurrentFile}},[e._v(" "+e._s(e.$t("GCodeViewer.LoadCurrentFile"))+" ")]):e._e(),t(Bt,{on:{click:e.chooseFile}},[e._v(e._s(e.$t("GCodeViewer.LoadLocal")))])]:[e.showTrackingButton?t(Bt,{staticClass:"mr-3",on:{click:function(i){e.tracking=!e.tracking}}},[t(Ri,{staticClass:"mr-2",domProps:{innerHTML:e._s(e.tracking?e.mdiToggleSwitch:e.mdiToggleSwitchOffOutline)}}),e._v(" "+e._s(e.$t("GCodeViewer.Tracking"))+" ")],1):e._e(),t(Bt,{on:{click:e.clearLoadedFile}},[t(Ri,{attrs:{left:""}},[e._v(e._s(e.mdiBroom))]),e._v(" "+e._s(e.$t("GCodeViewer.ClearLoadedFile"))+" ")],1)]],2),t(ds,{staticClass:"col-12 col-sm-6 col-md-4"},[t(Io,{attrs:{items:e.colorModes,label:e.$t("GCodeViewer.ColorMode"),"item-text":"text",dense:"","hide-details":"",outlined:""},model:{value:e.colorMode,callback:function(i){e.colorMode=i},expression:"colorMode"}})],1),t(ds,{staticClass:"col-12 col-sm-6 col-md-4 d-flex",attrs:{"order-md":"3"}},[t(Io,{attrs:{items:e.renderQualities,label:e.$t("GCodeViewer.RenderQuality"),"item-text":"label",dense:"","hide-details":"",outlined:""},model:{value:e.renderQuality,callback:function(i){e.renderQuality=i},expression:"renderQuality"}}),t(vf,{attrs:{"offset-y":!0,"offset-x":!0,top:"","close-on-content-click":!1,title:e.$t("Files.SetupCurrentList")},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:s}){return[t(Bt,e._g(e._b({staticClass:"minwidth-0 px-2 ml-3"},"v-btn",s,!1),i),[t(Ri,[e._v(e._s(e.mdiCog))])],1)]}}])},[t(bf,[t(Bi,{staticClass:"minHeight36"},[t(Li,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("GCodeViewer.ShowToolhead")},model:{value:e.showCursor,callback:function(i){e.showCursor=i},expression:"showCursor"}})],1),t(Bi,{staticClass:"minHeight36"},[t(Li,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("GCodeViewer.ShowTravelMoves")},model:{value:e.showTravelMoves,callback:function(i){e.showTravelMoves=i},expression:"showTravelMoves"}})],1),t(Bi,{staticClass:"minHeight36"},[t(Li,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("GCodeViewer.ShowGCode")},model:{value:e.showGCode,callback:function(i){e.showGCode=i},expression:"showGCode"}})],1),e.loadedFile===e.sdCardFilePath&&e.printing_objects.length?t(Bi,{staticClass:"minHeight36"},[t(Li,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("GCodeViewer.ShowObjectSelection")},model:{value:e.showObjectSelection,callback:function(i){e.showObjectSelection=i},expression:"showObjectSelection"}})],1):e._e(),t(xf),t(Bi,{staticClass:"minHeight36"},[t(Li,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("GCodeViewer.HDRendering")},model:{value:e.hdRendering,callback:function(i){e.hdRendering=i},expression:"hdRendering"}})],1),t(Bi,{staticClass:"minHeight36"},[t(Li,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("GCodeViewer.ForceLineRendering")},model:{value:e.forceLineRendering,callback:function(i){e.forceLineRendering=i},expression:"forceLineRendering"}})],1),t(Bi,{staticClass:"minHeight36"},[t(Li,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("GCodeViewer.Transparency")},model:{value:e.transparency,callback:function(i){e.transparency=i},expression:"transparency"}})],1),t(Bi,{staticClass:"minHeight36"},[t(Li,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("GCodeViewer.VoxelMode")},model:{value:e.voxelMode,callback:function(i){e.voxelMode=i},expression:"voxelMode"}})],1),t(Bi,{staticClass:"minHeight36"},[t(Li,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("GCodeViewer.SpecularLighting")},model:{value:e.specularLighting,callback:function(i){e.specularLighting=i},expression:"specularLighting"}})],1),t(Bi,{staticClass:"minHeight36"},[t(Li,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("GCodeViewer.CNCMode")},model:{value:e.cncMode,callback:function(i){e.cncMode=i},expression:"cncMode"}})],1)],1)],1)],1)],1)],1)],1),t("input",{ref:"fileInput",attrs:{accept:".g,.gcode,.gc,.gco,.nc,.ngc,.tap",hidden:"",multiple:"",type:"file"},on:{change:e.fileSelected}})],1),t("resize-observer",{on:{notify:e.handleResize}})],1),t(Eo,{attrs:{timeout:-1,fixed:"",right:"",bottom:""},scopedSlots:e._u([{key:"action",fn:function({attrs:i}){return[t(Bt,e._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:""},on:{click:function(s){return e.cancelRendering()}}},"v-btn",i,!1),[t(Ri,{staticClass:"0"},[e._v(e._s(e.mdiClose))])],1)]}}]),model:{value:e.loading,callback:function(i){e.loading=i},expression:"loading"}},[t("div",[e._v(" "+e._s(e.$t("GCodeViewer.Rendering"))+" - "+e._s(e.loadingPercent)+"% "),t("br"),t("strong",[e._v(e._s(e.loadedFile))])]),t(da,{staticClass:"mt-2",attrs:{value:e.loadingPercent}})],1),t(Eo,{attrs:{timeout:-1,fixed:"",right:"",bottom:""},scopedSlots:e._u([{key:"action",fn:function({attrs:i}){return[t(Bt,e._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:""},on:{click:e.cancelDownload}},"v-btn",i,!1),[t(Ri,{staticClass:"0"},[e._v(e._s(e.mdiClose))])],1)]}}]),model:{value:e.downloadSnackbar.status,callback:function(i){e.$set(e.downloadSnackbar,"status",i)},expression:"downloadSnackbar.status"}},[e.downloadSnackbar.total>0?[t("div",[e._v(" "+e._s(e.$t("GCodeViewer.Downloading"))+" - "+e._s(Math.round(e.downloadSnackbar.percent))+" % @ "+e._s(e.formatFilesize(Math.round(e.downloadSnackbar.speed)))+"/s "),t("br"),t("strong",[e._v(e._s(e.downloadSnackbar.filename))])]),t(da,{staticClass:"mt-2",attrs:{value:e.downloadSnackbar.percent}})]:[t("div",[e._v(" "+e._s(e.$t("GCodeViewer.Downloading"))+" "),t("br"),t("strong",[e._v(e._s(e.downloadSnackbar.filename))])]),t(da,{staticClass:"mt-2",attrs:{indeterminate:""}})]],2),t(yf,{attrs:{"max-width":"400"},model:{value:e.excludeObject.bool,callback:function(i){e.$set(e.excludeObject,"bool",i)},expression:"excludeObject.bool"}},[t(Tf,[t(Af,{attrs:{flat:"",dense:""}},[t(Rf,[t("span",{staticClass:"subheading"},[t(Ri,{attrs:{left:""}},[e._v(e._s(e.mdiSelectionRemove))]),e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.ExcludeObjectHeadline"))+" ")],1)])],1),t(Ro,{staticClass:"mt-3"},[e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.ExcludeObjectText",{name:e.excludeObject.name}))+" ")]),t(If,[t(Ef),t(Bt,{attrs:{text:""},on:{click:function(i){e.excludeObject.bool=!1}}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.Cancel"))+" ")]),t(Bt,{attrs:{color:"primary",text:""},on:{click:e.cancelObject}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.ExcludeObject"))+" ")])],1)],1)],1)],1)},qb=[],jb=o0($e,Yb,qb,!1,null,"4c02d29b");const _f=jb.exports;var $b=Object.getOwnPropertyDescriptor,Zb=(a,e,t,i)=>{for(var s=i>1?void 0:i?$b(e,t):e,n=a.length-1,r;n>=0;n--)(r=a[n])&&(s=r(s)||s);return s};let r0=class extends El(Cl){};r0=Zb([a0({components:{Viewer:_f}})],r0);var Qb=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(_f)},Jb=[],ex=o0(r0,Qb,Jb,!1,null,null);const tx=ex.exports,ox=Object.freeze(Object.defineProperty({__proto__:null,default:tx},Symbol.toStringTag,{value:"Module"}));export{ae as A,st as B,ht as C,sp as F,ft as I,b0 as L,mt as P,g0 as R,Me as S,rx as T,v as V,Nd as _,U as a,Ir as b,de as c,On as d,Wd as e,J as f,ie as g,ec as h,ox as i}; diff --git a/assets/Viewer-oTo4b16s.css b/assets/Viewer-oTo4b16s.css new file mode 100644 index 0000000..8402b62 --- /dev/null +++ b/assets/Viewer-oTo4b16s.css @@ -0,0 +1 @@ +[data-v-083209f9] .cm-activeLine{background-color:#333!important}.codeview[data-v-083209f9]{height:100%;overflow:auto}.viewer{width:100%;height:calc(var(--app-height) - 240px);border:1px solid #3f3f3f}.withScrubber .viewer{height:calc(var(--app-height) - 300px)}@media (min-width: 600px) and (max-width: 959px){.viewer{height:calc(var(--app-height) - 295px)}.withScrubber .viewer{height:calc(var(--app-height) - 360px)}}@media (max-width: 599px){.viewer,.withScrubber .viewer{height:calc(var(--app-height) - 340px)}}.scrubber[data-v-4c02d29b]{position:relative;left:0;right:0;bottom:5px} diff --git a/assets/WebcamNozzleCrosshair-OgFJAMdG.js b/assets/WebcamNozzleCrosshair-OgFJAMdG.js new file mode 100644 index 0000000..ac4e544 --- /dev/null +++ b/assets/WebcamNozzleCrosshair-OgFJAMdG.js @@ -0,0 +1 @@ +import{m as c,B as p,P as h,R as _,C as f,n as m}from"./index-Bku7SJna.js";var u=Object.defineProperty,v=Object.getOwnPropertyDescriptor,l=(s,e,t,r)=>{for(var i=r>1?void 0:r?v(e,t):e,o=s.length-1,a;o>=0;o--)(a=s[o])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&u(e,t,i),i};let n=class extends c(p){constructor(){super(...arguments),this.clientHeight=0}get color(){var s,e;return(e=(s=this.webcam.extra_data)==null?void 0:s.nozzleCrosshairColor)!=null?e:"#ff0000"}get styleLines(){return{backgroundColor:this.color}}get styleCircle(){var t,r;const s=(r=(t=this.webcam.extra_data)==null?void 0:t.nozzleCrosshairSize)!=null?r:.1,e=this.clientHeight*s;return{borderColor:this.color,width:"".concat(e,"px"),height:"".concat(e,"px"),marginLeft:"-".concat(e/2,"px"),marginTop:"-".concat(e/2,"px")}}mounted(){this.handleResize()}handleResize(){this.$nextTick(()=>{this.clientHeight=this.container.clientHeight})}};l([h({type:Object,required:!0})],n.prototype,"webcam",2);l([_()],n.prototype,"container",2);n=l([f],n);var d=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{ref:"container",staticClass:"crosshair-container"},[t("div",{staticClass:"line horizontal",style:e.styleLines}),t("div",{staticClass:"line vertical",style:e.styleLines}),t("div",{staticClass:"circle",style:e.styleCircle}),t("resize-observer",{on:{notify:e.handleResize}})],1)},C=[],z=m(n,d,C,!1,null,"ca5e15f6");const x=z.exports;export{x as _}; diff --git a/assets/WebcamNozzleCrosshair-nYNM-zbo.css b/assets/WebcamNozzleCrosshair-nYNM-zbo.css new file mode 100644 index 0000000..fd563d8 --- /dev/null +++ b/assets/WebcamNozzleCrosshair-nYNM-zbo.css @@ -0,0 +1 @@ +.crosshair-container[data-v-ca5e15f6]{position:absolute;top:0;right:0;bottom:0;left:0}.line[data-v-ca5e15f6]{position:absolute;background-color:red}.horizontal[data-v-ca5e15f6]{height:1px;top:50%;left:0;right:0}.vertical[data-v-ca5e15f6]{left:50%;top:0;bottom:0;width:1px}.circle[data-v-ca5e15f6]{position:absolute;border:1px solid #ff0000;border-radius:50%;box-sizing:border-box;top:50%;left:50%} diff --git a/assets/WebrtcCameraStreamer-CRSlmQer.js b/assets/WebrtcCameraStreamer-CRSlmQer.js new file mode 100644 index 0000000..24340b8 --- /dev/null +++ b/assets/WebrtcCameraStreamer-CRSlmQer.js @@ -0,0 +1 @@ +import{_ as m}from"./WebcamNozzleCrosshair-OgFJAMdG.js";import{m as d,B as u,H as g,J as f,P as h,R as _,W as p,C as S,n as y}from"./index-Bku7SJna.js";import{m as w,n as C,r as v}from"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./echarts-DzoUeqWp.js";var T=Object.defineProperty,b=Object.getOwnPropertyDescriptor,n=(l,t,e,s)=>{for(var r=s>1?void 0:s?b(t,e):t,o=l.length-1,c;o>=0;o--)(c=l[o])&&(r=(s?c(t,e,r):c(r))||r);return s&&r&&T(t,e,r),r};let a=class extends d(u,g){constructor(){super(...arguments),this.capitalize=f,this.pc=null,this.useStun=!1,this.aspectRatio=null,this.status="connecting",this.restartTimer=null}get url(){var t;return this.convertUrl((t=this.camSettings)==null?void 0:t.stream_url,this.printerUrl)}get webcamStyle(){var e,s,r;const t={transform:this.generateTransform((e=this.camSettings.flip_horizontal)!=null?e:!1,(s=this.camSettings.flip_vertical)!=null?s:!1,(r=this.camSettings.rotation)!=null?r:0),aspectRatio:1.7777777777777777};return this.aspectRatio&&(t.aspectRatio=this.aspectRatio),t}get nozzleCrosshair(){var t,e;return(e=(t=this.camSettings.extra_data)==null?void 0:t.nozzleCrosshair)!=null?e:!1}get expanded(){var t;return this.page!=="dashboard"?!0:(t=this.$store.getters["gui/getPanelExpand"]("webcam-panel",this.viewport))!=null?t:!1}expandChanged(t){if(!t){this.terminate();return}this.start()}async start(){if(this.restartTimer&&(this.log("Clearing restart timer before starting stream"),window.clearTimeout(this.restartTimer)),!this.expanded){this.log("Not expanded, not starting stream");return}this.log("Requesting ICE servers from ".concat(this.url));try{const t=this.useStun?[{urls:["stun:stun.l.google.com:19302"]}]:null,e=await fetch(this.url,{body:JSON.stringify({type:"request",iceServers:t}),method:"POST"});if(e.status!==200){this.log("Failed to start stream: ".concat(e.status)),this.restartStream();return}const s=await e.json();await this.onIceServers(s)}catch(t){this.log("Failed to start stream",t)}}async onIceServers(t){var o,c;this.pc&&this.pc.close();let e={iceServers:(o=t.iceServers)!=null?o:[],sdpSemantics:"unified-plan"};this.pc=new RTCPeerConnection(e),this.pc.addTransceiver("video",{direction:"recvonly"}),"iceServers"in t?this.pc.onicecandidate=i=>this.onIceCandidate(i,t.id):this.log("No ICE servers returned, so the current camera-streamer version may not support them"),this.pc.onconnectionstatechange=()=>this.onConnectionStateChange(),this.pc.ontrack=i=>this.onTrack(i),await((c=this.pc)==null?void 0:c.setRemoteDescription(t));const s=await this.pc.createAnswer();await this.pc.setLocalDescription(s);const r=this.pc.localDescription;if(!r){this.log("Failed to create offer"),this.restartStream();return}try{const i=await fetch(this.url,{body:JSON.stringify({type:r==null?void 0:r.type,id:t.id,sdp:r==null?void 0:r.sdp}),headers:{"Content-Type":"application/json"},method:"POST"});i.status!==200&&(this.log("Failed to send offer: ".concat(i.status)),this.restartStream())}catch(i){this.log("Failed to send offer",i),this.restartStream()}}async onIceCandidate(t,e){if(t.candidate)try{const s=await fetch(this.url,{body:JSON.stringify({id:e,type:"remote_candidate",candidates:[t.candidate]}),headers:{"Content-Type":"application/json"},method:"POST"});s.status!==200&&(this.log("Failed to send ICE candidate: ".concat(s.status)),this.restartStream())}catch(s){this.log("Failed to send ICE candidate",s),this.restartStream()}}onConnectionStateChange(){var t,e;this.status=(e=(t=this.pc)==null?void 0:t.connectionState)!=null?e:"connecting",this.log("State: ".concat(this.status)),["failed","disconnected"].includes(this.status)&&this.restartStream(5e3)}onTrack(t){t.track.kind==="video"&&(this.stream.srcObject=t.streams[0])}log(t,e){const s="[WebRTC camera-streamer] ".concat(t);if(e){window.console.log(s,e);return}window.console.log(s)}beforeDestroy(){this.terminate(),this.restartTimer&&window.clearTimeout(this.restartTimer)}terminate(){var t;this.log("Terminating stream"),(t=this.pc)==null||t.close()}restartStream(t=500){this.terminate(),!this.restartTimer&&(this.restartTimer=window.setTimeout(async()=>{this.restartTimer=null,await this.start()},t))}changedUrl(){this.restartStream()}};n([h({required:!0})],a.prototype,"camSettings",2);n([h({default:null})],a.prototype,"printerUrl",2);n([h({type:String,default:null})],a.prototype,"page",2);n([_()],a.prototype,"stream",2);n([p("expanded",{immediate:!0})],a.prototype,"expandChanged",1);n([p("url")],a.prototype,"changedUrl",1);a=n([S({components:{WebcamNozzleCrosshair:m}})],a);var x=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{staticClass:"position-relative d-flex"},[e("video",{directives:[{name:"show",rawName:"v-show",value:t.status==="connected",expression:"status === 'connected'"}],ref:"stream",staticClass:"webcamStream",style:t.webcamStyle,attrs:{autoplay:"",muted:"",playsinline:""},domProps:{muted:!0}}),t.nozzleCrosshair?e(m,{attrs:{webcam:t.camSettings}}):t._e(),t.status!=="connected"?e(w,[e(C,{staticClass:"_webcam_webrtc_output text-center d-flex flex-column justify-center align-center"},[t.status==="connecting"?e(v,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):t._e(),e("span",{staticClass:"mt-3"},[t._v(t._s(t.capitalize(t.status)))])],1)],1):t._e()],1)},z=[],P=y(a,x,z,!1,null,"378940ea");const N=P.exports;export{N as default}; diff --git a/assets/WebrtcCameraStreamer-CeCrPMao.css b/assets/WebrtcCameraStreamer-CeCrPMao.css new file mode 100644 index 0000000..fae9fed --- /dev/null +++ b/assets/WebrtcCameraStreamer-CeCrPMao.css @@ -0,0 +1 @@ +.webcamStream[data-v-378940ea]{width:100%}._webcam_webrtc_output[data-v-378940ea]{aspect-ratio:1.5}video[data-v-378940ea]{width:100%} diff --git a/assets/WebrtcGo2rtc-DGvVGkMJ.js b/assets/WebrtcGo2rtc-DGvVGkMJ.js new file mode 100644 index 0000000..7e1a2fb --- /dev/null +++ b/assets/WebrtcGo2rtc-DGvVGkMJ.js @@ -0,0 +1 @@ +import{m as d,B as p,H as m,P as u,R as g,W as l,C as f,n as _}from"./index-Bku7SJna.js";import{m as w,n as v,r as b}from"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./echarts-DzoUeqWp.js";var S=Object.defineProperty,y=Object.getOwnPropertyDescriptor,o=(c,t,e,i)=>{for(var s=i>1?void 0:i?y(t,e):t,n=c.length-1,r;n>=0;n--)(r=c[n])&&(s=(i?r(t,e,s):r(s))||s);return i&&s&&S(t,e,s),s};let a=class extends d(p,m){constructor(){super(...arguments),this.pc=null,this.ws=null,this.restartPause=2e3,this.restartTimeout=null,this.status="connecting"}mounted(){this.start()}beforeDestroy(){this.terminate(),this.restartTimeout&&clearTimeout(this.restartTimeout)}get webcamStyle(){var t,e,i;return{transform:this.generateTransform((t=this.camSettings.flip_horizontal)!=null?t:!1,(e=this.camSettings.flip_vertical)!=null?e:!1,(i=this.camSettings.rotation)!=null?i:0)}}get url(){let t="",e=new URL(location.href);try{t=new URL(this.camSettings.stream_url).search.toString(),e=new URL("api/ws"+t,this.camSettings.stream_url)}catch{this.log("invalid url",this.camSettings.stream_url)}const i=["video"];return this.enableAudio&&i.push("audio"),e.searchParams.set("media",i.join("+")),e.protocol=this.$store.state.socket.protocol+":",e.searchParams.has("src")||this.log("no src set in url"),this.convertUrl(e.toString(),this.printerUrl)}get enableAudio(){var t,e;return(e=(t=this.camSettings.extra_data)==null?void 0:t.enableAudio)!=null?e:!1}changedUrl(){this.terminate(),this.start()}changedEnableAudio(){this.terminate(),this.start()}get expanded(){var t;return(t=this.$store.getters["gui/getPanelExpand"]("webcam-panel",this.viewport))!=null?t:!1}expandChanged(t){if(!t){this.terminate();return}this.start()}log(t,e){if(e){window.console.log("[WebRTC go2rtc] ".concat(t),e);return}window.console.log("[WebRTC go2rtc] ".concat(t))}start(){if(!this.video){this.scheduleRestart();return}this.log("connecting to "+this.url),this.status="connecting",this.pc=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});let t=[];["video","audio"].forEach(i=>{var n;const s=(n=this.pc)==null?void 0:n.addTransceiver(i,{direction:"recvonly"}).receiver.track;s&&t.push(s)}),this.video.srcObject=new MediaStream(t),this.ws=new WebSocket(this.url),this.ws.addEventListener("open",()=>this.onWebSocketOpen()),this.ws.addEventListener("message",i=>this.onWebSocketMessage(i)),this.ws.addEventListener("close",i=>this.onWebSocketClose(i))}onWebSocketOpen(){var t,e,i;this.log("open"),this.restartTimeout!==null&&(clearTimeout(this.restartTimeout),this.restartTimeout=null),(t=this.pc)==null||t.addEventListener("icecandidate",s=>{var r;if(!s.candidate)return;const n={type:"webrtc/candidate",value:s.candidate.candidate};(r=this.ws)==null||r.send(JSON.stringify(n))}),(e=this.pc)==null||e.addEventListener("connectionstatechange",()=>{var s,n;this.status=((n=(s=this.pc)==null?void 0:s.connectionState)!=null?n:"").toString(),this.log("connection state changed",this.status),["failed","disconnected"].includes(this.status)&&this.scheduleRestart()}),(i=this.pc)==null||i.createOffer().then(s=>{var n;return(n=this.pc)==null?void 0:n.setLocalDescription(s)}).then(()=>{var n,r,h;const s={type:"webrtc/offer",value:(r=(n=this.pc)==null?void 0:n.localDescription)==null?void 0:r.sdp};(h=this.ws)==null||h.send(JSON.stringify(s))})}onWebSocketMessage(t){var i,s;const e=JSON.parse(t.data);e.type==="webrtc/candidate"?(i=this.pc)==null||i.addIceCandidate({candidate:e.value,sdpMid:"0"}):e.type==="webrtc/answer"&&((s=this.pc)==null||s.setRemoteDescription({type:"answer",sdp:e.value}))}onWebSocketClose(t){this.log("close"),this.status="disconnected",t.wasClean||this.scheduleRestart()}terminate(){this.log("terminating"),this.pc!==null&&(this.pc.close(),this.pc=null),this.ws!==null&&(this.ws.close(),this.ws=null)}scheduleRestart(){this.restartTimeout===null&&(this.terminate(),this.restartTimeout=window.setTimeout(()=>{this.restartTimeout=null,this.start()},this.restartPause))}};o([u({required:!0})],a.prototype,"camSettings",2);o([u({default:null})],a.prototype,"printerUrl",2);o([g()],a.prototype,"video",2);o([l("url")],a.prototype,"changedUrl",1);o([l("enableAudio")],a.prototype,"changedEnableAudio",1);o([l("expanded",{immediate:!0})],a.prototype,"expandChanged",1);a=o([f],a);var C=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",[e("video",{directives:[{name:"show",rawName:"v-show",value:t.status==="connected",expression:"status === 'connected'"}],ref:"video",staticClass:"webcamImage",style:t.webcamStyle,attrs:{autoplay:"",playsinline:"",muted:""},domProps:{muted:!0}}),t.status!=="connected"?e(w,[e(v,{staticClass:"_webcam_webrtc_output text-center d-flex flex-column justify-center align-center"},[t.status==="connecting"?e(b,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):t._e(),e("span",{staticClass:"mt-3"},[t._v(t._s(t.status))])],1)],1):t._e()],1)},T=[],x=_(a,C,T,!1,null,"673627af");const L=x.exports;export{L as default}; diff --git a/assets/WebrtcGo2rtc-rSd4eisB.css b/assets/WebrtcGo2rtc-rSd4eisB.css new file mode 100644 index 0000000..6ff4f6e --- /dev/null +++ b/assets/WebrtcGo2rtc-rSd4eisB.css @@ -0,0 +1 @@ +.webcamImage[data-v-673627af]{width:100%}._webcam_webrtc_output[data-v-673627af]{aspect-ratio:1.5}video[data-v-673627af]{width:100%} diff --git a/assets/WebrtcMediaMTX-9dkGjohV.js b/assets/WebrtcMediaMTX-9dkGjohV.js new file mode 100644 index 0000000..fda35d6 --- /dev/null +++ b/assets/WebrtcMediaMTX-9dkGjohV.js @@ -0,0 +1 @@ +import{m as g,B as T,H as w,J as _,P as u,R as C,W as m,C as v,n as y}from"./index-Bku7SJna.js";import{m as R,n as S,r as b}from"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./echarts-DzoUeqWp.js";var x=Object.defineProperty,P=Object.getOwnPropertyDescriptor,l=(d,t,e,s)=>{for(var i=s>1?void 0:s?P(t,e):t,a=d.length-1,n;a>=0;a--)(n=d[a])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&x(t,e,i),i};let c=class extends g(T,w){constructor(){super(...arguments),this.capitalize=_,this.pc=null,this.restartTimeout=null,this.status="connecting",this.eTag=null,this.sessionUuid=null,this.queuedCandidates=[],this.offerData={iceUfrag:"",icePwd:"",medias:[]},this.RESTART_PAUSE=2e3,this.unquoteCredential=t=>JSON.parse('"'.concat(t,'"'))}beforeDestroy(){this.terminate(),this.restartTimeout&&clearTimeout(this.restartTimeout)}get webcamStyle(){var t,e,s;return{transform:this.generateTransform((t=this.camSettings.flip_horizontal)!=null?t:!1,(e=this.camSettings.flip_vertical)!=null?e:!1,(s=this.camSettings.rotation)!=null?s:0)}}get url(){let t=this.camSettings.stream_url;return t.endsWith("/")||(t+="/"),t+="whep",this.convertUrl(t,this.printerUrl)}changedUrl(){this.terminate(),this.start()}get expanded(){var t;return this.page!=="dashboard"?!0:(t=this.$store.getters["gui/getPanelExpand"]("webcam-panel",this.viewport))!=null?t:!1}expandChanged(t){if(!t){this.terminate();return}this.start()}log(t,e){if(e){window.console.log("[WebRTC mediamtx] ".concat(t),e);return}window.console.log("[WebRTC mediamtx] ".concat(t))}linkToIceServers(t){return t===null?[]:t.split(", ").map(e=>{const s=e.match(/^<(.+?)>; rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i);if(s===null)return{urls:""};const i={urls:[s[1]]};return s.length>3&&(i.username=this.unquoteCredential(s[3]),i.credential=this.unquoteCredential(s[4]),i.credentialType="password"),i})}parseOffer(t){const e={iceUfrag:"",icePwd:"",medias:[]};for(const s of t.split("\r\n"))s.startsWith("m=")?e.medias.push(s.slice(2)):e.iceUfrag===""&&s.startsWith("a=ice-ufrag:")?e.iceUfrag=s.slice(12):e.icePwd===""&&s.startsWith("a=ice-pwd:")&&(e.icePwd=s.slice(10));return e}generateSdpFragment(t,e){const s={};for(const n of e){const o=n.sdpMLineIndex;o!==null&&(o in s||(s[o]=[]),s[o].push(n))}let i="a=ice-ufrag:"+t.iceUfrag+"\r\na=ice-pwd:"+t.icePwd+"\r\n",a=0;for(const n of t.medias){if(s[a]!==void 0){i+="m="+n+"\r\na=mid:"+a+"\r\n";for(const o of s[a])i+="a="+o.candidate+"\r\n"}a++}return i}async start(){if(this.restartTimeout!==null&&(clearTimeout(this.restartTimeout),this.restartTimeout=null),this.url===null){this.log("invalid url"),this.scheduleRestart();return}this.log("requesting ICE servers from "+this.url);try{const t=await fetch(this.url,{method:"OPTIONS"});if(t.status!==204){this.log("error: Received bad status code:",t.status),this.scheduleRestart();return}await this.onIceServers(t)}catch{this.log("error: Cannot connect to backend"),this.scheduleRestart()}}async onIceServers(t){const e=this.linkToIceServers(t.headers.get("Link"));this.log("ice servers:",e),this.pc=new RTCPeerConnection({iceServers:e,sdpSemantics:"unified-plan"});const s="sendrecv";this.pc.addTransceiver("video",{direction:s}),this.pc.addTransceiver("audio",{direction:s}),this.pc.onicecandidate=a=>this.onLocalCandidate(a),this.pc.oniceconnectionstatechange=()=>this.onConnectionState(),this.pc.ontrack=a=>{this.log("new track:",a.track.kind),this.video.srcObject=a.streams[0]};const i=await this.pc.createOffer();await this.onLocalOffer(i)}async onLocalOffer(t){var e,s,i,a,n,o,p;try{const r=await fetch((e=this.url)!=null?e:"",{method:"POST",headers:{"Content-Type":"application/sdp"},body:t.sdp});if(r.status!==201){this.log("error: Received bad status code:",r.status),this.scheduleRestart();return}this.offerData=this.parseOffer((s=t.sdp)!=null?s:""),(i=this.pc)==null||i.setLocalDescription(t),this.eTag=r.headers.get("ETag");const h=(a=r.headers.get("Location"))!=null?a:"";this.sessionUuid=(n=h==null?void 0:h.substring(h.lastIndexOf("/")+1))!=null?n:null,r.headers.has("E-Tag")&&(this.eTag=r.headers.get("E-Tag"));const f=await r.text();this.onRemoteAnswer(new RTCSessionDescription({type:"answer",sdp:f}))}catch(r){this.log((p=(o=r==null?void 0:r.message)!=null?o:r)!=null?p:"unknown error"),this.scheduleRestart()}}onRemoteAnswer(t){var e;if(this.restartTimeout===null){try{(e=this.pc)==null||e.setRemoteDescription(t)}catch(s){this.log(s),this.scheduleRestart()}this.queuedCandidates.length!==0&&(this.sendLocalCandidates(this.queuedCandidates),this.queuedCandidates=[])}}onConnectionState(){var t,e;if(this.restartTimeout===null)switch(this.status=(e=(t=this.pc)==null?void 0:t.iceConnectionState)!=null?e:"",this.log("peer connection state:",this.status),this.status){case"disconnected":this.scheduleRestart()}}onLocalCandidate(t){if(this.restartTimeout===null&&t.candidate!==null){if(this.eTag===""){this.queuedCandidates.push(t.candidate);return}this.sendLocalCandidates([t.candidate])}}async sendLocalCandidates(t){var s;if(this.sessionUuid===null){this.log("Session-UUID is null"),this.scheduleRestart();return}const e=((s=this.url)!=null?s:"")+"/"+this.sessionUuid;try{const i=await fetch(e,{method:"PATCH",headers:{"Content-Type":"application/trickle-ice-sdpfrag","If-Match":this.eTag},body:this.generateSdpFragment(this.offerData,t)});if(i.status===204)return;if(i.status===404){this.log("stream not found"),this.scheduleRestart();return}this.log("bad status code ".concat(i.status)),this.scheduleRestart()}catch(i){this.log(i),this.scheduleRestart()}}terminate(){this.log("terminating"),this.pc!==null&&(this.pc.close(),this.pc=null)}scheduleRestart(){this.restartTimeout===null&&(this.terminate(),this.restartTimeout=window.setTimeout(()=>{this.log("scheduling restart"),this.restartTimeout=null,this.start()},this.RESTART_PAUSE),this.eTag="",this.queuedCandidates=[])}};l([u({required:!0})],c.prototype,"camSettings",2);l([u({default:null})],c.prototype,"printerUrl",2);l([u({type:String,default:null})],c.prototype,"page",2);l([C()],c.prototype,"video",2);l([m("url")],c.prototype,"changedUrl",1);l([m("expanded",{immediate:!0})],c.prototype,"expandChanged",1);c=l([v],c);var U=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",[e("video",{directives:[{name:"show",rawName:"v-show",value:t.status==="connected",expression:"status === 'connected'"}],ref:"video",staticClass:"webcamImage",style:t.webcamStyle,attrs:{autoplay:"",playsinline:"",muted:""},domProps:{muted:!0}}),t.status!=="connected"?e(R,[e(S,{staticClass:"_webcam_webrtc_output text-center d-flex flex-column justify-center align-center"},[t.status==="connecting"?e(b,{staticClass:"mb-3",attrs:{indeterminate:"",color:"primary"}}):t._e(),e("span",{staticClass:"mt-3"},[t._v(t._s(t.capitalize(t.status)))])],1)],1):t._e()],1)},O=[],W=y(c,U,O,!1,null,"7234d392");const D=W.exports;export{D as default}; diff --git a/assets/WebrtcMediaMTX-D-CyIvoY.css b/assets/WebrtcMediaMTX-D-CyIvoY.css new file mode 100644 index 0000000..5af6aad --- /dev/null +++ b/assets/WebrtcMediaMTX-D-CyIvoY.css @@ -0,0 +1 @@ +.webcamImage[data-v-7234d392]{width:100%}._webcam_webrtc_output[data-v-7234d392]{aspect-ratio:1.5}video[data-v-7234d392]{width:100%} diff --git a/assets/bakedVertexAnimation-jXsepPDt.js b/assets/bakedVertexAnimation-jXsepPDt.js new file mode 100644 index 0000000..ad1adfa --- /dev/null +++ b/assets/bakedVertexAnimation-jXsepPDt.js @@ -0,0 +1 @@ +import{S as e}from"./Viewer-DVCEMRp5.js";const i="bonesDeclaration",t="#if NUM_BONE_INFLUENCERS>0\nattribute vec4 matricesIndices;attribute vec4 matricesWeights;\n#if NUM_BONE_INFLUENCERS>4\nattribute vec4 matricesIndicesExtra;attribute vec4 matricesWeightsExtra;\n#endif\n#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#ifdef BONETEXTURE\nuniform highp sampler2D boneSampler;uniform float boneTextureWidth;\n#else\nuniform mat4 mBones[BonesPerMesh];\n#endif\n#ifdef BONES_VELOCITY_ENABLED\nuniform mat4 mPreviousBones[BonesPerMesh];\n#endif\n#ifdef BONETEXTURE\n#define inline\nmat4 readMatrixFromRawSampler(sampler2D smp,float index)\n{float offset=index *4.0;float dx=1.0/boneTextureWidth;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));return mat4(m0,m1,m2,m3);}\n#endif\n#endif\n#endif\n";e.IncludesShadersStore[i]=t;const a="bakedVertexAnimationDeclaration",r="#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\nuniform float bakedVertexAnimationTime;uniform vec2 bakedVertexAnimationTextureSizeInverted;uniform vec4 bakedVertexAnimationSettings;uniform sampler2D bakedVertexAnimationTexture;\n#ifdef INSTANCES\nattribute vec4 bakedVertexAnimationSettingsInstanced;\n#endif\n#define inline\nmat4 readMatrixFromRawSamplerVAT(sampler2D smp,float index,float frame)\n{float offset=index*4.0;float frameUV=(frame+0.5)*bakedVertexAnimationTextureSizeInverted.y;float dx=bakedVertexAnimationTextureSizeInverted.x;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),frameUV));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),frameUV));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),frameUV));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),frameUV));return mat4(m0,m1,m2,m3);}\n#endif\n";e.IncludesShadersStore[a]=r;const n="bonesVertex",m="#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#if NUM_BONE_INFLUENCERS>0\nmat4 influence;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];\n#endif\n#else\ninfluence=mBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=mBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=mBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=mBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\n#endif\nfinalWorld=finalWorld*influence;\n#endif\n#endif\n";e.IncludesShadersStore[n]=m;const s="bakedVertexAnimation",f="#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\n{\n#ifdef INSTANCES\n#define BVASNAME bakedVertexAnimationSettingsInstanced\n#else\n#define BVASNAME bakedVertexAnimationSettings\n#endif\nfloat VATStartFrame=BVASNAME.x;float VATEndFrame=BVASNAME.y;float VATOffsetFrame=BVASNAME.z;float VATSpeed=BVASNAME.w;float totalFrames=VATEndFrame-VATStartFrame+1.0;float time=bakedVertexAnimationTime*VATSpeed/totalFrames;float frameCorrection=time<1.0 ? 0.0 : 1.0;float numOfFrames=totalFrames-frameCorrection;float VATFrameNum=fract(time)*numOfFrames;VATFrameNum=mod(VATFrameNum+VATOffsetFrame,numOfFrames);VATFrameNum=floor(VATFrameNum);VATFrameNum+=VATStartFrame+frameCorrection;mat4 VATInfluence;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[0],VATFrameNum)*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[1],VATFrameNum)*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[2],VATFrameNum)*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[3],VATFrameNum)*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[0],VATFrameNum)*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[1],VATFrameNum)*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[2],VATFrameNum)*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\nVATInfluence+=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[3],VATFrameNum)*matricesWeightsExtra[3];\n#endif\nfinalWorld=finalWorld*VATInfluence;}\n#endif\n";e.IncludesShadersStore[s]=f; diff --git a/assets/basisTextureLoader-C2AKop91.js b/assets/basisTextureLoader-C2AKop91.js new file mode 100644 index 0000000..b8d8a6e --- /dev/null +++ b/assets/basisTextureLoader-C2AKop91.js @@ -0,0 +1 @@ +import{f as h,I as R,g as v}from"./Viewer-DVCEMRp5.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./index-Bku7SJna.js";import"./echarts-DzoUeqWp.js";import"./codemirror-ZSHHXwGs.js";function D(){const e={cTFETC1:0,cTFETC2:1,cTFBC1:2,cTFBC3:3,cTFBC7:6,cTFPVRTC1_4_RGB:8,cTFPVRTC1_4_RGBA:9,cTFASTC_4x4:10,cTFRGB565:14};let o=null;onmessage=t=>{if(t.data.action==="init"){if(t.data.url)try{importScripts(t.data.url)}catch(n){postMessage({action:"error",error:n})}o||(o=BASIS({wasmBinary:t.data.wasmBinary})),o!==null&&o.then(n=>{BASIS=n,n.initializeBasis(),postMessage({action:"init"})})}else if(t.data.action==="transcode"){const n=t.data.config,a=t.data.imageData,d=new BASIS.BasisFile(a),i=l(d);let f=t.data.ignoreSupportedFormats?null:s(t.data.config,i),p=!1;f===null&&(p=!0,f=i.hasAlpha?e.cTFBC3:e.cTFBC1);let m=!0;d.startTranscoding()||(m=!1);const T=[];for(let g=0;g>2&3],f[_++]=i[u>>4&3],f[_++]=i[u>>6&3]}}return f}}function W(e,o,s){return new Promise((l,r)=>{const c=t=>{t.data.action==="init"?(e.removeEventListener("message",c),l(e)):t.data.action==="error"&&r(t.data.error||"error initializing worker")};e.addEventListener("message",c),e.postMessage({action:"init",url:s?h.GetBabylonScriptURL(s):void 0,wasmBinary:o},[o])})}var C;(function(e){e[e.cTFETC1=0]="cTFETC1",e[e.cTFETC2=1]="cTFETC2",e[e.cTFBC1=2]="cTFBC1",e[e.cTFBC3=3]="cTFBC3",e[e.cTFBC4=4]="cTFBC4",e[e.cTFBC5=5]="cTFBC5",e[e.cTFBC7=6]="cTFBC7",e[e.cTFPVRTC1_4_RGB=8]="cTFPVRTC1_4_RGB",e[e.cTFPVRTC1_4_RGBA=9]="cTFPVRTC1_4_RGBA",e[e.cTFASTC_4x4=10]="cTFASTC_4x4",e[e.cTFATC_RGB=11]="cTFATC_RGB",e[e.cTFATC_RGBA_INTERPOLATED_ALPHA=12]="cTFATC_RGBA_INTERPOLATED_ALPHA",e[e.cTFRGBA32=13]="cTFRGBA32",e[e.cTFRGB565=14]="cTFRGB565",e[e.cTFBGR565=15]="cTFBGR565",e[e.cTFRGBA4444=16]="cTFRGBA4444",e[e.cTFFXT1_RGB=17]="cTFFXT1_RGB",e[e.cTFPVRTC2_4_RGB=18]="cTFPVRTC2_4_RGB",e[e.cTFPVRTC2_4_RGBA=19]="cTFPVRTC2_4_RGBA",e[e.cTFETC2_EAC_R11=20]="cTFETC2_EAC_R11",e[e.cTFETC2_EAC_RG11=21]="cTFETC2_EAC_RG11"})(C||(C={}));const b={JSModuleURL:"".concat(h._DefaultCdnUrl,"/basisTranscoder/1/basis_transcoder.js"),WasmModuleURL:"".concat(h._DefaultCdnUrl,"/basisTranscoder/1/basis_transcoder.wasm")},V=(e,o)=>{let s;switch(e){case C.cTFETC1:s=36196;break;case C.cTFBC1:s=33776;break;case C.cTFBC4:s=33779;break;case C.cTFASTC_4x4:s=37808;break;case C.cTFETC2:s=37496;break;case C.cTFBC7:s=36492;break}if(s===void 0)throw"The chosen Basis transcoder format is not currently supported";return s};let y=null,w=null,k=0;const H=!1,x=()=>(y||(y=new Promise((e,o)=>{w?e(w):h.LoadFileAsync(h.GetBabylonScriptURL(b.WasmModuleURL)).then(s=>{if(typeof URL!="function")return o("Basis transcoder requires an environment with a URL constructor");const l=URL.createObjectURL(new Blob(["(".concat(D,")()")],{type:"application/javascript"}));w=new Worker(l),W(w,s,b.JSModuleURL).then(e,o)}).catch(o)})),y),G=(e,o)=>{const s=e instanceof ArrayBuffer?new Uint8Array(e):e;return new Promise((l,r)=>{x().then(()=>{const c=k++,t=a=>{a.data.action==="transcode"&&a.data.id===c&&(w.removeEventListener("message",t),a.data.success?l(a.data):r("Transcode is not supported on this device"))};w.addEventListener("message",t);const n=new Uint8Array(s.byteLength);n.set(new Uint8Array(s.buffer,s.byteOffset,s.byteLength)),w.postMessage({action:"transcode",id:c,imageData:n,config:o,ignoreSupportedFormats:H},[n.buffer])},c=>{r(c)})})},E=(e,o)=>{var l,r;let s=(l=o._gl)==null?void 0:l.TEXTURE_2D;e.isCube&&(s=(r=o._gl)==null?void 0:r.TEXTURE_CUBE_MAP),o._bindTextureDirectly(s,e,!0)},P=(e,o)=>{const s=e.getEngine();for(let l=0;l{s._releaseTexture(c),E(e,s)})}else e._invertVScale=!e.invertY,e.width=r.width+3&-4,e.height=r.height+3&-4,e.samplingMode=2,E(e,s),s._uploadDataToTextureDirectly(e,new Uint16Array(r.transcodedPixels.buffer),l,0,4,!0);else{e.width=r.width,e.height=r.height,e.generateMipMaps=o.fileInfo.images[l].levels.length>1;const c=B.GetInternalFormatFromBasisFormat(o.format,s);e.format=c,E(e,s),o.fileInfo.images[l].levels.forEach((t,n)=>{s._uploadCompressedDataToTextureDirectly(e,c,t.width,t.height,t.transcodedPixels,l,n)}),s._features.basisNeedsPOT&&(Math.log2(e.width)%1!==0||Math.log2(e.height)%1!==0)&&(h.Warn("Loaded .basis texture width and height are not a power of two. Texture wrapping will be set to Texture.CLAMP_ADDRESSMODE as other modes are not supported with non power of two dimensions in webGL 1."),e._cachedWrapU=v.CLAMP_ADDRESSMODE,e._cachedWrapV=v.CLAMP_ADDRESSMODE)}}},B={JSModuleURL:b.JSModuleURL,WasmModuleURL:b.WasmModuleURL,GetInternalFormatFromBasisFormat:V,TranscodeAsync:G,LoadTextureFromTranscodeResult:P};Object.defineProperty(B,"JSModuleURL",{get:function(){return b.JSModuleURL},set:function(e){b.JSModuleURL=e}});Object.defineProperty(B,"WasmModuleURL",{get:function(){return b.WasmModuleURL},set:function(e){b.WasmModuleURL=e}});class ${constructor(){this.supportCascades=!1}loadCubeData(o,s,l,r,c){if(Array.isArray(o))return;const t=s.getEngine().getCaps(),n={supportedCompressionFormats:{etc1:!!t.etc1,s3tc:!!t.s3tc,pvrtc:!!t.pvrtc,etc2:!!t.etc2,astc:!!t.astc,bc7:!!t.bptc}};G(o,n).then(a=>{const d=a.fileInfo.images[0].levels.length>1&&s.generateMipMaps;P(s,a),s.getEngine()._setCubeMapTextureParams(s,d),s.isReady=!0,s.onLoadedObservable.notifyObservers(s),s.onLoadedObservable.clear(),r&&r()}).catch(a=>{h.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"),s.isReady=!0,c&&c(a)})}loadData(o,s,l){const r=s.getEngine().getCaps(),c={supportedCompressionFormats:{etc1:!!r.etc1,s3tc:!!r.s3tc,pvrtc:!!r.pvrtc,etc2:!!r.etc2,astc:!!r.astc,bc7:!!r.bptc}};G(o,c).then(t=>{const n=t.fileInfo.images[0].levels[0],a=t.fileInfo.images[0].levels.length>1&&s.generateMipMaps;l(n.width,n.height,a,t.format!==-1,()=>{P(s,t)})}).catch(t=>{h.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"),h.Warn("Failed to transcode Basis file: ".concat(t)),l(0,0,!1,!1,()=>{},!0)})}}export{$ as _BasisTextureLoader}; diff --git a/assets/bonesVertex-B72aYlMi.js b/assets/bonesVertex-B72aYlMi.js new file mode 100644 index 0000000..1481ff0 --- /dev/null +++ b/assets/bonesVertex-B72aYlMi.js @@ -0,0 +1 @@ +import{S as e}from"./Viewer-DVCEMRp5.js";const t="bonesDeclaration",n="#if NUM_BONE_INFLUENCERS>0\nattribute matricesIndices : vec4;attribute matricesWeights : vec4;\n#if NUM_BONE_INFLUENCERS>4\nattribute matricesIndicesExtra : vec4;attribute matricesWeightsExtra : vec4;\n#endif\n#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#ifdef BONETEXTURE\nvar boneSampler : texture_2d;uniform boneTextureWidth : f32;\n#else\nuniform mBones : array;\n#ifdef BONES_VELOCITY_ENABLED\nuniform mPreviousBones : array;\n#endif\n#endif\n#ifdef BONETEXTURE\nfn readMatrixFromRawSampler(smp : texture_2d,index : f32)->mat4x4\n{let offset=i32(index) *4; \nlet m0=textureLoad(smp,vec2(offset+0,0),0);let m1=textureLoad(smp,vec2(offset+1,0),0);let m2=textureLoad(smp,vec2(offset+2,0),0);let m3=textureLoad(smp,vec2(offset+3,0),0);return mat4x4(m0,m1,m2,m3);}\n#endif\n#endif\n#endif\n";e.IncludesShadersStoreWGSL[t]=n;const i="bonesVertex",r="#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#if NUM_BONE_INFLUENCERS>0\nvar influence : mat4x4;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3];\n#endif \n#else \ninfluence=uniforms.mBones[int(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];\n#endif \n#endif\nfinalWorld=finalWorld*influence;\n#endif\n#endif\n";e.IncludesShadersStoreWGSL[i]=r; diff --git a/assets/clipPlaneFragment-ef4zNzcj.js b/assets/clipPlaneFragment-ef4zNzcj.js new file mode 100644 index 0000000..7d68fb0 --- /dev/null +++ b/assets/clipPlaneFragment-ef4zNzcj.js @@ -0,0 +1 @@ +import{S as e}from"./Viewer-DVCEMRp5.js";const i="clipPlaneFragmentDeclaration",f="#ifdef CLIPPLANE\nvarying fClipDistance: f32;\n#endif\n#ifdef CLIPPLANE2\nvarying fClipDistance2: f32;\n#endif\n#ifdef CLIPPLANE3\nvarying fClipDistance3: f32;\n#endif\n#ifdef CLIPPLANE4\nvarying fClipDistance4: f32;\n#endif\n#ifdef CLIPPLANE5\nvarying fClipDistance5: f32;\n#endif\n#ifdef CLIPPLANE6\nvarying fClipDistance6: f32;\n#endif\n";e.IncludesShadersStoreWGSL[i]=f;const n="clipPlaneFragment",d="#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nif (false) {}\n#endif\n#ifdef CLIPPLANE\nelse if (fragmentInputs.fClipDistance>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE2\nelse if (fragmentInputs.fClipDistance2>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE3\nelse if (fragmentInputs.fClipDistance3>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE4\nelse if (fragmentInputs.fClipDistance4>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE5\nelse if (fragmentInputs.fClipDistance5>0.0)\n{discard;}\n#endif\n#ifdef CLIPPLANE6\nelse if (fragmentInputs.fClipDistance6>0.0)\n{discard;}\n#endif\n";e.IncludesShadersStoreWGSL[n]=d; diff --git a/assets/clipPlaneVertex-L9tMAQxe.js b/assets/clipPlaneVertex-L9tMAQxe.js new file mode 100644 index 0000000..a55e865 --- /dev/null +++ b/assets/clipPlaneVertex-L9tMAQxe.js @@ -0,0 +1 @@ +import{S as e}from"./Viewer-DVCEMRp5.js";const i="clipPlaneVertexDeclaration",f="#ifdef CLIPPLANE\nuniform vClipPlane: vec4;varying fClipDistance: f32;\n#endif\n#ifdef CLIPPLANE2\nuniform vClipPlane2: vec4;varying fClipDistance2: f32;\n#endif\n#ifdef CLIPPLANE3\nuniform vClipPlane3: vec4;varying fClipDistance3: f32;\n#endif\n#ifdef CLIPPLANE4\nuniform vClipPlane4: vec4;varying fClipDistance4: f32;\n#endif\n#ifdef CLIPPLANE5\nuniform vClipPlane5: vec4;varying fClipDistance5: f32;\n#endif\n#ifdef CLIPPLANE6\nuniform vClipPlane6: vec4;varying fClipDistance6: f32;\n#endif\n";e.IncludesShadersStoreWGSL[i]=f;const n="clipPlaneVertex",l="#ifdef CLIPPLANE\nvertexOutputs.fClipDistance=dot(worldPos,uniforms.vClipPlane);\n#endif\n#ifdef CLIPPLANE2\nvertexOutputs.fClipDistance2=dot(worldPos,uniforms.vClipPlane2);\n#endif\n#ifdef CLIPPLANE3\nvertexOutputs.fClipDistance3=dot(worldPos,uniforms.vClipPlane3);\n#endif\n#ifdef CLIPPLANE4\nvertexOutputs.fClipDistance4=dot(worldPos,uniforms.vClipPlane4);\n#endif\n#ifdef CLIPPLANE5\nvertexOutputs.fClipDistance5=dot(worldPos,uniforms.vClipPlane5);\n#endif\n#ifdef CLIPPLANE6\nvertexOutputs.fClipDistance6=dot(worldPos,uniforms.vClipPlane6);\n#endif\n";e.IncludesShadersStoreWGSL[n]=l; diff --git a/assets/codemirror-ZSHHXwGs.js b/assets/codemirror-ZSHHXwGs.js new file mode 100644 index 0000000..2d6e186 --- /dev/null +++ b/assets/codemirror-ZSHHXwGs.js @@ -0,0 +1 @@ +class Q{lineAt(e){if(e<0||e>this.length)throw new RangeError("Invalid position ".concat(e," in document of length ").concat(this.length));return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError("Invalid line number ".concat(e," in ").concat(this.lines,"-line document"));return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),qe.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),qe.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new di(this),r=new di(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new di(this,e)}iterRange(e,t=this.length){return new ra(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new oa(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Q.empty:e.length<=32?new G(e):qe.from(G.split(e,[]))}}class G extends Q{constructor(e,t=gf(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new mf(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new G(oo(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=cn(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new G(l,o.length+r.length));else{let a=l.length>>1;i.push(new G(l.slice(0,a)),new G(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof G))return super.replace(e,t,i);let s=cn(this.text,cn(i.text,oo(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new G(s,r):qe.from(G.split(s,[]),r)}sliceString(e,t=this.length,i="\n"){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new G(i,s)),i=[],s=-1);return s>-1&&t.push(new G(i,s)),t}}class qe extends Q{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if(i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let c=this.children.slice();return c[s]=a,new qe(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i="\n"){let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof qe))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new G(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof qe)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof G&&a&&(p=c[c.length-1])instanceof G&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new G(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:qe.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new qe(l,t)}}Q.empty=new G([""],0);function gf(n){let e=-1;for(let t of n)e+=t.length+1;return e}function cn(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof G?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof G?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value="\n",this;e--}else if(s instanceof G){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof G?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class ra{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new di(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class oa{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Q.prototype[Symbol.iterator]=function(){return this.iter()},di.prototype[Symbol.iterator]=ra.prototype[Symbol.iterator]=oa.prototype[Symbol.iterator]=function(){return this});class mf{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Vt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return Vt[e-1]<=n;return!1}function lo(n){return n>=127462&&n<=127487}const ao=8205;function ue(n,e,t=!0,i=!0){return(t?la:bf)(n,e,i)}function la(n,e,t){if(e==n.length)return e;e&&aa(n.charCodeAt(e))&&ha(n.charCodeAt(e-1))&&e--;let i=re(n,e);for(e+=De(i);e=0&&lo(re(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function bf(n,e,t){for(;e>0;){let i=la(n,e-2,t);if(i=56320&&n<57344}function ha(n){return n>=55296&&n<56320}function re(n,e){let t=n.charCodeAt(e);if(!ha(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return aa(i)?(t-55296<<10)+(i-56320)+65536:t}function Sr(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function De(n){return n<65536?1:2}const Ds=/\r\n?|\n/;var pe=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(pe||(pe={}));class Ke{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=pe.Simple&&h>=e&&(i==pe.TrackDel&&se||i==pe.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError("Position ".concat(e," is out of range for changeset of length ").concat(s));return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ke(e)}static create(e){return new Ke(e)}}class J extends Ke{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Rs(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return Bs(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&ht(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError("Invalid change range ".concat(f," to ").concat(u," (in doc of length ").concat(t,")"));let p=d?typeof d=="string"?Q.of(d.split(i||Ds)):d:Q.empty,m=p.length;if(f==u&&m==0)return;fo&&ce(s,f-o,-1),ce(s,u-f,m),ht(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new J(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function ht(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function Bs(n,e,t,i=!1){let s=[],r=i?[]:null,o=new yi(n),l=new yi(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);ce(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class yi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?Q.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?Q.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class At{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new At(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return x.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return x.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return x.range(e.anchor,e.head)}static create(e,t,i){return new At(e,t,i)}}class x{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:x.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new x(e.ranges.map(t=>At.fromJSON(t)),e.main)}static single(e,t=e){return new x([x.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?x.range(a,l):x.range(l,a))}}return new x(e,t)}}function fa(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let vr=0;class A{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=vr++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new A(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Cr),!!e.static,e.enables)}of(e){return new fn([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new fn(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new fn(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Cr(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class fn{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=vr++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Es(f,c)){let d=i(f);if(l?!ho(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=wn(u,p);if(this.dependencies.every(g=>g instanceof A?u.facet(g)===f.facet(g):g instanceof le?u.field(g,!1)==f.field(g,!1):!0)||(l?ho(d=i(f),m,s):s(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}}function ho(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(co).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,co.of({field:this,create:e})]}get extension(){return this}}const vt={lowest:4,low:3,default:2,high:1,highest:0};function ii(n){return e=>new ua(e,n)}const Zt={highest:ii(vt.highest),high:ii(vt.high),default:ii(vt.default),low:ii(vt.low),lowest:ii(vt.lowest)};class ua{constructor(e,t){this.inner=e,this.prec=t}}class Un{of(e){return new Ls(this,e)}reconfigure(e){return Un.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Ls{constructor(e,t){this.compartment=e,this.inner=t}}class kn{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Of(e,t,o))u instanceof le?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,Cr(m,d))a.push(i.facet(p));else{let g=p.combine(d.map(y=>y.value));a.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(y=>g.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(g=>xf(g,p,d))}}let f=h.map(u=>u(l));return new kn(e,o,f,l,a,r)}}function Of(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof Ls&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof Ls){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof ua)r(o.inner,o.prec);else if(o instanceof le)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof fn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,vt.default);else{let h=o.extension;if(!h)throw new Error("Unrecognized extension value in extension set (".concat(o,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));r(h,l)}}return r(n,vt.default),i.reduce((o,l)=>o.concat(l))}function pi(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function wn(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const da=A.define(),pa=A.define({combine:n=>n.some(e=>e),static:!0}),ga=A.define({combine:n=>n.length?n[0]:void 0,static:!0}),ma=A.define(),ya=A.define(),ba=A.define(),xa=A.define({combine:n=>n.length?n[0]:!1});class st{constructor(e,t){this.type=e,this.value=t}static define(){return new kf}}class kf{of(e){return new st(this,e)}}class wf{constructor(e){this.map=e}of(e){return new R(this,e)}}class R{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new R(this.type,t)}is(e){return this.type==e}static define(e={}){return new wf(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}R.reconfigure=R.define();R.appendConfig=R.define();class te{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&fa(i,t.newLength),r.some(l=>l.type==te.time)||(this.annotations=r.concat(te.time.of(Date.now())))}static create(e,t,i,s,r,o){return new te(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(te.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}te.time=st.define();te.userEvent=st.define();te.addToHistory=st.define();te.remote=st.define();function Sf(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof te?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof te?n=r[0]:n=ka(e,Ft(r),!1)}return n}function Cf(n){let e=n.startState,t=e.facet(ba),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=Oa(i,Is(e,r,n.changes.newLength),!0))}return i==n?n:te.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const Af=[];function Ft(n){return n==null?Af:Array.isArray(n)?n:[n]}var U=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(U||(U={}));const Pf=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Ns;try{Ns=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Mf(n){if(Ns)return Ns.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||Pf.test(t)))return!0}return!1}function Tf(n){return e=>{if(!/\S/.test(e))return U.Space;if(Mf(e))return U.Word;for(let t=0;t-1)return U.Word;return U.Other}}class N{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(R.reconfigure)?(t=null,i=o.value):o.is(R.appendConfig)&&(t=null,i=Ft(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=kn.resolve(i,s,this),r=new N(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new N(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:x.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Ft(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return N.create({doc:e.doc,selection:x.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=kn.resolve(e.extensions||[],new Map),i=e.doc instanceof Q?e.doc:Q.of((e.doc||"").split(t.staticFacet(N.lineSeparator)||Ds)),s=e.selection?e.selection instanceof x?e.selection:x.single(e.selection.anchor,e.selection.head):x.single(0);return fa(s,i.length),t.staticFacet(pa)||(s=s.asSingle()),new N(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(N.tabSize)}get lineBreak(){return this.facet(N.lineSeparator)||"\n"}get readOnly(){return this.facet(xa)}phrase(e,...t){for(let i of this.facet(N.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(da))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return Tf(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=ue(t,o,!1);if(r(t.slice(a,o))!=U.Word)break;o=a}for(;ln.length?n[0]:4});N.lineSeparator=ga;N.readOnly=xa;N.phrases=A.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});N.languageData=da;N.changeFilter=ma;N.transactionFilter=ya;N.transactionExtender=ba;Un.reconfigure=R.define();function Ye(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class Dt{eq(e){return this==e}range(e,t=e){return Qs.create(e,t,this)}}Dt.prototype.startSide=Dt.prototype.endSide=0;Dt.prototype.point=!1;Dt.prototype.mapMode=pe.TrackDel;let Qs=class wa{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new wa(e,t,i)}};function Ws(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Ar{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Ar(s,r,i,l):null,pos:o}}}class W{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new W(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Ws)),this.isEmpty)return t.length?W.of(t):this;let l=new Sa(this,null,-1).goto(0),a=0,h=[],c=new gt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return bi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return bi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=fo(o,l,i),h=new ni(o,a,r),c=new ni(l,a,r);i.iterGaps((f,u,d)=>uo(h,f,c,u,d,s)),i.empty&&i.length==0&&uo(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=999999999);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=fo(r,o),a=new ni(r,l,0).goto(i),h=new ni(o,l,0).goto(i);for(;;){if(a.to!=h.to||!$s(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new ni(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new gt;for(let s of e instanceof Qs?[e]:t?Df(e):e)i.add(s.from,s.to,s.value);return i.finish()}}W.empty=new W([],[],null,-1);function Df(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(Ws);e=i}return n}W.empty.nextLayer=W.empty;class gt{finishChunk(e){this.chunks.push(new Ar(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new gt)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(W.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=W.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function fo(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new Sa(o,t,i,r));return s.length==1?s[0]:new bi(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)ss(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)ss(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),ss(this.heap,0)}}}function ss(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class ni{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=bi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Fi(this.active,e),Fi(this.activeTo,e),Fi(this.activeRank,e),this.minActive=po(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&Fi(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function uo(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let h=n.to+a-t.to||n.endSide-t.endSide,c=h<0?n.to+a:t.to,f=Math.min(c,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&$s(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!$s(n.active,t.active)&&r.compareRange(l,f,n.active,t.active),c>o)break;l=c,h<=0&&n.next(),h>=0&&t.next()}}function $s(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function po(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=ue(n,s)}return i===!0?-1:n.length}const Vs="ͼ",go=typeof Symbol>"u"?"__"+Vs:Symbol.for(Vs),Fs=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),mo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class mt{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=mo[go]||1;return mo[go]=e+1,Vs+e.toString(36)}static mount(e,t,i){let s=e[Fs],r=i&&i.nonce;s?r&&s.setNonce(r):s=new Rf(e,r),s.mount(Array.isArray(t)?t:[t])}}let yo=new Map;class Rf{constructor(e,t){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=yo.get(i);if(r)return e.adoptedStyleSheets=[r.sheet,...e.adoptedStyleSheets],e[Fs]=r;this.sheet=new s.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],yo.set(i,this)}else{this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let r=e.head||e;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],e[Fs]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Bf=typeof navigator<"u"&&/Mac/.test(navigator.platform),Ef=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var oe=0;oe<10;oe++)yt[48+oe]=yt[96+oe]=String(oe);for(var oe=1;oe<=24;oe++)yt[oe+111]="F"+oe;for(var oe=65;oe<=90;oe++)yt[oe]=String.fromCharCode(oe+32),xi[oe]=String.fromCharCode(oe);for(var rs in yt)xi.hasOwnProperty(rs)||(xi[rs]=yt[rs]);function Lf(n){var e=Bf&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Ef&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?xi:yt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Sn(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Hs(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function If(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function un(n,e){if(!e.anchorNode)return!1;try{return Hs(n,e.anchorNode)}catch{return!1}}function Oi(n){return n.nodeType==3?Rt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function vn(n,e,t,i){return t?bo(n,e,t,i,-1)||bo(n,e,t,i,1):!1}function ki(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function bo(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:et(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=ki(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?et(n):0}else return!1}}function et(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Pr(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function Nf(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function Qf(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,m=1;if(d)u=Nf(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let w=c.getBoundingClientRect();p=w.width/c.offsetWidth,m=w.height/c.offsetHeight,u={left:w.left,right:w.left+c.clientWidth*p,top:w.top,bottom:w.top+c.clientHeight*m}}let g=0,y=0;if(s=="nearest")e.top0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+y+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y0&&e.right>u.right+g&&(g=e.right-u.right+g+r)):e.right>u.right&&(g=e.right-u.right+r,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class $f{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?et(t):0),i,Math.min(e.focusOffset,i?et(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Nt=null;function va(n){if(n.setActive)return n.setActive();if(Nt)return n.focus(Nt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Nt==null?{get preventScroll(){return Nt={preventScroll:!0},!0}}:void 0),!Nt){Nt=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}class fe{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new fe(e.parentNode,ki(e),t)}static after(e,t){return new fe(e.parentNode,ki(e)+1,t)}}const Mr=[];class q{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,s=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=q.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=Oo(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=Oo(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let s=et(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!q.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;at)return f.domBoundsAround(e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=Mr){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Ma(n,e,t,i,s,r,o,l,a){let{children:h}=n,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,a))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(t2);var M={mac:wo||/Mac/.test(Me.platform),windows:/Win/.test(Me.platform),linux:/Linux|X11/.test(Me.platform),ie:Xn,ie_version:Da?qs.documentMode||6:Xs?+Xs[1]:Us?+Us[1]:0,gecko:ko,gecko_version:ko?+(/Firefox\/(\d+)/.exec(Me.userAgent)||[0,0])[1]:0,chrome:!!os,chrome_version:os?+os[1]:0,ios:wo,android:/Android\b/.test(Me.userAgent),safari:Ra,webkit_version:Ff?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:qs.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Hf=256;class tt extends q{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof tt)||this.length-(t-e)+i.length>Hf||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new tt(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new fe(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return qf(this.dom,e,t)}}class it extends q{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(Ca(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,r,o){return i&&(!(i instanceof it&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new it(this.mark,t,o)}domAtPos(e){return Ba(this,e)}coordsAt(e,t){return La(this,e,t)}}function qf(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?M.chrome||M.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return M.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?Pr(a,o<0):a||null}class ct extends q{static create(e,t,i){return new ct(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=ct.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof ct)||!this.widget.compare(i.widget)||e>0&&r<=0||t0)?fe.before(this.dom):fe.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top0?fe.before(this.dom):fe.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Q.empty}get isHidden(){return!0}}tt.prototype.children=ct.prototype.children=jt.prototype.children=Mr;function Ba(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;sr&&e0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof it&&s.length&&(i=s[s.length-1])instanceof it&&i.mark.eq(e.mark)?Ea(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function La(n,e,t){let i=null,s=-1,r=null,o=-1;function l(h,c){for(let f=0,u=0;f=c&&(d.children.length?l(d,c-u):(!r||r.isHidden&&t>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function Gs(n,e,t){let i=!1;if(e)for(let s in e)t&&s in t||(i=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(i=!0,s=="style"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return i}function Xf(n){let e=Object.create(null);for(let t=0;t0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Tr(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Ea(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=js(t,this.attrs||{})),i&&(this.attrs=js({class:i},this.attrs||{}))}domAtPos(e){return Ba(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(Ca(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Gs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&q.get(s)instanceof it;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=q.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!M.ios||!this.children.some(r=>r instanceof tt))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof tt)||/[^ -~]/.test(i.text))return null;let s=Oi(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=La(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof Z)return r;if(o>t)break}s=o+r.breakAfter}return null}}class ut extends q{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof ut)||!this.widget.compare(i.widget)||e>0&&r<=0||t0}}class Ot{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}destroy(e){}}var ge=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(ge||(ge={}));class D extends Dt{constructor(e,t,i,s){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return new Ii(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new bt(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Ia(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new bt(e,i,s,t,e.widget||null,!0)}static line(e){return new Ni(e)}static set(e,t=!1){return W.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}D.none=W.empty;class Ii extends D{constructor(e){let{start:t,end:i}=Ia(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof Ii&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&Tr(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Ii.prototype.point=!1;class Ni extends D{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Ni&&this.spec.class==e.spec.class&&Tr(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Ni.prototype.mapMode=pe.TrackBefore;Ni.prototype.point=!0;class bt extends D{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?pe.TrackBefore:pe.TrackAfter:pe.TrackDel}get type(){return this.startSide!=this.endSide?ge.WidgetRange:this.startSide<=0?ge.WidgetBefore:ge.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof bt&&jf(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}bt.prototype.point=!0;function Ia(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t!=null?t:e,end:i!=null?i:e}}function jf(n,e){return n==e||!!(n&&e&&n.compare(e))}function Ks(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class gi{constructor(e,t,i,s){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof ut&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Z),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(qi(new jt(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof ut)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(qi(new tt(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof bt){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof bt)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ut(i.widget||new vo("div"),l,i));else{let a=ct.create(i.widget||new vo("span"),l,l?0:i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),c=!a.isEditable&&(es.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(f.append(qi(new jt(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(qi(a,s),r),this.atCursorPos=c,this.pendingBuffer=c?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new gi(e,t,i,r);return o.openEnd=W.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function qi(n,e){for(let t of e)n=new it(t,[n],n.length);return n}class vo extends Ot{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const Na=A.define(),Qa=A.define(),Wa=A.define(),$a=A.define(),_s=A.define(),za=A.define(),Va=A.define(),Fa=A.define({combine:n=>n.some(e=>e)}),Ha=A.define({combine:n=>n.some(e=>e)});class Cn{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new Cn(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const Co=R.define({map:(n,e)=>n.map(e)});function Ie(n,e,t){let i=n.facet($a);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const jn=A.define({combine:n=>n.length?n[0]:!0});let Gf=0;const li=A.define();class K{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new K(Gf++,e,i,s,l=>{let a=[li.of(l)];return o&&a.push(wi.of(h=>{let c=h.plugin(l);return c?o(c):D.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return K.define(i=>new e(i),t)}}class ls{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Ie(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Ie(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Ie(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const qa=A.define(),Dr=A.define(),wi=A.define(),Rr=A.define(),Ua=A.define();function Ao(n,e,t){let i=n.state.facet(Ua);if(!i.length)return i;let s=i.map(o=>o instanceof Function?o(n):o),r=[];return W.spans(s,e,t,{point(){},span(o,l,a,h){let c=r;for(let f=a.length-1;f>=0;f--,h--){let u=a[f].spec.bidiIsolate,d;if(u!=null)if(h>0&&c.length&&(d=c[c.length-1]).to==o&&d.direction==u)d.to=l,c=d.inner;else{let p={from:o,to:l,direction:u,inner:[]};c.push(p),c=p.inner}}}}),r}const Xa=A.define();function ja(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(Xa)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const ai=A.define();class Ee{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Ee(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!a)return i;new Ee(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class An{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=J.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Ee(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new An(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var X=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(X||(X={}));const Si=X.LTR,Ga=X.RTL;function Ka(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function _a(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;m-=3)if($e[m+1]==-d){let g=$e[m+2],y=g&2?s:g&4?g&1?r:s:0;y&&($[f]=$[$e[m]]=y),l=m;break}}else{if($e.length==189)break;$e[l++]=f,$e[l++]=u,$e[l++]=a}else if((p=$[f])==2||p==1){let m=p==s;a=m?0:1;for(let g=l-3;g>=0;g-=3){let y=$e[g+2];if(y&2)break;if(m)$e[g+2]|=2;else{if(y&4)break;$e[g+2]|=4}}}}}function tu(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=sa;)p==g&&(p=t[--m].from,g=m?t[m-1].to:n),$[--p]=d;a=c}else r=h,a++}}}function Zs(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,h=0;aa&&o.push(new ft(a,m.from,d));let g=m.direction==Si!=!(d%2);Js(n,g?i+1:i,s,m.inner,m.from,m.to,o),a=m.to}p=m.to}else{if(p==t||(c?$[p]!=l:$[p]==l))break;p++}u?Zs(n,a,p,i+1,s,u,o):ae;){let c=!0,f=!1;if(!h||a>r[h-1].to){let m=$[a-1];m!=l&&(c=!1,f=m==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h&&p==r[h-1].to){if(f)break e;let m=r[--h];if(!c)for(let g=m.from,y=h;;){if(g==e)break e;if(y&&r[y-1].to==g)g=r[--y].from;else{if($[g-1]==l)break e;break}}if(u)u.push(m);else{m.to$.length;)$[$.length]=256;let i=[],s=e==Si?0:1;return Js(n,s,s,t,0,n.length,i),i}function Ya(n){return[new ft(0,n,0)]}let Za="";function nu(n,e,t,i,s){var r;let o=i.head-n.from,l=-1;if(o==0){if(!s||!n.length)return null;e[0].level!=t&&(o=e[0].side(!1,t),l=0)}else if(o==n.length){if(s)return null;let u=e[e.length-1];u.level!=t&&(o=u.side(!0,t),l=e.length-1)}l<0&&(l=ft.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc));let a=e[l];o==a.side(s,t)&&(a=e[l+=s?1:-1],o=a.side(!s,t));let h=s==(a.dir==t),c=ue(n.text,o,h);if(Za=n.text.slice(Math.min(o,c),Math.max(o,c)),c!=a.side(s,t))return x.cursor(c+n.from,h?-1:1,a.level);let f=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return!f&&a.level!=t?x.cursor(s?n.to:n.from,s?-1:1,t):f&&f.level0&&i.length&&(i.every(({fromA:h,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let s=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!cu(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?ru(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:c}=this.hasComposition;i=new Ee(h,c,e.changes.mapPos(h,-1),e.changes.mapPos(c,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(M.ie||M.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=au(o,l,e.changes);return i=Ee.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=M.chrome||M.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:h,fromB:c,toB:f}=l,u,d,p,m;if(i&&i.range.fromBc){let O=gi.build(this.view.state.doc,c,i.range.fromB,this.decorations,this.dynamicDecorationMap),k=gi.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=O.breakAtStart,p=O.openStart,m=k.openEnd;let S=this.compositionView(i);k.breakAtStart?S.breakAfter=1:k.content.length&&S.merge(S.length,S.length,k.content[0],!1,k.openStart,0)&&(S.breakAfter=k.content[0].breakAfter,k.content.shift()),O.content.length&&S.merge(0,0,O.content[O.content.length-1],!0,0,O.openEnd)&&O.content.pop(),u=O.content.concat(S).concat(k.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:m}=gi.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:y}=r.findPos(h,1),{i:w,off:C}=r.findPos(a,-1);Ma(this,w,C,g,y,u,d,p,m)}i&&this.fixCompositionDOM(i)}compositionView(e){let t=new tt(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new it(s,[t],t.length);let i=new Z;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=q.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&un(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),h=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(M.gecko&&l.empty&&!this.hasComposition&&su(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new fe(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||!vn(a.node,a.offset,c.anchorNode,c.anchorOffset)||!vn(h.node,h.offset,c.focusNode,c.focusOffset))&&(this.view.observer.ignore(()=>{M.android&&M.chrome&&this.dom.contains(c.focusNode)&&hu(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=Sn(this.view.root);if(f)if(l.empty){if(M.gecko){let u=ou(a.node,a.offset);if(u&&u!=3){let d=eh(a.node,a.offset,u==1?1:-1);d&&(a=new fe(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new fe(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new fe(c.focusNode,c.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=Sn(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=Z.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let s=e.offset;!i&&s=0;s--){let r=q.get(t.childNodes[s]);r instanceof Z&&(i=r.domAtPos(r.length))}return i?new fe(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=q.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t=0;o--){let l=this.children[o],a=r-l.breakAfter,h=a-l.length;if(ae||l.covers(1))&&(!i||l instanceof Z&&!(i instanceof Z&&t>=0))&&(i=l,s=h),r=h}return i?i.coordsAt(e-s,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),s=this.children[t];if(!(s instanceof Z))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof tt))return null;let r=ue(s.text,i);if(r==i)return null;let o=Rt(s.dom,i,r).getClientRects();return!o.length||o[0].top>=o[0].bottom?null:o[0]}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==X.LTR;for(let h=0,c=0;cs)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,m=p?Oi(p):[];if(m.length){let g=m[m.length-1],y=a?g.right-d.left:d.right-g.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?X.RTL:X.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Z){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=Oi(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Pa(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(D.replace({widget:new Mo(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return D.set(e)}updateDeco(){let e=this.view.state.facet(wi).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=ja(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom};Qf(this.view.scrollDOM,o,t.head0)i=i.childNodes[s-1],s=et(i);else break}if(t>=0)for(let i=n,s=e;;){if(i.nodeType==3)return{node:i,offset:s};if(i.nodeType==1&&s=0)i=i.childNodes[s],s=0;else break}return null}function ou(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e{ie.from&&(t=!0)}),t}function fu(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return x.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=ue(s.text,r,!1):l=ue(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let h=ue(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;ln?e.left-n:Math.max(0,n-e.right)}function du(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function as(n,e){return n.tope.top+1}function To(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function er(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let m=Oi(p);for(let g=0;gC||o==C&&r>w){i=p,s=y,r=w,o=C;let O=C?t0?g0)}w==0?t>y.bottom&&(!c||c.bottomy.top)&&(h=p,f=y):c&&as(c,y)?c=Do(c,y.bottom):f&&as(f,y)&&(f=To(f,y.top))}}if(c&&c.bottom>=t?(i=a,s=c):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return Ro(i,u,t);if(l&&i.contentEditable!="false")return er(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function Ro(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((M.chrome||M.gecko)&&Rt(n,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function th(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:h}=n.viewState,{x:c,y:f}=e,u=f-l;if(u<0)return 0;if(u>h)return n.state.doc.length;for(let O=n.viewState.heightOracle.textHeight/2,k=!1;a=n.elementAtHeight(u),a.type!=ge.Text;)for(;u=i>0?a.bottom+O:a.top-O,!(u>=0&&u<=h);){if(k)return t?null:0;k=!0,i=-i}f=l+u;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:Bo(n,o,a,c,f);let p=n.dom.ownerDocument,m=n.root.elementFromPoint?n.root:p,g=m.elementFromPoint(c,f);g&&!n.contentDOM.contains(g)&&(g=null),g||(c=Math.max(o.left+1,Math.min(o.right-1,c)),g=m.elementFromPoint(c,f),g&&!n.contentDOM.contains(g)&&(g=null));let y,w=-1;if(g&&((s=n.docView.nearest(g))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let O=p.caretPositionFromPoint(c,f);O&&({offsetNode:y,offset:w}=O)}else if(p.caretRangeFromPoint){let O=p.caretRangeFromPoint(c,f);O&&({startContainer:y,startOffset:w}=O,(!n.contentDOM.contains(y)||M.safari&&pu(y,w,c)||M.chrome&&gu(y,w,c))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let O=Z.find(n.docView,d);if(!O)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:w}=er(O.dom,c,f))}let C=n.docView.nearest(y);if(!C)return null;if(C.isWidget&&((r=C.dom)===null||r===void 0?void 0:r.nodeType)==1){let O=C.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+zs(o,r,n.state.tabSize)}function pu(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Rt(n,i-1,i).getBoundingClientRect().left>t}function gu(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Rt(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function tr(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==ge.Text))return i}return t}function mu(n,e,t,i){let s=tr(n,e.head),r=!i||s.type!=ge.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==X.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return x.cursor(a,t?-1:1)}return x.cursor(t?s.to:s.from,t?-1:1)}function Eo(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=nu(s,r,o,l,t),c=Za;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c="\n",s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=x.cursor(t?s.from:s.to)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function yu(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==U.Space&&(s=o),s==o}}function bu(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return x.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s,e.assoc||-1),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i!=null?i:n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,m=th(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?ms)){let g=n.docView.coordsForChar(m),y=!g||p{if(e>r&&es(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:x.cursor(i,i{if(t.target==e.scrollDOM&&t.clientY>e.contentDOM.getBoundingClientRect().bottom&&(this.runHandlers("mousedown",t),!t.defaultPrevented&&t.button==2)){let i=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=i,200)}}),e.scrollDOM.addEventListener("drop",t=>{t.target==e.scrollDOM&&t.clientY>e.contentDOM.getBoundingClientRect().bottom&&this.runHandlers("drop",t)}),this.notifiedFocused=e.hasFocus,M.safari&&e.contentDOM.addEventListener("input",()=>null),M.gecko&&Iu(e.contentDOM.ownerDocument)}handleEvent(e){!Pu(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let i=this.handlers[e];if(i){for(let s of i.observers)s(this.view,t);for(let s of i.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Ou(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()i.keyCode==e.keyCode))&&!e.ctrlKey||ku.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,Ht(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:M.safari&&!M.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Lo(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){Ie(t.state,s)}}}function Ou(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let s=i.spec;if(s&&s.domEventHandlers)for(let r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(Lo(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(Lo(i.value,o))}}for(let i in _e)t(i).handlers.push(_e[i]);for(let i in Ne)t(i).observers.push(Ne[i]);return e}const ih=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ku="dthko",nh=[16,17,18,20,91,92,224,225],Ui=6;function Xi(n){return Math.max(0,n)*.7+8}function wu(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class Su{constructor(e,t,i,s){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=Wf(e.contentDOM),this.atoms=e.state.facet(Rr).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(N.allowMultipleSelections)&&vu(e,t),this.dragging=Au(e,t)&&lh(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&wu(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,s=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=ja(this.view);e.clientX-o.left<=r.left+Ui?i=-Xi(r.left-e.clientX):e.clientX+o.right>=r.right-Ui&&(i=Xi(e.clientX-r.right)),e.clientY-o.top<=r.top+Ui?s=-Xi(r.top-e.clientY):e.clientY+o.bottom>=r.bottom-Ui&&(s=Xi(e.clientY-r.bottom)),this.setScrollSpeed(i,s)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;ithis.select(this.lastEvent),20)}}function vu(n,e){let t=n.state.facet(Na);return t.length?t[0](e):M.mac?e.metaKey:e.ctrlKey}function Cu(n,e){let t=n.state.facet(Qa);return t.length?t[0](e):M.mac?!e.altKey:!e.ctrlKey}function Au(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Sn(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Pu(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=q.get(t))&&i.ignoreEvent(e))return!1;return!0}const _e=Object.create(null),Ne=Object.create(null),sh=M.ie&&M.ie_version<15||M.ios&&M.webkit_version<604;function Mu(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),rh(n,t.value)},50)}function rh(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(ir!=null&&t.selection.ranges.every(a=>a.empty)&&ir==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:x.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:x.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Ne.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};_e.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now()),!1);Ne.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Ne.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};_e.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(Wa))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=Ru(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new Su(n,e,t,i)),i&&n.observer.ignore(()=>va(n.contentDOM));let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function Io(n,e,t,i){if(i==1)return x.cursor(e,t);if(i==2)return fu(n.state,e,t);{let s=Z.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return ln>=e.top&&n<=e.bottom,No=(n,e,t)=>oh(e,t)&&n>=t.left&&n<=t.right;function Tu(n,e,t,i){let s=Z.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&No(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&No(t,i,l)?1:o&&oh(i,o)?-1:1}function Qo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Tu(n,t,e.clientX,e.clientY)}}const Du=M.ie&&M.ie_version<=11;let Wo=null,$o=0,zo=0;function lh(n){if(!Du)return n.detail;let e=Wo,t=zo;return Wo=n,zo=Date.now(),$o=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?($o+1)%3:1}function Ru(n,e){let t=Qo(n,e),i=lh(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=Qo(n,r),h,c=Io(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let f=Io(n,t.pos,t.bias,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=Bu(s,a.pos))?h:l?s.addRange(c):x.create([c])}}}function Bu(n,e){for(let t=0;t=e)return x.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}_e.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;return i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};function Vo(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&Cu(n,e)?{from:r.dragging.from,to:r.dragging.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}_e.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),s=0,r=()=>{++s==t.length&&Vo(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return Vo(n,e,i,!0),!0}return!1};_e.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=sh?null:e.clipboardData;return t?(rh(n,t.getData("text/plain")||t.getData("text/uri-text")),!0):(Mu(n),!1)};function Eu(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function Lu(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let ir=null;_e.copy=_e.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=Lu(n.state);if(!t&&!s)return!1;ir=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=sh?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(Eu(n,t),!1)};const ah=st.define();function hh(n,e){let t=[];for(let i of n.facet(Va)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:ah.of(!0)}):null}function ch(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=hh(n.state,e);t?n.dispatch(t):n.update([])}},10)}Ne.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),ch(n)};Ne.blur=n=>{n.observer.clearSelectionRange(),ch(n)};Ne.compositionstart=Ne.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};Ne.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,M.chrome&&M.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};Ne.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};_e.beforeinput=(n,e)=>{var t;let i;if(M.chrome&&M.android&&(i=ih.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return!1};const Fo=new Set;function Iu(n){Fo.has(n)||(Fo.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const Ho=["pre-wrap","normal","pre-line","break-spaces"];class Nu{constructor(e){this.lineWrapping=e,this.doc=Q.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Ho.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>pn&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return me.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=s[l],u=r.lineAt(a,H.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,H.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,c=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return"block(".concat(this.length,")")}}class Ae extends fh{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new Ue(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Ae||s instanceof se&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof se?s=new Ae(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):me.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}class se extends me{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),c=t.doc.lineAt(h),f=l+c.length*a,u=Math.max(i,e-f/2);return new Ue(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:c,length:f}=t.doc.line(r+h);return new Ue(c,f,i+l*h,l,0)}}lineAt(e,t,i,s,r){if(t==H.ByHeight)return this.blockAt(e,i,s,r);if(t==H.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new Ue(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),h=i.doc.lineAt(e),c=l+h.length*a,f=h.number-o,u=s+l*f+a*(h.from-r-f);return new Ue(h.from,h.length,Math.max(s,Math.min(u,s+this.height-c)),c,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(i,r);for(let c=e,f=s;c<=t;){let u=i.doc.lineAt(c);if(c==e){let p=u.number-l;f+=a*p+h*(e-r-p)}let d=a+h*u.length;o(new Ue(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof se?i[i.length-1]=new se(r.length+s):i.push(null,new se(s-1))}if(e>0){let r=i[0];r instanceof se?i[0]=new se(e+r.length):i.unshift(new se(e-1),null)}return me.of(i)}decomposeLeft(e,t){t.push(new se(e-1),null)}decomposeRight(e,t){t.push(null,new se(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new se(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=pn&&(a=-2);let u=new Ae(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new se(r-l).updateHeight(e,l));let h=me.of(o);return(a<0||Math.abs(h.height-this.height)>=pn||Math.abs(a-this.heightMetrics(e,t).perLine)>=pn)&&(e.heightChanged=!0),h}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return"gap(".concat(this.length,")")}}class Wu extends me{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return h;let c=t==H.ByPosNoHeight?H.ByPosNoHeight:H.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,H.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&qo(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?me.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function qo(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof se&&(i=n[e+1])instanceof se&&n.splice(e-1,3,new se(t.length+1+i.length))}const $u=5;class Br{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ae?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ae(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=$u)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ae(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new se(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ae)return e;let t=new Ae(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ae)&&!this.isCovered?this.nodes.push(new Ae(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=h==n.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function Hu(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class cs{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new Nu(t),this.stateDeco=e.facet(wi).filter(i=>typeof i!="function"),this.heightMap=me.empty().applyChanges(this.stateDeco,Q.empty,this.heightOracle.setDoc(e.doc),[new Ee(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=D.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new ji(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?Xo:new ju(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:hi(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(wi).filter(c=>typeof c!="function");let s=e.changedRanges,r=Ee.extendWithRanges(s,zu(i,this.stateDeco,e?e.changes:J.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Ha)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?X.RTL:X.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let O=l.width/t.offsetWidth,k=l.height/t.offsetHeight;(O>.995&&O<1.005||!isFinite(O)||Math.abs(l.width-t.offsetWidth)<1)&&(O=1),(k>.995&&k<1.005||!isFinite(k)||Math.abs(l.height-t.offsetHeight)<1)&&(k=1),(this.scaleX!=O||this.scaleY!=k)&&(this.scaleX=O,this.scaleY=k,h|=8,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Aa(e.scrollDOM);let p=(this.printing?Hu:Fu)(t,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let w=l.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),a){let O=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(O)&&(o=!0),o||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:k,charWidth:S,textHeight:T}=e.docView.measureTextSize();o=k>0&&s.refresh(r,k,S,T,w/S,O),o&&(e.docView.minWidth=0,h|=8)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),s.heightChanged=!1;for(let k of this.viewports){let S=k.from==this.viewport.from?O:e.docView.measureVisibleLineHeights(k);this.heightMap=(o?me.empty().applyChanges(this.stateDeco,Q.empty,this.heightOracle,[new Ee(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new Qu(k.from,S))}s.heightChanged&&(h|=2)}let C=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return C&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||C)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new ji(s.lineAt(o-i*1e3,H.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,H.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,H.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=X.LTR&&!i)return[];let l=[],a=(h,c,f,u)=>{if(c-hh&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-h)g.fromy));if(!m){if(cg.from<=c&&g.to>=c)){let g=t.moveToLineBoundary(x.cursor(c),!1,!0).head;g>h&&(c=g)}m=new cs(h,c,this.gapSize(f,h,c,u))}l.push(m)};for(let h of this.viewportLines){if(h.lengthh.from&&a(h.from,u,h,c),dt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];W.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||hi(this.heightMap.lineAt(e,H.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return hi(this.heightMap.lineAt(this.scaler.fromDOM(e),H.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return hi(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ji{constructor(e,t){this.from=e,this.to=t}}function Uu(n,e,t){let i=[],s=n,r=0;return W.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Ki(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function Xu(n,e){for(let t of n)if(e(t))return t}const Xo={toDOM(n){return n},fromDOM(n){return n},scale:1};class ju{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,H.ByPos,e,0,0).top,c=t.lineAt(a,H.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=thi(s,e)):n._content)}const _i=A.define({combine:n=>n.join(" ")}),nr=A.define({combine:n=>n.indexOf(!0)>-1}),sr=mt.newName(),uh=mt.newName(),dh=mt.newName(),ph={"&light":"."+uh,"&dark":"."+dh};function rr(n,e,t){return new mt(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError("Unsupported selector: ".concat(s));return t[s]}):n+" "+i}})}const Gu=rr("."+sr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ph),ci="￿";class Ku{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(N.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ci}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==t)break;let l=q.get(s),a=q.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:jo(s))||jo(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=q.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(_u(e,i.node,i.offset)?t:0))}}function _u(n,e,t){for(;;){if(!e||t-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:ed(e),a=new Ku(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=td(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Hs(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Hs(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset);this.newSel=x.single(h,a)}}}function gh(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,h=null;(r===8||M.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:(M.mac||M.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=x.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:Q.of([" "])}):M.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()=="\n "&&n.lineWrapping&&(i&&(i=x.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:Q.of([" "])}),t){if(M.ios&&n.inputState.flushIOSKey()||M.android&&(t.from==s.from&&t.to==s.to&&t.insert.length==1&&t.insert.lines==2&&Ht(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||r==8&&t.insert.lengths.head)&&Ht(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&Ht(n.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let l,a=()=>l||(l=Zu(n,t,i));return n.state.facet(za).some(h=>h(n,t.from,t.to,o,a))||n.dispatch(a()),!0}else if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function Zu(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.frome.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let h=n.state.sliceDoc(e.from,e.to),c,f=t&&Ja(n,t.main.head);if(f){let p=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-p}}else c=n.state.doc.lineAt(r.head);let u=r.to-e.to,d=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let m=p.to-u,g=m-h.length;if(p.to-p.from!=d||n.state.sliceDoc(g,m)!=h||p.to>=c.from&&p.from<=c.to)return{range:p};let y=s.changes({from:g,to:m,insert:e.insert}),w=p.to-r.to;return{changes:y,range:a?x.range(Math.max(0,a.anchor+w),Math.max(0,a.head+w)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function Ju(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function ed(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new Go(t,i)),(s!=t||r!=i)&&e.push(new Go(s,r))),e}function td(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?x.single(t+e,i+e):null}const id={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},fs=M.ie&&M.ie_version<=11;class nd{constructor(e){this.view=e,this.active=!1,this.selectionRange=new $f,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(M.ie&&M.ie_version<=11||M.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),fs&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(jn)?i.root.activeElement!=this.dom:!un(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(M.ie&&M.ie_version<=11||M.android&&M.chrome)&&!i.state.selection.main.empty&&s.focusNode&&vn(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=M.safari&&e.root.nodeType==11&&If(this.dom.ownerDocument)==this.dom&&sd(this.view)||Sn(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=un(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Ht(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&un(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Yu(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return!1;let i=this.view.state,s=gh(this.view,t);return this.view.state==i&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=Ko(t,e.previousSibling||e.target.previousSibling,-1),s=Ko(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i,s;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect(),(s=this.resizeContent)===null||s===void 0||s.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function Ko(n,e,t){for(;e;){let i=q.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function sd(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return vn(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}class P{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(s=>t(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||zf(e.parent)||document,this.viewState=new Uo(e.state||N.create(e)),this.plugins=this.state.facet(li).map(i=>new ls(i));for(let i of this.plugins)i.update(this);this.observer=new nd(this),this.inputState=new xu(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Po(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}dispatch(...e){let t=e.length==1&&e[0]instanceof te?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(ah))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=hh(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(N.phrases)!=this.state.facet(N.phrases))return this.setState(r);s=An.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new Cn(d.empty?d:x.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(Co)&&(f=d.value)}this.viewState.update(s,f),this.bidiCache=Pn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ai)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(_i)!=s.state.facet(_i)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let u of this.state.facet(_s))u(s);(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!gh(this,c)&&h.force&&Ht(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Uo(e),this.plugins=e.facet(li).map(i=>new ls(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new Po(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(li),i=e.state.facet(li);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new ls(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Aa(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Ie(this.state,p),_o}}),f=An.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f));for(let d=0;d1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(_s))l(t)}get themeClasses(){return sr+" "+(this.state.facet(nr)?dh:uh)+" "+this.state.facet(_i)}updateAttrs(){let e=Yo(this,qa,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(jn)?"true":"false",class:"cm-content",style:"".concat(M.tabSize,": ").concat(this.state.tabSize),role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Yo(this,Dr,t);let i=this.observer.ignore(()=>{let s=Gs(this.contentDOM,this.contentAttrs,t),r=Gs(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(P.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ai);let e=this.state.facet(P.cspNonce);mt.mount(this.root,this.styleModules.concat(Gu).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return hs(this,e,Eo(this,e,t,i))}moveByGroup(e,t){return hs(this,e,Eo(this,e,t,i=>yu(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return mu(this,e,t,i)}moveVertically(e,t,i){return hs(this,e,bu(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),th(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[ft.find(r,e-s.from,-1,t)];return Pr(i,o.dir==X.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Fa)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>rd)return Ya(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||_a(r.isolates,i=Ao(this,e.from,e.to))))return r.order;i||(i=Ao(this,e.from,e.to));let s=iu(e.text,t,i);return this.bidiCache.push(new Pn(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||M.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{va(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Co.of(new Cn(typeof e=="number"?x.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return K.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return K.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=mt.newName(),s=[_i.of(i),ai.of(rr(".".concat(i),e))];return t&&t.dark&&s.push(nr.of(!0)),s}static baseTheme(e){return Zt.lowest(ai.of(rr("."+sr,e,ph)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&q.get(i)||q.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}P.styleModule=ai;P.inputHandler=za;P.focusChangeEffect=Va;P.perLineTextDirection=Fa;P.exceptionSink=$a;P.updateListener=_s;P.editable=jn;P.mouseSelectionStyle=Wa;P.dragMovesSelection=Qa;P.clickAddsSelectionRange=Na;P.decorations=wi;P.atomicRanges=Rr;P.bidiIsolatedRanges=Ua;P.scrollMargins=Xa;P.darkTheme=nr;P.cspNonce=A.define({combine:n=>n.length?n[0]:""});P.contentAttributes=Dr;P.editorAttributes=qa;P.lineWrapping=P.contentAttributes.of({class:"cm-lineWrapping"});P.announce=R.define();const rd=4096,_o={};class Pn{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:X.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&js(o,t)}return t}const od=M.mac?"mac":M.windows?"win":M.linux?"linux":"key";function ld(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}function hd(n,e,t){return yh(mh(n.state),e,n,t)}let at=null;const cd=4e3;function fd(n,e=od){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>ld(y,e));for(let y=1;y{let O=at={view:C,prefix:w,scope:o};return setTimeout(()=>{at==O&&(at=null)},cd),!0}]})}let m=p.join(" ");s(m,!1);let g=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&g.run.push(a),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(o.any)}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}function yh(n,e,t,i){let s=Lf(e),r=re(s,0),o=De(r)==s.length&&s!=" ",l="",a=!1,h=!1,c=!1;at&&at.view==t&&at.scope==i&&(l=at.prefix+" ",nh.indexOf(e.keyCode)<0&&(h=!0,at=null));let f=new Set,u=g=>{if(g){for(let y of g.run)if(!f.has(y)&&(f.add(y),y(t,e)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,m;return d&&(u(d[l+Yi(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(M.windows&&e.ctrlKey&&e.altKey)&&(p=yt[e.keyCode])&&p!=s?(u(d[l+Yi(p,e,!0)])||e.shiftKey&&(m=xi[e.keyCode])!=s&&m!=p&&u(d[l+Yi(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+Yi(s,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),a}class Qi{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=bh(e);return[new Qi(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return ud(e,t,i)}}function bh(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==X.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function Jo(n,e,t){let i=x.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:ge.Text}}function ud(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==X.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=bh(n),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=tr(n,i),p=tr(n,s),m=d.type==ge.Text?d:null,g=p.type==ge.Text?p:null;if(m&&(n.lineWrapping||d.widgetLineBreaks)&&(m=Jo(n,i,m)),g&&(n.lineWrapping||p.widgetLineBreaks)&&(g=Jo(n,s,g)),m&&g&&m.from==g.from)return w(C(t.from,t.to,m));{let k=m?C(t.from,null,m):O(d,!1),S=g?C(null,t.to,g):O(p,!0),T=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&k.bottom+n.defaultLineHeight/2_&&be.from=he)break;Y>ne&&F(Math.max(j,ne),k==null&&j<=_,Math.min(Y,he),S==null&&Y>=ae,xe.dir)}if(ne=We.to+1,ne>=he)break}return E.length==0&&F(_,k==null,ae,S==null,n.textDirection),{top:I,bottom:B,horizontal:E}}function O(k,S){let T=l.top+(S?k.top:k.bottom);return{top:T,bottom:T,horizontal:[]}}}function dd(n,e){return n.constructor==e.constructor&&n.eq(e)}class pd{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(gn)!=e.state.facet(gn)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,i=e.facet(gn);for(;t!dd(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const gn=A.define();function xh(n){return[K.define(e=>new pd(e,n)),gn.of(n)]}const Oh=!M.ios,vi=A.define({combine(n){return Ye(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function gd(n={}){return[vi.of(n),md,yd,bd,Ha.of(!0)]}function kh(n){return n.startState.facet(vi)!=n.state.facet(vi)}const md=xh({above:!0,markers(n){let{state:e}=n,t=e.facet(vi),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||Oh:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:x.cursor(s.head,s.head>s.anchor?-1:1);for(let a of Qi.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=kh(n);return t&&el(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){el(e.state,n)},class:"cm-cursorLayer"});function el(n,e){e.style.animationDuration=n.facet(vi).cursorBlinkRate+"ms"}const yd=xh({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Qi.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||kh(n)},class:"cm-selectionLayer"}),wh={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Oh&&(wh[".cm-line"].caretColor="transparent !important");const bd=Zt.highest(P.theme(wh)),Sh=R.define({map(n,e){return n==null?null:e.mapPos(n)}}),fi=le.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(Sh)?i.value:t,n)}}),xd=K.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(fi);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(fi)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(fi),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(fi)!=n&&this.view.dispatch({effects:Sh.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Od(){return[fi,xd]}function tl(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function kd(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class wd{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new gt,i=t.add.bind(t);for(let{from:s,to:r}of kd(e,this.maxLength))tl(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(y.range(m,g));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:u})}}return t}}const or=/x/.unicode!=null?"gu":"g",Sd=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]",or),vd={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let us=null;function Cd(){var n;if(us==null&&typeof document<"u"&&document.body){let e=document.body.style;us=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return us||!1}const mn=A.define({combine(n){let e=Ye(n,{render:null,specialChars:Sd,addSpecialChars:null});return(e.replaceTabs=!Cd())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,or)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,or)),e}});function Ad(n={}){return[mn.of(n),Pd()]}let il=null;function Pd(){return il||(il=K.fromClass(class{constructor(n){this.view=n,this.decorations=D.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(mn)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new wd({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=re(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=Jt(o.text,l,i-o.from);return D.replace({widget:new Rd((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=D.replace({widget:new Dd(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(mn);n.startState.facet(mn)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Md="•";function Td(n){return n>=32?Md:n==10?"␤":String.fromCharCode(9216+n)}class Dd extends Ot{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Td(this.code),i=e.state.phrase("Control character")+" "+(vd[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Rd extends Ot{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function Bd(){return Ld}const Ed=D.line({class:"cm-activeLine"}),Ld=K.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let s=n.lineBlockAt(i.head);s.from>e&&(t.push(Ed.range(s.from)),e=s.from)}return D.set(t)}},{decorations:n=>n.decorations}),lr=2e3;function Id(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>lr||t.off>lr||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(x.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=zs(h.text,o,n.tabSize,!0);if(c<0)r.push(x.cursor(h.to));else{let f=zs(h.text,l,n.tabSize);r.push(x.range(h.from+c,h.from+f))}}}return r}function Nd(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function nl(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>lr?-1:s==i.length?Nd(n,e.clientX):Jt(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function Qd(n,e){let t=nl(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=nl(n,s);if(!l)return i;let a=Id(n.state,t,l);return a.length?o?x.create(a.concat(i.ranges)):x.create(a):i}}:null}function Wd(n){let e=t=>t.altKey&&t.button==0;return P.mouseSelectionStyle.of((t,i)=>e(i)?Qd(t,i):null)}const $d={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},zd={style:"cursor: crosshair"};function Vd(n={}){let[e,t]=$d[n.key||"Alt"],i=K.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[i,P.contentAttributes.of(s=>{var r;return!((r=s.plugin(i))===null||r===void 0)&&r.isDown?zd:null})]}const Zi="-10000px";class vh{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){var t;let i=e.state.facet(this.facet),s=i.filter(o=>o);if(i===this.input){for(let o of this.tooltipViews)o.update&&o.update(e);return!1}let r=[];for(let o=0;o{var e,t,i;return{position:M.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Fd}}}),sl=new WeakMap,Ch=K.fromClass(class{constructor(n){this.view=n,this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(ds);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new vh(n,Lr,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(ds);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Zi,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);this.parent&&this.container.remove(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{offsetParent:s}=this.manager.tooltipViews[0].dom;i=!!(s&&s!=this.container.ownerDocument.body)}if(i||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((s,r)=>{let o=this.manager.tooltipViews[r];return o.getCoords?o.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(ds).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:t,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l=Math.min(t.bottom,i.bottom)||f.rightMath.min(t.right,i.right)+.1){c.style.top=Zi;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=u.right-u.left,g=(e=sl.get(h))!==null&&e!==void 0?e:u.bottom-u.top,y=h.offset||qd,w=this.view.textDirection==X.LTR,C=u.width>i.right-i.left?w?i.left:i.right-u.width:w?Math.min(f.left-(d?14:0)+y.x,i.right-m):Math.max(i.left,f.left-m+(d?14:0)-y.x),O=!!a.above;!a.strictSide&&(O?f.top-(u.bottom-u.top)-y.yi.bottom)&&O==i.bottom-f.bottom>f.top-i.top&&(O=!O);let k=(O?f.top-i.top:i.bottom-f.bottom)-p;if(kC&&I.topS&&(S=O?I.top-g-2-p:I.bottom+p+2);if(this.position=="absolute"?(c.style.top=(S-n.parent.top)/r+"px",c.style.left=(C-n.parent.left)/s+"px"):(c.style.top=S/r+"px",c.style.left=C/s+"px"),d){let I=f.left+(w?y.x:-y.x)-(C+14-7);d.style.left=I/s+"px"}h.overlap!==!0&&o.push({left:C,top:S,right:T,bottom:S+g}),c.classList.toggle("cm-tooltip-above",O),c.classList.toggle("cm-tooltip-below",!O),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Zi}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Hd=P.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"".concat(7*2,"px"),position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),qd={x:0,y:0},Lr=A.define({enables:[Ch,Hd]}),Mn=A.define();class Ir{static create(e){return new Ir(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new vh(e,Mn,t=>this.createHostedView(t))}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}}const Ud=Lr.compute([Mn],n=>{let e=n.facet(Mn).filter(t=>t);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>t.end!=null).map(t=>t.end)),create:Ir.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class Xd{constructor(e,t,i,s,r){this.view=e,this.source=t,this.field=i,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;el.bottom||t.xl.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(s)).find(c=>c.from<=s&&c.to>=s),h=a&&a.dir==X.RTL?-1:1;r=t.x{this.pending==l&&(this.pending=null,a&&e.dispatch({effects:this.setHover.of(a)}))},a=>Ie(e.state,a,"hover tooltip"))}else o&&e.dispatch({effects:this.setHover.of(o)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let i=this.active;if(i&&!rl(this.lastMove.target)||this.pending){let{pos:s}=i||this.pending,r=(t=i==null?void 0:i.end)!==null&&t!==void 0?t:s;(s==r?this.view.posAtCoords(this.lastMove)!=s:!jd(this.view,s,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&!rl(e.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function rl(n){for(let e=n;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function jd(n,e,t,i,s,r){let o=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>i||o.rights||Math.min(o.bottom,l)=e&&a<=t}function Gd(n,e={}){let t=R.define(),i=le.define({create(){return null},update(s,r){if(s&&(e.hideOnChange&&(r.docChanged||r.selection)||e.hideOn&&e.hideOn(r,s)))return null;if(s&&r.docChanged){let o=r.changes.mapPos(s.pos,-1,pe.TrackDel);if(o==null)return null;let l=Object.assign(Object.create(null),s);l.pos=o,s.end!=null&&(l.end=r.changes.mapPos(s.end)),s=l}for(let o of r.effects)o.is(t)&&(s=o.value),o.is(Kd)&&(s=null);return s},provide:s=>Mn.from(s)});return[i,K.define(s=>new Xd(s,n,i,t,e.hoverTime||300)),Ud]}function Ah(n,e){let t=n.plugin(Ch);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const Kd=R.define(),ol=A.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Ci(n,e){let t=n.plugin(Ph),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Ph=K.fromClass(class{constructor(n){this.input=n.state.facet(Ai),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(ol);this.top=new Ji(n,!0,e.topContainer),this.bottom=new Ji(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(ol);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ji(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ji(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Ai);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>P.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Ji{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=ll(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=ll(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function ll(n){let e=n.nextSibling;return n.remove(),e}const Ai=A.define({enables:Ph});class nt extends Dt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}nt.prototype.elementClass="";nt.prototype.toDOM=void 0;nt.prototype.mapMode=pe.TrackBefore;nt.prototype.startSide=nt.prototype.endSide=-1;nt.prototype.point=!0;const yn=A.define(),_d={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>W.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},mi=A.define();function Yd(n){return[Mh(),mi.of(Object.assign(Object.assign({},_d),n))]}const al=A.define({combine:n=>n.some(e=>e)});function Mh(n){return[Zd]}const Zd=K.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(mi).map(e=>new cl(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(al),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(al)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=W.iter(this.view.state.facet(yn),this.view.viewport.from),i=[],s=this.gutters.map(r=>new Jd(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==ge.Text&&o){ar(t,i,l.from);for(let a of s)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of s)a.widget(this.view,l)}else if(r.type==ge.Text){ar(t,i,r.from);for(let o of s)o.line(this.view,r,i)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(mi),t=n.state.facet(mi),i=n.docChanged||n.heightChanged||n.viewportChanged||!W.eq(n.startState.facet(yn),n.state.facet(yn),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(n)&&(i=!0);else{i=!0;let s=[];for(let r of t){let o=e.indexOf(r);o<0?s.push(new cl(this.view,r)):(this.gutters[o].update(n),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)this.dom.appendChild(r.dom);this.gutters=s}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>P.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==X.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function hl(n){return Array.isArray(n)?n:[n]}function ar(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class Jd{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=W.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:s}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==s.elements.length){let l=new Th(e,o,r,i);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,i);this.height=t.bottom,this.i++}line(e,t,i){let s=[];ar(this.cursor,s,t.from),i.length&&(s=s.concat(i));let r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t);i&&this.addElement(e,t,[i])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class cl{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,s=>{let r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,s)&&s.preventDefault()});this.markers=hl(t.markers(e)),t.initialSpacer&&(this.spacer=new Th(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=hl(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let i=e.view.viewport;return!W.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Th{constructor(e,t,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,s)}update(e,t,i,s){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),ep(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let i="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=rr(l,a,h)||o(l,a,h):o}return i}})}});class ps extends nt{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function gs(n,e){return n.state.facet($t).formatNumber(e,n.state)}const ip=mi.compute([$t],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(tp)},lineMarker(e,t,i){return i.some(s=>s.toDOM)?null:new ps(gs(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet($t)!=e.state.facet($t),initialSpacer(e){return new ps(gs(e,fl(e.state.doc.lines)))},updateSpacer(e,t){let i=gs(t.view,fl(t.view.state.doc.lines));return i==e.number?e:new ps(i)},domEventHandlers:n.facet($t).domEventHandlers}));function np(n={}){return[$t.of(n),Mh(),ip]}function fl(n){let e=9;for(;e{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(sp.range(s)))}return W.of(e)});function op(){return rp}const Dh=1024;let lp=0;class ms{constructor(e,t){this.from=e,this.to=t}}class L{constructor(e={}){this.id=lp++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ye.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:n=>n.split(" ")});L.openedBy=new L({deserialize:n=>n.split(" ")});L.group=new L({deserialize:n=>n.split(" ")});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class Tn{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[L.mounted.id]}}const ap=Object.create(null);class ye{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):ap,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ye(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(L.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(L.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}ye.none=new ye("",Object.create(null),0,8);class Gn{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|ee.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Wr(ye.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new z(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new z(ye.none,t,i,s)))}static build(e){return up(e)}}z.empty=new z(ye.none,[],[],0);class Nr{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Nr(this.buffer,this.index)}}class Lt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ye.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Pi(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(Rh(s,i,f,f+c.length)){if(c instanceof Lt){if(r&ee.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new Xe(new hp(o,c,e,f),null,u)}else if(r&ee.IncludeAnonymous||!c.type.isAnonymous||Qr(c)){let u;if(!(r&ee.IgnoreMounts)&&(u=Tn.get(c))&&!u.overlay)return new Se(u.tree,f,e,o);let d=new Se(c,f,e,o);return r&ee.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&ee.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&ee.IgnoreOverlays)&&(s=Tn.get(this._tree))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new Se(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function dl(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function hr(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class hp{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class Xe extends Bh{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new Xe(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&ee.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new Xe(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Xe(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Xe(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new z(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Eh(n){if(!n.length)return null;if(n.length==1)return n[0];let e=0,t=n[0];for(let r=1;rt.from||o.to=e){let l=new Se(o.tree,o.overlay[0].from+r.from,0,null);(s||(s=[i])).push(Pi(l,e,t,!1))}}return s?Eh(s):i}class cr{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Se)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Se?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&ee.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ee.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ee.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&ee.IncludeAnonymous||l instanceof Lt||!l.type.isAnonymous||Qr(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s=0;r--){if(r<0)return hr(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function Qr(n){return n.children.some(e=>e instanceof Lt||!e.type.isAnonymous||Qr(e))}function up(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=Dh,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new Nr(t,t.length):t,a=i.types,h=0,c=0;function f(O,k,S,T,I){let{id:B,start:E,end:F,size:_}=l,ae=c;for(;_<0;)if(l.next(),_==-1){let xe=r[B];S.push(xe),T.push(E-O);return}else if(_==-3){h=B;return}else if(_==-4){c=B;return}else throw new RangeError("Unrecognized record size: ".concat(_));let be=a[B],ne,he,We=E-O;if(F-E<=s&&(he=m(l.pos-k,I))){let xe=new Uint16Array(he.size-he.skip),j=l.pos-he.size,Y=xe.length;for(;l.pos>j;)Y=g(he.start,xe,Y);ne=new Lt(xe,F-he.start,i),We=he.start-O}else{let xe=l.pos-_;l.next();let j=[],Y=[],wt=B>=o?B:-1,It=0,Vi=F;for(;l.pos>xe;)wt>=0&&l.id==wt&&l.size>=0?(l.end<=Vi-s&&(d(j,Y,E,It,l.end,Vi,wt,ae),It=j.length,Vi=l.end),l.next()):f(E,xe,j,Y,wt);if(wt>=0&&It>0&&It-1&&It>0){let ro=u(be);ne=Wr(be,j,Y,0,j.length,0,F-E,ro,ro)}else ne=p(be,j,Y,F-E,ae-F)}S.push(ne),T.push(We)}function u(O){return(k,S,T)=>{let I=0,B=k.length-1,E,F;if(B>=0&&(E=k[B])instanceof z){if(!B&&E.type==O&&E.length==T)return E;(F=E.prop(L.lookAhead))&&(I=S[B]+E.length+F)}return p(O,k,S,T,I)}}function d(O,k,S,T,I,B,E,F){let _=[],ae=[];for(;O.length>T;)_.push(O.pop()),ae.push(k.pop()+S-I);O.push(p(i.types[E],_,ae,B-I,F-B)),k.push(I-S)}function p(O,k,S,T,I=0,B){if(h){let E=[L.contextHash,h];B=B?[E].concat(B):[E]}if(I>25){let E=[L.lookAhead,I];B=B?[E].concat(B):[E]}return new z(O,k,S,T,B)}function m(O,k){let S=l.fork(),T=0,I=0,B=0,E=S.end-s,F={size:0,start:0,skip:0};e:for(let _=S.pos-O;S.pos>_;){let ae=S.size;if(S.id==k&&ae>=0){F.size=T,F.start=I,F.skip=B,B+=4,T+=4,S.next();continue}let be=S.pos-ae;if(ae<0||be<_||S.start=o?4:0,he=S.start;for(S.next();S.pos>be;){if(S.size<0)if(S.size==-3)ne+=4;else break e;else S.id>=o&&(ne+=4);S.next()}I=he,T+=ae,B+=ne}return(k<0||T==O)&&(F.size=T,F.start=I,F.skip=B),F.size>4?F:void 0}function g(O,k,S){let{id:T,start:I,end:B,size:E}=l;if(l.next(),E>=0&&T4){let _=l.pos-(E-4);for(;l.pos>_;)S=g(O,k,S)}k[--S]=F,k[--S]=B-O,k[--S]=I-O,k[--S]=T}else E==-3?h=T:E==-4&&(c=T);return S}let y=[],w=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,y,w,-1);let C=(e=n.length)!==null&&e!==void 0?e:y.length?w[0]+y[0].length:0;return new z(a[n.topID],y.reverse(),w.reverse(),C)}const pl=new WeakMap;function bn(n,e){if(!n.isAnonymous||e instanceof Lt||e.type!=n)return 1;let t=pl.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof z)){t=1;break}t+=bn(n,i)}pl.set(e,t)}return t}function Wr(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;S+=T}if(C==O+1){if(S>c){let T=p[O];d(T.children,T.positions,0,T.children.length,m[O]+w);continue}f.push(p[O])}else{let T=m[C-1]+p[C-1].length-k;f.push(Wr(n,p,m,O,C,k,T,null,a))}u.push(k+w-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class dp{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Xe?this.setBuffer(e.context.buffer,e.index,t):e instanceof Se&&this.map.set(e.tree,t)}get(e){return e instanceof Xe?this.getBuffer(e.context.buffer,e.index):e instanceof Se?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Tt{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new Tt(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Tt(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew ms(s.from,s.to)):[new ms(0,0)]:[new ms(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class pp{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new L({perNode:!0});let gp=0;class He{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=gp++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new He([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new Dn;return t=>t.modified.indexOf(e)>-1?t:Dn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let mp=0;class Dn{constructor(){this.instances=[],this.id=mp++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&yp(t,l.modified));if(i)return i;let s=[],r=new He(s,e,t);for(let l of t)l.instances.push(r);let o=bp(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(Dn.get(l,a));return r}}function yp(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function bp(n){let e=[[]];for(let t=0;ti.length-t.length)}function zr(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new Rn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Lh.add(e)}const Lh=new L;class Rn{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function xp(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function Op(n,e,t,i=0,s=n.length){let r=new kp(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class kp{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=wp(e)||Rn.empty,f=xp(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(L.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,y=l;;g++){let w=g=C||!e.nextSibling())););if(!w||C>i)break;y=w.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,w.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),h))}m&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function wp(n){let e=n.type.prop(Lh);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const v=He.define,tn=v(),ot=v(),gl=v(ot),ml=v(ot),lt=v(),nn=v(lt),ys=v(lt),Fe=v(),St=v(Fe),ze=v(),Ve=v(),fr=v(),si=v(fr),sn=v(),b={comment:tn,lineComment:v(tn),blockComment:v(tn),docComment:v(tn),name:ot,variableName:v(ot),typeName:gl,tagName:v(gl),propertyName:ml,attributeName:v(ml),className:v(ot),labelName:v(ot),namespace:v(ot),macroName:v(ot),literal:lt,string:nn,docString:v(nn),character:v(nn),attributeValue:v(nn),number:ys,integer:v(ys),float:v(ys),bool:v(lt),regexp:v(lt),escape:v(lt),color:v(lt),url:v(lt),keyword:ze,self:v(ze),null:v(ze),atom:v(ze),unit:v(ze),modifier:v(ze),operatorKeyword:v(ze),controlKeyword:v(ze),definitionKeyword:v(ze),moduleKeyword:v(ze),operator:Ve,derefOperator:v(Ve),arithmeticOperator:v(Ve),logicOperator:v(Ve),bitwiseOperator:v(Ve),compareOperator:v(Ve),updateOperator:v(Ve),definitionOperator:v(Ve),typeOperator:v(Ve),controlOperator:v(Ve),punctuation:fr,separator:v(fr),bracket:si,angleBracket:v(si),squareBracket:v(si),paren:v(si),brace:v(si),content:Fe,heading:St,heading1:v(St),heading2:v(St),heading3:v(St),heading4:v(St),heading5:v(St),heading6:v(St),contentSeparator:v(Fe),list:v(Fe),quote:v(Fe),emphasis:v(Fe),strong:v(Fe),link:v(Fe),monospace:v(Fe),strikethrough:v(Fe),inserted:v(),deleted:v(),changed:v(),invalid:v(),meta:sn,documentMeta:v(sn),annotation:v(sn),processingInstruction:v(sn),definition:He.defineModifier(),constant:He.defineModifier(),function:He.defineModifier(),standard:He.defineModifier(),local:He.defineModifier(),special:He.defineModifier()};Ih([{tag:b.link,class:"tok-link"},{tag:b.heading,class:"tok-heading"},{tag:b.emphasis,class:"tok-emphasis"},{tag:b.strong,class:"tok-strong"},{tag:b.keyword,class:"tok-keyword"},{tag:b.atom,class:"tok-atom"},{tag:b.bool,class:"tok-bool"},{tag:b.url,class:"tok-url"},{tag:b.labelName,class:"tok-labelName"},{tag:b.inserted,class:"tok-inserted"},{tag:b.deleted,class:"tok-deleted"},{tag:b.literal,class:"tok-literal"},{tag:b.string,class:"tok-string"},{tag:b.number,class:"tok-number"},{tag:[b.regexp,b.escape,b.special(b.string)],class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.local(b.variableName),class:"tok-variableName tok-local"},{tag:b.definition(b.variableName),class:"tok-variableName tok-definition"},{tag:b.special(b.variableName),class:"tok-variableName2"},{tag:b.definition(b.propertyName),class:"tok-propertyName tok-definition"},{tag:b.typeName,class:"tok-typeName"},{tag:b.namespace,class:"tok-namespace"},{tag:b.className,class:"tok-className"},{tag:b.macroName,class:"tok-macroName"},{tag:b.propertyName,class:"tok-propertyName"},{tag:b.operator,class:"tok-operator"},{tag:b.comment,class:"tok-comment"},{tag:b.meta,class:"tok-meta"},{tag:b.invalid,class:"tok-invalid"},{tag:b.punctuation,class:"tok-punctuation"}]);var bs;const Pt=new L;function Nh(n){return A.define({combine:n?e=>e.concat(n):void 0})}const Sp=new L;class Re{constructor(e,t,i=[],s=""){this.data=e,this.name=s,N.prototype.hasOwnProperty("tree")||Object.defineProperty(N.prototype,"tree",{get(){return ie(this)}}),this.parser=t,this.extension=[xt.of(this),N.languageData.of((r,o,l)=>{let a=yl(r,o,l),h=a.type.prop(Pt);if(!h)return[];let c=r.facet(h),f=a.type.prop(Sp);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return yl(e,t,i).type.prop(Pt)==this.data}findRegions(e){let t=e.facet(xt);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(Pt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(Pt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Mi(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ie(n){let e=n.field(Re.state,!1);return e?e.tree:z.empty}class vp{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let ri=null;class Gt{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Gt(e,t,[],z.empty,0,i,[],null)}startParse(){return this.parser.startParse(new vp(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=z.empty&&this.isDone(t!=null?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Tt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ri;ri=this;try{return e()}finally{ri=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=bl(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Tt.applyChanges(i,a),s=z.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=bl(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends $r{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=ri;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new z(ye.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ri}}function bl(n,e,t){return Tt.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Kt{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Kt(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Gt.create(e.facet(xt).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Kt(i)}}Re.state=le.define({create:Kt.init,update(n,e){for(let t of e.effects)if(t.is(Re.setState))return t.value;return e.startState.facet(xt)!=e.state.facet(xt)?Kt.init(e.state):n.apply(e)}});let Qh=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Qh=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const xs=typeof navigator<"u"&&(!((bs=navigator.scheduling)===null||bs===void 0)&&bs.isInputPending)?()=>navigator.scheduling.isInputPending():null,Cp=K.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Re.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Re.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Qh(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>xs&&xs()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Re.setState.of(new Kt(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ie(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),xt=A.define({combine(n){return n.length?n[0]:null},enables:n=>[Re.state,Cp,P.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Wh{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const $h=A.define(),Vr=A.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Bt(n){let e=n.facet(Vr);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Ti(n,e){let t="",i=n.tabSize,s=n.facet(Vr)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=e?Ap(n,t,e):null}class Kn{constructor(e,t={}){this.state=e,this.options=t,this.unit=Bt(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return Jt(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Hr=new L;function Ap(n,e,t){let i=e.resolveStack(t),s=i.node.enterUnfinishedNodesBefore(t);if(s!=i.node){let r=[];for(let o=s;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return zh(i,n,t)}function zh(n,e,t){for(let i=n;i;i=i.next){let s=Mp(i.node);if(s)return s(qr.create(e,t,i))}return 0}function Pp(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Mp(n){let e=n.type.prop(Hr);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(L.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>Bp(o,!0,1,void 0,r&&!Pp(o)?s.from:void 0)}return n.parent==null?Tp:null}function Tp(){return 0}class qr extends Kn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new qr(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Dp(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return zh(this.context.next,this.base,this.pos)}}function Dp(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Rp(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.from{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const Ep=200;function Lp(){return N.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,s=t.lineAt(i);if(i>s.from+Ep)return n;let r=t.sliceString(s.from,i);if(!e.some(h=>h.test(r)))return n;let{state:o}=n,l=-1,a=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let f=Fr(o,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=Ti(o,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const Ip=A.define(),Ur=new L;function Vh(n){let e=n.firstChild,t=n.lastChild;return e&&e.tot)continue;if(r&&l.from=e&&h.to>t&&(r=h)}}return r}function Qp(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Bn(n,e,t){for(let i of n.facet(Ip)){let s=i(n,e,t);if(s)return s}return Np(n,e,t)}function Fh(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const _n=R.define({map:Fh}),Wi=R.define({map:Fh});function Hh(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const Et=le.define({create(){return D.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(_n)&&!Wp(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(Xh),s=i?D.replace({widget:new Up(i(e.state,t.value))}):xl;n=n.update({add:[s.range(t.value.from,t.value.to)]})}else t.is(Wi)&&(n=n.update({filter:(i,s)=>t.value.from!=i||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:i}=e.selection.main;n.between(i,i,(s,r)=>{si&&(t=!0)}),t&&(n=n.update({filterFrom:i,filterTo:i,filter:(s,r)=>r<=i||s>=i}))}return n},provide:n=>P.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,s)=>{t.push(i,s)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!s||s.from>r)&&(s={from:r,to:o})}),s}function Wp(n,e,t){let i=!1;return n.between(e,e,(s,r)=>{s==e&&r==t&&(i=!0)}),i}function qh(n,e){return n.field(Et,!1)?e:e.concat(R.appendConfig.of(jh()))}const $p=n=>{for(let e of Hh(n)){let t=Bn(n.state,e.from,e.to);if(t)return n.dispatch({effects:qh(n.state,[_n.of(t),Uh(n,t)])}),!0}return!1},zp=n=>{if(!n.state.field(Et,!1))return!1;let e=[];for(let t of Hh(n)){let i=En(n.state,t.from,t.to);i&&e.push(Wi.of(i),Uh(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function Uh(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,s=n.state.doc.lineAt(e.to).number;return P.announce.of("".concat(n.state.phrase(t?"Folded lines":"Unfolded lines")," ").concat(i," ").concat(n.state.phrase("to")," ").concat(s,"."))}const Vp=n=>{let{state:e}=n,t=[];for(let i=0;i{let e=n.state.field(Et,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,s)=>{t.push(Wi.of({from:i,to:s}))}),n.dispatch({effects:t}),!0},Hp=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:$p},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:zp},{key:"Ctrl-Alt-[",run:Vp},{key:"Ctrl-Alt-]",run:Fp}],qp={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Xh=A.define({combine(n){return Ye(n,qp)}});function jh(n){return[Et,Gp]}function Gh(n,e){let{state:t}=n,i=t.facet(Xh),s=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=En(n.state,l.from,l.to);a&&n.dispatch({effects:Wi.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,s,e);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}const xl=D.replace({widget:new class extends Ot{toDOM(n){return Gh(n,null)}}});class Up extends Ot{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Gh(e,this.value)}}const Xp={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Os extends nt{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function jp(n={}){let e=Object.assign(Object.assign({},Xp),n),t=new Os(e,!0),i=new Os(e,!1),s=K.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(xt)!=o.state.facet(xt)||o.startState.field(Et,!1)!=o.state.field(Et,!1)||ie(o.startState)!=ie(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new gt;for(let a of o.viewportLineBlocks){let h=En(o.state,a.from,a.to)?i:Bn(o.state,a.from,a.to)?t:null;h&&l.add(a.from,a.from,h)}return l.finish()}}),{domEventHandlers:r}=e;return[s,Yd({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||W.empty},initialSpacer(){return new Os(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let h=En(o.state,l.from,l.to);if(h)return o.dispatch({effects:Wi.of(h)}),!0;let c=Bn(o.state,l.from,l.to);return c?(o.dispatch({effects:_n.of(c)}),!0):!1}})}),jh()]}const Gp=P.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Yn{constructor(e,t){this.specs=e;let i;function s(l){let a=mt.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof Re?l=>l.prop(Pt)==o.data:o?l=>l==o:void 0,this.style=Ih(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new mt(i):null,this.themeType=t.themeType}static define(e,t){return new Yn(e,t||{})}}const dr=A.define(),Kh=A.define({combine(n){return n.length?[n[0]]:null}});function ks(n){let e=n.facet(dr);return e.length?e:n.facet(Kh)}function Kp(n,e){let t=[Yp],i;return n instanceof Yn&&(n.module&&t.push(P.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Kh.of(n)):i?t.push(dr.computeN([P.darkTheme],s=>s.facet(P.darkTheme)==(i=="dark")?[n]:[])):t.push(dr.of(n)),t}class _p{constructor(e){this.markCache=Object.create(null),this.tree=ie(e.state),this.decorations=this.buildDeco(e,ks(e.state))}update(e){let t=ie(e.state),i=ks(e.state),s=i!=ks(e.startState);t.length{i.add(o,l,this.markCache[a]||(this.markCache[a]=D.mark({class:a})))},s,r);return i.finish()}}const Yp=Zt.high(K.fromClass(_p,{decorations:n=>n.decorations})),Zp=Yn.define([{tag:b.meta,color:"#404740"},{tag:b.link,textDecoration:"underline"},{tag:b.heading,textDecoration:"underline",fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strong,fontWeight:"bold"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.keyword,color:"#708"},{tag:[b.atom,b.bool,b.url,b.contentSeparator,b.labelName],color:"#219"},{tag:[b.literal,b.inserted],color:"#164"},{tag:[b.string,b.deleted],color:"#a11"},{tag:[b.regexp,b.escape,b.special(b.string)],color:"#e40"},{tag:b.definition(b.variableName),color:"#00f"},{tag:b.local(b.variableName),color:"#30a"},{tag:[b.typeName,b.namespace],color:"#085"},{tag:b.className,color:"#167"},{tag:[b.special(b.variableName),b.macroName],color:"#256"},{tag:b.definition(b.propertyName),color:"#00c"},{tag:b.comment,color:"#940"},{tag:b.invalid,color:"#f00"}]),Jp=P.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),_h=1e4,Yh="()[]{}",Zh=A.define({combine(n){return Ye(n,{afterCursor:!0,brackets:Yh,maxScanDistance:_h,renderMatch:ig})}}),eg=D.mark({class:"cm-matchingBracket"}),tg=D.mark({class:"cm-nonmatchingBracket"});function ig(n){let e=[],t=n.matched?eg:tg;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const ng=le.define({create(){return D.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Zh);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=je(e.state,s.head,-1,i)||s.head>0&&je(e.state,s.head-1,1,i)||i.afterCursor&&(je(e.state,s.head,1,i)||s.headP.decorations.from(n)}),sg=[ng,Jp];function rg(n={}){return[Zh.of(n),sg]}const og=new L;function pr(n,e,t){let i=n.prop(e<0?L.openedBy:L.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function gr(n){let e=n.type.prop(og);return e?e(n.node):n}function je(n,e,t,i={}){let s=i.maxScanDistance||_h,r=i.brackets||Yh,o=ie(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=pr(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return lg(n,e,t,a,c,h,r)}}return ag(n,e,t,o,l.type,s,r)}function lg(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function Ol(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function hg(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||cg,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||jr}}function cg(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const kl=new WeakMap;class ec extends Re{constructor(e){let t=Nh(e.languageData),i=hg(e),s,r=new class extends $r{createParse(o,l,a){return new ug(s,o,l,a)}};super(t,r,[$h.of((o,l)=>this.getIndent(o,l))],e.name),this.topNode=gg(t),s=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=e.tokenTable?new sc(i.tokenTable):pg}static define(e){return new ec(e)}getIndent(e,t){let i=ie(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r,{overrideIndentation:o}=e.options;o&&(r=kl.get(e.state),r!=null&&r1e4)return null;for(;a=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof z&&a=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&Xr(n,s.tree,0-s.offset,t,o),a;if(l&&(a=tc(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?Bt(i):4),tree:z.empty}}let ug=class{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=Gt.get(),o=s[0].from,{state:l,tree:a}=fg(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t=="\n"&&(t="");else{let i=t.indexOf("\n");i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new Jh(t,e?e.state.tabSize:4,e?Bt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=ic(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const jr=Object.create(null),Di=[ye.none],dg=new Gn(Di),wl=[],nc=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])nc[n]=rc(jr,e);class sc{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),nc)}resolve(e){return e?this.table[e]||(this.table[e]=rc(this.extra,e)):0}}const pg=new sc(jr);function ws(n,e){wl.indexOf(n)>-1||(wl.push(n),console.warn(e))}function rc(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||b[r];o?typeof o=="function"?t?t=o(t):ws(r,"Modifier ".concat(r," used at start of tag")):t?ws(r,"Tag ".concat(r," used as modifier")):t=o:ws(r,"Unknown highlighting tag ".concat(r))}if(!t)return 0;let i=e.replace(/ /g,"_"),s=ye.define({id:Di.length,name:i,props:[zr({[i]:t})]});return Di.push(s),s.id}function gg(n){let e=ye.define({id:Di.length,name:"Document",props:[Pt.add(()=>n)],top:!0});return Di.push(e),e}const mg=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=Kr(n.state,t.from);return i.line?yg(n):i.block?xg(n):!1};function Gr(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const yg=Gr(wg,0),bg=Gr(oc,0),xg=Gr((n,e)=>oc(n,e,kg(e)),0);function Kr(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const oi=50;function Og(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-oi,i),o=n.sliceDoc(s,s+oi),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*oi?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+oi),f=n.sliceDoc(s-oi,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function kg(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function oc(n,e,t=e.selection.ranges){let i=t.map(r=>Kr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>Og(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const mr=st.define(),Sg=st.define(),vg=A.define(),lc=A.define({combine(n){return Ye(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}});function Cg(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const ac=le.define({create(){return Ge.empty},update(n,e){let t=e.state.facet(lc),i=e.annotation(mr);if(i){let a=e.docChanged?x.single(Cg(e.changes)):void 0,h=ke.fromTransaction(e,a),c=i.side,f=c==0?n.undone:n.done;return h?f=Ln(f,f.length,t.minDepth,h):f=fc(f,e.startState.selection),new Ge(c==0?i.rest:f,c==0?f:i.rest)}let s=e.annotation(Sg);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(te.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=ke.fromTransaction(e),o=e.annotation(te.time),l=e.annotation(te.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Ge(n.done.map(ke.fromJSON),n.undone.map(ke.fromJSON))}});function Ag(n={}){return[ac,lc.of(n),P.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?hc:e.inputType=="historyRedo"?yr:null;return i?(e.preventDefault(),i(t)):!1}})]}function Zn(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(ac,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const hc=Zn(0,!1),yr=Zn(1,!1),Pg=Zn(0,!0),Mg=Zn(1,!0);class ke{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new ke(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new ke(e.changes&&J.fromJSON(e.changes),[],e.mapped&&Ke.fromJSON(e.mapped),e.startSelection&&x.fromJSON(e.startSelection),e.selectionsAfter.map(x.fromJSON))}static fromTransaction(e,t){let i=Be;for(let s of e.startState.facet(vg)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new ke(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Be)}static selection(e){return new ke(void 0,Be,void 0,void 0,e)}}function Ln(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function Tg(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function Dg(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function cc(n,e){return n.length?e.length?n.concat(e):n:e}const Be=[],Rg=200;function fc(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Rg));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Ln(n,n.length-1,1e9,t.setSelAfter(i)))}else return[ke.selection([e])]}function Bg(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Ss(n,e){if(!n.length)return n;let t=n.length,i=Be;for(;t;){let s=Eg(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[ke.selection(i)]:Be}function Eg(n,e,t){let i=cc(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Be,t);if(!n.changes)return ke.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new ke(s,R.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const Lg=/^(input\.type|delete)($|\.)/;class Ge{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new Ge(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||Lg.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Jn(t,e))}function de(n){return n.textDirectionAt(n.state.selection.main.head)==X.LTR}const dc=n=>uc(n,!de(n)),pc=n=>uc(n,de(n));function gc(n,e){return Qe(n,t=>t.empty?n.moveByGroup(t,e):Jn(t,e))}const Ng=n=>gc(n,!de(n)),Qg=n=>gc(n,de(n));function Wg(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function es(n,e,t){let i=ie(n).resolveInner(e.head),s=t?L.closedBy:L.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;Wg(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?je(n,i.from,1):je(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,x.cursor(l,t?-1:1)}const $g=n=>Qe(n,e=>es(n.state,e,!de(n))),zg=n=>Qe(n,e=>es(n.state,e,de(n)));function mc(n,e){return Qe(n,t=>{if(!t.empty)return Jn(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const yc=n=>mc(n,!1),bc=n=>mc(n,!0);function xc(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Jn(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomOc(n,!1),br=n=>Oc(n,!0);function kt(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=x.cursor(i.from+r))}return s}const Vg=n=>Qe(n,e=>kt(n,e,!0)),Fg=n=>Qe(n,e=>kt(n,e,!1)),Hg=n=>Qe(n,e=>kt(n,e,!de(n))),qg=n=>Qe(n,e=>kt(n,e,de(n))),Ug=n=>Qe(n,e=>x.cursor(n.lineBlockAt(e.head).from,1)),Xg=n=>Qe(n,e=>x.cursor(n.lineBlockAt(e.head).to,-1));function jg(n,e,t){let i=!1,s=ei(n.selection,r=>{let o=je(n,r.head,-1)||je(n,r.head,1)||r.head>0&&je(n,r.head-1,1)||r.headjg(n,e);function Le(n,e){let t=ei(n.state.selection,i=>{let s=e(i);return x.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Ze(n.state,t)),!0)}function kc(n,e){return Le(n,t=>n.moveByChar(t,e))}const wc=n=>kc(n,!de(n)),Sc=n=>kc(n,de(n));function vc(n,e){return Le(n,t=>n.moveByGroup(t,e))}const Kg=n=>vc(n,!de(n)),_g=n=>vc(n,de(n)),Yg=n=>Le(n,e=>es(n.state,e,!de(n))),Zg=n=>Le(n,e=>es(n.state,e,de(n)));function Cc(n,e){return Le(n,t=>n.moveVertically(t,e))}const Ac=n=>Cc(n,!1),Pc=n=>Cc(n,!0);function Mc(n,e){return Le(n,t=>n.moveVertically(t,e,xc(n).height))}const vl=n=>Mc(n,!1),Cl=n=>Mc(n,!0),Jg=n=>Le(n,e=>kt(n,e,!0)),em=n=>Le(n,e=>kt(n,e,!1)),tm=n=>Le(n,e=>kt(n,e,!de(n))),im=n=>Le(n,e=>kt(n,e,de(n))),nm=n=>Le(n,e=>x.cursor(n.lineBlockAt(e.head).from)),sm=n=>Le(n,e=>x.cursor(n.lineBlockAt(e.head).to)),Al=({state:n,dispatch:e})=>(e(Ze(n,{anchor:0})),!0),Pl=({state:n,dispatch:e})=>(e(Ze(n,{anchor:n.doc.length})),!0),Ml=({state:n,dispatch:e})=>(e(Ze(n,{anchor:n.selection.main.anchor,head:0})),!0),Tl=({state:n,dispatch:e})=>(e(Ze(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),rm=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),om=({state:n,dispatch:e})=>{let t=ts(n).map(({from:i,to:s})=>x.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:x.create(t),userEvent:"select"})),!0},lm=({state:n,dispatch:e})=>{let t=ei(n.selection,i=>{var s;let r=ie(n).resolveStack(i.from,1);for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&(!((s=l.parent)===null||s===void 0)&&s.parent))return x.range(l.to,l.from)}return i});return e(Ze(n,t)),!0},am=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=x.create([t.main]):t.main.empty||(i=x.create([x.cursor(t.main.head)])),i?(e(Ze(n,i)),!0):!1};function $i(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=rn(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=rn(n,o,!1),l=rn(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:x.cursor(o,os(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const Tc=(n,e)=>$i(n,t=>{let i=t.from,{state:s}=n,r=s.doc.lineAt(i),o,l;if(!e&&i>r.from&&iTc(n,!1),Dc=n=>Tc(n,!0),Rc=(n,e)=>$i(n,t=>{let i=t.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=ue(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),Bc=n=>Rc(n,!1),hm=n=>Rc(n,!0),cm=n=>$i(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head$i(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),um=n=>$i(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Q.of(["",""])},range:x.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},pm=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:ue(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:ue(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:x.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ts(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function Ec(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of ts(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(x.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(x.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:x.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const gm=({state:n,dispatch:e})=>Ec(n,e,!1),mm=({state:n,dispatch:e})=>Ec(n,e,!0);function Lc(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of ts(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ym=({state:n,dispatch:e})=>Lc(n,e,!1),bm=({state:n,dispatch:e})=>Lc(n,e,!0),xm=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(ts(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Om(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ie(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(L.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const km=Ic(!1),wm=Ic(!0);function Ic(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&Om(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new Kn(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=Fr(h,r);for(c==null&&(c=Jt(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:x.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const Sm=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Kn(n,{overrideIndentation:r=>{let o=t[r];return o==null?-1:o}}),s=_r(n,(r,o,l)=>{let a=Fr(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=Ti(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(_r(n,(t,i)=>{i.push({from:t.from,insert:n.facet(Vr)})}),{userEvent:"input.indent"})),!0),Qc=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(_r(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=Jt(s,n.tabSize),o=0,l=Ti(n,Math.max(0,r-Bt(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),Am=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:$g,shift:Yg},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:zg,shift:Zg},{key:"Alt-ArrowUp",run:gm},{key:"Shift-Alt-ArrowUp",run:ym},{key:"Alt-ArrowDown",run:mm},{key:"Shift-Alt-ArrowDown",run:bm},{key:"Escape",run:am},{key:"Mod-Enter",run:wm},{key:"Alt-l",mac:"Ctrl-l",run:om},{key:"Mod-i",run:lm,preventDefault:!0},{key:"Mod-[",run:Qc},{key:"Mod-]",run:Nc},{key:"Mod-Alt-\\",run:Sm},{key:"Shift-Mod-k",run:xm},{key:"Shift-Mod-\\",run:Gg},{key:"Mod-/",run:mg},{key:"Alt-A",run:bg}].concat(Cm),Ny={key:"Tab",run:Nc,shift:Qc};function V(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class _t{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(Dl(l)):Dl,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return re(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Sr(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=De(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=In(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new qt(t,e.sliceString(t,i));return vs.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=In(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=qt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(zc.prototype[Symbol.iterator]=Vc.prototype[Symbol.iterator]=function(){return this});function Pm(n){try{return new RegExp(n,Yr),!0}catch{return!1}}function In(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function Or(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=V("input",{class:"cm-textfield",name:"line",value:e}),i=V("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),n.dispatch({effects:Nn.of(!1)}),n.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},V("label",n.state.phrase("Go to line"),": ",t)," ",V("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,h,c,f]=r,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let g=d/100;a&&(g=g*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*g)}else h&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),m=x.cursor(p.from+Math.max(0,Math.min(u,p.length)));n.dispatch({effects:[Nn.of(!1),P.scrollIntoView(m.from,{y:"center"})],selection:m}),n.focus()}return{dom:i}}const Nn=R.define(),Rl=le.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Nn)&&(n=t.value);return n},provide:n=>Ai.from(n,e=>e?Or:null)}),Mm=n=>{let e=Ci(n,Or);if(!e){let t=[Nn.of(!0)];n.state.field(Rl,!1)==null&&t.push(R.appendConfig.of([Rl,Tm])),n.dispatch({effects:t}),e=Ci(n,Or)}return e&&e.dom.querySelector("input").select(),!0},Tm=P.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Dm={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Rm=A.define({combine(n){return Ye(n,Dm,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Bm(n){return[Qm,Nm]}const Em=D.mark({class:"cm-selectionMatch"}),Lm=D.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Bl(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=U.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=U.Word)}function Im(n,e,t,i){return n(e.sliceDoc(t,t+1))==U.Word&&n(e.sliceDoc(i-1,i))==U.Word}const Nm=K.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Rm),{state:t}=n,i=t.selection;if(i.ranges.length>1)return D.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return D.none;let a=t.wordAt(s.head);if(!a)return D.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return D.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Bl(o,t,s.from,s.to)&&Im(o,t,s.from,s.to)))return D.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return D.none}let l=[];for(let a of n.visibleRanges){let h=new _t(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Bl(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(Lm.range(c,f)):(c>=s.to||f<=s.from)&&l.push(Em.range(c,f)),l.length>e.maxMatches))return D.none}}return D.set(l)}},{decorations:n=>n.decorations}),Qm=P.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Wm=({state:n,dispatch:e})=>{let{selection:t}=n,i=x.create(t.ranges.map(s=>n.wordAt(s.head)||x.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function $m(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new _t(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new _t(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const zm=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return Wm({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=$m(n,i);return s?(e(n.update({selection:n.selection.addRange(x.range(s.from,s.to),!1),effects:P.scrollIntoView(s.to)})),!0):!1},ti=A.define({combine(n){return Ye(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Zm(e),scrollToMatch:e=>P.scrollIntoView(e)})}});class Fc{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Pm(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?"\n":i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new qm(this):new Fm(this)}getCursor(e,t=0,i){let s=e.doc?e:N.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Wt(this,s,t,i):Qt(this,s,t,i)}}class Hc{constructor(e){this.spec=e}}function Qt(n,e,t,i){return new _t(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?Vm(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Vm(n,e){return(t,i,s,r)=>((r>t||r+s.length=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Qt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Wt(n,e,t,i){return new zc(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Hm(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function Qn(n,e){return n.slice(ue(n,e,!1),e)}function Wn(n,e){return n.slice(e,ue(n,e))}function Hm(n){return(e,t,i)=>!i[0].length||(n(Qn(i.input,i.index))!=U.Word||n(Wn(i.input,i.index))!=U.Word)&&(n(Wn(i.input,i.index+i[0].length))!=U.Word||n(Qn(i.input,i.index+i[0].length))!=U.Word)}class qm extends Hc{nextMatch(e,t,i){let s=Wt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Wt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Wt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Wt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Ri=R.define(),Zr=R.define(),dt=le.define({create(n){return new Cs(kr(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Ri)?n=new Cs(t.value.create(),n.panel):t.is(Zr)&&(n=new Cs(n.query,t.value?Jr:null));return n},provide:n=>Ai.from(n,e=>e.panel)});class Cs{constructor(e,t){this.query=e,this.panel=t}}const Um=D.mark({class:"cm-searchMatch"}),Xm=D.mark({class:"cm-searchMatch cm-searchMatch-selected"}),jm=K.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(dt))}update(n){let e=n.state.field(dt);(e!=n.startState.field(dt)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return D.none;let{view:t}=this,i=new gt;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Xm:Um)})}return i.finish()}},{decorations:n=>n.decorations});function zi(n){return e=>{let t=e.state.field(dt,!1);return t&&t.query.spec.valid?n(e,t):Xc(e)}}const $n=zi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=x.single(i.from,i.to),r=n.state.facet(ti);return n.dispatch({selection:s,effects:[eo(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),Uc(n),!0}),zn=zi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=x.single(s.from,s.to),o=n.state.facet(ti);return n.dispatch({selection:r,effects:[eo(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),Uc(n),!0}),Gm=zi((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:x.create(t.map(i=>x.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Km=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new _t(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(x.range(l.value.from,l.value.to))}return e(n.update({selection:x.create(r,o),userEvent:"select.search.matches"})),!0},El=zi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=[],l,a,h=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t,r.from,r.to),h.push(P.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l=x.single(r.from-c,r.to-c),h.push(eo(n,r)),h.push(t.facet(ti).scrollToMatch(l.main,n))}return n.dispatch({changes:o,selection:l,effects:h,userEvent:"input.replace"}),!0}),_m=zi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:P.announce.of(i),userEvent:"input.replace.all"}),!0});function Jr(n){return n.state.facet(ti).createPanel(n)}function kr(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=n.facet(ti);return new Fc({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function qc(n){let e=Ci(n,Jr);return e&&e.dom.querySelector("[main-field]")}function Uc(n){let e=qc(n);e&&e==n.root.activeElement&&e.select()}const Xc=n=>{let e=n.state.field(dt,!1);if(e&&e.panel){let t=qc(n);if(t&&t!=n.root.activeElement){let i=kr(n.state,e.query.spec);i.valid&&n.dispatch({effects:Ri.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[Zr.of(!0),e?Ri.of(kr(n.state,e.query.spec)):R.appendConfig.of(e0)]});return!0},jc=n=>{let e=n.state.field(dt,!1);if(!e||!e.panel)return!1;let t=Ci(n,Jr);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Zr.of(!1)}),!0},Ym=[{key:"Mod-f",run:Xc,scope:"editor search-panel"},{key:"F3",run:$n,shift:zn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:$n,shift:zn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:jc,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Km},{key:"Alt-g",run:Mm},{key:"Mod-d",run:zm,preventDefault:!0}];class Zm{constructor(e){this.view=e;let t=this.query=e.state.field(dt).query.spec;this.commit=this.commit.bind(this),this.searchField=V("input",{value:t.search,placeholder:ve(e,"Find"),"aria-label":ve(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=V("input",{value:t.replace,placeholder:ve(e,"Replace"),"aria-label":ve(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=V("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=V("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=V("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return V("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=V("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>$n(e),[ve(e,"next")]),i("prev",()=>zn(e),[ve(e,"previous")]),i("select",()=>Gm(e),[ve(e,"all")]),V("label",null,[this.caseField,ve(e,"match case")]),V("label",null,[this.reField,ve(e,"regexp")]),V("label",null,[this.wordField,ve(e,"by word")]),...e.state.readOnly?[]:[V("br"),this.replaceField,i("replace",()=>El(e),[ve(e,"replace")]),i("replaceAll",()=>_m(e),[ve(e,"replace all")])],V("button",{name:"close",onclick:()=>jc(e),"aria-label":ve(e,"close"),type:"button"},["×"])])}commit(){let e=new Fc({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Ri.of(e)}))}keydown(e){hd(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?zn:$n)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),El(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Ri)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ti).top}}function ve(n,e){return n.state.phrase(e)}const on=30,ln=/[\s\.,:;?!]/;function eo(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-on),o=Math.min(s,t+on),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-on;a--)if(!ln.test(l[a-1])&&ln.test(l[a])){l=l.slice(0,a);break}}return P.announce.of("".concat(n.state.phrase("current match"),". ").concat(l," ").concat(n.state.phrase("on line")," ").concat(i.number,"."))}const Jm=P.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),e0=[dt,Zt.low(jm),Jm];class Gc{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ie(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Kc(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Ll(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),"[".concat(t?"\\w":"").concat(e.replace(/[^\w\s]/g,"\\$&"),"]")}function t0(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:t0(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}class Il{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function pt(n){return n.selection.main.from}function Kc(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp("".concat(s?"^":"","(?:").concat(i,")").concat(r?"$":""),(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const n0=st.define();function s0(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(l=>l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i)?{range:l}:{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:e},range:x.cursor(l.from+r+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const Nl=new WeakMap;function r0(n){if(!Array.isArray(n))return n;let e=Nl.get(n);return e||Nl.set(n,e=i0(n)),e}const to=R.define(),Bi=R.define();class o0{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(S=Sr(k))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!w||T==1&&g||O==0&&T!=0)&&(t[f]==k||i[f]==k&&(u=!0)?o[f++]=w:o.length&&(y=!1)),O=T,w+=De(k)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,m]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?!1:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?De(re(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}const we=A.define({combine(n){return Ye(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:l0,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>Ql(e(i),t(i)),optionClass:(e,t)=>i=>Ql(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function Ql(n,e){return n?e?n+" "+e:n:e}function l0(n,e,t,i,s,r){let o=n.textDirection==X.RTL,l=o,a=!1,h="top",c,f,u=e.left-s.left,d=s.right-e.right,p=i.right-i.left,m=i.bottom-i.top;if(l&&u=m||w>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let g=(e.bottom-e.top)/r.offsetHeight,y=(e.right-e.left)/r.offsetWidth;return{style:"".concat(h,": ").concat(c/g,"px; max-width: ").concat(f/y,"px"),class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function a0(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let o=t.displayLabel||t.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(o.slice(l,h)));let f=r.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,c))),f.className="cm-completionMatchedText",l=c}return lt.position-i.position).map(t=>t.render)}function Wl(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class h0{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(we);this.optionContent=a0(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Wl(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{for(let h=a.target,c;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(c=/-(\d+)$/.exec(h.id))&&+c[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(we).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Bi.of(null)})}),this.list=this.dom.appendChild(this.createListBox(r,s.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}mount(){this.updateSel()}update(e){var t,i,s;let r=e.state.field(this.stateField),o=e.startState.field(this.stateField);this.updateTooltipClass(e.state),r!=o&&(this.updateSel(),((t=r.open)===null||t===void 0?void 0:t.disabled)!=((i=o.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(!((s=r.open)===null||s===void 0)&&s.disabled)))}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=Wl(t.options.length,t.selected,this.view.state.facet(we).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,i)}).catch(o=>Ie(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&f0(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottomi.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew h0(t,n,e)}function f0(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/s)}function $l(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function u0(n,e){let t=[],i=null,s=a=>{t.push(a);let{section:h}=a.completion;if(h){i||(i=[]);let c=typeof h=="string"?h:h.name;i.some(f=>f.name==c)||i.push(typeof h=="string"?{name:c}:h)}};for(let a of n)if(a.hasResult()){let h=a.result.getMatch;if(a.result.filter===!1)for(let c of a.result.options)s(new Il(c,a.source,h?h(c):[],1e9-t.length));else{let c=new o0(e.sliceDoc(a.from,a.to));for(let f of a.result.options)if(c.match(f.label)){let u=f.displayLabel?h?h(f,c.matched):[]:c.matched;s(new Il(f,a.source,u,c.score+(f.boost||0)))}}}if(i){let a=Object.create(null),h=0,c=(f,u)=>{var d,p;return((d=f.rank)!==null&&d!==void 0?d:1e9)-((p=u.rank)!==null&&p!==void 0?p:1e9)||(f.namec.score-h.score||l(h.completion,c.completion))){let h=a.completion;!o||o.label!=h.label||o.detail!=h.detail||o.type!=null&&h.type!=null&&o.type!=h.type||o.apply!=h.apply||o.boost!=h.boost?r.push(a):$l(a.completion)>$l(o)&&(r[r.length-1]=a),o=a.completion}return r}class zt{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new zt(this.options,zl(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=u0(e,t);if(!o.length)return s&&e.some(a=>a.state==1)?new zt(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let l=t.facet(we).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(a,h.from):a,1e8),create:c0(Pe,Zc),above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new zt(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Vn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Vn(g0,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(we),r=(i.override||t.languageDataAt("autocomplete",pt(t)).map(r0)).map(l=>(this.active.find(h=>h.source==l)||new Oe(l,this.active.some(h=>h.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!d0(r,this.active)?o=zt.build(r,t,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new Oe(l.source,0):l));for(let l of e.effects)l.is(Yc)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new Vn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:p0}}function d0(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const g0=[];function wr(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class Oe{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=wr(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new Oe(s.source,0));for(let r of e.effects)if(r.is(to))s=new Oe(s.source,1,r.value?pt(e.state):-1);else if(r.is(Bi))s=new Oe(s.source,0);else if(r.is(_c))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new Oe(this.source,1)}handleChange(e){return e.changes.touchesRange(pt(e.startState))?new Oe(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Oe(this.source,this.state,e.mapPos(this.explicitPos))}}class Ut extends Oe{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=pt(e.state);if((this.explicitPos<0?l<=r:lo||t=="delete"&&pt(e.startState)==this.from)return new Oe(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return m0(this.result.validFor,e.state,r,o)?new Ut(this.source,a,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new Gc(e.state,l,a>=0)))?new Ut(this.source,a,h,h.from,(s=h.to)!==null&&s!==void 0?s:pt(e.state)):new Oe(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Oe(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Ut(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function m0(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):Kc(n,!0).test(s)}const _c=R.define({map(n,e){return n.map(t=>t.map(e))}}),Yc=R.define(),Pe=le.define({create(){return Vn.start()},update(n,e){return n.update(e)},provide:n=>[Lr.from(n,e=>e.tooltip),P.contentAttributes.from(n,e=>e.attrs)]});function Zc(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Pe).active.find(s=>s.source==e.source);return i instanceof Ut?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},s0(n.state,t,i.from,i.to)),{annotations:n0.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}function an(n,e="option"){return t=>{let i=t.state.field(Pe,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Yc.of(l)}),!0}}const y0=n=>{let e=n.state.field(Pe,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(Pe,!1)?(n.dispatch({effects:to.of(!0)}),!0):!1,x0=n=>{let e=n.state.field(Pe,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Bi.of(null)}),!0)};class O0{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Vl=50,k0=50,w0=1e3,S0=K.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Pe).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Pe);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Pe)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!wr(i));for(let i=0;ik0&&Date.now()-s.time>w0){for(let r of s.context.abortListeners)try{r()}catch(o){Ie(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),Vl):-1,this.composing!=0)for(let i of n.transactions)wr(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Pe);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=pt(e),i=new Gc(e,t,n.explicitPos==t),s=new O0(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Bi.of(null)}),Ie(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),Vl))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(we);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new Oe(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:_c.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Pe,!1);if(e&&e.tooltip&&this.view.state.facet(we).closeOnBlur){let t=e.open&&Ah(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:Bi.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:to.of(!1)}),20),this.composing=0}}}),v0=P.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Ei={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Mt=R.define({map(n,e){let t=e.mapPos(n,-1,pe.TrackAfter);return t==null?void 0:t}}),io=new class extends Dt{};io.startSide=1;io.endSide=-1;const Jc=le.define({create(){return W.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=W.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(Mt)&&(n=n.update({add:[io.range(t.value,t.value+1)]}));return n}});function C0(){return[P0,Jc]}const As="()[]{}<>";function ef(n){for(let e=0;e{if((A0?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&De(re(i,0))==1||e!=s.from||t!=s.to)return!1;let r=D0(n.state,i);return r?(n.dispatch(r),!0):!1}),M0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=tf(n,n.selection.main.head).brackets||Ei.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=R0(n.doc,o.head);for(let a of i)if(a==l&&is(n.doc,o.head)==ef(re(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:x.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},T0=[{key:"Backspace",run:M0}];function D0(n,e){let t=tf(n,n.selection.main.head),i=t.brackets||Ei.brackets;for(let s of i){let r=ef(re(s,0));if(e==s)return r==s?L0(n,s,i.indexOf(s+s+s)>-1,t):B0(n,s,r,t.before||Ei.before);if(e==r&&nf(n,n.selection.main.from))return E0(n,s,r)}return null}function nf(n,e){let t=!1;return n.field(Jc).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function is(n,e){let t=n.sliceString(e,e+2);return t.slice(0,De(re(t,0)))}function R0(n,e){let t=n.sliceString(e-2,e);return De(re(t,0))==t.length?t:t.slice(1)}function B0(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Mt.of(o.to+e.length),range:x.range(o.anchor+e.length,o.head+e.length)};let l=is(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:Mt.of(o.head+e.length),range:x.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function E0(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&is(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:x.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function L0(n,e,t,i){let s=i.stringPrefixes||Ei.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Mt.of(l.to+e.length),range:x.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=is(n.doc,a),c;if(h==e){if(Fl(n,a))return{changes:{insert:e+e,from:a},effects:Mt.of(a+e.length),range:x.cursor(a+e.length)};if(nf(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:x.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=Hl(n,a-2*e.length,s))>-1&&Fl(n,c))return{changes:{insert:e+e+e+e,from:a},effects:Mt.of(a+e.length),range:x.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=U.Word&&Hl(n,a,s)>-1&&!I0(n,a,e,s))return{changes:{insert:e+e,from:a},effects:Mt.of(a+e.length),range:x.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Fl(n,e){let t=ie(n).resolveInner(e+1);return t.parent&&t.from==e}function I0(n,e,t,i){let s=ie(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function Hl(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=U.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=U.Word)return r}return-1}function N0(n={}){return[Pe,we.of(n),S0,Q0,v0]}const sf=[{key:"Ctrl-Space",run:b0},{key:"Escape",run:x0},{key:"ArrowDown",run:an(!0)},{key:"ArrowUp",run:an(!1)},{key:"PageDown",run:an(!0,"page")},{key:"PageUp",run:an(!1,"page")},{key:"Enter",run:y0}],Q0=Zt.highest(Er.computeN([we],n=>n.facet(we).defaultKeymap?[sf]:[]));class W0{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Ct{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=e,r=i.facet(lf).markerFilter;r&&(s=r(s));let o=D.set(s.map(l=>l.from==l.to||l.from==l.to-1&&i.doc.lineAt(l.from).to==l.from?D.widget({widget:new j0(l),diagnostic:l}).range(l.from):D.mark({attributes:{class:"cm-lintRange cm-lintRange-"+l.severity+(l.markClass?" "+l.markClass:"")},diagnostic:l}).range(l.from,l.to)),!0);return new Ct(o,t,Yt(o))}}function Yt(n,e=null,t=0){let i=null;return n.between(t,1e9,(s,r,{spec:o})=>{if(!(e&&o.diagnostic!=e))return i=new W0(s,r,o.diagnostic),!1}),i}function $0(n,e){let t=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(i=>i.is(rf))||n.changes.touchesRange(t.from,t.to))}function z0(n,e){return n.field(Te,!1)?e:e.concat(R.appendConfig.of(_0))}const rf=R.define(),no=R.define(),of=R.define(),Te=le.define({create(){return new Ct(D.none,null,null)},update(n,e){if(e.docChanged){let t=n.diagnostics.map(e.changes),i=null;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);i=Yt(t,n.selected.diagnostic,s)||Yt(t,null,s)}n=new Ct(t,n.panel,i)}for(let t of e.effects)t.is(rf)?n=Ct.init(t.value,n.panel,e.state):t.is(no)?n=new Ct(n.diagnostics,t.value?ns.open:null,n.selected):t.is(of)&&(n=new Ct(n.diagnostics,n.panel,t.value));return n},provide:n=>[Ai.from(n,e=>e.panel),P.decorations.from(n,e=>e.diagnostics)]}),V0=D.mark({class:"cm-lintRange cm-lintRange-active"});function F0(n,e,t){let{diagnostics:i}=n.state.field(Te),s=[],r=2e8,o=0;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,h,{spec:c})=>{e>=a&&e<=h&&(a==h||(e>a||t>0)&&(ehf(n,t,!1)))}const q0=n=>{let e=n.state.field(Te,!1);(!e||!e.panel)&&n.dispatch({effects:z0(n.state,[no.of(!0)])});let t=Ci(n,ns.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},ql=n=>{let e=n.state.field(Te,!1);return!e||!e.panel?!1:(n.dispatch({effects:no.of(!1)}),!0)},U0=n=>{let e=n.state.field(Te,!1);if(!e)return!1;let t=n.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},X0=[{key:"Mod-Shift-m",run:q0,preventDefault:!0},{key:"F8",run:U0}],lf=A.define({combine(n){return Object.assign({sources:n.map(e=>e.source)},Ye(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t}))}});function af(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;ir.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function hf(n,e,t){var i;let s=t?af(e.actions):[];return V("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},V("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(i=e.actions)===null||i===void 0?void 0:i.map((r,o)=>{let l=!1,a=u=>{if(u.preventDefault(),l)return;l=!0;let d=Yt(n.state.field(Te).diagnostics,e);d&&r.apply(n,d.from,d.to)},{name:h}=r,c=s[o]?h.indexOf(s[o]):-1,f=c<0?h:[h.slice(0,c),V("u",h.slice(c,c+1)),h.slice(c+1)];return V("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":" Action: ".concat(h).concat(c<0?"":' (access key "'.concat(s[o],')"'),".")},f)}),e.source&&V("div",{class:"cm-diagnosticSource"},e.source))}class j0 extends Ot{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return V("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Ul{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=hf(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ns{constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)ql(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=af(r.actions);for(let l=0;l{for(let r=0;rql(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Te).selected;if(!e)return-1;for(let t=0;t{let h=-1,c;for(let f=i;fi&&(this.items.splice(i,h-i),s=!0)),t&&c.diagnostic==t.diagnostic?c.dom.hasAttribute("aria-selected")||(c.dom.setAttribute("aria-selected","true"),r=c):c.dom.hasAttribute("aria-selected")&&c.dom.removeAttribute("aria-selected"),i++});i({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:l})=>{let a=l.height/this.list.offsetHeight;o.topl.bottom&&(this.list.scrollTop+=(o.bottom-l.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Te),i=Yt(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:of.of(i)})}static open(e){return new ns(e)}}function G0(n,e='viewBox="0 0 40 40"'){return'url(\'data:image/svg+xml,").concat(encodeURIComponent(n),"')")}function hn(n){return G0(''),'width="6" height="3"')}const K0=P.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:hn("#d11")},".cm-lintRange-warning":{backgroundImage:hn("orange")},".cm-lintRange-info":{backgroundImage:hn("#999")},".cm-lintRange-hint":{backgroundImage:hn("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),_0=[Te,P.decorations.compute([Te],n=>{let{selected:e,panel:t}=n.field(Te);return!e||!t||e.from==e.to?D.none:D.set([V0.range(e.from,e.to)])}),Gd(F0,{hideOn:$0}),K0],Qy=[np(),op(),Ad(),Ag(),jp(),gd(),Od(),N.allowMultipleSelections.of(!0),Lp(),Kp(Zp,{fallback:!0}),rg(),C0(),N0(),Wd(),Vd(),Bd(),Bm(),Er.of([...T0,...Am,...Ym,...Ig,...Hp,...sf,...X0])];var Xl={};class Fn{constructor(e,t,i,s,r,o,l,a,h,c=0,f){this.p=e,this.stack=t,this.state=i,this.reducePos=s,this.pos=r,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=f}toString(){return"[".concat(this.stack.filter((e,t)=>t%3==0).concat(this.state),"]@").concat(this.pos).concat(this.score?"!"+this.score:"")}static start(e,t,i=0){let s=e.parser.context;return new Fn(e,[],t,i,i,0,[],0,s?new jl(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,s=e&65535,{parser:r}=this.p,o=r.dynamicPrecedence(s);if(o&&(this.score+=o),i==0){this.pushState(r.getGoto(this.state,s,!0),this.reducePos),s=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(s,a)}storeNode(e,t,i,s=4,r=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(t==i)return;if(o.buffer[l-2]>=t){o.buffer[l-2]=i;return}}}if(!r||this.pos==i)this.buffer.push(e,t,i,s);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,s>4&&(s-=4);this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=i,this.buffer[o+3]=s}}shift(e,t,i,s){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=s,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,s,4);else{let r=e,{parser:o}=this.p;(s>this.pos||t<=o.maxNode)&&(this.pos=s,o.stateFlag(r,1)||(this.reducePos=s)),this.pushState(r,i),this.shiftContext(t,i),t<=o.maxNode&&this.buffer.push(t,i,s,4)}}apply(e,t,i,s){e&65536?this.reduce(e):this.shift(e,t,i,s)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(t,s),this.buffer.push(i,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),s=e.bufferBase+t;for(;e&&s==e.bufferBase;)e=e.parent;return new Fn(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Y0(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if(!(i&65536))return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let s=[];for(let r=0,o;ra&1&&l==o)||s.push(t[r],o)}t=s}let i=[];for(let s=0;s>19,s=t&65535,r=this.stack.length-i*3;if(r<0||e.getGoto(this.stack[r],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(s,r)=>{if(!t.includes(s))return t.push(s),e.allActions(s,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-r;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,r+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class jl{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Y0{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=s}}class Hn{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Hn(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Hn(this.stack,this.pos,this.index)}}function ui(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,s=0;i=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),r+=a,l)break;r*=46}t?t[s++]=r:t=new e(r)}return t}class xn{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Gl=new xn;class Z0{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Gl,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,s=this.rangeIndex,r=this.pos+e;for(;ri.to:r>=i.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];r+=o.from-i.to,i=o}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,s;if(t>=0&&t=this.chunk2Pos&&il.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),s=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),s}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Gl,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let s of this.ranges){if(s.from>=t)break;s.to>e&&(i+=this.input.read(Math.max(s.from,e),Math.min(s.to,t)))}return i}}class Xt{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;ff(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}Xt.prototype.contextual=Xt.prototype.fallback=Xt.prototype.extend=!1;class cf{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e=="string"?ui(e):e}token(e,t){let i=e.pos,s=0;for(;;){let r=e.next<0,o=e.resolveOffset(1,1);if(ff(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(r||s++,o==null)break;e.reset(o,e.token)}s&&(e.reset(i,e.token),e.acceptToken(this.elseToken,s))}}cf.prototype.contextual=Xt.prototype.fallback=Xt.prototype.extend=!1;class so{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function ff(n,e,t,i,s,r){let o=0,l=1<0){let p=n[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||J0(p,e.token.value,s,r))){e.acceptToken(p);break}}let c=e.next,f=0,u=n[o+2];if(e.next<0&&u>f&&n[h+u*3-3]==65535&&n[h+u*3-3]==65535){o=n[h+u*3-1];continue e}for(;f>1,p=h+d+(d<<1),m=n[p],g=n[p+1]||65536;if(c=g)f=d+1;else{o=n[p+2],e.advance();continue e}}break}}function Kl(n,e,t){for(let i=e,s;(s=n[i])!=65535;i++)if(s==t)return i-e;return-1}function J0(n,e,t,i){let s=Kl(t,i,e);return s<0||Kl(t,i,n)e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class ey{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?_l(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?_l(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(r instanceof z){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}}class ty{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new xn)}getActions(e){let t=0,i=null,{parser:s}=e.p,{tokenizers:r}=s,o=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;hf.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let u=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!c.extend&&(i=f,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new xn,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new xn,{pos:i,p:s}=e;return t.start=i,t.end=Math.min(i+1,s.stream.end),t.value=i==s.stream.end?s.parser.eofTerm:0,t}updateCachedToken(e,t,i){let s=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(s,e),i),e.value>-1){let{parser:r}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,t,i,s){for(let r=0;re.bufferLength*4?new ey(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],s,r;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)i.push(l);else{if(this.advanceStack(l,i,e))continue;{s||(s=[],r=[]),s.push(l);let a=this.tokens.getMainToken(l);r.push(a.value,a.end)}}break}}if(!i.length){let o=s&&sy(s);if(o)return Ce&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Ce&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,r,i);if(o)return Ce&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let f=this.fragments.nodeAt(s);f;){let u=this.parser.nodeSet.types[f.type.id]==f.type?r.getGoto(e.state,f.type.id):-1;if(u>-1&&f.length&&(!h||(f.prop(L.contextHash)||0)==c))return e.useNode(f,u),Ce&&console.log(o+this.stackID(e)+" (via reuse of ".concat(r.getName(f.type.id),")")),!0;if(!(f instanceof z)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof z&&f.positions[0]==0)f=d;else break}}let l=r.stateSlot(e.state,4);if(l>0)return e.reduce(l),Ce&&console.log(o+this.stackID(e)+" (via always-reduce ".concat(r.getName(l&65535),")")),!0;if(e.stack.length>=9e3)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;hs?t.push(p):i.push(p)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return Yl(e,t),!0}}runRecovery(e,t,i){let s=null,r=!1;for(let o=0;o ":"";if(l.deadEnd&&(r||(r=!0,l.restart(),Ce&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),u=c;for(let d=0;f.forceReduce()&&d<10&&(Ce&&console.log(u+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));d++)Ce&&(u=this.stackID(f)+" -> ");for(let d of l.recoverByInsert(a))Ce&&console.log(c+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,i);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),Ce&&console.log(c+this.stackID(l)+" (via recover-delete ".concat(this.parser.getName(a),")")),Yl(l,i)):(!s||s.scoree.topRules[l][1]),s=[];for(let l=0;l=0)r(c,a,l[h++]);else{let f=l[h+-c];for(let u=-c;u>0;u--)r(l[h++],a,f);h++}}}this.nodeSet=new Gn(t.map((l,a)=>ye.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:s[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Dh;let o=ui(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Xt(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let s=new iy(this,e,t,i);for(let r of this.wrappers)s=r(s,e,t,i);return s}getGoto(e,t,i=!1){let s=this.goto;if(t>=s[0])return-1;for(let r=s[t+1];;){let o=s[r++],l=o&1,a=s[r++];if(l&&i)return a;for(let h=r+(o>>1);r0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),s=i?t(i):void 0;for(let r=this.stateSlot(e,1);s==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Je(this.data,r+2);else break;s=t(Je(this.data,r+1))}return s}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Je(this.data,i+2);else break;if(!(this.data[i+2]&1)){let s=this.data[i+1];t.some((r,o)=>o&1&&r==s)||t.push(this.data[i],s)}}return t}configure(e){let t=Object.assign(Object.create(Li.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError("Invalid top rule name ".concat(e.top));t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let s=e.tokenizers.find(r=>r.from==i);return s?s.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,s)=>{let r=e.specializers.find(l=>l.from==i.external);if(!r)return i;let o=Object.assign(Object.assign({},i),{external:r.to});return t.specializers[s]=Zl(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let r of e.split(" ")){let o=t.indexOf(r);o>=0&&(i[o]=!0)}let s=null;for(let r=0;ri)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scoren.external(t,i)<<1|e}return n.get}const ry=zr({String:b.string,Number:b.number,"True False":b.bool,PropertyName:b.propertyName,Null:b.null,",":b.separator,"[ ]":b.squareBracket,"{ }":b.brace}),oy=Li.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[ry],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),ly=Mi.define({name:"json",parser:oy.configure({props:[Hr.add({Object:ur({except:/^\s*\}/}),Array:ur({except:/^\s*\]/})}),Ur.add({"Object Array":Vh})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Wy(){return new Wh(ly)}const ay=96,Jl=1,hy=97,cy=98,ea=2,uf=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],fy=58,uy=40,df=95,dy=91,On=45,py=46,gy=35,my=37;function qn(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function yy(n){return n>=48&&n<=57}const by=new so((n,e)=>{for(let t=!1,i=0,s=0;;s++){let{next:r}=n;if(qn(r)||r==On||r==df||t&&yy(r))!t&&(r!=On||s>0)&&(t=!0),i===s&&r==On&&i++,n.advance();else{t&&n.acceptToken(r==uy?hy:i==2&&e.canShift(ea)?ea:cy);break}}}),xy=new so(n=>{if(uf.includes(n.peek(-1))){let{next:e}=n;(qn(e)||e==df||e==gy||e==py||e==dy||e==fy||e==On)&&n.acceptToken(ay)}}),Oy=new so(n=>{if(!uf.includes(n.peek(-1))){let{next:e}=n;if(e==my&&(n.advance(),n.acceptToken(Jl)),qn(e)){do n.advance();while(qn(n.next));n.acceptToken(Jl)}}}),ky=zr({"AtKeyword import charset namespace keyframes media supports":b.definitionKeyword,"from to selector":b.keyword,NamespaceName:b.namespace,KeyframeName:b.labelName,KeyframeRangeName:b.operatorKeyword,TagName:b.tagName,ClassName:b.className,PseudoClassName:b.constant(b.className),IdName:b.labelName,"FeatureName PropertyName":b.propertyName,AttributeName:b.attributeName,NumberLiteral:b.number,KeywordQuery:b.keyword,UnaryQueryOp:b.operatorKeyword,"CallTag ValueName":b.atom,VariableName:b.variableName,Callee:b.operatorKeyword,Unit:b.unit,"UniversalSelector NestingSelector":b.definitionOperator,MatchOp:b.compareOperator,"ChildOp SiblingOp, LogicOp":b.logicOperator,BinOp:b.arithmeticOperator,Important:b.modifier,Comment:b.blockComment,ColorLiteral:b.color,"ParenthesizedContent StringLiteral":b.string,":":b.punctuation,"PseudoOp #":b.derefOperator,"; ,":b.separator,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace}),wy={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},Sy={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},vy={__proto__:null,not:128,only:128},Cy=Li.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[xy,Oy,by,1,2,3,4,new cf("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:n=>wy[n]||-1},{term:56,get:n=>Sy[n]||-1},{term:98,get:n=>vy[n]||-1}],tokenPrec:1169});let Ms=null;function Ts(){if(!Ms&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let i in n)i!="cssText"&&i!="cssFloat"&&typeof n[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));Ms=e.sort().map(i=>({type:"property",label:i}))}return Ms||[]}const ta=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(n=>({type:"class",label:n})),ia=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(n=>({type:"keyword",label:n})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(n=>({type:"constant",label:n}))),Ay=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(n=>({type:"type",label:n})),rt=/^(\w[\w-]*|-\w[\w-]*|)$/,Py=/^-(-[\w-]*)?$/;function My(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let i=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:e.sliceString(i.from,i.to)=="var"}const na=new dp,Ty=["Declaration"];function Dy(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function pf(n,e,t){if(e.to-e.from>4096){let i=na.get(e);if(i)return i;let s=[],r=new Set,o=e.cursor(ee.IncludeAnonymous);if(o.firstChild())do for(let l of pf(n,o.node,t))r.has(l.label)||(r.add(l.label),s.push(l));while(o.nextSibling());return na.set(e,s),s}else{let i=[],s=new Set;return e.cursor().iterate(r=>{var o;if(t(r)&&r.matchContext(Ty)&&((o=r.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=n.sliceString(r.from,r.to);s.has(l)||(s.add(l),i.push({label:l,type:"variable"}))}}),i}}const Ry=n=>e=>{let{state:t,pos:i}=e,s=ie(t).resolveInner(i,-1),r=s.type.isError&&s.from==s.to-1&&t.doc.sliceString(s.from,s.to)=="-";if(s.name=="PropertyName"||(r||s.name=="TagName")&&/^(Block|Styles)$/.test(s.resolve(s.to).name))return{from:s.from,options:Ts(),validFor:rt};if(s.name=="ValueName")return{from:s.from,options:ia,validFor:rt};if(s.name=="PseudoClassName")return{from:s.from,options:ta,validFor:rt};if(n(s)||(e.explicit||r)&&My(s,t.doc))return{from:n(s)||r?s.from:i,options:pf(t.doc,Dy(s),n),validFor:Py};if(s.name=="TagName"){for(let{parent:a}=s;a;a=a.parent)if(a.name=="Block")return{from:s.from,options:Ts(),validFor:rt};return{from:s.from,options:Ay,validFor:rt}}if(!e.explicit)return null;let o=s.resolve(i),l=o.childBefore(i);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:ta,validFor:rt}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:ia,validFor:rt}:o.name=="Block"||o.name=="Styles"?{from:i,options:Ts(),validFor:rt}:null},By=Ry(n=>n.name=="VariableName"),sa=Mi.define({name:"css",parser:Cy.configure({props:[Hr.add({Declaration:ur()}),Ur.add({"Block KeyframeList":Vh})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function $y(){return new Wh(sa,sa.data.of({autocomplete:By}))}export{P as E,Yn as H,ec as S,N as a,Qy as b,Ny as c,$y as d,Vr as i,Wy as j,Er as k,Kp as s,b as t}; diff --git a/assets/color.fragment-BjUREcw_.js b/assets/color.fragment-BjUREcw_.js new file mode 100644 index 0000000..4a6b600 --- /dev/null +++ b/assets/color.fragment-BjUREcw_.js @@ -0,0 +1 @@ +import{S as r}from"./Viewer-DVCEMRp5.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./index-Bku7SJna.js";import"./echarts-DzoUeqWp.js";import"./codemirror-ZSHHXwGs.js";const e="colorPixelShader",o="#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\n#define VERTEXCOLOR\nvarying vec4 vColor;\n#else\nuniform vec4 color;\n#endif\n#include\n#include\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\ngl_FragColor=vColor;\n#else\ngl_FragColor=color;\n#endif\n#include(color,gl_FragColor)\n#define CUSTOM_FRAGMENT_MAIN_END\n}";r.ShadersStore[e]=o;const c={name:e,shader:o};export{c as colorPixelShader}; diff --git a/assets/color.fragment-DNkpzaOC.js b/assets/color.fragment-DNkpzaOC.js new file mode 100644 index 0000000..4d355d4 --- /dev/null +++ b/assets/color.fragment-DNkpzaOC.js @@ -0,0 +1 @@ +import{S as r}from"./Viewer-DVCEMRp5.js";import"./clipPlaneFragment-ef4zNzcj.js";import"./fogFragment-BYUe2MTZ.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./index-Bku7SJna.js";import"./echarts-DzoUeqWp.js";import"./codemirror-ZSHHXwGs.js";const e="colorPixelShader",n="#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\n#define VERTEXCOLOR\nvarying vColor: vec4f;\n#else\nuniform color: vec4f;\n#endif\n#include\n#include\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nfragmentOutputs.color=input.vColor;\n#else\nfragmentOutputs.color=uniforms.color;\n#endif\n#include(color,fragmentOutputs.color)\n#define CUSTOM_FRAGMENT_MAIN_END\n}";r.ShadersStoreWGSL[e]=n;const c={name:e,shader:n};export{c as colorPixelShaderWGSL}; diff --git a/assets/color.vertex-BL9BK6Le.js b/assets/color.vertex-BL9BK6Le.js new file mode 100644 index 0000000..7bd8664 --- /dev/null +++ b/assets/color.vertex-BL9BK6Le.js @@ -0,0 +1 @@ +import{S as o}from"./Viewer-DVCEMRp5.js";import"./bakedVertexAnimation-jXsepPDt.js";import"./vertexColorMixing-CVYhb6uZ.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./index-Bku7SJna.js";import"./echarts-DzoUeqWp.js";import"./codemirror-ZSHHXwGs.js";const e="colorVertexShader",i="attribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include\n#include\n#include\n#include\n#ifdef FOG\nuniform mat4 view;\n#endif\n#include\nuniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include\n#include\n#include\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#include\n#include\n#include\n#define CUSTOM_VERTEX_MAIN_END\n}";o.ShadersStore[e]=i;const s={name:e,shader:i};export{s as colorVertexShader}; diff --git a/assets/color.vertex-Ccg8Ge1R.js b/assets/color.vertex-Ccg8Ge1R.js new file mode 100644 index 0000000..f391820 --- /dev/null +++ b/assets/color.vertex-Ccg8Ge1R.js @@ -0,0 +1 @@ +import{S as n}from"./Viewer-DVCEMRp5.js";import"./bonesVertex-B72aYlMi.js";import"./clipPlaneVertex-L9tMAQxe.js";import"./vertexColorMixing-D-DdWwxQ.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./index-Bku7SJna.js";import"./echarts-DzoUeqWp.js";import"./codemirror-ZSHHXwGs.js";const e="colorVertexShader",i="attribute position: vec3f;\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include\n#include\n#include\n#include\n#ifdef FOG\nuniform view: mat4x4f;\n#endif\n#include\nuniform viewProjection: mat4x4f;\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#include\n#include\n#include\nvar worldPos: vec4f=finalWorld* vec4f(input.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;\n#include\n#include\n#include\n#define CUSTOM_VERTEX_MAIN_END\n}";n.ShadersStoreWGSL[e]=i;const s={name:e,shader:i};export{s as colorVertexShaderWGSL}; diff --git a/assets/cubemapToSphericalPolynomial-DI79UW0r.js b/assets/cubemapToSphericalPolynomial-DI79UW0r.js new file mode 100644 index 0000000..a1be11e --- /dev/null +++ b/assets/cubemapToSphericalPolynomial-DI79UW0r.js @@ -0,0 +1 @@ +import{b as V,c as D,d as H,C as P,e as _,V as n}from"./Viewer-DVCEMRp5.js";class A{constructor(e,i,w,c){this.name=e,this.worldAxisForNormal=i,this.worldAxisForFileX=w,this.worldAxisForFileY=c}}class T{static ConvertCubeMapTextureToSphericalPolynomial(e){var h;if(!e.isCube)return null;(h=e.getScene())==null||h.getEngine().flushFramebuffer();const i=e.getSize().width,w=e.readPixels(0,void 0,void 0,!1),c=e.readPixels(1,void 0,void 0,!1);let S,a;e.isRenderTarget?(S=e.readPixels(3,void 0,void 0,!1),a=e.readPixels(2,void 0,void 0,!1)):(S=e.readPixels(2,void 0,void 0,!1),a=e.readPixels(3,void 0,void 0,!1));const C=e.readPixels(4,void 0,void 0,!1),R=e.readPixels(5,void 0,void 0,!1),x=e.gammaSpace,y=5;let E=0;return(e.textureType==1||e.textureType==2)&&(E=1),new Promise(p=>{Promise.all([c,w,S,a,C,R]).then(([F,r,t,f,d,m])=>{const M={size:i,right:r,left:F,up:t,down:f,front:d,back:m,format:y,type:E,gammaSpace:x};p(this.ConvertCubeMapToSphericalPolynomial(M))})})}static _AreaElement(e,i){return Math.atan2(e*i,Math.sqrt(e*e+i*i+1))}static ConvertCubeMapToSphericalPolynomial(e){const i=new V;let w=0;const c=2/e.size,S=c,a=.5*c,C=a-1;for(let h=0;h<6;h++){const p=this._FileFaces[h],F=e[p.name];let r=C;const t=e.format===5?4:3;for(let f=0;fg){const u=g/L;s*=u,o*=u,l*=u}}else s=P(s,0,g),o=P(o,0,g),l=P(l,0,g);const v=new D(s,o,l);i.addLight(M,v,z),w+=z,d+=c}r+=S}}const E=4*Math.PI*6/6/w;return i.scaleInPlace(E),i.convertIncidentRadianceToIrradiance(),i.convertIrradianceToLambertianRadiance(),H.FromHarmonics(i)}}T._FileFaces=[new A("right",new n(1,0,0),new n(0,0,-1),new n(0,-1,0)),new A("left",new n(-1,0,0),new n(0,0,1),new n(0,-1,0)),new A("up",new n(0,1,0),new n(1,0,0),new n(0,0,1)),new A("down",new n(0,-1,0),new n(1,0,0),new n(0,0,-1)),new A("front",new n(0,0,1),new n(1,0,0),new n(0,-1,0)),new A("back",new n(0,0,-1),new n(-1,0,0),new n(0,-1,0))];T.MAX_HDRI_VALUE=4096;T.PRESERVE_CLAMPED_COLORS=!1;export{T as C}; diff --git a/assets/cz-D8m9rjS3.js b/assets/cz-D8m9rjS3.js new file mode 100644 index 0000000..0609098 --- /dev/null +++ b/assets/cz-D8m9rjS3.js @@ -0,0 +1 @@ +const e={Notifications:{DependencyDescription:"Aktuální verze {name} nepodporuje všechny funkce aplikace Mainsail. Aktualizujte {name} alespoň na verzi {neededVersion}.",DependencyName:"Závislost: {name}",DismissAll:"Zrušit vše",KlipperWarnings:{DeprecatedOption:"Volba '{option}' v sekci '{section}' je zastaralá a bude odstraněna v budoucí verzi.",DeprecatedOptionHeadline:"Zastaralá volba Klipper",DeprecatedValue:"Hodnota '{value}' v volbě '{option}' v sekci '{section}' je zastaralá a bude odstraněna v budoucí verzi.",DeprecatedValueHeadline:"Zastaralá hodnota Klipper",KlipperWarning:"Upozornění Klipperu"},MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"Při načítání komponenty Moonraker '{component}' byla zjištěna chyba. Zkontrolujte prosím log soubor a opravte problém.",MoonrakerWarning:"Upozornění Moonrakeru",UnparsedConfigOption:"V sekci [{section}] byla detekována nepřeložená konfigurační volba '{option}: {value}'. Může se jednat o zastaralou volbu nebo o výsledek modulu, který se nepodařilo načíst. V budoucnu to bude způsobovat chybu při spuštění.",UnparsedConfigSection:"Detekována nepřeložená konfigurační sekce [{section}]. Může se jednat o výsledek komponenty, která se nepodařilo načíst. V budoucnu to bude způsobovat chybu při spuštění."},Never:"nikdy",NextReboot:"příští restart",NoNotification:"Žádné upozornění není k dispozici",Notifications:"Upozornění",Remind:"Připomenutí:"},NumberInput:{GreaterOrEqualError:"Musí být větší nebo rovno {min}!",MustBeBetweenError:"Musí být mezi {min} a {max}!",NoEmptyAllowedError:"Vstup nesmí být prázdný!"},Printers:"Tiskárny",ThrottledStates:{DescriptionCurrentlyThrottled:"Jádro/jádra ARM rPi jsou aktuálně zpomalená.",DescriptionFrequencyCapped:"Maximální frekvence jádra/jader ARM rPi je aktuálně omezena na 1,2 GHz.",DescriptionPreviouslyFrequencyCapped:"Maximální frekvence jádra/jader ARM rPi byla alespoň jednou omezena na 1,2 GHz od posledního spuštění.",DescriptionPreviouslyTemperatureLimited:"Teplota mikrokontroléru rPi (jen 3A+/3B+) byla alespoň jednou od posledního spuštění vyšší než mezní teplota (výchozí hodnota 60 °C).",DescriptionPreviouslyThrottled:"Jádro/jádra ARM rPi byla alespoň jednou od posledního spuštění zpomalena.",DescriptionPreviouslyUnderVolted:"Napájecí napětí rPi kleslo alespoň jednou pod 4,65 V od posledního spuštění.",DescriptionTemperatureLimitActive:"Teplota mikrokontroléru rPi (jen 3A+/3B+) je aktuálně vyšší než mezní teplota (výchozí hodnota 60 °C).",DescriptionUnderVoltageDetected:"Napájecí napětí rPi je aktuálně nižší než 4,65 V.",TitleCurrentlyThrottled:"Aktuálně zpomaleno",TitleFrequencyCapped:"Frekvence omezena",TitlePreviouslyFrequencyCapped:"Frekvence dříve omezena",TitlePreviouslyTemperatureLimited:"Teplota dříve omezena",TitlePreviouslyThrottled:"Dříve zpomaleno",TitlePreviouslyUnderVolted:"Dříve podnapájecí napětí",TitleTemperatureLimitActive:"Omezení teploty aktivní",TitleUnderVoltageDetected:"Detekováno podnapájecí napětí"},Titles:{Complete:"Dokončeno - {filename}",Error:"CHYBA",Pause:"Pozastavit tisk",PrinterOff:"Tiskárna vypnuta",Printing:"{percent}% Tisk - {filename}",PrintingETA:"{percent}% Tisk - ETA: {eta} - {filename}"},TopBar:{CannotUploadTheFile:"Soubor nelze nahrát!",EmergencyStop:"Nouzové zastavení",SAVE_CONFIG:"ULOŽIT KONFIGURACI",Uploading:"Nahrávání",UploadOfFileSuccessful:"Soubor {file} byl úspěšně nahrán!",UploadPrint:"Nahrát a tisknout"},TopCornerMenu:{Cancel:"Zrušit",ConfirmationDialog:{Description:{HostReboot:"Rebootování hosta způsobí, že aktuální tisk selže!",HostShutdown:"Vypnutí hosta způsobí, že aktuální tisk selže!",KlipperFirmwareRestart:"Restartování firmware Klipperu způsobí, že aktuální tisk selže!",KlipperRestart:"Restartování Klipperu způsobí, že aktuální tisk selže!",KlipperStop:"Zastavení Klipperu způsobí, že aktuální tisk selže!",ServiceRestart:"Restartování této služby může způsobit, že aktuální tisk selže!",ServiceStart:"Spuštění této služby může způsobit, že aktuální tisk selže!",ServiceStop:"Zastavení této služby může způsobit, že aktuální tisk selže!"},Title:{HostReboot:"Rebootování hosta",HostShutdown:"Vypnutí hosta",KlipperFirmwareRestart:"Restartování firmware Klipperu",KlipperRestart:"Restartování Klipperu",ServiceRestart:"Restartování služby",ServiceStart:"Spuštění služby",ServiceStop:"Zastavení služby"}},HostControl:"Ovládání hosta",KlipperControl:"Ovládání Klipperu",KlipperFirmwareRestart:"Restartovat firmware",KlipperRestart:"Restartovat",PowerDevices:"Napájecí zařízení",Reboot:"Rebootovat",Restart:"Restartovat",ServiceControl:"Ovládání služby",Shutdown:"Vypnout",Start:"Spuštění",Stop:"Zastavení"},UpdateDialog:{Close:"Zavřít",Empty:"Prázdné",Recovering:"Obnovování {software}...",RecoveringDone:"Obnova {software} dokončena!",Updating:"Aktualizace {software}...",UpdatingDone:"Aktualizace {software} dokončena!"}},o={Abort:"Přerušit",Accept:"Přijmout",Adjusted:"Upraveno",Description:"Pokud byl aktuální šroub upraven, klikněte na UPRAVENO. Pokud nebyla žádná úprava provedena, klikněte na PŘIJMOUT.",Headline:"Šrouby podložky",ScrewAccepted:"Šrouby přijaty",ScrewIndex:"Index šroubu",ScrewName:"Název šroubu",ScrewOutput:"{current} z {max}"},t={CannotConnectTo:"Nelze se připojit k Moonraker ({host}).",CheckMoonrakerLog:"Pokud se tato zpráva opakovaně zobrazuje, prosím podívejte se do souboru logu umístěného na:",Connecting:"Připojuji se k {host}",Failed:"Spojení selhalo",Initializing:"Inicializuji",TryAgain:"zkuste to znovu"},a={CommandList:"Seznam příkazů",Empty:"Prázdné",HideTemperatures:"Skrýt teploty",HideTimelapse:"Skrýt záznam",SendCode:"Odeslat kód...",SetupConsole:"Nastavení konzole"},n={StartPrint:{Cancel:"Zrušit",DoYouWantToStartFilename:"Chcete začít tisk {filename}?",Headline:"Začít tisk",Print:"tisk",Timelapse:"Záznam"}},r={ConfigReference:"Odkaz na konfiguraci",DontSave:"Neukládat",Downloading:"Stahování",FailedSave:"{filename} nelze nahrát!",FileReadOnly:"jen ke čtení",SaveClose:"Uložit a zavřít",SaveRestart:"Uložit a restartovat",SuccessfullySaved:"{filename} úspěšně uloženo.",UnsavedChanges:"Neuložené změny",UnsavedChangesMessage:"Chcete uložit změny provedené v {filename}?",UnsavedChangesSubMessage:"Vaše změny budou ztraceny, pokud je neuložíte. Tuto zprávu lze vypnout v nastavení editoru.",Uploading:"Nahrávání"},i={AreYouSure:"Jste si jisti?",EmergencyStop:"Nouzové zastavení",No:"Ne",Yes:"Ano"},s={AddBatchToQueue:"Přidat dávku do fronty",AddToQueue:"Přidat do fronty",AllFiles:"Vše",BedTemp:"Teplota podložky",Cancel:"Zrušit",ChamberTemp:"Teplota komory",Count:"Počet",Create:"Vytvořit",CreateNewDirectory:"Vytvořit nový adresář",CurrentPath:"Aktuální cesta",Delete:"Smazat",DeleteDirectory:"Smazat adresář",DeleteDirectoryQuestion:'Opravdu chcete smazat adresář "{name}" včetně všech jeho obsahů?',DeleteSelectedQuestion:"Opravdu chcete smazat {count} vybrané soubory?",Download:"Stáhnout",EditFile:"Upravit soubor",Empty:"Prázdný",ExtruderTemp:"Teplota extrudéru",Filament:"Filament",FilamentName:"Název filamentu",FilamentType:"Typ filamentu",FilamentUsage:"Spotřeba filamentu",FilamentWeight:"Hmotnost filamentu",Files:"Soubory",Filesize:"Velikost souboru",Free:"Volné",FreeDisk:"Volné místo na disku",GCodeFiles:"Soubory G-Code",GcodesRootDirectoryDoesntExists:'Adresář s G-Code soubory neexistuje. Prosím zkontrolujte volbu "{path}" v sekci [virtual_sdcard] konfigurace Klipperu.',HiddenFiles:"Skryté soubory",InvalidNameAlreadyExists:"Název již existuje, zvolte prosím jiný název.",InvalidNameEmpty:"Vstup nesmí být prázdný!",LastEndTime:"Poslední čas ukončení",LastFilamentUsed:"Poslední použitý filament",LastModified:"Poslední změna",LastPrintDuration:"Doba posledního tisku",LastStartTime:"Poslední čas spuštění",LastTotalDuration:"Celková doba posledního tisku",LayerHeight:"Výška vrstvy",Name:"Název",NewDirectory:"Nový adresář",NozzleDiameter:"Průměr trysky",ObjectHeight:"Výška objektu",Preheat:"Předehřátí",PrintedFiles:"Vytisknuté soubory",PrintStart:"Začátek tisku",PrintTime:"Čas tisku",RefreshCurrentDirectory:"Obnovit aktuální adresář",Rename:"Přejmenovat",RenameDirectory:"Přejmenovat adresář",RenameFile:"Přejmenovat soubor",Search:"Hledat",SetupCurrentList:"Nastavit aktuální seznam",Slicer:"Slicer",SuccessfullyCreated:"Úspěšně vytvořen soubor {filename}.",SuccessfullyDeleted:"Úspěšně smazán soubor {filename}.",SuccessfullyMoved:"Úspěšně přesunut soubor {filename}.",SuccessfullyRenamed:"Úspěšně přejmenován soubor {filename}.",SuccessfullyUploaded:"Nahrávání souboru {filename} úspěšné!",Total:"Celkem",UploadNewGcode:"Nahrát nový G-Code",Used:"Použito",View3D:"Zobrazit 3D"},l={CannotUploadFile:"Soubor nelze nahrát!",DropFilesToUploadFiles:"Přetáhněte soubory pro nahrání"},u={ClearLoadedFile:"Vymazat",CNCMode:"Režim CNC",ColorMode:"Režim barev",Downloading:"Stahování",ForceLineRendering:"Vynutit vykreslování čar",HDRendering:"HD vykreslování (zaoblené extruze)",High:"Vysoké",LoadCurrentFile:"Aktuální soubor",LoadLocal:"Lokální soubor",Low:"Nízké",Max:"Maximální",Medium:"Střední",ReloadRequired:"Je nutné znovu načíst",Rendering:"Vykreslování",RenderQuality:"Kvalita vykreslování",ShowGCode:"Zobrazit G-Code",ShowObjectSelection:"Zobrazit výběr objektu",ShowToolhead:"Zobrazit nástrojovou hlavu",ShowTravelMoves:"Zobrazit přesuny",SpecularLighting:"Zrcadlové osvětlení",Title:"Prohlížeč G-Code",Tracking:"Sledování",Transparency:"Průhlednost",Ultra:"Ultra",VoxelMode:"Voxelový režim (ASMBL)"},d={Abort:"Zrušit",BedMeshCalibrate:"Vytvořit drátěný model podložky",BedMeshRemove:"Odebrat model podložky",Calibrate:"Vytvořit",Clear:"Vymazat",CurrentMesh:{Headline:"Aktuální model podložky",Max:"Maximální",Min:"Minimální",Name:"Název",Range:"Rozsah",Size:"Velikost"},DeleteBedMeshProfile:"Smazat profil modelu podložky",DoYouReallyWantToDelete:'Opravdu chcete smazat profil "{name}"?',ErrorKlipperNotReady:"Klipper není připraven. Drátěný model podložky je vypnut.",Flat:"Rovina",Heightmap:"Výšková mapa",InvalidNameAlreadyExists:"Název profilu již existuje, zvolte prosím jiný název profilu.",InvalidNameEmpty:"Vstup nesmí být prázdný!",InvalidNameReserved:"Profil 'default' je rezervován, zvolte prosím jiný název profilu.",Later:"Později",Mesh:"Síť",Name:"Název",NoBedMeshHasBeenLoadedYet:"Dosud nebyla načtena žádná síť podložky.",NoProfile:"Žádný profil není k dispozici",Ok:"OK",Probed:"Změřeno",Profiles:"Profily",Remove:"smazat",RemoveSaveDescription:"Profil bed_mesh byl označen jako smazaný. K odstranění ze souboru printer.cfg a restartování Klipperu klikněte na SAVE_CONFIG.",Rename:"přejmenovat",RenameBedMeshProfile:"Přejmenovat profil sítě podložky",SAVE_CONFIG:"SAVE_CONFIG",ScaleGradient:"Škálovat gradient",ScaleZMax:"Škálovat z-max.",TitleCalibrate:"Nastavit novou síť podložky",TitleClear:"Vymazat síť podložky",TitleHomeAll:"Homing všech os",Wireframe:"Drátěný model"},p={AddNote:"Přidat poznámku",AllJobs:"Všechny",AvgPrinttime:"Průměrný čas tisku",Cancel:"Zrušit",Chart:"Graf",CreateNote:"Vytvořit poznámku",Delete:"Smazat",DeleteSelectedQuestion:"Opravdu chcete smazat {count} vybraných tisků?",Details:"Detaily",EditNote:"Upravit poznámku",Empty:"prázdný",EndTime:"Čas konce",EstimatedFilament:"Odhadovaná spotřeba filamentu",EstimatedFilamentWeight:"Odhadovaná hmotnost filamentu",EstimatedTime:"Odhadovaný čas",FilamentCalc:"Kalkulace filamentu",FilamentUsage:"Spotřeba filamentu",FilamentUsed:"Spotřebovaný filament",Filename:"Název souboru",Filesize:"Velikost souboru",FirstLayerBedTemp:"Teplota podložky 1. vrstvy",FirstLayerExtTemp:"Teplota extrudéru 1. vrstvy",FirstLayerHeight:"Výška 1. vrstvy",HistoryFilamentUsage:"Filament",HistoryPrinttimeAVG:"Tisky",JobDetails:"Detaily tisku",Jobs:"Tisky",LastModified:"Poslední změna",LayerHeight:"Výška vrstvy",LongestPrinttime:"Nejdelší doba tisku",Note:"Poznámka",ObjectHeight:"Výška objektu",PrintDuration:"Čas tisku",PrintHistory:"Historie tisků",PrintTime:"Čas tisku",PrinttimeAvg:"Průměrný čas tisku",Reprint:"Opakovaný tisk",Save:"Uložit",Search:"Hledat",SelectedFilamentUsed:"Spotřeba vybraného filamentu",SelectedJobs:"Vybrané tisky",SelectedPrinttime:"Vybraný čas tisku",Slicer:"Slicer",SlicerVersion:"Verze sliceru",StartTime:"Čas začátku",Statistics:"Statistiky",Status:"Stav",StatusValues:{cancelled:"Zrušeno",completed:"Dokončeno",error:"Chyba",in_progress:"Probíhá",klippy_disconnect:"Odpojení Klippy",klippy_shutdown:"Vypnutí Klippy",Others:"Jiné",server_exit:"Ukončení serveru"},Table:"Tabulka",TitleExportHistory:"Exportovat historii",TitleRefreshHistory:"Obnovit historii",TitleSettings:"Nastavení",TotalDuration:"Celkový čas",TotalFilamentUsed:"Celkově spotřebovaný filament",TotalJobs:"Celkový počet tisků",TotalPrinttime:"Celkový čas tisku",TotalTime:"Celkový čas"},m={AllJobs:"Všechny tisky",Cancel:"Zrušit",ChangeCount:"Změnit počet",Count:"Počet",Empty:"Prázdné",InvalidCountEmpty:"Vstup nemůže být prázdný!",InvalidCountGreaterZero:"Vstup musí být větší než 0!",JobQueue:"Fronta tisků",Jobs:"Tisky",Pause:"Pozastavit",RemoveFromQueue:"Odebrat z fronty",Start:"Spustit"},v={ConfigFilesPanel:{AllFiles:"Vše",Cancel:"Zrušit",ConfigFiles:"Konfigurační soubory",ConfigRootDirectoryDoesntExists:'Nenalezen adresář s konfiguracemi. Zkontrolujte prosím volbu "config_path" v sekci [file_manager] konfigurace Moonraker.',Create:"Vytvořit",CreateDirectory:"Vytvořit adresář",CreateFile:"Vytvořit soubor",CurrentPath:"Aktuální cesta",Delete:"Smazat",DeleteDirectory:"Smazat adresář",DeleteDirectoryQuestion:'Smazat adresář "{name}" a všechny jeho obsahy?',DeleteSelectedQuestion:"Smazat {count} vybrané položky?",Download:"Stáhnout",EditFile:"Upravit soubor",Empty:"Prázdné",Files:"Soubory",Filesize:"Velikost souboru",Free:"Volné",FreeDisk:"Volné místo",HiddenFiles:"Skryté soubory",HideBackupFiles:"Skrýt záložní soubory",LastModified:"Poslední úprava",Name:"Název",RefreshDirectory:"Obnovit adresář",Rename:"Přejmenovat",RenameDirectory:"Přejmenovat adresář",RenameFile:"Přejmenovat soubor",Root:"Kořenový adresář",SetupCurrentList:"Nastavit aktuální seznam",ShowFile:"Zobrazit soubor",Total:"Celkově",UploadFile:"Nahrát soubor",Uploading:"Nahrávám",Used:"Použité"},EndstopPanel:{Endstop:"Koncový spínač",EndstopInfo:"Stiskněte tlačítko synchronizace v pravém dolním rohu pro načtení aktuálního stavu koncových spínačů.",Endstops:"Koncové spínače",open:"OTEVŘENO",TRIGGERED:"AKTIVOVÁNO"},LogfilesPanel:{Accept:"potvrdit",Cancel:"zrušit",Logfiles:"Log soubory",Rollover:"Převést logy",RolloverDescription:"Vyberte, které logy by měly být resetovány:",RolloverToastFailed:'Chyba při převodu logu pro "{name}": {message}',RolloverToastSuccessful:'Log pro "{name}" byl úspěšně resetován.'},SystemPanel:{Constants:"Konstanty",Cpu:"CPU",HostDetails:"Podrobnosti hostitele",LastStats:"Poslední statistiky",Load:"Zátěž",Memory:"PAMĚŤ",NoMoreInfos:"Žádné další informace",SystemLoad:"Zatížení systému",Values:{Awake:"Bdělý: {awake}",Bandwidth:"Propustnost: {bandwidth}/s",Distro:"Distribuce: {name} {version_id}",Frequency:"Frekvence: {frequency}",Load:"Zátěž: {load}",Memory:"Paměť: {memory}",Os:"OS: {os}",Received:"Přijato: {received}",Temp:"Teplota: {temp}°C",TempMax:"max: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Přeneseno: {transmitted}",Version:"Verze: {version}"}},UpdatePanel:{CheckForUpdates:"Kontrola aktualizací",Commits:"Commit(y)",CommitsAvailable:"žádné commity k dispozici | {count} commit k dispozici | {count} commity k dispozici",CommitsOnDate:"Commity z {date}",CommittedDaysAgo:"commitováno před {days} dny",CommittedHoursAgo:"commitováno před {hours} hodinami",CommittedOnDate:"commitováno dne {date}",CommittedYesterday:"commitováno včera",Detached:"odpojený",Dirty:"upravený",ERROR:"CHYBA",Invalid:"neplatný",OSPackages:"OS balíčky",PackagesCanBeUpgraded:"balíčky lze aktualizovat",System:"Systém",Unknown:"neznámý",Update:"aktualizace",UpdateAll:"Aktualizovat všechny komponenty",UpdateManager:"Správce aktualizací",Upgrade:"upgradovat",UpToDate:"aktualizováno"}},c={Abort:"Zrušit",Accept:"Přijmout",Advanced:"Pokročilé",Headline:"Manuální měření"},k={ExtruderControlPanel:{Allowed:"Povoleno",EstimatedExtrusion:"Odhadovaná extruze:",Extrude:"Extrudovat",ExtruderTempTooLow:"Teplota extruderu <",ExtrusionFactor:"Extruze",ExtrusionFeedrate:"Rychlost extruze",FilamentLength:"Délka extruze filamentu",FirmwareRetractionSettings:{RetractLength:"Délka retrakce",RetractSpeed:"Rychlost retrakce",UnretractExtraLength:"Dod. délka při deretrakci",UnretractSpeed:"Rychlost deretrakce"},Headline:"Extruder",LoadFilament:"Naložit filament",PressureAdvanceSettings:{Advance:"Přetlak",Extruder:"Extruder",SmoothTime:"Čas vyhlazování"},Requested:"Požadováno",Retract:"Vytáhnout",TooLargeExtrusion:"Příliš velká extruze!",UnloadFilament:"Vyjmout filament"},FarmPrinterPanel:{ReconnectToPrinter:"Připojit znovu",SwitchToPrinter:"Přepnout na tiskárnu",WebcamOff:"Vypnuto"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Prosím zkontrolujte, zda služba Klipper běží a jestli je klippy_uds_address správně nakonfigurován v moonraker.conf.",FirmwareRestart:"Restartovat firmware",MoonrakerCannotConnect:"Moonraker nemůže navázat spojení s Klipperem!",PowerOn:"Zapnout",PrinterSwitchedOff:"Tiskárna je vypnuta",PrinterSwitchedOffDescription:"Tiskárna je momentálně vypnutá a Klipper nemůže navázat spojení. Pro zapnutí tiskárny klikněte na tlačítko níže:",Restart:"Restartovat",ServiceReports:"{service} hlásí"},MachineSettingsPanel:{Headline:"Tiskárna",MotionSettings:{Acceleration:"Zrychlení",MaxAccelToDecel:"Max. zrychlení pro zpomalení",SquareCornerVelocity:"Rychlost v rohových bodech",Velocity:"Rychlost"}},MacrosPanel:{Headline:"Makra",Send:"odeslat"},MiniconsolePanel:{Headline:"Konzole",HideTemperatures:"Skrýt teploty",HideTimelapse:"Skrýt Timelapse",SendCode:"Odeslat kód...",SetupConsole:"Nastavit konzoli"},MinSettingsPanel:{IncludeMainsailCfg:"Ujistěte se, že jste v souboru printer.cfg zahrnuli mainsail.cfg.",IsNotDefinedInConfig:"není definován v konfiguraci.",MissingConfiguration:"Chybějící konfigurace",MoreInformation:"více informací"},MiscellaneousPanel:{Headline:"Různé",Light:{Blue:"modrá",Green:"zelená",Red:"červená",White:"bílá"},RunoutSensor:{Detected:"detekováno",Disabled:"vypnuto",Empty:"prázdné"}},PowerControlPanel:{Error:"Chyba",Off:"Vypnuto",On:"Zapnuto",PowerControl:"Řízení napájení"},StatusPanel:{CancelPrint:"Zrušit tisk",ClearPrintStats:"Vymazat statistiky tisku",Difference:"Rozdíl",EmptyGcodes:"Žádné G-kódy k dispozici.",EmptyJobqueue:"V seznamu úloh momentálně není žádný soubor.",Estimate:"Předpokládaný čas",ETA:"Odhadovaný čas dokončení",ExcludeObject:{Cancel:"Zrušit",Excluded:"Vyloučený",ExcludeObject:"Vyloučit objekt",ExcludeObjectHeadline:"Vyloučit objekt",ExcludeObjectText:'Opravdu chcete vyloučit objekt "{name}"?'},Filament:"Filament",File:"Soubor",Files:"Soubory",Flow:"Průtok",Headline:"Stav",Jobqueue:"Seznam úloh",JobqueueMoreFiles:"žádné další úlohy | jedna další úloha | {count} dalších úloh",Layer:"Vrstva",Max:"max",ObjectHeight:"Výška objektu",PauseAtLayer:{Abort:"Zrušit",Accept:"Přijmout",AtLayer:"na vrstvě",Call:"Volat",DescriptionPauseAtLayerActive:'Tato funkce již aktivní a zavolá "{call}" na vrstvě {layer}. Pokud příkaz zavoláte znovu, tyto nastavení budou přepsána.',DescriptionPauseNextLayerActive:'Tato funkce již aktivní a zavolá "{call}" na následující vrstvě.',Layer:"Vrstva",NextLayer:"následující vrstva",PauseAtLayer:"Pozastavit na vrstvě",Type:"Typ"},PausePrint:"Pozastavit tisk",Print:"Tisknout",PrintTime:"Doba tisku",ReprintJob:"Znovu vytisknout úlohu",Requested:"Požadováno",ResumePrint:"Pokračovat v tisku",Slicer:"Slicer",Speed:"Rychlost",Status:"Stav",Total:"Celkem",Unknown:"Neznámý"},TemperaturePanel:{AutoscaleChart:"Automaticky škálovat graf",Avg:"Průměr",Cooldown:"Zchladnutí",Current:"Aktuální",Dataset:{Power:"PWM-výkon",Speed:"PWM-rychlost",Target:"Cílová teplota",Temperature:"Aktuální teplota"},Headline:"Teploty",Max:"Max.",Min:"Min.",Name:"Název",Presets:"Předvolby",SetupTemperatures:"Nastavit teploty",ShowChart:"Zobrazit graf",ShowNameInChart:"Zobrazit {name} v grafu",ShowNameInList:"Zobrazit {name} v seznamu",State:"Stav",Target:"Cíl",TemperaturesInChart:"Teplota [°C]",TempTooHigh:"Teplota pro {name} je příliš vysoká! (max.: {max})",TempTooLow:"Teplota pro {name} je příliš nízká! (min.: {min})"},ToolheadControlPanel:{Absolute:"absolutní",ALL:"VŠE",Headline:"Nástroj",PleaseConfigureSteps:"Prosím nakonfigurujte kroky",Position:"Pozice",QGL:"QGL",Relative:"relativní",SettingsInterfaceControl:"Nastavení > Rozhraní > Ovládání",SpeedFactor:"Rychlost",ZTilt:"Z-tilt"},WebcamPanel:{All:"Vše",FPS:"FPS",Headline:"Webkamera",NoWebcam:'Žádná webkamera není k dispozici. Přidejte webkameru v sekci "Nastavení rozhraní" -> "Webkamery".',UnknownWebcamService:"Neznámá služba webkamery"},ZoffsetPanel:{Clear:"Smazat",Headline:"Z-offset",Later:"Později",Ok:"OK",Save:"Uložit",SaveConfig:"ULOŽIT KONFIGURACI",SaveInfoDescription:'Nový Z-offset byl vypočítán a uložen. Klikněte na tlačítko "ULOŽIT KONFIGURACI" pro uložení do printer.cfg a restart Klipperu.',SaveInfoDescriptionPrint:'Nový Z-offset byl vypočítán a uložen. Po dokončení tisku klikněte na tlačítko "ULOŽIT KONFIGURACI" v horní liště pro uložení do printer.cfg a restart Klipperu.',SaveInfoHeadline:"Informace",ToEndstop:"ke koncovému spínači",ToProbe:"ke snímači"}},y={AreYouSure:"Jste si jisti?",No:"Ne",TurnDeviceOff:"Vypnout {device}",TurnDeviceOn:"Zapnout {device}",Yes:"Ano"},b={Console:"Konzole",Dashboard:"Nástěnka","G-Code Files":"Soubory G-Code","G-Code Viewer":"Prohlížeč G-Code",Heightmap:"Výšková mapa",History:"Historie",Machine:"Zařízení",Printers:"Tiskárny",Timelapse:"Time-lapse",Webcam:"Webkamera"},z={Accept:"Přijmout",Base:"Základna",ErrorText:"Při procesu sondování došlo k chybě.",Headline:"Naklonění šroubů"},h={AddPrinter:"Přidat tiskárnu",AddPrintersToJson:"Prosím, přidejte tiskárny do config.json.",CannotConnectTo:"Nelze se připojit k {host}.",ChangePrinter:"Změnit tiskárnu",Connecting:"Připojování k {host}",ConnectionFailed:"Připojení selhalo",EditPrinter:"Upravit tiskárnu",Hello:"Vítejte v dálkovém režimu Mainsail!",HostnameInvalid:"Neplatný hostname/IP",HostnameIp:"Hostname/IP",HostnameRequired:"Je vyžadován hostname",Port:"Port",PortRequired:"Je vyžadován port",RememberToAdd:"Nezapomeňte přidat '{cors}' do moonraker.conf v 'cors_domains'.",SelectPrinter:"Vybrat tiskárnu",TryAgain:"zkusit znovu",UpdatePrinter:"Aktualizovat tiskárnu",YouCanFindMore:"Další informace naleznete na"},P={Cancel:"Zrušit",Close:"Zavřít",ConsoleTab:{AddFilter:"Přidat filtr",Console:"Konzole",CreateHeadline:"Vytvořit filtr",Direction:"Směr",DirectionShell:"Poslední vstup dole",DirectionTable:"Poslední vstup nahoře",EditHeadline:"Upravit filtr",EntryStyle:"Styl zápisu",EntryStyleCompact:"Kompaktní",EntryStyleDefault:"Výchozí",Filters:"Filtry",Height:"Výška",HideTemperatures:"Skrýt teploty",HideTimelapse:"Skrýt timelapse",Name:"Název",Regex:"Regulární výraz",StoreButton:"Uložit filtr",UpdateButton:"Aktualizovat filtr"},ControlTab:{Bars:"Lišty",Circle:"Kruh",Control:"Ovládání",Cross:"Kříž",EnableXYHoming:"Povolit společné homování osy X a Y",EstimatedExtrusionInfo:"Zobrazit informace o odhadované extruzi",EstimatedExtrusionInfoDescription:"Zobrazit / skrýt informace o odhadované extruzi na základě množství extrudovaného materiálu a rychlosti podávání",InvertXMovement:"Invertovat směr pohybu osy X",InvertYMovement:"Invertovat směr pohybu osy Y",InvertZMovement:"Invertovat směr pohybu osy Z",IsDefault:" (výchozí)",MaximumValues:"Maximální hodnoty: {maximum}",MaximumValuesVisibility:"Pro nejlepší viditelnost se doporučuje maximálně {maximum} hodnot",MinimumValues:"Minimální hodnoty: {minimum}",MotorsOff:"Vypnout motory{isDefault}",MoveDistancesEInMm:"Přednastavení množství extruze (v mm)",MoveDistancesInMm:"Přírůstky vzdálenosti při pohybu (v mm)",MoveDistancesXYInMm:"Přírůstky vzdálenosti při pohybu osami X a Y (v mm)",MoveDistancesZInMm:"Přírůstky vzdálenosti při pohybu osou Z (v mm)",QuadGantryLevel:"Vyrovnání čtyřech os{isDefault}",SpeedEInMms:"Přednastavení rychlosti extruze (v mm/s)",SpeedXY:"Rychlost pohybu os X a Y",SpeedZ:"Rychlost pohybu osou Z",Style:"Styl",ValueGreaterThan:"Hodnota musí být větší než {value}",ZOffsetIncrements:"Přírůstky Z-offsetu (v mm)",ZTiltAdjust:"Nastavení Z-tiltu{isDefault}"},DashboardTab:{Dashboard:"Nástěnka",Desktop:"Desktop",Mobile:"Mobilní",ResetLayout:"Resetovat rozložení",Tablet:"Tablet",Widescreen:"Widescreen"},Edit:"Upravit",EditorTab:{ConfirmUnsavedChanges:"Upozornit na neuložené změny",ConfirmUnsavedChangesDescription:"Pokud je aktivováno, editor vyžaduje potvrzení, zda chcete uložit nebo zrušit změny. Pokud je deaktivováno, změny budou tiché.",Editor:"Editor",KlipperRestartMethod:"Metoda restartu Klipperu",KlipperRestartMethodDescription:'Vyberte metodu restartu, která se použije při editaci konfiguračních souborů Klipperu v "Uložit a restartovat".',UseEscToClose:"Použít ESC pro zavření editoru",UseEscToCloseDescription:"Umožňuje použití klávesy ESC k zavření editoru"},GCodeViewerTab:{BackgroundColor:"Barva pozadí",ExtruderColor:"Barvy extrudérů",GCodeViewer:"Prohlížeč G-kódu",GridColor:"Barva mřížky",MaxFeed:"Maximální podávací rychlost",MinFeed:"Minimální podávací rychlost",ProgressColor:"Barva postupu",ShowAxes:"Zobrazit osy"},GeneralTab:{"12hours":"12-hodinový formát ({time})","24hours":"24-hodinový formát ({time})",Backup:"Záloha",BackupDialog:"Prosím zvolte všechny sekce, které chcete zazálohovat:",CalcEstimateTime:"Výpočet odhadovaného času",CalcEstimateTimeDescription:"Pokud je vybráno více možností, bude spočítán průměr",CalcEtaTime:"Výpočet ETA",CalcEtaTimeDescription:"Pokud je vybráno více možností, bude spočítán průměr",CalcPrintProgress:"Výpočet průběhu tisku",CalcPrintProgressDescription:"Metoda pro výpočet průběhu tisku.",CalcPrintProgressItems:{Filament:"Filament",FileAbsolute:"Poloha souboru (absolutní)",FileRelative:"Poloha souboru (relativní)",Slicer:"Slicer (M73)"},CannotReadJson:"Nepodařilo se načíst/zpracovat soubor s zálohou.",DateFormat:"Formát data",DbConsoleHistory:"Historie konzole",DbHistoryJobs:"Historie úloh",DbHistoryTotals:"Historie celkových hodnot",DbTimelapseSettings:"Nastavení časosběrného videa",DbView:"Nastavení zobrazení",DbWebcams:"Webkamery",EstimateValues:{Filament:"Filament",File:"Soubor",Slicer:"Slicer"},FactoryDialog:"Prosím zvolte všechny sekce, které chcete resetovat:",FactoryReset:"Reset na tovární hodnoty",General:"Obecné",Language:"Jazyk",MoonrakerDb:"Moonraker databáze",PrinterName:"Název tiskárny",Reset:"Resetovat",Restore:"Obnovit",RestoreDialog:"Prosím zvolte všechny sekce, které chcete obnovit:",TimeFormat:"Formát času"},InterfaceSettings:"Nastavení rozhraní",MacrosTab:{Add:"přidat",AddGroup:"přidat skupinu",AvailableMacros:"Dostupné makra",ChangeMacroColor:"Změnit barvu tlačítka",Color:"Barva",CountMacros:"žádná makra přidána | {count} makro | {count} maker",Custom:"vlastní",CustomColor:"Vlastní barva",DeletedMacro:"Makro smazáno",DeleteMacroFromGroup:"Smazat makro ze skupiny",EditGroup:"Upravit skupinu",Error:"chyba",Expert:"Expert",General:"Obecné",Group:"Skupina",GroupMacros:"Seskupit makra",Macrogroups:"Skupiny maker",Macros:"Makra",Management:"Správa",Name:"Jméno",NoAvailableMacros:"Nejsou dostupná žádná makra.",NoGroups:"Nenalezena žádná skupina...",NOMacros:"Nenalezena žádná makra...",NoMacrosInGroup:"V této skupině nejsou žádná makra.",Primary:"primární",Search:"Hledat",Secondary:"sekundární",ShowInStatePaused:"Zobrazovat/skrýt, pokud je tiskárna pozastavena",ShowInStatePrinting:"Zobrazovat/skrýt, pokud tiskárna tiskne",ShowInStateStandby:"Zobrazovat/skrýt, pokud je tiskárna v pohotovostním režimu",Simple:"Jednoduchý",Status:"Stav",Success:"úspěch",UnknownGroup:"Neznámá skupina",Warning:"varování"},MiscellaneousTab:{AddGroup:"Přidat skupinu",AddPreset:"Přidat předvolbu",Color:"Barva",CreateGroup:"Vytvořit skupinu",CreatePreset:"Vytvořit předvolbu",End:"Konec",EndDescription:"Poslední LED této skupiny.",Groups:"Skupiny",GroupSubTitle:"Start: {start}, Konec: {end}",LightGroups:"{name} - Skupiny",LightPresets:"{name} - Předvolby",Miscellaneous:"Různé",Name:"Název",NoDevicesFound:"Nenalezena žádná zařízení",NoGroupFound:"Nebyla nalezena žádná skupina",NoPresetFound:"Nebyla nalezena žádná předvolba",Presets:"Předvolby",Start:"Start",StartDescription:"První LED této skupiny.",UnableToLoadLight:"Nelze načíst světlo",UnableToLoadPreset:"Nelze načíst předvolbu"},PresetsTab:{AddPreset:"Přidat předvolbu",Cooldown:"Zchladnutí",CreateHeadline:"Vytvořit předvolbu",CustomGCode:"Vlastní G-kód",EditCooldown:"Upravit zchladnutí",EditHeadline:"Upravit předvolbu",ErrorInvalidValue:"Neplatná hodnota",ErrorNameNotUnique:"Název již existuje",ErrorNameRequired:"Název je povinný",Name:"Název",PreheatPresets:"Předvolby",PresetInfo:"Nastavte alespoň cílovou teplotu nebo vlastní G-kód.",PresetNamePlaceholder:"Název předvolby (povinný)",StoreButton:"Uložit předvolbu",UpdateButton:"Aktualizovat předvolbu",UpdateCooldown:"Aktualizovat zchladnutí"},RemotePrintersTab:{AddPrinter:"Přidat tiskárnu",EditPrinter:"Upravit tiskárnu",Hostname:"Hostname",Port:"Port",RemotePrinters:"Vzdálené tiskárny",UpdatePrinter:"Aktualizovat tiskárnu",UseConfigJson:"Byla zjištěna InstanceDB = JSON. Pro úpravu seznamu tiskáren použijte prosím config.json."},Store:"uložit",TimelapseTab:{Autorender:"Automatické vygenerování časosběrného videa",AutorenderDescription:"Pokud povoleno, časosběrné video se automaticky vygeneruje na konci tisku",Camera:"Kamera",CameraDescription:"Vyberte, která kamera se má použít",ConstantRateFactor:"Konstantní rychlost faktoru",ConstantRateFactorDescription:"Toto nastavuje poměr kvality a velikosti výstupního videa. Rozsah stupnice CRF je 0–51, kde 0 znamená bez ztráty, 23 je výchozí hodnota a 51 je nejhorší možná kvalita. Nižší hodnota obvykle znamená vyšší kvalitu a obvykle se používají hodnoty 17-28, kde 17 nebo 18 jsou považovány za vizuálně bezeztrátové.",duplicatelastframe:"Duplikovat poslední snímek",duplicatelastframeDescription:"Duplikuje poslední snímek na konci videa",Enabled:"Povoleno",EnabledDescription:"Pokud zakázáno, G-Code makra jsou ignorována a automatické vygenerování časosběrného videa se přeskočí.",Extraoutputparams:"Další výstupní parametry",ExtraoutputparamsDescription:"Definuje další výstupní parametry pro FFMPEG. Poznámka: Zadání cokoli sem vypne nastavení rotace",FwRetract:"FW zatažení",FwRetractDescription:"Použít firmware retrakci v časosběrném makru",GcodeVerbose:"Podrobné G-kódy",GcodeVerboseDescription:"Pokud je povoleno, G-kódy v makrech zobrazují informace v konzoli",General:"Obecné",HyperlapseCycle:"Hyperlapse doba cyklu",HyperlapseCycleDescription:"Snímek se pořídí každých X sekund",Mode:"Režim",ModeDescription:"Vyberte mezi makrem vrstvy a hyperlapse (časovým) režimem",OutputFramerate:"Výstupní snímková frekvence",OutputFramerateDescription:"Definuje snímkovou frekvenci videa. Poznámka: Toto bude ignorováno, pokud je povolena proměnná snímková frekvence",Parkhead:"Parkovat hlavu nástroje",ParkheadDescription:"Pokud povoleno, hlava nástroje se parkuje před pořízením snímku.",Parkpos:"Pozice parkování",ParkposDescription:"Vyberte pozici parkování",ParkTime:"Doba parkování",ParkTimeDescription:"Přidat další nečinnost při parkování.",Pixelformat:"Formát pixelů",PixelformatDescription:"Definuje formát pixelů výstupního videa",PosDZ:"Pozice Z",PosDZDescription:"Parkovací pozice Z (relativní)",PosX:"Pozice X",PosXDescription:"Parkovací pozice X (absolutní)",PosY:"Pozice Y",PosYDescription:"Parkovací pozice Y (absolutní)",PreviewImage:"Náhledový obrázek",PreviewImageDescription:"Uloží náhledový obrázek se stejným názvem jako video",RenderingOptions:"Možnosti vykreslování",RetractDistance:"Vzdálenost zpětného tahání",RetractDistanceDescription:"Délka filamentu, který extruder zpětně táhne.",RetractSpeed:"Rychlost zpětného tahání",RetractSpeedDescription:"Rychlost, kterou extruder zpětně táhne filament.",SaveFrames:"Uložit snímky",SaveFramesDescription:"Uloží snímky do zip souboru pro externí vykreslování",StreamDelayCompensation:"Kompensace zpoždění streamu",StreamDelayCompensationDescription:"Zpoždění zachycení snímku",Targetlength:"Cílová délka",TargetlengthDescription:"Cílová délka při povoleném proměnném počtu snímků za sekundu",TimeFormatCode:"Kód formátu času",TimeFormatCodeDescription:"Definuje, jak bude časové razítko výstupního souboru zakódováno",Timelapse:"Timelapse",TravelSpeed:"Rychlost pohybu",TravelSpeedDescription:"Rychlost pohybu při přesunu na parkovací pozici a obnovení tisku",UnretractDistance:"Vzdálenost roztažení",UnretractDistanceDescription:"Délka filamentu, který extruder roztažený zpět vrací",UnretractSpeed:"Rychlost roztažení",UnretractSpeedDescription:"Rychlost, kterou extruder roztažený filament vrací zpět",VariableFps:"Proměnný počet snímků za sekundu",VariableFpsDescription:"Pokud je povoleno, rychlost snímků výstupního videa bude vypočítána na základě cílové délky",VariableFpsMax:"Proměnný FPS max",VariableFpsMaxDescription:"",VariableFpsMin:"Minimální počet snímků na sekundu při proměnné rychlosti",VariableFpsMinDescription:""},UiSettingsTab:{BoolBigThumbnail:"Velký náhled",BoolBigThumbnailDescription:"Zobrazit velký náhled v panelu stavu během tisku.",BoolHideUploadAndPrintButton:"Skrýt tlačítko Nahrát a Tisknout",BoolHideUploadAndPrintButtonDescription:'Zobrazit nebo skrýt tlačítko "Nahrát a Tisknout" v horní liště.',ConfirmOnEmergencyStop:"Potvrdit nouzové zastavení",ConfirmOnEmergencyStopDescription:"Zobrazit potvrzovací dialog při nouzovém zastavení.",ConfirmOnPowerDeviceChange:"Potvrdit změnu napájecího zařízení",ConfirmOnPowerDeviceChangeDescription:"Zobrazit potvrzovací dialog při změně napájecího zařízení.",DisableFanAnimation:"Vypnout animaci ventilátorů",DisableFanAnimationDescription:"Toto může snížit zátěž pro váš prohlížeč.",DisplayCANCEL_PRINT:"Zobrazit CANCEL_PRINT",DisplayCANCEL_PRINTDescription:"Zobrazuje tlačítko CANCEL_PRINT trvale - není třeba druhé potvrzení pro druhou vrstvu.",GcodeThumbnails:"Náhledy G-Code",GcodeThumbnailsDescription:"Klikněte na tlačítko, abyste se dostali k návodům.",Guide:"Průvodce",HideSaveConfigButtonForBedMesh:"Skrýt tlačítko Uložit konfiguraci pro změny bed_mesh",HideSaveConfigButtonForBedMeshDescription:"Skrýt tlačítko Uložit konfiguraci, pokud jsou pouze změny bed_mesh čekající na uložení v Klipperu.",LockSliders:"Uzamknout posuvníky na dotykových zařízeních",LockSlidersDelay:"Prodleva uzamčení posuvníků",LockSlidersDelayDescription:"Posuvníky se uzamknou po určité prodlevě. Pokud je nastaveno na 0 nebo ponecháno prázdné, posuvníky se uzamknou pouze při změně/obnovení stránky.",LockSlidersDescription:"Posuvníky na dotykových zařízeních musí být odemknuty před povolením změn.",Logo:"Logo",NavigationStyle:"Styl navigace",NavigationStyleDescription:"Změnit vzhled navigace",NavigationStyleIconsAndText:"Ikony + Text",NavigationStyleIconsOnly:"Pouze ikony",PowerDeviceName:"Napájecí zařízení tiskárny",PowerDeviceNameDescription:"Vyberte, které zařízení pro napájení tiskárny v Moonrakeru se má použít.",Primary:"Primární",ShowWebcamInNavigation:"Zobrazit webkameru v navigaci",UiSettings:"Nastavení uživatelského rozhraní"},Update:"Aktualizovat",WebcamsTab:{AddWebcam:"Přidat webkameru",CreateWebcam:"Vytvořit webkameru",EditCrowsnestConf:"Upravit crowsnest.conf",EditWebcam:"Upravit webkameru",FlipWebcam:"Obrátit obrázek kamery:",Hlsstream:"HLS stream",Horizontally:"horizontálně",IconBed:"Postel",IconCam:"Kamera",IconDoor:"Dveře",IconFilament:"Filament",IconHot:"Horké",IconMcu:"MCU",IconNozzle:"Tryska",IconPrinter:"Tiskárna",Ipstream:"IP kamera",Mjpegstreamer:"MJPEG-Streamer",MjpegstreamerAdaptive:"Adaptivní MJPEG-Streamer (experimentální)",Name:"Jméno",NameAlreadyExists:"Jméno již existuje",Required:"vyžadováno",Rotate:"Otočit",SaveWebcam:"Uložit webkameru",Service:"Služba",TargetFPS:"Cílové FPS",UpdateWebcam:"Aktualizovat webkameru",UrlSnapshot:"URL snímku",UrlStream:"URL streamu",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"vertikálně",Webcams:"Webkamery",WebrtcCameraStreamer:"WebRTC (streamer z kamery)"}},S={AllFiles:"Všechny",Autorender:"Automatické vykreslování",Cancel:"Zrušit",Create:"Vytvořit",CreateNewDirectory:"vytvořit adresář",CurrentPath:"Aktuální cesta",Delete:"Smazat",DeleteDirectory:"Smazat adresář",DeleteDirectoryQuestion:'Opravdu chcete smazat adresář "{name}" se všemi jeho obsahy?',DeleteSelectedQuestion:"Opravdu chcete smazat {count} vybrané soubory?",Download:"Stáhnout",DuplicateLastframe:"Duplikovat poslední snímek",Empty:"Nebyly nalezeny žádné dokončené časosběrné snímky.",Enabled:"Zapnuto",EstimatedLength:"Předpokládaná délka",Files:"Soubory",Filesize:"Velikost",Fixed:"Pevný",Framerate:"Snímkovací frekvence",Frames:"Snímky",Free:"Volný",FreeDisk:"Volné místo",LastModified:"Naposledy upraveno",MaxFramerate:"Max. snímkovací frekvence",MinFramerate:"Min. snímkovací frekvence",Name:"Název",NewDirectory:"Nový adresář",NoActiveTimelapse:"Nejsou k dispozici žádné záznamy.",Preview:"Náhled",RefreshCurrentDirectory:"Obnovit adresář",Rename:"Přejmenovat",RenameDirectory:"Přejmenovat adresář",RenameFile:"Přejmenovat soubor",Render:"Vykreslit",RenderSettings:"Nastavení vykreslování",SaveFrames:"Uložit snímky",Search:"Hledat",StartRender:"Spustit vykreslování",Status:"Stav",TargetFps:"Cílová snímkovací frekvence",Targetlength:"Cílová délka",TimelapseFiles:"Soubory časosběrných snímků",TimelapseRendering:"Vykreslování časosběrných snímků",TimelapseRenderingSuccessful:"Vykreslování časosběrných snímků úspěšné",Total:"Celkem",Type:"Typ",Used:"Použité",Variable:"Proměnný",Video:"Video"},C="Čeština",D={App:e,BedScrews:o,ConnectionDialog:t,Console:a,Dialogs:n,Editor:r,EmergencyStopDialog:i,Files:s,FullscreenUpload:l,GCodeViewer:u,Heightmap:d,History:p,JobQueue:m,Machine:v,ManualProbe:c,Panels:k,PowerDeviceChangeDialog:y,Router:b,ScrewsTiltAdjust:z,SelectPrinterDialog:h,Settings:P,Timelapse:S,title:C};export{e as App,o as BedScrews,t as ConnectionDialog,a as Console,n as Dialogs,r as Editor,i as EmergencyStopDialog,s as Files,l as FullscreenUpload,u as GCodeViewer,d as Heightmap,p as History,m as JobQueue,v as Machine,c as ManualProbe,k as Panels,y as PowerDeviceChangeDialog,b as Router,z as ScrewsTiltAdjust,h as SelectPrinterDialog,P as Settings,S as Timelapse,D as default,C as title}; diff --git a/assets/da-DYgaz82Z.js b/assets/da-DYgaz82Z.js new file mode 100644 index 0000000..10c9762 --- /dev/null +++ b/assets/da-DYgaz82Z.js @@ -0,0 +1 @@ +const e={Notifications:{BrowserWarnings:{Description:"{name} er forældet og ikke længere fuldt understøttet. Den nuværende version er {version}, men Mainsail kræver version {minVersion} eller højere.",Headline:"Forældet browser"},DependencyDescription:"Den nuværende version af {name} understøtter ikke alle funktioner i Mainsail. Opdatér {name} til minimum version: {neededVersion}.",DependencyName:"Afhængighed: {name}",DismissAll:"Fjern alle",KlipperWarnings:{DeprecatedOption:'Funktionen "{option}" i sektion "{section}" er forældet.',DeprecatedOptionHeadline:"Forældet Klipper mulighed",DeprecatedValue:'Værdien "{value}" i muligheden "{option}" i sektion "{section}" er forældet.',DeprecatedValueHeadline:"Forældet Klipper værdi",KlipperRuntimeWarning:"Klipper runtime advarsel",KlipperWarning:"Klipper advarsel"},MaintenanceReminder:"Vedligeholdelsespåmindelse",MaintenanceReminderText:'Vedligeholdelse "{name}" forfalder.',MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"Der blev fundet en fejl under indlæsning af Moonraker komponenten '{component}'. Tjek logfilen og løs problemet.",MoonrakerFailedInitComponentDescription:"Der blev fundet en fejl under opstart af Moonraker komponenten '{component}'. Tjek logfilen og løs problemet.",MoonrakerInitComponent:"Starter Moonraker: {component}",MoonrakerWarning:"Moonraker advarsel",UnparsedConfigOption:"Upareret mulighed '{option}: {value}' fundet i sektionen: [{section}]. Denne mulighed er måske ikke længere tilgængelig, eller der kan være et problem under indlæsning af et modul. Dette vil resultere i en opstartsfejl.",UnparsedConfigSection:"Upareret konfigurationssektion [{section}] fundet. Dette kan være på grund af en fejl under indlæsning af en komponent. Dette vil resultere i en opstartsfejl."},Never:"aldrig",NextReboot:"næste genstart",NoNotification:"Ingen tilgængelig notifikationer",Notifications:"Notifikationer",OneDayShort:"1D",OneHourShort:"1H",OneWeekShort:"1W",Remind:"Påmind mig om:",ShowDetails:"vis detaljer"},NumberInput:{GreaterOrEqualError:"Skal være større eller lig med {min}!",MustBeBetweenError:"Skal være mellem {min} og {max}!",NoEmptyAllowedError:"Må ikke være tom!"},Printers:"Printere",TextfieldWithCopy:{Copied:"Kopieret"},TheServiceWorker:{DescriptionNeedUpdate:"Den lokale cahce er forældet og skal opdateres. Tryk venligst nedenfor for at opdatere.",TitleNeedUpdate:"PWA skal opdateres",Update:"Opdater"},ThrottledStates:{DescriptionCurrentlyThrottled:"rPi ARM kerne(r) er i øjeblikket begrænset .",DescriptionFrequencyCapped:"rPi ARM maks. frekvens er i øjeblikket begrænset til 1.2 GHz.",DescriptionPreviouslyFrequencyCapped:"rPi ARM maks. frekvens var mindst en gang begrænset til 1.2 GHz siden sidste opstart.",DescriptionPreviouslyTemperatureLimited:"rPi uC (3A+/3B+ only) temperatur var mindst en gang over advarselsgrænsen siden sidste opstart.",DescriptionPreviouslyThrottled:"rPI ARM kerne(r) var begrænset mindst en gang siden sidste opstart.",DescriptionPreviouslyUnderVolted:"rPI strømforsyning faldt til under 4,65V mindst en gang siden sidste opstart.",DescriptionTemperatureLimitActive:"rPi uC (3A+/3B+ only) temperatur er i øjeblikket over advarselsgrænsen (standard 60°C).",DescriptionUnderVoltageDetected:"rPI strømforsyning i øjeblikket under 4,65V",TitleCurrentlyThrottled:"Begrænset i øjeblikket",TitleFrequencyCapped:"Maks. frekvens formindsket",TitlePreviouslyFrequencyCapped:"Maks. frekvens formindsket tidligere",TitlePreviouslyTemperatureLimited:"Temperaturgrænse nået tidligere",TitlePreviouslyThrottled:"Tidligere begrænset",TitlePreviouslyUnderVolted:"Lav spænding opdaget tidligere",TitleTemperatureLimitActive:"Temperaturgrænse nået",TitleUnderVoltageDetected:"Lav spænding opdaget"},Titles:{Complete:"Færdig - {filename}",Error:"Fejl",Pause:"Pause",PrinterOff:"Printer slukket",Printing:"{percent}% printet",PrintingETA:"{percent}% printet - ETA {eta}"},TopBar:{CannotUploadTheFile:"Kan ikke uploade filen!",EmergencyStop:"Nødstop",SAVE_CONFIG:"GEM KONFIGURATION",Uploading:"Uploader",UploadOfFileSuccessful:"Upload af {file} udført!",UploadPrint:"Upload & Print"},TopCornerMenu:{Cancel:"Annuller",ConfirmationDialog:{Description:{HostReboot:"Hvis du genstarter værten nu, vil det igangværende print fejle!",HostShutdown:"Hvis du lukker værten ned nu, vil det igangværende print fejle!",KlipperFirmwareRestart:"Hvis du genstarter Klipper firmware nu, vil det igangværende print fejle!",KlipperRestart:"Hvis du genstarter Klipper nu, vil det igangværende print fejle!",KlipperStop:"Hvis du stopper Klipper nu, vil det igangværende print fejle!",ServiceRestart:"Hvis du genstarter denne service nu, er der stor risiko for at dit igangværende print vil fejle!",ServiceStart:"Hvis du starter denne service nu, er der stor risiko for at dit igangværende print vil fejle!",ServiceStop:"Hvis du stopper denne service nu, er der stor risiko for at dit igangværende print vil fejle!"},Title:{HostReboot:"Genstart vært",HostShutdown:"Luk vært ned",KlipperFirmwareRestart:"Genstart Klipper firmware",KlipperRestart:"Genstart Klipper",ServiceRestart:"Genstart service",ServiceStart:"Start service",ServiceStop:"Stop service"}},HostControl:"Værtsstyring",KlipperControl:"Klipper styring",KlipperFirmwareRestart:"Genstart firmware",KlipperRestart:"Genstart",PowerDevices:"Strømstyring",Reboot:"Genstart",Restart:"Genstart",ServiceControl:"Services",Shutdown:"Luk ned",Start:"Start",Stop:"Stop"},UpdateDialog:{Close:"Luk",Empty:"Tøm",Recovering:"Gendanner {software}...",RecoveringDone:"Gendannelse af {software} udført!",Updating:"Opdaterer {software}...",UpdatingDone:"Opdatering af {software} udført!"}},t={Abort:"Afbryd",Accept:"Acceptér",Adjusted:"Justeret",Description:"Klik på Justeret hvis skruen blev justeret. Klik på Acceptér for at fortsætte uden justering.",Headline:"Bed skruer",ScrewAccepted:"Skrue accepteret",ScrewIndex:"Skrue Index",ScrewName:"Skrue Navn",ScrewOutput:"{current} af {max}"},r={CannotConnectTo:"Kan ikke forbinde med Moonraker ({host}).",CheckMoonrakerLog:"Hvis denne besked vises flere gange, kig da i logfilen her:",Connecting:"Forbinder med {host}",Failed:"Forbindelse fejlede",Initializing:"Initialiserer",TryAgain:"Prøv igen"},i={CommandList:"Liste over kommandoer",Empty:"Tom",HideTemperatures:"Skjul temperaturer",HideTimelapse:"Skjul Timelapse",SendCode:"Send kode...",SetupConsole:"Terminalindstillinger"},n={AreYouSure:"Er du sikker?",CoolDown:"Nedkøling",No:"Nej",Yes:"Ja"},a={CanBusInfo:"Kun ikke tildelte nodes kan findes. Det anbefales kun at have én ikke tildelt enhed forbundet til CanBus for at undgå kommunikationsproblemer. For flere detaljer, klik på linket:",ClickRefresh:"Klik på Opdatér for at søge efter enheder.",DevicePath:"Enhedssti",Formats:"Formater",Headline:"Enheder",HideSystemEntries:"Skjul systemenheder",LibcameraId:"LibCamera ID",NoDeviceFound:"Ingen enhed fundet. Tjek forbindelsen og klik på Opdatér.",PathByHardware:"Sti via hardware",PathById:"Sti via ID",Refresh:"Opdatér",Resolutions:"Opløsninger"},o={StartPrint:{Cancel:"Annuller",DoYouWantToStartFilename:"Vil du begynde at printe: {filename}?",DoYouWantToStartFilenameFilament:"Vil du begynde at printe {filename} med dette filament?",Headline:"Start print",Print:"Print",Timelapse:"Timelapse"}},l={ConfigReference:"Konfigurationsreference",DeviceDialog:"Enheder",DontSave:"Gem ikke",Downloading:"Downloader",FailedSave:"{filename} blev IKKE gemt!",FileReadOnly:"Skrivebeskyttet",SaveClose:"Gem & luk",SaveRestart:"Gem & genstart",SuccessfullySaved:"{filename} blev gemt.",UnsavedChanges:"Ugemte ændringer",UnsavedChangesMessage:"Ønsker du at gemme ændringerne i filen {filename}?",UnsavedChangesSubMessage:'Dine ændringer går tabt hvis du ikke gemmer. Du kan deaktivere denne besked i "editor-settings".',Uploading:"Uploader"},s={AreYouSure:"Er du sikker?",EmergencyStop:"Nødstop",No:"Nej",Yes:"Ja"},d={AddBatchToQueue:"tilføj batch til kø",AddToQueue:"Tilføj til kø",AllFiles:"Alle",BedTemp:"Bed temperatur.",Cancel:"Annuller",ChamberTemp:"Indelukke temperatur.",Count:"Tæl",Create:"Opret",CreateNewDirectory:"Ny mappe",CurrentPath:"Du er her",Delete:"Slet",DeleteDirectory:"Slet mappe",DeleteDirectoryQuestion:'Vil du slette mappen "{name}" og alt dens indhold?',DeleteSelectedQuestion:"Vil du slette alle {count} valgte filer?",DeleteSingleFileQuestion:'Vil du slette "{name}"?',Download:"Download",Duplicate:"Dupliker",DuplicateFile:"Dupliker fil",EditFile:"Rediger Fil",Empty:"Tom",ExtruderTemp:"Hotend temperatur.",Filament:"Filament",FilamentName:"Filament navn",FilamentType:"Filament type",FilamentUsage:"Filament forbrug",FilamentWeight:"Filament vægt",Files:"Filer",Filesize:"Filstørrelse",Free:"Ledig",FreeDisk:"Ledig plads",GCodeFiles:"G-Kode Filer",GcodesRootDirectoryDoesntExists:'Ingen mappe med g-koder fundet. Tjek at opsætning af "path" under [virtual_sdcard] sektionen i printer.cfg er korrekt.',HiddenFiles:"Skjulte filer",InvalidNameAlreadyExists:"Navnet eksisterer allerede, vælg venligst et andet navn.",InvalidNameEmpty:"Feltet må ikke være tomt!",LastEndTime:"Sidste slut tid",LastFilamentUsed:"Sidste filament forbrug",LastModified:"Sidst ændret",LastPrintDuration:"Sidste printtid",LastStartTime:"Sidste start tid",LastTotalDuration:"Sidste totale tid",LayerHeight:"Laghøjde",Name:"Navn",NewDirectory:"Ny mappe",NozzleDiameter:"Nozzle diameter",ObjectHeight:"Total højde",Preheat:"Forvarm",PrintedFiles:"Printede filer",PrintStart:"Start print",PrintTime:"Printtid",RefreshCurrentDirectory:"Opdater mappe",Rename:"Omdøb",RenameDirectory:"Omdøb mappe",RenameFile:"Omdøb Fil",ScanMeta:"Skan metadata",ScanMetaSuccess:"Metadata skannet fra: {filename}.",Search:"Søg",SetupCurrentList:"Rediger visning",Slicer:"Slicer",SuccessfullyCreated:"{filename} oprettet.",SuccessfullyDeleted:"{filename} slettet.",SuccessfullyMoved:"{filename} flyttet.",SuccessfullyRenamed:"{filename} omdøbt.",SuccessfullyUploaded:"Upload af {filename} udført!",Total:"Total",UploadNewGcode:"Upload ny G-Code",Used:"Brugt",View3D:"Vis i 3D"},p={CannotUploadFile:"Kan ikke uploade filen!",DropFilesToUploadFiles:"Drop filer her for at uploade"},m={ClearLoadedFile:"Fjern",CNCMode:"CNC Mode",ColorMode:"Farvevisning",Downloading:"Downloader",ForceLineRendering:"Gennemtving Linje Rendering",HDRendering:"HD Rendering (Runde Extrusions)",High:"Høj",LoadCurrentFile:"Aktuel fil",LoadLocal:"Lokal Fil",Low:"Lav",Max:"Maks",Medium:"Medium",ReloadRequired:"Opdatering påkrævet",Rendering:"Rendering",RenderQuality:"Renderingskvalitet",ShowGCode:"Vis G-kode",ShowObjectSelection:"Vis Objekt valg",ShowToolhead:"Vis nozzle",ShowTravelMoves:"Vis Travel",SpecularLighting:"Spejlende belysning",Title:"G-Code Viser",Tracking:"Sporing",Transparency:"Transparens",Ultra:"Ultra",VoxelMode:"Voxel Mode (ASMBL)"},g={Abort:"Afbryd",BedMeshCalibrate:"Kalibrer Bed Mesh",BedMeshRemove:"Slet Bed Mesh",Calibrate:"Kalibrer",Clear:"Slet",CurrentMesh:{Headline:"Nuværende Bed Mesh",Max:"Maks",Min:"Min",Name:"Navn",Range:"Variation",Size:"Størrelse"},DeleteBedMeshProfile:"Slet Bed Mesh profil",DoYouReallyWantToDelete:'Vil du slette "{name}"?',ErrorKlipperNotReady:"Klipper er ikke klar. Kan ikke vise højdekort.",Flat:"Fladt",Heightmap:"Højdekort",InvalidNameAlreadyExists:"Profilnavnet bruges allerede, vælg venligst et andet profilnavn.",InvalidNameAscii:"Navnet er ugyldigt. Der kan kun bruges ascii karakterer.",InvalidNameEmpty:"Feltet må ikke være tomt!",InvalidNameReserved:"Profilnavnet 'default' er reserveret af systemet, vælg venligst et andet profilnavn.",Later:"Senere",Mesh:"Mesh",Name:"Navn",NoBedMeshHasBeenLoadedYet:"Intet Bed Mesh indlæst.",NoProfile:"Ingen profil tilgængelig",Ok:"Ok",Probed:"Målt",Profiles:"Profiler",Remove:"Fjern",RemoveSaveDescription:"Profilen er markeret til sletning. Klik på GEM KONFIGURATIONfor at fjerne den fra printer.cfg og genstarte Klipper.",Rename:"Omdøb",RenameBedMeshProfile:"Omdøb Bed Mesh profil",SAVE_CONFIG:"GEM KONFIGURATION",ScaleGradient:"Skala graduering",ScaleZMax:"Skalér til z-max.",TitleCalibrate:"Kalibrer nyt Bed Mesh",TitleClear:"Slet bed mesh",TitleHomeAll:"Home alle",Wireframe:"Wireframe"},u={AddANote:"Tilføj note",AddMaintenance:"Tilføj vedligeholdelse",AddNote:"Tilføj note",AddToQueueSuccessful:"Filen {filename} tilføjet til Køen.",AllJobs:"Alle job",AvgPrinttime:"Gns. printtid",Cancel:"Annuller",Chart:"Skema",CreateNote:"Gem note",DateBasedReminder:"Dato",DateBasedReminderDescription:"Denne påmindelse er baseret på datoen.",Days:"dage",Delete:"Slet",DeleteSelectedQuestion:"Er du sikker på du vil slette alle {count} valgte jobs?",DeleteSingleJobQuestion:"Er du sikker på du vil slette dette job?",Details:"Detaljer",EditMaintenance:"Redigér Vedligeholdelse",EditNote:"Redigér note",Empty:"Tom",EndTime:"Sluttid",EntryCreatedAt:"Oprettet d. {date}.",EntryNextPerform:"Udføres næste gang:",EntryPerformedAt:"Udført d. {date}.",EntrySince:"Brugt siden:",EstimatedFilament:"Estimeret filament",EstimatedFilamentWeight:"Estimeret filament vægt",EstimatedTime:"Estimeret tid",FilamentBasedReminder:"Filament baseret",FilamentBasedReminderDescription:"Denne påmindelse er baseret på filament forbrug.",FilamentCalc:"Filament beregnet",FilamentUsage:"Filament brugt",FilamentUsed:"Filament brugt",Filename:"Filnavn",Filesize:"Filstørrelse",FirstLayerBedTemp:"Første lag Bed Temp.",FirstLayerExtTemp:"Første lag Nozzle Temp.",FirstLayerHeight:"Første lag højde",HistoryFilamentUsage:"Filament",HistoryPrinttimeAVG:"Antal print",Hours:"timer",InvalidNameEmpty:"Ugyldigt navn. Navnet må ikke være tomt!",JobDetails:"Jobdetaljer",Jobs:"Job",LastModified:"Sidst ændret",LayerHeight:"Laghøjde",LoadCompleteHistory:"Indlæs komplet historik",LongestPrinttime:"Længste print",Maintenance:"Vedligeholdelse",MaintenanceEntries:"Vedligeholdelsesposter",Meter:"meter",Name:"Navn",NoReminder:"Ingen påmindelse",Note:"Note",ObjectHeight:"Objekt Højde",OneTime:"Éngangs",Perform:"Udfør",Performed:"Udført",PerformedAndReschedule:"Udført og planlagt",PerformMaintenance:"Udfør Vedligeholdelse",PrintDuration:"Print varighed",PrintHistory:"Print historik",PrintJobs:"Print job",PrintTime:"Print Tid",PrinttimeAvg:"Printtid gennemsnit",PrinttimeBasedReminder:"Print tid",PrinttimeBasedReminderDescription:"Denne påmindelse er baseret på print tiden.",Reminder:"Påmindelse",Repeat:"Gentag",Reprint:"Print igen",Save:"Gem",Search:"Søg",SelectedFilamentUsed:"Filament brugt på valgte",SelectedJobs:"Valgte jobs",SelectedPrinttime:"Printtid for valgte",Slicer:"Slicer",SlicerVersion:"Slicer Version",StartTime:"Starttid",Statistics:"Statistik",Status:"Status",StatusValues:{cancelled:"Annulleret",completed:"Færdige",error:"Fejl",in_progress:"Igangværende",interrupted:"Afbrudt",klippy_disconnect:"Klippy afbrudt",klippy_shutdown:"Klippy lukket ned",Others:"Andre",server_exit:"Server afslutning"},Table:"Tabel",TitleExportHistory:"Export historik",TotalDuration:"Total varighed",TotalFilamentUsed:"Filament brugt ialt",TotalJobs:"Totale antal print",TotalPrinttime:"Total printtid",TotalTime:"Total Tid"},c={AllJobs:"Alle Jobs",Cancel:"Annuller",ChangeCount:"Ændre antal",Count:"Tæl",Empty:"Tom",InvalidCountEmpty:"Input må ikke være tom!",InvalidCountGreaterZero:"Input skal være over 0!",JobQueue:"Jobkø",Jobs:"Jobs",Pause:"Pause",RemoveFromQueue:"Fjern fra køen",Start:"Start",StartPrint:"Start job"},k={ConfigFilesPanel:{AllFiles:"Alle",Cancel:"Annuller",ConfigFiles:"Konfigurationsfiler",ConfigRootDirectoryDoesntExists:'Ingen konfiguration fundet. Tjek venligst opsætningen af "config_path" under [file_manager] sektionen af Moonraker konfigurationen.',Create:"Ny",CreateDirectory:"Ny mappe",CreateFile:"Ny Fil",CurrentPath:"Du er her",Delete:"Slet",DeleteDirectory:"Slet mappe",DeleteDirectoryQuestion:'Vil du slette mappen "{name}" og alt dens indhold?',DeleteSelectedQuestion:"Vil du slette alle {count} valgte filer?",DeleteSingleFileQuestion:'Vil du slette "{name}"?',Download:"Download",Duplicate:"Dupliker",DuplicateFile:"Dupliker fil",EditFile:"Rediger fil",Empty:"Tom",Files:"Filer",Filesize:"Filstørrelse",Free:"Ledig",FreeDisk:"Ledig plads",HiddenFiles:"Skjulte filer",HideBackupFiles:"Skjul backupfiler",LastModified:"Sidst ændret",Name:"Navn",RefreshDirectory:"Opdater mappe",Rename:"Omdøb",RenameDirectory:"Omdøb mappe",RenameFile:"Omdøb fil",Root:"Rod",SetupCurrentList:"Indstil visning",ShowFile:"Vis fil",Total:"Total",UploadFile:"Upload Fil",Uploading:"Uploader",Used:"Brugt"},EndstopPanel:{Endstop:"Endestop",EndstopInfo:'Klik på "Sync"-knappen nederst til højre for at opdatere Endstop status.',Endstops:"Endestops",open:"Åben",TRIGGERED:"Aktiveret"},LogfilesPanel:{Accept:"Acceptér",Cancel:"Annuller",Logfiles:"Logfiler",Rollover:"Nulstil log-filer",RolloverDescription:"Vælg hvilke log-filer der skal nulstilles:",RolloverToastFailed:'Nulstillings fejl-log for "{name}": {message}',RolloverToastSuccessful:'Filen: "{name}" blev nulstillet.'},SystemPanel:{Constants:"Konstanter",Cpu:"CPU",HostDetails:"Værtsdetaljer",LastStats:"Sidste detaljer",Load:"Belastning",Memory:"RAM",NoMoreInfos:"Ikke mere info",SystemLoad:"Systembelastninger",Values:{Awake:"Vågen/Aktiv: {awake}",Bandwidth:"Båndbredde: {bandwidth}/s",Distro:"Distro: {name} {version_id}",Frequency:"Frekvens: {frequency}",Load:"Belastning: {load}",Memory:"Hukkommelse: {memory}",Os:"OS: {os}",Received:"Modtaget: {received}",Temp:"Temperatur: {temp}°C",TempMax:"maks: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Sendt: {transmitted}",Version:"Version: {version}"}},UpdatePanel:{Abort:"Afbryd",AreYouSure:"Er du sikker?",CheckForUpdates:"Tjek for opdateringer",Close:"Luk",CommitHistory:"Forpligtelseshistorik",Commits:"Forpligtelse",CommitsAvailable:"Ingen commits tilgængelige | {count} commits tilgængelige | {count} commits tilgængelige",CommitsOnDate:"Forpligtelse af {date}",CommittedDaysAgo:"Forpligtelse delt for {days} dage siden",CommittedHoursAgo:"Forpligtelse delt for {hours} timer siden",CommittedOnDate:"Forpligtelse delt d. {date}",CommittedYesterday:"Forpligtelse delt igår",ConfigChanges:"Konfigurationsændringer",Corrupt:"Ødelagt",CountPackagesCanBeUpgraded:"{count} pakker der kan opgraderes",Detached:"Løsrevet",Dirty:"Uren-kode",GenericUpdateQuestion:"Tjek Forpligtelseshistorikken (hvis tilgængelig) og GitHub siden for dette projekt, for at se om der er behov for manuelle justeringer for denne opdatering.",GitHubPage:"GitHub side",HardRecovery:"Hård nulstilling",InitUpdateManager:'Opdateringsmanageren er ikke initialiseret endnu. Dette er normalt ved første opstart. Klik venligst på "Opdater" for at initialisere alle komponenter.',Invalid:"Ugyldig",IUnderstandTheRisks:"Jeg forstår risisci",KlipperUpdateQuestionConfig:"Denne opdatering kan indeholde ændringer til konfigurationsparametre, som efterfølgende skal modificeres i printer.cfg filen. Tjek ændringsloggen for yderligere detaljer.",KlipperUpdateQuestionFirmware:"Denne opdatering kan indeholde ændringer til værts-firmwaren. Bundkortet skal muligvis flashes med opdateret firmware før printeren kan bruges igen.",LinkToGithub:"Link til GitHub",MoonrakerUpdateQuestion:"Dette vil opdatere Moonraker API. Det kan være nødvendigt at ændre i moonraker.conf filen før printeren kan bruges igen.",MoreCommitsInfo:"Der kan maksimalt vises 30 forpligtelser her. For at se dem alle, tryk her:",OSPackages:"OS-Pakker",SoftRecovery:"Blød nulstilling",StartUpdate:"Start opdatering",System:"System",ThesePackagesCanBeUpgrade:"Disse pakker kan opgraderes:",Unknown:"Ukendt",Update:"Opdater",UpdateAll:"Opdater alle komponenter",UpdateManager:"Opdateringsmanager",UpdateWarning:"Opdateringsadvarsel: {name}",Upgrade:"Opgrader",UpgradeableSystemPackages:"Systempakker med opdateringer",UpToDate:"up-to-date",WebClientUpdateQuestion:"I visse tilfælde kan opdateringer til webklienten forårsage problemer med inkompatibilitet. Se ændingsloggen for yderligere information."}},f={Abort:"Afbryd",Accept:"Acceptér",Advanced:"Avanceret",Headline:"Manuel Probing"},v={ExtruderControlPanel:{Allowed:"Tilladt",CleanNozzle:"Rens dyse",EstimatedExtrusion:"Estimeret ekstrudering:",Extrude:"Extrudér",ExtruderControl:"Esktruder-kontrol",ExtruderTempTooLow:"Hotend temp. <",ExtrusionFactor:"Ekstruderingsfaktor",ExtrusionFeedrate:"Ekstruderingsfødehastighed",FilamentLength:"Filamentlængde",FirmwareRetraction:"Firwmare Retraction",FirmwareRetractionSettings:{RetractLength:"Retract længde",RetractSpeed:"Retract hastighed",UnretractExtraLength:"Unretract ekstra længde",UnretractSpeed:"Unretract hastighed"},Headline:"Ekstruder Kontrolpanel",LoadFilament:"Fød filament",PressureAdvance:"Pressure Advance",PressureAdvanceSettings:{Advance:"Advance",Extruder:"Ekstruder",SmoothTime:"Smooth Time"},PurgeFilament:"Udrens filament",Requested:"Anmodet",Retract:"Retract",TooLargeExtrusion:"Ekstruderingen er for lang!",Tools:"Printhoveder",UnloadFilament:"Fjern filament"},FarmPrinterPanel:{ReconnectToPrinter:"Genopret forbindelse",SwitchToPrinter:"Skift til printer",WebcamOff:"Sluk"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Tjek at Klipper-servicen kører, samt at klippy_uds_address er korrekt konfigureret i moonraker.conf.",FirmwareRestart:"Genstart alt",KlipperLog:"Klipper-Log",MoonrakerCannotConnect:"Moonraker kan ikke forbinde til Klipper!",MoonrakerLog:"Moonraker-log",PowerOn:"Tænd",PrinterSwitchedOff:"Printeren er slukket",PrinterSwitchedOffDescription:"Printeren er slukket og Klipper kan ikke forbinde til den. Tryk på nedenstående knap for at tænde printeren:",Restart:"Genstart",ServiceReports:"{service} rapporter"},MachineSettingsPanel:{Headline:"Printer indstillinger",MotionSettings:{Acceleration:"Acceleration",MaxAccelToDecel:"Maks. accel. til decel.",MinimumCruiseRatio:"Minimum rulle forhold",SquareCornerVelocity:"Hastighed for 90° hjørne",Velocity:"Hastighed (Feedrate)"}},MacrosPanel:{Headline:"Makroer",Send:"Send"},MiniconsolePanel:{Autoscroll:"Automatisk rulning",Headline:"Terminal",HideTemperatures:"Skjul temperaturer",HideTimelapse:"Skjul Timelapse",SendCode:"Send kode...",SetupConsole:"Terminalindstillinger"},MinSettingsPanel:{IncludeMainsailCfg:"Husk at inkludere mainsail.cfg i din CONFIG fil.",IsNotDefinedInConfig:"er ikke defineret i CONFIG.",MissingConfiguration:"Konfiguration mangler",MoreInformation:"Mere information"},MiscellaneousPanel:{Headline:"Diverse",Light:{Blue:"blå",Green:"grøn",Red:"rød",White:"hvid"},RunoutSensor:{Detected:"Fundet",Empty:"Tom"}},PowerControlPanel:{Error:"Fejl",Off:"Sluk",On:"Tænd",PowerControl:"Strømstyring"},SpoolmanPanel:{Cancel:"Annuller",ChangeSpool:"Skift spool",DaysAgo:"{days} dage siden",EjectSpool:"Afmontér spole",EjectSpoolQuestion:"Er du sikker på du ønsker at afmontere spolen?",Filament:"Filament",FilamentTypeMismatch:"Materialet på den aktive spole({spoolType}) matcher ikke materialet i G-koden ({fileType}).",Headline:"Spoolman",LastUsed:"Sidst brugt",Location:"Placering",Material:"Materiale",Never:"Aldrig",NoActiveSpool:"Filamentforbrug registreres ikke. Vælg en spole for at begynde.",NoResults:"Ingen spole fundet der matcher søgekriterierne.",NoSpools:"Ingen spoler tilgængelige",NoSpoolSelected:"Ingen spole valgt. Vælg en spole for at registrere filamentforbrug.",OpenSpoolManager:"Åben SpoolMan",Refresh:"Opdatér",Search:"Søg",SelectSpool:"Vælg spole",Today:"I dag",TooLessFilament:"Den nuværende spole har muligvis ikke nok filament til det valgte print. ({spoolWeight}g af {fileWeight}g)",Weight:"vægt",Yesterday:"Igår"},StatusPanel:{CancelPrint:"Afbryd print",ClearPrintStats:"Slet printstatistik",Difference:"Opvarmning",EmptyGcodes:"Ingen G-kode tilgængelig.",EmptyJobqueue:"Der er ingen jobs i kø.",Estimate:"Estimeret",ETA:"ETA",ExcludeObject:{Cancel:"Annuller",Excluded:"Ekskluderet",ExcludeObject:"Ekskluder objekt",ExcludeObjectHeadline:"Ekskluder objekt",ExcludeObjectText:'Vil du ekskludere "{name}"?'},Filament:"Filament",File:"Fil",Files:"Filer",Flow:"Flow",Headline:"Status",Jobqueue:"Jobkø",JobqueueMoreFiles:"Ikke flere jobs | Et job til | {count} jobs tilbage",Layer:"Lag",Max:"maks",ObjectHeight:"Objekt Højde",PauseAtLayer:{Abort:"Afbryd",Accept:"Acceptér",AtLayer:"ved lag",Call:"Kør",DescriptionPauseAtLayerActive:'Denne funktion er allerede aktiv og vil køre "{call}" ved lag: {layer}. Hvis du kører kommandoen igen overskrives disse indstillinger.',DescriptionPauseNextLayerActive:'Denne funktion er allerede aktiv og vil køre "{call}" ved næste lag.',Layer:"Lag",NextLayer:"Næste lag",PauseAtLayer:"Pause ved lag",Type:"Type"},PausePrint:"Sæt print på pause",Print:"Reel printtid",PrintTime:"Print Tid",ReprintJob:"Print job igen",Requested:"Anmodet",ResumePrint:"Genoptag print",Slicer:"Slicer",Speed:"Hastighed",Status:"Status",Total:"Total",Unknown:"Ukendt"},TemperaturePanel:{AutoscaleChart:"Autoskalér diagram",Avg:"Gns",Cooldown:"Nedkøling",Current:"Nuværende",Dataset:{Power:"PWM-power",Speed:"PWM-hastighed",Target:"Indstillet temperatur",Temperature:"Nuværende temperatur"},Headline:"Temperaturer",HideMcuHostSensors:"Skjul værts/MCU sensorer",HideMonitors:"Skjul overvågere",Max:"maks",Min:"min",Name:"Navn",Presets:"Forudindstillinger",SetupTemperatures:"Temperaturvisningsindstillinger",ShowChart:"Vis diagram",ShowNameInChart:"Vis {name} i diagram",ShowNameInList:"Vis {name} på liste",State:"Status",Target:"Indstillet",TemperaturesInChart:"Temperatur [°C]",TempTooHigh:"Temperaturen er for høj for {name}! (max: {max})",TempTooLow:"Temperaturen er for lav for {name}! (min: {min})"},ToolheadControlPanel:{Absolute:"absolut",ALL:"Alle",ControlButtons:"Kontrol-knapper",CoordinateFields:"Koordinatfelter",Headline:"Kontrolpanel",PleaseConfigureSteps:"Konfigurer steps",Position:"Position",PositionOutput:"Positionsoutput",QGL:"QGL",Relative:"relativ",SettingsInterfaceControl:"Indstillinger > Interface > Control",SpeedFactor:"Hastighed",ZOffset:"Z-Offset",ZTilt:"Z-Tilt"},WebcamPanel:{All:"Alle",FPS:"FPS",Headline:"Webcam",NoWebcam:'Intet webcam tilgængeligt. Tilføj et under "Interfaceindstillinger" -> "Webcams".',UnknownWebcamService:"Ukendt Webcam service"},ZoffsetPanel:{Clear:"Nulstil",Headline:"Z-Offset",Later:"Senere",Ok:"OK",Save:"Gem",SaveConfig:"GEM KONFIGURATION",SaveInfoDescription:'Det nye z-offset er blevet beregnet og registreret. Klik på "GEM KONFIGURATION" for at gemme det nye z-offset i CONFIG og genstarte Klipper.',SaveInfoDescriptionPrint:'Det nye z-offset er blevet beregnet og registreret. Klik på "GEM KONFIGURATION" i topbaren efter endt print for at gemme det nye z-offset i CONFIG og genstarte Klipper.',SaveInfoHeadline:"Information"}},S={AreYouSure:"Er du sikker?",No:"Nej",TurnDeviceOff:"Sluk {device}",TurnDeviceOn:"Tænd {device}",Yes:"Ja"},D={Console:"Terminal",Dashboard:"Kontrolpanel","G-Code Files":"G-Code Filer","G-Code Viewer":"G-Code Viser",Heightmap:"Højdekort",History:"Historik",Machine:"Printer",Printers:"Printere",Timelapse:"Timelapse",Webcam:"Webcam"},b={Accept:"Acceptér",Base:"Udgangspunkt",ErrorText:"Noget gik galt under målingsprocessen.",Headline:"Bed-skrue justering",Retry:"Forsøg igen"},h={AddPrinter:"Tilføj Printer",AddPrintersToJson:"Tilføj venligst Printere til config.json.",CannotConnectTo:"Kan ikke forbinde med {host}.",ChangePrinter:"Skift Printer",Connecting:"Forbinder med {host}",ConnectionFailed:"Forbindelse fejlede",EditPrinter:"Rediger Printer",Hello:"Hej og velkommen til fjernbetjeningsversionen af Mainsail!",HostnameInvalid:"Ugyldigt værtsnavn/IP",HostnameIp:"Værtsnavn/IP",HostnameRequired:"Værtsnavn er påkrævet",Name:"Navn",Path:"Sti",Port:"Port",PortRequired:"Port er påkrævet",RememberToAdd:'Husk at tilføje {cors} i moonraker.conf under "cors_domains".',SelectPrinter:"Vælg printer",TryAgain:"Prøv igen",UpdatePrinter:"Opdater Printer",YouCanFindMore:"Du kan finde flere detaljer her"},T={Cancel:"Annuller",Close:"Luk",ConsoleTab:{AddFilter:"Tilføj filter",Console:"Terminal",CreateHeadline:"Nyt filter",Direction:"Retning",DirectionShell:"Sidste handling nederst",DirectionTable:"Sidste handling øverst",EditHeadline:"Rediger filter",EntryStyle:"Indtastnings-Design",EntryStyleCompact:"Kompakt",EntryStyleDefault:"Standard",Filters:"Filtre",Height:"Højde",HideTemperatures:"Skjul temperaturer",HideTimelapse:"Skjul Timelapse",Name:"Navn",Regex:"Regex",StoreButton:"Gem filter",UpdateButton:"Opdater filter"},ControlTab:{Bars:"Barer",Circle:"Cirkel",Control:"Kontrol",Cross:"Kryds",EnableXYHoming:"Aktivér kombineret X & Y homing",EstimatedExtrusionInfo:"Vis estimerede ekstruderingsinformationer",EstimatedExtrusionInfoDescription:"Vis/Skjul information om estimerede ekstruderinger baseret på ekstruderingsmængde og hastighed",HideDuringPrint:"Skjul akse kontrol under print",InvertXMovement:"Invertér X",InvertYMovement:"Invertér Y",InvertZMovement:"Invertér Z",IsDefault:" Standard",MaximumValues:"Maksimumværdier",MaximumValuesVisibility:"Vis maksimumværdier",MinimumValues:"Minimumsværdier",MotorsOff:"Slukkede motorer{isDefault}",MoveDistancesEInMm:"Distance E i mm",MoveDistancesInMm:"Distance i mm",MoveDistancesXYInMm:"Distance XY i mm",MoveDistancesZInMm:"Distance Z i mm",QuadGantryLevel:"Firarms nivellering {isDefault}",SpeedEInMms:"Hastighed E i mm/s",SpeedXY:"Hastighed XY",SpeedZ:"Hastighed Z",Style:"Stil",ValueGreaterThan:"Værdi større end {value}",ZOffsetIncrements:"Z-offset trin (i mm)",ZOffsetSaveOption:"Z-Offset Gem-mulighed",ZOffsetSaveOptionDescription:"Ændr metoden for 'gem Z-Offset'",ZTiltAdjust:"Z-Tilt justering{isDefault}"},DashboardTab:{Dashboard:"Kontrolpanel",Desktop:"Desktop",Mobile:"Mobil",ResetLayout:"Nulstil layout",Tablet:"Tablet",Widescreen:"Widescreen"},Edit:"Rediger",EditorTab:{ConfirmUnsavedChanges:"Spørg om at gemme ændringer",ConfirmUnsavedChangesDescription:"Hvis aktiv beder Editor om bekræftelse på at gemme eller kassere. Ellers bliver ændringer automatisk kasseret.",Editor:"Editor",KlipperRestartMethod:"Metode for genstart af Klipper",KlipperRestartMethodDescription:"Vælg hvilken metode der skal bruges ved brug af 'Gem & Genstart' når der redigeres i Klipper config filer.",Spaces:"Mellemrum: {count}",TabSize:"Tabuleringsstørrelse",TabSizeDescription:"Juster hvor mange mellemrum der skal tilføjes ved tryk på TAB",UseEscToClose:"Tryk ESC for at lukke Editor",UseEscToCloseDescription:"Tillader at ESC lukker Editor"},GCodeViewerTab:{BackgroundColor:"Baggrundsfarve",ExtruderColor:"Ekstruder farve",GCodeViewer:"G-Code viser",GridColor:"Grid farve",MaxFeed:"Maksimum hastighed",MinFeed:"Minimum hastighed",ProgressColor:"Fremgangsfarve",ShowAxes:"Vis akser"},GeneralTab:{"12hours":"12-timers ({time})","24hours":"24-timers ({time})",Backup:"Backup",BackupDialog:"Vælg de sektioner du ønsker at lave backup af:",CalcEstimateTime:"Beregn estimeret printtid",CalcEstimateTimeDescription:"Hvis flere er valgt vil et gennemsnit blive brugt",CalcEtaTime:"Beregn sluttidspunkt for print",CalcEtaTimeDescription:"Hvis flere er valgt vil et gennemsnit blive brugt",CalcPrintProgress:"Fremgangsberegning",CalcPrintProgressDescription:"Metode til beregning af fremgang.",CalcPrintProgressItems:{Filament:"Filament",FileAbsolute:"Filposition (absolut)",FileRelative:"Filposition (relativ)",Slicer:"Slicer (M73)"},CannotReadJson:"Kan ikke læse backup-fil",DateFormat:"Datoformat",DbConsoleHistory:"Terminal Historik",DbHistoryJobs:"Jobhistorik",DbHistoryTotals:"Totalhistorik",DbMaintenance:"Vedligeholdelse",DbNavigation:"Navigation",DbTimelapseSettings:"Timelapse indstillinger",DbView:"Vis indstillinger",EstimateValues:{Filament:"Filament",File:"Fil",Slicer:"Slicer"},Everything:"Alt",FactoryDialog:"Vælg venligst de sektioner du ønsker at nulstille:",FactoryReset:"Komplet nulstilling",General:"Generelt",Language:"Sprog",MainsailSettingsMoonrakerDb:"Mainsails indstillinger i Moonrakers database",PrinterName:"Printernavn",Reset:"Nulstil",Restore:"Gendan",RestoreDialog:"Vælg de sektioner du ønsker at gendanne fra backup:",TimeFormat:"Tidsformat"},HeightmapTab:{ColorSchemes:"Farvetemaer",Heightmap:"Højdekort",IsDefault:"(Standard)",Schemes:{GrayScale:"Gråskala",Hot:"Varm",Hsv:"TMV",Portland:"Portland",Spring:"Forår"}},InterfaceSettings:"Interfaceindstillinger",MacrosTab:{Add:"Tilføj",AddGroup:"Tilføj gruppe",AvailableMacros:"Tilgængelige makroer",ChangeMacroColor:"Skift farve på knappen.",Color:"Farve",CountMacros:"Ingen Makroer tilføjet | {count} Makro | {count} Makroer",Custom:"Brugerdefineret",CustomColor:"Brugerdefineret farve",DeletedMacro:"Makro fjernet",DeleteMacroFromGroup:"Fjern makro fra gruppe.",EditGroup:"Edit Gruppe",Error:"Fejl",Expert:"Ekspert",General:"Generelt",Group:"Gruppe",GroupMacros:"Gruppér makroer",Macrogroups:"Grupper",Macros:"Makroer",Management:"Håndtering",Name:"Navn",NoAvailableMacros:"Ingen tilgængelige makroer.",NoGroups:"Ingen grupper fundet...",NOMacros:"Ingen makroer fundet...",NoMacrosInGroup:"Ingen makroer i denne gruppe.",Primary:"Primær",Search:"Søg",Secondary:"Sekundær",ShowInStatePaused:"Vis/skjul hvis printer er på pause.",ShowInStatePrinting:"Vis/skjul hvis printer er aktiv.",ShowInStateStandby:"Vis/skjul hvis printer er inaktiv.",Simple:"Simpel",Status:"Status",Success:"Succes",UnknownGroup:"Ukendt gruppe",Warning:"Advarsel"},MiscellaneousTab:{AddGroup:"Tilføj gruppe",AddPreset:"Tilføj forudindstilling",Color:"Farve",CreateGroup:"Tilføj gruppe",CreatePreset:"Tilføj forudindstilling",End:"Slut",EndDescription:"Sidste LED i denne gruppe.",Groups:"Grupper",GroupSubTitle:"Start: {start}, Slut: {end}",LightGroups:"{name} - Grupper",LightPresets:"{name} - Forudindstillinger",Miscellaneous:"Diverse",Name:"Navn",NoDevicesFound:"Ingen enheder fundet",NoGroupFound:"Ingen gruppe fundet",NoPresetFound:"Ingen forudindstilling fundet",Presets:"Forudindstillinger",Start:"Første",StartDescription:"Første LED i denne gruppe.",UnableToLoadLight:"Kunne ikke indlæse LED",UnableToLoadPreset:"Kunne ikke indlæse forudindstilling"},NavigationTab:{Navigation:"Navigation"},PresetsTab:{AddPreset:"Tilføj forudindstilling",Cooldown:"Nedkøling",CreateHeadline:"Ny forudindstilling",CustomGCode:"Brugerdefineret G-Code",EditCooldown:"Rediger nedkøling",EditHeadline:"Rediger forudindstilling",ErrorInvalidValue:"Ugyldig værdi",ErrorNameNotUnique:"Navnet er allerede i brug",ErrorNameRequired:"Navn skal udfyldes",Name:"Navn",PreheatPresets:"Forudindstillinger",PresetInfo:"Du skal indstille mindst én temperatur eller g-kode.",PresetNamePlaceholder:"Navn (skal udfyldes)",StoreButton:"Gem forudindstilling",UpdateButton:"Opdater forudindstilling",UpdateCooldown:"Opdater nedkøling"},RemotePrintersTab:{AddPrinter:"Tilføj printer",EditPrinter:"Rediger printer",Hostname:"Værtsnavn",Name:"Navn",NameDescription:"Dette navn er ikke synligt i GUI og vil kun blive brugt til redirects.",Path:"Sti",Port:"Port",RemotePrinters:"Printere",UpdatePrinter:"Opdater printer",UseConfigJson:"InstanceDB = JSON fundet. Brug venligst config.json til at ændre på printerlisten."},Store:"Gem",TimelapseTab:{Autorender:"Autorendering",AutorenderDescription:"Hvis aktiv, vil Timelapse video automatisk blive renderet efter afsluttet print",Camera:"Kamera",CameraDescription:"Vælg hvilket kamera der skal bruges",CameraDescriptionWithSnapshotUrl:"Vælg hvilket kamera (med snapshot url) der skal bruges",CameraWarningAlreadySet:"Denne værdi er allerede indstillet i Moonrakers konfigurationsfil.",CameraWarningAlreadySetSmall:"snapshot url i [timelapse] sektionen",ConstantRateFactor:"Constant Rate Faktor",ConstantRateFactorDescription:'Konfigurerer Kvalitet / Filstørrelse af den renderede video. Kan justeres mellem 0-51, Hvor 0 er tabsfri, 23 er standard og 51 er værste kvalitet (mindste filstørrelse). En lavere værdi giver højere kvalitet, og et "normalt" område er 17-28. 17 eller 18 kan betragtes som visuelt tabsfrit.',duplicatelastframe:"Kopier sidste frame",duplicatelastframeDescription:"Kopierer sidste frame i videoen",Enabled:"Aktiveret",EnabledDescription:"Hvis inaktiv, bliver G-Kode makroer ignoreret og AutoRendering bliver sprunget over.",Extraoutputparams:"Ekstra output parametre",ExtraoutputparamsDescription:"Definerer ekstra output parametre til FFMPEG. Bemærk: Udfyldning af dette felt vil deaktivere rotationsindstillinger",FwRetract:"Firmware Retract",FwRetractDescription:"Brug firmware retraction i timelapse makroen",GcodeVerbose:"Beskrevet G-Kode",GcodeVerboseDescription:"Hvis aktiv, vil G-Code skrive informationer i terminalen",General:"Generelt",HyperlapseCycle:"Hyperlapse cyklus tid",HyperlapseCycleDescription:"Frames optages med det angivne tidsmellemrum (sek.)",Mode:"Modus",ModeDescription:'Vælg mellem "Layermacro" og "Hyperlapse" (tidsbaseret) modus',NoWebcamFound:"Intet Webcam tilgængeligt",OutputFramerate:"Output Framerate",OutputFramerateDescription:'Definerer framerate i videoen. Bemærk: Dette ignoreres hvis "variable_fps" er aktiveret',Parkhead:"Parker Hotend",ParkheadDescription:"Hvis aktiv, vil hotend blive parkeret før der tages billeder.",Parkpos:"Parkeringsposition",ParkposDescription:"Vælg parkeringsposition",ParkTime:"Parkeringstid",ParkTimeDescription:"Tilføj yderligere tid til parkering for bedre præcision.",Pixelformat:"Pixelformat",PixelformatDescription:"Definerer pixelformatet i videoen",PosDZ:"Position Z",PosDZDescription:"Parkeringspostion Z (relativ)",PosX:"Position X",PosXDescription:"Parkeringspostion X (absolut)",PosY:"Position Y",PosYDescription:"Parkeringspostion Y (absolut)",PreviewImage:"Forhåndsvisning af billede",PreviewImageDescription:"Gem en forhåndsvisning med samme navn som videoen",RenderingOptions:"Renderingsindstillinger",RetractDistance:"Retract distance",RetractDistanceDescription:"Længden af retractions.",RetractSpeed:"Retract hastighed",RetractSpeedDescription:"Hastighed der bruges til retractions.",RulesBetweenMinMax:"Værdien skal være mellem {min} og {max}!",RulesMin:"Værdien skal være minimum {min}!",RulesPositive:"Værdien skal være positiv!",RulesRequired:"Værdi påkrævet!",RulesZeroAndPositive:"Værdien skal være 0 eller højere!",SaveFrames:"Gem Frames",SaveFramesDescription:"Gem frames til zip-fil for ekstern rendering",SelectWebcam:"Vælg Webcam...",StreamDelayCompensation:'Kompensering for "Stream-Delay" forsinkelse',StreamDelayCompensationDescription:'Kompenser "frame capture"',Targetlength:"Ønsket længde",TargetlengthDescription:"Den ænskede længde på videoen når Variabel FPS er aktiveret",TimeFormatCode:"Tidsformat kode",TimeFormatCodeDescription:"Angiver hvordan tid skal defineres i output filen",Timelapse:"Timelapse",TravelSpeed:"Travel-hastighed",TravelSpeedDescription:"Travel-hastighed til og fra parkeringsposition",UnretractDistance:"Unretract distance",UnretractDistanceDescription:"Længden af unretracts.",UnretractSpeed:"Unretract hastighed",UnretractSpeedDescription:"Hastigheden der bruges til unretracts.",VariableFps:"Variabel FPS",VariableFpsDescription:"Hvis aktiv, vil framerate blive beregnet ud fra ønsket længde",VariableFpsMax:"Variabel FPS maks",VariableFpsMaxDescription:"Største værdi for variabel FPS",VariableFpsMin:"Variabel FPS min",VariableFpsMinDescription:"Mindste værdi for variabel FPS"},UiSettingsTab:{BedScrewsDialog:"Bed-skrue justeringsvindue",BedScrewsDialogDescription:"Viser vindue til hjælp med Bed-skrue justering.",BigThumbnailBackground:"vælg baggrundsfarver for stor forhåndsvisning",BoolBigThumbnail:"Stor forhåndsvisning",BoolBigThumbnailDescription:"Vis et stort billede i statuspanelet under print.",BoolHideUploadAndPrintButton:'Skjul "Upload og Print" knap',BoolHideUploadAndPrintButtonDescription:'Vis eller skjul "Upload and Print" knappen i top-baren.',ConfirmOnCoolDown:"Kræv bekræftelse på Nedkøling",ConfirmOnCoolDownDescription:"Vis en dialogboks ved Nedkøling",ConfirmOnEmergencyStop:"Kræv bekræftelse før Nødstop",ConfirmOnEmergencyStopDescription:"Viser en bekræftelses dialogboks ved tryk på Nødstop",ConfirmOnPowerDeviceChange:"Kræv bekræftelse ved ændringer på Enhedens strømtilstand",ConfirmOnPowerDeviceChangeDescription:"Vis bekræftelse ved ændringer på Enhedens strømtilstand",DefaultNavigationState:"Standard for Navigationsfanen",DefaultNavigationStateAlwaysClosed:"Altid lukket",DefaultNavigationStateAlwaysOpen:"Altid åben",DefaultNavigationStateDescription:"Vælg standardindstilling for navigationsfanen.",DefaultNavigationStateLastState:"Sidste tilstand",DisableFanAnimation:"Deaktivér animation af blæsere",DisableFanAnimationDescription:"Dette kan fjerne lidt af belastningen for nogle browsere.",DisplayCANCEL_PRINT:"Vis Afbryd print",DisplayCANCEL_PRINTDescription:"Viser Afbryd print knappen konstant - ingen tofaktor godkendelse nødvendig.",GcodeThumbnails:"G-Kode forhåndsvisninger",GcodeThumbnailsDescription:"Klik på knappen for mere information.",Guide:"Guide",HideSaveConfigButtonForBedMesh:"Skjul GEM KONFIGURATION knap for ændringer i højdekort",HideSaveConfigButtonForBedMeshDescription:"Skjul GEM KONFIGURATION, hvis det kun er ændringer i højdekort der venter på at blive gemt i Klipper.",HideUpdateWarnings:"Skjul opdateringsadvarsler",HideUpdateWarningsDescription:"Dette vil skjule alle advarsler om opdateringer i Opdateringsmanageren.",LockSliders:"Lås sliders på touch-enheder",LockSlidersDelay:"Forsinkelse på låsning af sliders",LockSlidersDelayDescription:"Sliders vil låse efter det angivne tidsrum (sek). Hvis sat til 0 eller efterladt tomt, vil Sliders kun låse ved opdatering/genindlæsning af siden.",LockSlidersDescription:"Sliders skal låses op på touchenheder før de kan ændres.",Logo:"Logo",ManualProbeDialog:"Probe justeringsvindue",ManualProbeDialogDescription:"Viser vindue til hjælp med justering af Probe/Z-offset",NavigationStyle:"Navigationsstil",NavigationStyleDescription:"Skift navigationens udseende",NavigationStyleIconsAndText:"Ikoner + Tekst",NavigationStyleIconsOnly:"Kun ikoner",PowerDeviceName:"Printer strømenhed",PowerDeviceNameDescription:"Vælg hvilken strømenhed i Moonraker der styrer printerens strøm.",Primary:"Primær",PrintstatusThumbnailZoom:"Stort thumbnail zoom",PrintstatusThumbnailZoomDescription:"Dette vil deaktivere zoom-effekten på thumbnails i status panelet.",ProgressAsFavicon:"Vis fremgang som favicon",ProgressAsFaviconDescription:"Skift Mainsail logo favicon til fremgangscirkel.",ScrewsTiltAdjustDialog:"Bed-skrue justeringsvindue til Probe",ScrewsTiltAdjustDialogDescription:"Viser vindue til hjælp med Bed-skrue justeringer ved brug af proben.",TempchartHeight:"Temperaturgrafens højde",TempchartHeightDescription:"Ændrer højden på grafen i Temperaturvisningen.",Theme:"Tema",ThemeDark:"Mørkt",ThemeDescription:"Ændr grundfarverne og tonen af applikationen",ThemeLight:"Lyst",UiSettings:"UI-indstillinger"},Update:"Opdater",WebcamsTab:{AddWebcam:"Tilføj webcam",CreateWebcam:"Nyt Webcam",EditCrowsnestConf:"Redigér crowsnest.conf",EditWebcam:"Rediger Webcam",EnableAudio:"Aktivér lyd",FlipWebcam:"Vend webcam-billedet:",HideFps:"Skjul FPS",Hlsstream:"HLS Stream",Horizontally:"horisontalt",IconBed:"Bed",IconCam:"Kamera",IconDoor:"Dør",IconFilament:"Filament",IconHot:"Bål",IconMcu:"MCU",IconNozzle:"Dyse",IconPrinter:"Printer",Ipstream:"IP Kamera",JMuxerStream:"Rå h264 stream (jmuxer)",Mjpegstreamer:"MJPEG-Streamer",MjpegstreamerAdaptive:"Adaptiv MJPEG-Streamer (eksperimental)",Name:"Navn",NameAlreadyExists:"Navnet bruges allerede",Required:"Krævet",Rotate:"Rotér",SaveWebcam:"Gem Webcam",Service:"Service",TargetFPS:"Ønsket FPS",UpdateWebcam:"Opdater Webcam",UrlSnapshot:"URL Snapshot",UrlStream:"URL Stream",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"vertikalt",Webcams:"Webcams",WebrtcCameraStreamer:"WebRTC (camera-streamer)",WebrtcGo2rtc:"WebRTC (go2rtc)",WebrtcJanus:"WebRTC (janus-gateway)",WebrtcMediaMTX:"WebRTC (MediaMTX)"}},F={AllFiles:"Alle",Autorender:"Autorendering",Cancel:"Annuller",Create:"Opret",CreateNewDirectory:"Ny mappe",CurrentPath:"Du er her",Delete:"Slet",DeleteDirectory:"Slet mappe",DeleteDirectoryQuestion:'Vil du slette mappen "{name}" og alt dens indhold?',DeleteSelectedQuestion:"Er du sikker på du vil slette alle {count} valgte filer?",DeleteSingleFileQuestion:'Vil du slette "{name}"?',Download:"Download",DuplicateLastframe:"Dupliker sidste frame",Empty:"Ingen færdige Timelapse filer fundet.",Enabled:"Aktiv",EstimatedLength:"Estimeret længde",Files:"Filer",Filesize:"Filstørrelse",Fixed:"Fast",Framerate:"Framerate",Frames:"Frames",Free:"Ledig",FreeDisk:"Ledig plads",LastModified:"Sidst ændret",MaxFramerate:"Maks. framerate",MinFramerate:"Min. framerate",Name:"Navn",NewDirectory:"Ny mappe",NoActiveTimelapse:"Ingen Timelapses.",Preview:"Forhåndsvisning",RefreshCurrentDirectory:"Opdater mappe",Rename:"Omdøb",RenameDirectory:"Omdøb mappe",RenameFile:"Omdøb fil",Render:"Rendering",RenderSettings:"Indstillinger for rendering",SaveFrames:"Gem frames",Search:"Søg",StartRender:"Start rendering",Status:"Status",TargetFps:"Ønsket FPS",Targetlength:"Ønsket længde",TimelapseFiles:"Timelapse Filer",TimelapseRendering:"Timelapse rendering",TimelapseRenderingSuccessful:"Timelapse rendering succesfuld",Total:"Total",Type:"Type",Used:"Brugt",Variable:"Variabel",Video:"Video"},P="Dansk",C={App:e,BedScrews:t,ConnectionDialog:r,Console:i,CoolDownDialog:n,DevicesDialog:a,Dialogs:o,Editor:l,EmergencyStopDialog:s,Files:d,FullscreenUpload:p,GCodeViewer:m,Heightmap:g,History:u,JobQueue:c,Machine:k,ManualProbe:f,Panels:v,PowerDeviceChangeDialog:S,Router:D,ScrewsTiltAdjust:b,SelectPrinterDialog:h,Settings:T,Timelapse:F,title:P};export{e as App,t as BedScrews,r as ConnectionDialog,i as Console,n as CoolDownDialog,a as DevicesDialog,o as Dialogs,l as Editor,s as EmergencyStopDialog,d as Files,p as FullscreenUpload,m as GCodeViewer,g as Heightmap,u as History,c as JobQueue,k as Machine,f as ManualProbe,v as Panels,S as PowerDeviceChangeDialog,D as Router,b as ScrewsTiltAdjust,h as SelectPrinterDialog,T as Settings,F as Timelapse,C as default,P as title}; diff --git a/assets/dds-C4nWUSlI.js b/assets/dds-C4nWUSlI.js new file mode 100644 index 0000000..bc6f380 --- /dev/null +++ b/assets/dds-C4nWUSlI.js @@ -0,0 +1 @@ +import{A as D,R as At,L as yt,I as pt,_ as Ct,a as T,F as w,T as H,C as g}from"./Viewer-DVCEMRp5.js";import{C as Ft}from"./cubemapToSphericalPolynomial-DI79UW0r.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./index-Bku7SJna.js";import"./echarts-DzoUeqWp.js";import"./codemirror-ZSHHXwGs.js";D.prototype._partialLoadFile=function(F,n,e,r,o=null){const i=t=>{e[n]=t,e._internalCount++,e._internalCount===6&&r(e)},u=(t,l)=>{o&&t&&o(t.status+" "+t.statusText,l)};this._loadFile(F,i,void 0,void 0,!0,u)};D.prototype._cascadeLoadFiles=function(F,n,e,r=null){const o=[];o._internalCount=0;for(let i=0;i<6;i++)this._partialLoadFile(e[i],i,o,n,r)};D.prototype._cascadeLoadImgs=function(F,n,e,r,o=null,i){const u=[];u._internalCount=0;for(let t=0;t<6;t++)this._partialLoadImg(r[t],t,u,F,n,e,o,i)};D.prototype._partialLoadImg=function(F,n,e,r,o,i,u=null,t){const l=At();yt(F,c=>{e[n]=c,e._internalCount++,r&&r.removePendingData(l),e._internalCount===6&&i&&i(o,e)},(c,f)=>{r&&r.removePendingData(l),u&&u(c,f)},r?r.offlineProvider:null,t),r&&r.addPendingData(l)};D.prototype.createCubeTextureBase=function(F,n,e,r,o=null,i=null,u,t=null,l=!1,a=0,s=0,c=null,f=null,G=null,y=!1,p=null){const A=c||new pt(this,7);A.isCube=!0,A.url=F,A.generateMipMaps=!r,A._lodGenerationScale=a,A._lodGenerationOffset=s,A._useSRGBBuffer=!!y&&this._caps.supportSRGBBuffers&&(this.version>1||this.isWebGPU||!!r),A!==c&&(A.label=F.substring(0,60)),this._doNotHandleContextLost||(A._extension=t,A._files=e,A._buffer=p);const _=F;this._transformTextureUrl&&!c&&(F=this._transformTextureUrl(F));const B=F.split("?")[0],P=B.lastIndexOf("."),L=t||(P>-1?B.substring(P).toLowerCase():""),O=Ct(L),k=(d,h)=>{F===_?i&&d&&i(d.status+" "+d.statusText,h):(T.Warn("Failed to load ".concat(F,", falling back to the ").concat(_)),this.createCubeTextureBase(_,n,e,!!r,o,i,u,t,l,a,s,A,f,G,y,p))};if(O)O.then(d=>{const h=R=>{f&&f(A,R),d.loadCubeData(R,A,l,o,i)};p?h(p):e&&e.length===6?d.supportCascades?this._cascadeLoadFiles(n,R=>h(R.map(X=>new Uint8Array(X))),e,i):i?i("Textures type does not support cascades."):T.Warn("Texture loader does not support cascades."):this._loadFile(F,R=>h(new Uint8Array(R)),void 0,void 0,!0,k)});else{if(!e||e.length===0)throw new Error("Cannot load cubemap because files were not defined, or the correct loader was not found.");this._cascadeLoadImgs(n,A,(d,h)=>{G&&G(d,h)},e,i)}return this._internalTexturesCache.push(A),A};const dt=542327876,Q=131072,V=512,Y=4,Z=64,S=131072;function N(F){return F.charCodeAt(0)+(F.charCodeAt(1)<<8)+(F.charCodeAt(2)<<16)+(F.charCodeAt(3)<<24)}function _t(F){return String.fromCharCode(F&255,F>>8&255,F>>16&255,F>>24&255)}const q=N("DXT1"),tt=N("DXT3"),et=N("DXT5"),$=N("DX10"),rt=113,at=116,nt=2,st=10,Gt=88,j=31,mt=0,ht=1,ot=2,ft=3,v=4,it=7,J=20,lt=21,bt=22,Bt=23,xt=24,Rt=25,Ot=26,Ut=28,wt=32;class C{static GetDDSInfo(n){const e=new Int32Array(n.buffer,n.byteOffset,j),r=new Int32Array(n.buffer,n.byteOffset,j+4);let o=1;e[ot]&Q&&(o=Math.max(1,e[it]));const i=e[lt],u=i===$?r[wt]:0;let t=0;switch(i){case rt:t=2;break;case at:t=1;break;case $:if(u===st){t=2;break}if(u===nt){t=1;break}}return{width:e[v],height:e[ft],mipmapCount:o,isFourCC:(e[J]&Y)===Y,isRGB:(e[J]&Z)===Z,isLuminance:(e[J]&S)===S,isCube:(e[Ut]&V)===V,isCompressed:i===q||i===tt||i===et,dxgiFormat:u,textureType:t}}static _GetHalfFloatAsFloatRGBAArrayBuffer(n,e,r,o,i,u){const t=new Float32Array(o),l=new Uint16Array(i,r);let a=0;for(let s=0;s>8)}static _GetRGBArrayBuffer(n,e,r,o,i,u,t,l){const a=new Uint8Array(o),s=new Uint8Array(i,r);let c=0;for(let f=0;f0?o.sphericalPolynomial=Ft.ConvertCubeMapToSphericalPolynomial({size:f[v],right:s[0],left:s[1],up:s[2],down:s[3],front:s[4],back:s[5],format:5,type:1,gammaSpace:!1}):o.sphericalPolynomial=void 0}}C.StoreLODInAlphaChannel=!1;export{C as DDSTools}; diff --git a/assets/ddsTextureLoader-7rBWB6fI.js b/assets/ddsTextureLoader-7rBWB6fI.js new file mode 100644 index 0000000..68f3517 --- /dev/null +++ b/assets/ddsTextureLoader-7rBWB6fI.js @@ -0,0 +1 @@ +import{d as r}from"./Viewer-DVCEMRp5.js";import{DDSTools as n}from"./dds-C4nWUSlI.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./index-Bku7SJna.js";import"./echarts-DzoUeqWp.js";import"./codemirror-ZSHHXwGs.js";import"./cubemapToSphericalPolynomial-DI79UW0r.js";class w{constructor(){this.supportCascades=!0}loadCubeData(e,a,l,o){const p=a.getEngine();let i,m=!1,t=1e3;if(Array.isArray(e))for(let s=0;s1)&&a.generateMipMaps,p._unpackFlipY(i.isCompressed),n.UploadDDSLevels(p,a,d,i,m,6,-1,s),!i.isFourCC&&i.mipmapCount===1?p.generateMipMapsForCubemap(a):t=i.mipmapCount-1}else{const s=e;i=n.GetDDSInfo(s),a.width=i.width,a.height=i.height,l&&(i.sphericalPolynomial=new r),m=(i.isRGB||i.isLuminance||i.mipmapCount>1)&&a.generateMipMaps,p._unpackFlipY(i.isCompressed),n.UploadDDSLevels(p,a,s,i,m,6),!i.isFourCC&&i.mipmapCount===1?p.generateMipMapsForCubemap(a,!1):t=i.mipmapCount-1}p._setCubeMapTextureParams(a,m,t),a.isReady=!0,a.onLoadedObservable.notifyObservers(a),a.onLoadedObservable.clear(),o&&o({isDDS:!0,width:a.width,info:i,data:e,texture:a})}loadData(e,a,l){const o=n.GetDDSInfo(e),p=(o.isRGB||o.isLuminance||o.mipmapCount>1)&&a.generateMipMaps&&Math.max(o.width,o.height)>>o.mipmapCount-1===1;l(o.width,o.height,p,o.isFourCC,()=>{n.UploadDDSLevels(a.getEngine(),a,e,o,p,1)})}}export{w as _DDSTextureLoader}; diff --git a/assets/de-P4W13_SZ.js b/assets/de-P4W13_SZ.js new file mode 100644 index 0000000..eb70ebf --- /dev/null +++ b/assets/de-P4W13_SZ.js @@ -0,0 +1 @@ +const e={Notifications:{BrowserWarnings:{Description:"Die verwendete {name} Version ({version}) ist veraltet und wird nicht vollständig unterstützt. Mainsail benötigt die Version {minVersion} oder höher.",Headline:"Veralteter Browser"},DependencyDescription:"Die momentane {name} Version unterstützt nicht alle Funktionen von Mainsail. Aktualisiere {name} mindestens auf Version {neededVersion}.",DependencyName:"Abhängigkeit: {name}",DismissAll:"Alles verwerfen",KlipperWarnings:{DeprecatedOption:"Option '{option}' im Abschnitt '{section}' ist veraltet und wird in einem zukünftigen Release entfernt.",DeprecatedOptionHeadline:"Veralterte Klipper Option",DeprecatedValue:"Wert '{value}' in Option '{option}' im Abschnitt '{section}' ist veraltet und wird in einem zukünftigen Release entfernt.",DeprecatedValueHeadline:"Veralteter Klipper Wert",KlipperRuntimeWarning:"Klipper Laufzeitwarnung",KlipperWarning:"Klipper Warnung"},MaintenanceReminder:"Wartungserinnerung",MaintenanceReminderText:'Wartung "{name}" ist fällig.',MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"Beim Laden der Moonraker-Komponente '{component}' wurde ein Fehler festgestellt. Bitte prüfe die Logdatei und behebe das Problem.",MoonrakerFailedInitComponentDescription:"Beim Initialisieren der Moonraker-Komponente '{component}' wurde ein Fehler festgestellt. Bitte prüfe die Logdatei und behebe das Problem.",MoonrakerInitComponent:"Init. Moonraker: {component}",MoonrakerWarning:"Moonraker Warnung",UnparsedConfigOption:"Nicht erkannte Config-Option '{option}: {value}' in Abschnitt [{section}] entdeckt. Dies kann eine Option sein, die nicht mehr verfügbar ist, oder das Ergebnis eines Moduls sein, das nicht geladen werden konnte. In Zukunft wird dies zu einem Startfehler führen.",UnparsedConfigSection:"Nicht erkannter Config-Abschnitt [{section}] gefunden. Dies kann das Ergebnis einer Komponente sein, die nicht geladen werden konnte. In Zukunft wird dies zu einem Startfehler führen."},Never:"nie",NextReboot:"nächsten Reboot",NoNotification:"Keine Benachrichtigung vorhanden",Notifications:"Benachrichtigungen",OneDayShort:"1T",OneHourShort:"1Std",OneWeekShort:"1W",Remind:"Erinnere:",ShowDetails:"Details anzeigen",TmcOtFlag:"Stepper-Treiber Fehler: OT-Flag ist gesetzt",TmcOtFlagText:"Der Stepper-Treiber '{Name}' hat das OT-Flag ausgelöst und funktioniert nicht mehr. Dies kann durch einen zu hohen Strom verursacht werden. Bitte überprüfe die Einstellungen und die Kühlung des Steppertreibers.",TmcOtpwFlag:"Stepper-Treiber Fehler: OTPW-Flag ist gesetzt",TmcOtpwFlagText:"Der Stepper-Treiber '{Name}' hat das OTPW-Flag ausgelöst und funktioniert möglicherweise nicht mehr, wenn er noch heißer wird. Dies ist ein Hinweis auf einen Überhitzungszustand. Dies kann durch einen zu hohen Strom verursacht werden. Bitte überprüfe die Einstellungen und die Kühlung des Steppertreibers."},NumberInput:{GreaterOrEqualError:"Muss größer oder gleich {min} sein!",MustBeBetweenError:"Muss zwischen {min} und {max} liegen!",NoEmptyAllowedError:"Feld darf nicht leer sein!"},Printers:"Drucker",TextfieldWithCopy:{Copied:"Kopiert!"},TheServiceWorker:{DescriptionNeedUpdate:"Der lokale Cache ist veraltet und muss aktualisiert werden. Bitte klicke auf den Button unten, um den Cache zu aktualisieren.",TitleNeedUpdate:"PWA benötigt ein Update",Update:"aktualisieren"},ThrottledStates:{DescriptionCurrentlyThrottled:"rPi ARM-Kern(e) sind derzeit gedrosselt.",DescriptionFrequencyCapped:"rPi ARM max Frequenz ist derzeit auf 1,2 GHz begrenzt.",DescriptionPreviouslyFrequencyCapped:"Die maximale ARM-Frequenz des rPi war seit dem letzten Einschalten mindestens einmal auf 1,2 GHz begrenzt.",DescriptionPreviouslyTemperatureLimited:"Die Temperatur des rPi uC (nur 3A+/3B+) lag seit dem letzten Einschalten mindestens einmal über dem Soft-Limit (Standard 60C).",DescriptionPreviouslyThrottled:"rPI ARM-Kern(e) wurde(n) seit dem letzten Einschalten mindestens einmal gedrosselt.",DescriptionPreviouslyUnderVolted:"rPI-Versorgungsspannung ist seit dem letzten Einschalten mindestens einmal unter 4,65 V gefallen.",DescriptionTemperatureLimitActive:"Die Temperatur des rPi uC (nur 3A+/3B+) liegt derzeit über dem Soft-Limit (Standard 60C).",DescriptionUnderVoltageDetected:"rPI-Versorgungsspannung derzeit unter 4,65V",TitleCurrentlyThrottled:"Drosselung aktiv",TitleFrequencyCapped:"Frequenz begrenzt",TitlePreviouslyFrequencyCapped:"Vorh. Frequenzbegrenzung registriert",TitlePreviouslyTemperatureLimited:"Vorh. Temperaturbegrenzung registriert",TitlePreviouslyThrottled:"Vorh. Drosselung registriert",TitlePreviouslyUnderVolted:"Vorh. Unterspannung registriert",TitleTemperatureLimitActive:"Temperaturgrenze aktiv",TitleUnderVoltageDetected:"Unterspannung erkannt"},Titles:{Complete:"Fertiggestellt - {filename}",Error:"FEHLER",Pause:"Druck pausiert",PrinterOff:"Drucker AUS",Printing:"{percent}% Drucken - {filename}",PrintingETA:"{percent}% Drucken - ETA: {eta} - {filename}"},TopBar:{CannotUploadTheFile:"Hochladen nicht möglich!",EmergencyStop:"Notaus",SAVE_CONFIG:"SAVE CONFIG",Uploading:"Hochladen",UploadOfFileSuccessful:"Hochladen von {file} erfolgreich!",UploadPrint:"Hochladen & Drucken"},TopCornerMenu:{Cancel:"Abbrechen",ConfirmationDialog:{Description:{HostReboot:"Ein Neustart des Hosts wird zum Abbruch des aktuellen Druckauftrags führen!",HostShutdown:"Ein Herunterfahren des Hosts wird zum Abbruch des aktuellen Druckauftrags führen!",KlipperFirmwareRestart:"Ein Neustart der Klipper Firmware wird zum Abbruch des aktuellen Druckauftrags führen!",KlipperRestart:"Ein Neustart von Klipper wird zum Abbruch des aktuellen Druckauftrags führen!",KlipperStop:"Ein Stopp von Klipper wird zum Abbruch des aktuellen Druckauftrags führen!",ServiceRestart:"Ein Neustart dieses Dienstes kann zum Abbruch des aktuellen Druckauftrags führen!",ServiceStart:"Ein Start dieses Dienstes kann zum Abbruch des aktuellen Druckauftrags führen!",ServiceStop:"Ein Stopp dieses Dienstes kann zum Abbruch des aktuellen Druckauftrags führen!"},Title:{HostReboot:"Host Neustart",HostShutdown:"Host Herunterfahren",KlipperFirmwareRestart:"Klipper Firmware Neustart",KlipperRestart:"Klipper Neustart",ServiceRestart:"Dienst Neustart",ServiceStart:"Dienst Start",ServiceStop:"Dienst Stop"}},HostControl:"Host-Steuerung",KlipperControl:"Klipper-Steuerung",KlipperFirmwareRestart:"Firmware Neustart",KlipperRestart:"Neustart",PowerDevices:"Stromversorgung",Reboot:"Neustart",Restart:"Neustart",ServiceControl:"Dienst-Steuerung",Shutdown:"Herunterfahren",Start:"Start",Stop:"Stop"},UpdateDialog:{Close:"Schließen",Empty:"Leer",Recovering:"Wiederherstellung {software}...",RecoveringDone:"Wiederherstellung {software} abgeschlossen!",Updating:"Aktualisiere {software}...",UpdatingDone:"Aktualisierung {software} abgeschlossen!"}},n={Abort:"abbrechen",Accept:"bestätigen",Adjusted:"angepasst",Description:"Klick auf ANGEPASST wenn die aktuelle Schraube eingestellt wurde. Klick auf BESTÄTIGEN um fortzufahren ohne Anpassung.",Headline:"Bettschrauben",ScrewAccepted:"bestätigte Schrauben",ScrewIndex:"Index der Schraube",ScrewName:"Name der Schraube",ScrewOutput:"{current} von {max}"},t={AreYouSure:"Bist du sicher?",CancelJob:"Druck abbrechen",No:"Nein",Yes:"Ja"},r={CannotConnectTo:"Kann keine Verbindung zu Moonraker ({host}) herstellen.",CheckMoonrakerLog:"Wenn diese Meldung wiederholt erscheint, schaue bitte in die Logdatei unter:",Connecting:"Verbinde zu {host}",ErrorMessage:"Fehler-Nachricht: {message}",Failed:"Verbindung fehlgeschlagen",Help:"Hilfe",Initializing:"Initialisieren",TryAgain:"Erneut versuchen"},i={CommandList:"Kommandoliste",Empty:"Leer",HideTemperatures:"Temperaturen ausblenden",HideTimelapse:"Timelapse ausblenden",Search:"Suchen",SetupConsole:"Einstellungen"},a={AreYouSure:"Bist du sicher?",CoolDown:"Abkühlen",No:"Nein",Yes:"Ja"},s={CanBusInfo:"Nur nicht zugewiesene Knoten können erkannt werden. Es wird empfohlen, nur ein nicht zugewiesenes Gerät an den Can-Bus anzuschließen, um Kommunikationsprobleme zu vermeiden. Klicke hier für weitere Informationen:",ClickRefresh:"Klicke auf den Aktualisieren-Button, um die Geräte zu aktualisieren.",DevicePath:"Gerätepfad",Formats:"Formate",Headline:"Geräte",HideSystemEntries:"Systemeinträge ausblenden",LibcameraId:"Libcamera ID",NoDeviceFound:"Kein Gerät gefunden. Bitte überprüfe die Verbindung und klicke auf den Aktualisieren-Button.",PathByHardware:"Hardwarepfad",PathById:"ID-Pfad",Refresh:"Aktualisieren",Resolutions:"Auflösungen"},o={StartPrint:{Cancel:"abbrechen",DoYouWantToStartFilename:"Willst du {filename} starten?",DoYouWantToStartFilenameFilament:"Willst du {filename} mit dem folgenden Filament starten?",Headline:"Starte Job",Print:"drucken",Timelapse:"Zeitraffer"}},l={ConfigReference:"Konfig-Referenz",DeviceDialog:"Geräte",DontSave:"Nicht speichern",Downloading:"Herunterladen",FailedSave:"{filename} konnte nicht hochgeladen werden!",FileReadOnly:"schreibgeschützt",FileStructure:"Dateiaufbau",SaveClose:"Speichern & schließen",SaveRestart:"Speichern & Neustart",SuccessfullySaved:"{filename} erfolgreich gespeichert.",UnsavedChanges:"Ungespeicherte Änderungen",UnsavedChangesMessage:"Möchtest du die Änderungen an {filename} speichern?",UnsavedChangesSubMessage:"Deine Änderungen werden verloren gehen wenn du sie nicht speicherst. Du kannst diese Meldung in den Editor-Einstellungen deaktivieren.",Uploading:"Hochladen"},u={AreYouSure:"Bist du sicher?",EmergencyStop:"Notaus",No:"Nein",Yes:"Ja"},d={AddBatchToQueue:"Stapel zur Auftragswarteschlange hinzufügen",AddToQueue:"Zur Auftragswarteschlange hinzufügen",AllFiles:"Alle",BedTemp:"Bett Temp.",Cancel:"Abbrechen",ChamberTemp:"Kammer Temp.",Count:"Anzahl",Create:"Erstellen",CreateNewDirectory:"Ordner erstellen",CurrentPath:"Aktueller Pfad",Delete:"Löschen",DeleteDirectory:"Verzeichnis löschen",DeleteDirectoryQuestion:'Willst du wirklich das Verzeichnis "{name}" mit seinem gesamten Inhalt löschen?',DeleteSelectedQuestion:"Sollen wirklich {count} ausgewählte Dateien gelöscht werden?",DeleteSingleFileQuestion:'Soll die Datei "{name}" wirklich gelöscht werden?',Download:"Herunterladen",Duplicate:"duplizieren",DuplicateFile:"Datei duplizieren",EditFile:"Datei bearbeiten",Empty:"Leer",ExtruderTemp:"Extruder Temp.",FilamentName:"Filament Name",FilamentType:"Filament Typ",FilamentUsage:"Filamentverbrauch",FilamentWeight:"Filamentgewicht",Files:"Dateien",Filesize:"Dateigröße",Free:"Frei",FreeDisk:"Freier Speicherplatz",GCodeFiles:"G-Code Dateien",GcodesRootDirectoryDoesntExists:'Keinen G-Code Ordner gefunden. Bitte überprüfe die Option "path" im Abschnitt [virtual_sdcard] in der Klipper Konfiguration.',HiddenFiles:"Versteckte Dateien",InvalidNameAlreadyExists:"Name existiert bereits, bitte wähle einen anderen Namen.",InvalidNameEmpty:"Feld darf nicht leer sein!",LastEndTime:"Letzte Endzeit",LastFilamentUsed:"Letzter Filamentverbrauch",LastModified:"Zuletzt geändert",LastPrintDuration:"Letzte Druckzeit",LastStartTime:"Letzte Startzeit",LastTotalDuration:"Letzte Gesamtzeit",LayerHeight:"Schichthöhe",Name:"Name",NewDirectory:"Neues Verzeichnis",NozzleDiameter:"Düsendurchmesser",ObjectHeight:"Objekthöhe",Preheat:"Vorheizen",PrintedFiles:"Bereits gedruckt",PrintStart:"Druck starten",PrintTime:"Druckdauer",RefreshCurrentDirectory:"Verzeichnis aktualisieren",Rename:"Umbenennen",RenameDirectory:"Verzeichnis umbenennen",RenameFile:"Datei umbenennen",ScanMeta:"Metadaten scannen",ScanMetaSuccess:"Metadaten von {filename} wurden erfolgreich gescannt.",Search:"Suchen",SetupCurrentList:"Einstellungen",Slicer:"Slicer",SuccessfullyCreated:"{filename} erfolgreich erstellt.",SuccessfullyDeleted:"{filename} erfolgreich gelöscht.",SuccessfullyMoved:"{filename} erfolgreich verschoben.",SuccessfullyRenamed:"{filename} erfolgreich umbenannt.",SuccessfullyUploaded:"Hochladen von {filename} erfolgreich!",Total:"Gesamt",UploadNewGcode:"G-Code hochladen",Used:"Belegt",View3D:"3D Betrachtung"},c={CannotUploadFile:"Datei konnte nicht hochgeladen werden!",DropFilesToUploadFiles:"Datei ablegen zum Hochladen"},g={ClearLoadedFile:"Löschen",CNCMode:"CNC Modus",ColorMode:"Farbmodus",Downloading:"Downloaden",ForceLineRendering:"Erzwinge Liniendarstellung",HDRendering:"HD Darstellung (Runde Extrusionen)",High:"Hoch",LoadCurrentFile:"Momentane Datei",LoadLocal:"Lokale Datei",Low:"Gering",Max:"Max",Medium:"Mittel",ReloadRequired:"Neu laden erforderlich",Rendering:"Rendering",RenderQuality:"Darstellungsqualität",ShowGCode:"Zeige G-Code",ShowObjectSelection:"Zeige Objektauswahl",ShowToolhead:"Zeige Werkzeugkopf",ShowTravelMoves:"Zeige Bewegungen im Eilgang",SpecularLighting:"Glanzlichter",Title:"G-Code Betrachter",Tracking:"Tracking",Transparency:"Transparenz",Ultra:"Ultra",VoxelMode:"Voxel Modus (ASMBL)"},m={Abort:"abbruch",BedMeshCalibrate:"Bed Mesh Kalibrierung",BedMeshRemove:"Bed Mesh entfernen",Calibrate:"kalibrieren",Clear:"Löschen",CurrentMesh:{Headline:"Aktuelles Mesh",Max:"Max",Min:"Min",Name:"Name",Range:"Spannweite",Size:"Größe"},DeleteBedMeshProfile:"Lösche Bed Mesh",DoYouReallyWantToDelete:'Möchtest du das Profil "{name}" wirklich löschen?',ErrorKlipperNotReady:"Klipper nicht bereit. Heightmap deaktiviert.",Flat:"Flach",Heightmap:"Heightmap",InvalidNameAlreadyExists:"Das Profil existiert bereits, bitte wähle einen anderen Profilnamen.",InvalidNameAscii:"Name ist ungültig. Nur ASCII Zeichen sind erlaubt.",InvalidNameEmpty:"Feld darf nicht leer sein!",InvalidNameReserved:"Das Profil 'default' ist reserviert, bitte wähle einen anderen Profilnamen.",Mesh:"Mesh",Name:"Name",NoBedMeshHasBeenLoadedYet:"Es wurde noch kein Bed Mesh geladen.",NoProfile:"Kein Profil verfügbar",Probed:"Abgetastet",Profiles:"Profile",Remove:"löschen",Rename:"umbenennen",RenameBedMeshProfile:"Bed Mesh umbenennen",ScaleGradient:"Farbverlauf skalieren",ScaleZMax:"Skaliere z-max.",TitleCalibrate:"Neues Bed Mesh kalibrieren",TitleClear:"Lösche Bed Mesh",TitleHomeAll:"Home alle",Wireframe:"Drahtgitter"},h={AddANote:"Eine Notiz hinzufügen",AddMaintenance:"Wartung hinzufügen",AddNote:"Notiz hinzufügen",AddToQueueSuccessful:"Datei {filename} zur Warteschlange hinzugefügt.",AllJobs:"Alle",AvgPrinttime:"Druckzeit - Ø",Cancel:"abbrechen",Chart:"Diagramm",CreateNote:"Notiz anlegen",DateBasedReminder:"Datum",DateBasedReminderDescription:"Diese Erinnerung basiert auf dem Datum.",Days:"Tage",Delete:"Löschen",DeleteSelectedQuestion:"Sollen wirklich {count} ausgewählte Jobs gelöscht werden?",DeleteSingleJobQuestion:"Soll der Job wirklich gelöscht werden?",Details:"Details",EditMaintenance:"Wartung bearbeiten",EditNote:"Notiz bearbeiten",Empty:"leer",EndTime:"Endzeit",EntryCreatedAt:"Erstellt am {date}.",EntryNextPerform:"Nächste Ausführung:",EntryPerformedAt:"Ausgeführt am {date}.",EntrySince:"Verwendet seit:",EstimatedFilament:"Geschätzte Filamentlänge",EstimatedFilamentWeight:"Geschätztes Filamentgewicht",EstimatedTime:"Geschätzte Zeit",Filament:"Filament",FilamentBasedReminder:"Filament",FilamentBasedReminderDescription:"Diese Erinnerung basiert auf dem Filamentverbrauch.",FilamentCalc:"Geschätztes Filament",FilamentUsage:"Filamentverbrauch",FilamentUsed:"Filament verwendet - gesamt",Filename:"Dateiname",Filesize:"Dateigröße",FirstLayerBedTemp:"Erste Schicht Bett Temp.",FirstLayerExtTemp:"Erste Schicht Ext. Temp.",FirstLayerHeight:"Erste Schicht Höhe",HistoryFilamentUsage:"Filament",HistoryPrinttimeAVG:"Drucke",Hours:"Stunden",InvalidNameEmpty:"Ungültiger Name. Name darf nicht leer sein!",JobDetails:"Job Details",Jobs:"Drucke",LastModified:"Zuletzt geändert",LayerHeight:"Schichthöhe",LoadCompleteHistory:"Lade vollständige Historie",LongestPrinttime:"Druckzeit - längste",Maintenance:"Wartung",MaintenanceEntries:"Wartungseinträge",Meter:"Meter",Name:"Name",NoReminder:"Keine Erinnerung",Note:"Notiz",ObjectHeight:"Objekthöhe",OneTime:"Einmalig",Perform:"ausführen",Performed:"ausgeführt",PerformedAndReschedule:"ausgeführt und neu planen",PerformMaintenance:"Wartung ausführen",PrintDuration:"Druckdauer",PrintHistory:"Historie",PrintJobs:"Drucke",PrintTime:"Druckzeit",PrinttimeAvg:"Druckzeit - Ø",PrinttimeBasedReminder:"Druckzeit",PrinttimeBasedReminderDescription:"Diese Erinnerung basiert auf der Druckzeit.",Reminder:"Erinnerung",Repeat:"Wiederholen",Reprint:"Erneut drucken",Save:"speichern",Search:"Suchen",SelectedFilamentUsed:"Ausg. Filamentverbrauch",SelectedJobs:"Ausg. Drucke",SelectedPrinttime:"Ausg. Druckzeit",Settings:"Einstellungen",Slicer:"Slicer",SlicerVersion:"Slicerversion",StartTime:"Startzeit",Statistics:"Statistik",Status:"Status",StatusValues:{cancelled:"Abgebrochen",completed:"Abgeschlossen",error:"Fehler",in_progress:"In Arbeit",interrupted:"Unterbrochen",klippy_disconnect:"Klippy getrennt",klippy_shutdown:"Klippy heruntergefahren",Others:"Sonstige",server_exit:"Server-Exit"},Table:"Tabelle",Time:"Zeit",TitleExportHistory:"Historie exportieren",TotalDuration:"Gesamtdauer",TotalFilamentUsed:"Filament verwendet - gesamt",TotalJobs:"Druckvorgänge - gesamt",TotalPrinttime:"Druckzeit - gesamt",TotalTime:"Gesamtzeit"},p={Cancel:"abbrechen",ChangeCount:"Anzahl ändern",Count:"Anzahl",Empty:"Leer",InvalidCountEmpty:"Die Eingabe darf nicht leer sein!",InvalidCountGreaterZero:"Die Eingabe muss größer als 0 sein!",JobQueue:"Auftragswarteschlange",Pause:"Pause",RemoveFromQueue:"Von Auftragswarteschlange entfernen",Start:"Start",StartPrint:"Auftrag starten"},b={ConfigFilesPanel:{AllFiles:"Alle",Cancel:"Abbruch",ConfigFiles:"Konfigurationsdateien",ConfigRootDirectoryDoesntExists:'Keinen Konfigurations-Ordner gefunden. Bitte überprüfe die Option "config_path" im Abschnitt [file_manager] in der Moonraker Konfiguration.',Create:"Erstellen",CreateDirectory:"Verzeichnis erstellen",CreateFile:"Datei erstellen",CurrentPath:"Aktueller Pfad",Delete:"Löschen",DeleteDirectory:"Verzeichnis löschen",DeleteDirectoryQuestion:'Verzeichnis "{name}" und den gesamten Inhalt löschen?',DeleteSelectedQuestion:"{count} ausgewählte Elemente löschen?",DeleteSingleFileQuestion:'Soll die Datei "{name}" wirklich gelöscht werden?',Download:"Herunterladen",Duplicate:"duplizieren",DuplicateFile:"Datei duplizieren",EditFile:"Bearbeite Datei",Empty:"Leer",Files:"Dateien",Filesize:"Dateigröße",Free:"Frei",FreeDisk:"Freier Speicherplatz",HiddenFiles:"Versteckte Dateien",HideBackupFiles:"Sicherungsdateien ausblenden",LastModified:"zuletzt geändert",Name:"Name",RefreshDirectory:"Verzeichnis aktualisieren",Rename:"Umbenennen",RenameDirectory:"Verzeichnis umbenennen",RenameFile:"Datei umbenennen",Root:"Stammverzeichnis",SetupCurrentList:"Einstellungen",ShowFile:"Zeige Dateien",Total:"Gesamt",UploadFile:"Datei hochladen",Uploading:"Hochladen",Used:"Belegt"},EndstopPanel:{Endstop:"Endschalter",EndstopInfo:"Drücke die Sync-Schaltfläche in der rechten Ecke, um den aktuellen Zustand abzufragen.",Endstops:"Endschalter",open:"OFFEN",TRIGGERED:"AUSGELÖST"},LogfilesPanel:{Accept:"akzeptieren",Cancel:"abbrechen",Logfiles:"Logdateien",Rollover:"Logdatei zurücksetzen",RolloverDescription:"Wähle Logs zum zurücksetzen:",RolloverToastFailed:'Logdatei reset "{name}": {message}',RolloverToastSuccessful:'Logdatei für "{name}" wurde erfolgreich zurückgesetzt.'},SystemPanel:{Constants:"Konstanten",Cpu:"CPU",HostDetails:"Host-Details",LastStats:"Letzte Statistik",Load:"Auslastung",Memory:"MEM",NoMoreInfos:"Keine weiteren Informationen",SystemLoad:"Systemauslastung",Values:{Awake:"Wach: {awake}",Bandwidth:"Bandbreite: {bandwidth}/s",Distro:"Distribution: {name} {version_id}",Frequency:"Freq: {frequency}",Load:"Auslastung: {load}",Memory:"Mem: {memory}",Os:"OS: {os}",Received:"Empfangen: {received}",Temp:"Temp: {temp}°C",TempMax:"max: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Versendet: {transmitted}",Version:"Version: {version}"}},UpdatePanel:{Abort:"abbrechen",AreYouSure:"Bist du dir sicher?",CheckForUpdates:"auf Aktualisierungen prüfen",Close:"schließen",CommitHistory:"Commit Verlauf",Commits:"Commits",CommitsAvailable:"keine Einreichung verfügbar | {count} Einreichung verfügbar | {count} Einreichungen verfügbar",CommitsOnDate:"Eingereicht am {date}",CommittedDaysAgo:"eingereicht vor {days} Tagen",CommittedHoursAgo:"eingereicht vor {hours} Stunden",CommittedOnDate:"eingereicht am {date}",CommittedYesterday:"eingereicht gestern",ConfigChanges:"Konfigurationsänderungen",Corrupt:"Korrupt",CountPackagesCanBeUpgraded:"{count} Pakete können aktualisiert werden",Detached:"abgetrennt",Dirty:"kompromittiert",GenericUpdateQuestion:"Überprüfe den Commit-Verlauf (falls verfügbar) und die GitHub-Projektseite von diesem Projekt, um festzustellen, ob manuelle Anpassungen nach dieser Aktualisierung erforderlich sind.",GitHubPage:"GitHub Projektseite",HardRecovery:"Harte Wiederherstellung",InitUpdateManager:"Der Update Manager ist noch nicht initialisiert. Dies ist normal, wenn das System zum ersten Mal gestartet wird. Bitte klicke auf die Aktualisierungsschaltfläche, um alle Komponenten zu initialisieren.",Invalid:"ungültig",IUnderstandTheRisks:"Ich habe die Risiken verstanden",KlipperUpdateQuestionConfig:"Dieses Update kann Änderungen an den Konfigurationsparametern enthalten, die in der Datei printer.cfg geändert werden müssen; Informationen hierzu findest du im Änderungsprotokoll.",KlipperUpdateQuestionFirmware:"Dadurch wird die Klipper-Host-Software aktualisiert. Steuerplatinen, auf denen die Klipper-Firmware läuft, müssen möglicherweise mit einer neu kompilierten Firmware geflasht werden, bevor die Maschine wieder in Betrieb genommen werden kann.",LinkToGithub:"Link zu GitHub",MoonrakerUpdateQuestion:"Dadurch wird die Moonraker-API aktualisiert. Möglicherweise sind Änderungen an der Datei moonraker.conf erforderlich, damit die Maschine wieder verwendet werden kann.",MoreCommitsInfo:"Hier können maximal 30 Commits angezeigt werden. Um alle Commits zu sehen, klicke bitte auf den folgenden Link:",OSPackages:"OS-Pakete",SoftRecovery:"einfache Wiederherstellung",StartUpdate:"Aktualisierung starten",System:"System",ThesePackagesCanBeUpgrade:"Diese Systempakete können aktualisiert werden:",Unknown:"unbekannt",Update:"update",UpdateAll:"Alle Komponenten updaten",UpdateManager:"Update Manager",UpdateWarning:"Aktualisierungswarnung: {name}",Upgrade:"upgrade",UpgradeableSystemPackages:"Aktualisierbare Systempakete",UpToDate:"aktuell",WebClientUpdateQuestion:"In einigen Fällen kann die Aktualisierung des Webclients Änderungen mit sich bringen, die zu Inkompatibilitäten führen können. Weitere Informationen sind in den Veröffentlichungshinweisen zu finden."}},f={Abort:"abbrechen",Accept:"akzeptieren",Advanced:"Erweitert",Headline:"Manuelle Messung"},D={ExtruderControlPanel:{Allowed:"Erlaubt",CleanNozzle:"Düse reinigen",EstimatedExtrusion:"Extrusion:",Extrude:"Extrudieren",ExtruderControl:"Extruder Control",ExtruderTempTooLow:"Extruder Temp. <",ExtrusionFactor:"Extrusionsfaktor",ExtrusionFeedrate:"Extrusionsgeschwindigkeit",FilamentLength:"Filamentlänge",FirmwareRetraction:"Firmware Rückzug",FirmwareRetractionSettings:{RetractLength:"Rückzugslänge",RetractSpeed:"Rückzuggeschwindigkeit",UnretractExtraLength:"Zusätzliche Ausfahrlänge",UnretractSpeed:"Ausfahrgeschwindigkeit"},Headline:"Extruder",LoadFilament:"Filament laden",PressureAdvance:"Pressure Advance",PressureAdvanceSettings:{Advance:"Pressure Advance",Extruder:"Extruder",SmoothTime:"Smooth Time"},PurgeFilament:"Filament reinigen",Requested:"Angefordert",Retract:"Rückzug",TooLargeExtrusion:"Extrusion zu groß!",Tools:"Werkzeuge",UnloadFilament:"Filament entladen"},FarmPrinterPanel:{ReconnectToPrinter:"Neu verbinden",SwitchToPrinter:"Zum Drucker wechseln",WebcamOff:"Aus"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Bitte überprüfen, ob der Klipper-Dienst läuft und klippy_uds_address in der moonraker.conf korrekt konfiguriert ist.",FirmwareRestart:"Firmware Neustart",KlipperLog:"Klipper Log",MoonrakerCannotConnect:"Moonraker kann keine Verbindung zu Klipper herstellen!",MoonrakerLog:"Moonraker Log",PowerOn:"Drucker einschalten",PrinterSwitchedOff:"Drucker ist ausgeschaltet",PrinterSwitchedOffDescription:"Der Drucker ist ausgeschaltet und es kann keine Verbindung zu Klipper hergestellt werden. Um den Drucker einzuschalten, auf die Schaltfläche unten klicken:",Restart:"Neustart",ServiceReports:"{service} meldet"},MachineSettingsPanel:{Headline:"Maschine",MotionSettings:{Acceleration:"Beschleunigung",MaxAccelToDecel:"Max. Beschl. zu Verz.",MinimumCruiseRatio:"Min. Kreuzfahr Quote",SquareCornerVelocity:"Eck-Geschwindigkeit",Velocity:"Geschwindigkeit"}},MacrosPanel:{Headline:"Makros",Send:"senden"},MiniconsolePanel:{Autoscroll:"Autoscroll",Headline:"Konsole",HideTemperatures:"Temperaturmeldungen ausblenden",HideTimelapse:"Timelapse ausblenden",RawOutput:"RAW-Ausgabe (zum Debuggen)",SendCode:"Befehl senden...",SetupConsole:"Einstellungen"},MinSettingsPanel:{IncludeMainsailCfg:"Stelle sicher dass die Datei mainsail.cfg in der printer.cfg-Datei aufgeführt ist.",IsNotDefinedInConfig:"ist nicht in der Konfig definiert.",MissingConfiguration:"Fehlende Konfiguration",MoreInformation:"mehr Informationen"},MiscellaneousPanel:{Headline:"Sonstiges",Light:{Blue:"blau",Green:"grün",Red:"rot",White:"weiß"},RunoutSensor:{Detected:"erkannt",Empty:"leer"}},PowerControlPanel:{Error:"Fehler",Off:"Aus",On:"An",PowerControl:"Stromversorgung"},SpoolmanPanel:{ActiveSpool:"Aktive Rolle",Cancel:"Abbrechen",ChangeSpool:"Rolle wechseln",DaysAgo:"vor {days} Tagen",EjectSpool:"Rolle auswerfen",EjectSpoolQuestion:"Sind Sie sicher, dass Sie die Filamentrolle auswerfen wollen?",Filament:"Filament",FilamentTypeMismatch:"Das Material der aktiven Filamentrolle ({spoolType}) stimmt nicht mit dem Material des G-Codes ({fileType}) überein.",Headline:"Spoolman",LastUsed:"Zuletzt verwendet",Location:"Standort",Material:"Material",Never:"Nie",NoActiveSpool:"Die Filamentverfolgung ist inaktiv. Um zu beginnen, wählen Sie bitte eine Rolle aus.",NoResults:"Keine Rolle mit den aktuellen Suchkriterien gefunden.",NoSpool:"Keine Rolle",NoSpools:"Keine Rolle verfügbar",NoSpoolSelected:"Keine Rolle ausgewählt. Bitte wählen Sie eine Spule aus, sonst kann dieser Druck nicht verfolgt werden.",OpenSpoolManager:"Rollenverwaltung öffnen",Refresh:"aktualisieren",Search:"Suchen",SelectSpool:"Rolle auswählen",Today:"Heute",TooLessFilament:"Die aktuelle Rolle hat möglicherweise nicht genug Filament für diesen Druck. ({spoolWeight}g von {fileWeight}g)",Weight:"Gewicht",Yesterday:"Gestern"},StatusPanel:{CancelPrint:"Druck abbrechen",ClearPrintStats:"Druckstatistiken löschen",Difference:"Unterschied",EmptyGcodes:"Kein G-Code verfügbar.",EmptyHistory:"Kein Druckjob im Verlauf.",EmptyJobqueue:"Aktuell keine Datei in der Warteschlange.",Estimate:"Schätzung",ETA:"ETA",ExcludeObject:{Cancel:"abbrechen",Excluded:"ausgeschlossen",ExcludeObject:"Objekt ausschließen",ExcludeObjectHeadline:"Objekt ausschließen",ExcludeObjectText:'Willst du wirklich "{name}" ausschließen?'},Filament:"Filament",File:"Datei",Flow:"Fluss",Headline:"Status",JobqueueMoreFiles:"keine weiteren Aufträge | einen weiteren Auftrag | {count} weitere Aufträge",Layer:"Schicht",Max:"max",ObjectHeight:"Objekthöhe",PauseAtLayer:{Abort:"abbrechen",Accept:"akzeptieren",AtLayer:"bei Schicht",Call:"Ausführen",DescriptionPauseAtLayerActive:'Diese Funktion ist bereits aktiv und wird "{call}" bei Schicht {layer} ausführen. Wenn der Befehl nochmal ausgeführt wird, werden die Einstellungen überschreiben.',DescriptionPauseNextLayerActive:'Diese Funktion ist bereits aktiv und bei der nächsten Schicht wird "{call}" ausgeführt.',Layer:"Schicht",NextLayer:"nächste Schicht",PauseAtLayer:"Pause bei Schicht",Type:"Art"},PausePrint:"Druck pausieren",Print:"Druck",PrintTime:"Druckzeit",ReprintJob:"Auftrag erneut drucken",Requested:"Angefordert",ResumePrint:"Druck fortführen",Slicer:"Slicer",Speed:"Geschwindigkeit",Total:"Gesamt",TotalTime:"Gesamtzeit",Unknown:"Unbekannt"},TemperaturePanel:{AutoscaleChart:"Autoskalierung",Avg:"Ø",Cooldown:"Abkühlen",Current:"Aktuell",Dataset:{Power:"PWM-Leistung",Speed:"PWM-Geschwindigkeit",Target:"Zieltemperatur",Temperature:"Aktuelle Temperatur"},Headline:"Temperaturen",HideMcuHostSensors:"Host/MCU Sensoren ausblenden",HideMonitors:"Monitore ausblenden",Max:"max",Min:"min",Name:"Name",Presets:"Presets",SetupTemperatures:"Temperaturen einstellen",ShowChart:"Diagramm anzeigen",ShowNameInChart:"Zeige {name} in Diagramm",ShowNameInList:"Zeige {name} in Liste",State:"Status",Target:"Ziel",TemperaturesInChart:"Temperatur [°C]",TempTooHigh:"Temperature von {name} zu hoch! (max: {max})",TempTooLow:"Temperature von {name} zu niedrig! (min: {min})"},ToolheadControlPanel:{Absolute:"absolut",ALL:"ALLE",ControlButtons:"Kontrollknöpfe",CoordinateFields:"Koordinatenfelder",Headline:"Werkzeugkopf",PleaseConfigureSteps:"Bitte Schritte konfigurieren",Position:"Position",PositionOutput:"Positionsausgabe",QGL:"QGL",Relative:"relativ",SettingsInterfaceControl:"Einstellungen > Interface > Steuerung",SpeedFactor:"Geschwindigkeitsfaktor",ZOffset:"Z-Versatz",ZTilt:"Z Tilt"},WebcamPanel:{All:"Alle",ConnectingTo:"Verbinde zu {url}",Disconnected:"Getrennt",ErrorWhileConnecting:"Fehler während dem Verbinden zu {url}",FPS:"FPS",Headline:"Webcam",NoWebcam:'Keine Webcam verfügbar. Füge eine Webcam unter "Interface Einstellungen" -> "Webcams".',UnknownWebcamService:"Unbekannter Webcam Dienst"},ZoffsetPanel:{Clear:"Löschen",Headline:"Z-Versatz",Later:"Später",Ok:"OK",Save:"Speichern",SaveConfig:"SAVE CONFIG",SaveInfoDescription:'Der neue Z-Versatz wurde berechnet und registriert. Auf "SAVE CONFIG", klicken um den neuen Z-Versatz in der printer.cfg zu speichern und Klipper neu zu starten.',SaveInfoDescriptionPrint:'Der neue Z-Versatz wurde berechnet und registriert. Nach dem Drucken auf "SAVE CONFIG" in der oberen Leiste klicken um den neuen Z-Versatz in der printer.cfg zu speichern und Klipper neu zu starten.',SaveInfoHeadline:"Information"}},S={AreYouSure:"Bist du sicher?",No:"Nein",TurnDeviceOff:"{device} ausschalten",TurnDeviceOn:"{device} anschalten",Yes:"Ja"},k={Console:"Konsole",Dashboard:"Dashboard","G-Code Files":"G-Code Dateien","G-Code Viewer":"G-Code-Betrachter",Heightmap:"Heightmap",History:"Verlauf",Machine:"Maschine",Printers:"Drucker",Timelapse:"Zeitraffer",Webcam:"Webcam"},w={Accept:"akzeptieren",Base:"Basis",ErrorText:"Ein Fehler ist beim Abtasten aufgetreten.",Headline:"Neigungsverstellung",Retry:"wiederholen"},C={AddPrinter:"Drucker hinzufügen",AddPrintersToJson:"Bitte füge einen Drucker in der config.json hinzu.",CannotConnectTo:"Kann keine Verbindung zu {host} herstellen.",ChangePrinter:"Drucker ändern",Connecting:"Verbinde zu {host}",ConnectionFailed:"Verbindung fehlgeschlagen",EditPrinter:"Drucker bearbeiten",Hello:"Hallo und willkommen im Remote-Modus von Mainsail!",HostnameInvalid:"ungültiger Hostname/IP",HostnameIp:"Hostname/IP",HostnameRequired:"Hostname ist erforderlich",Name:"Name",Path:"Pfad",Port:"Port",PortRequired:"Port ist erforderlich",RememberToAdd:"Bitte denk daran, {cors} in moonraker.conf unter 'cors_domains' hinzuzufügen.",SelectPrinter:"Drucker auswählen",TryAgain:"Erneut versuchen",UpdatePrinter:"Drucker aktualisieren",YouCanFindMore:"Weitere Details findest du unter"},F={Cancel:"Abbruch",Close:"Schließen",ConsoleTab:{AddFilter:"Filter hinzufügen",Console:"Konsole",CreateHeadline:"Filter erstellen",Direction:"Richtung",DirectionShell:"Letzter Eintrag unten",DirectionTable:"Letzter Eintrag oben",EditHeadline:"Filter bearbeiten",EntryStyle:"Stil der Einträge",EntryStyleCompact:"kompakt",EntryStyleDefault:"standard",Filters:"Filter",Height:"Höhe",HideTemperatures:"Temperaturen ausblenden",HideTimelapse:"Timelapse ausblenden",Name:"Name",Regex:"Regex",StoreButton:"Filter speichern",UpdateButton:"Filter aktualisieren"},ControlTab:{Bars:"Balken",Circle:"Kreis",Control:"Steuerung",Cross:"Kreuz",EnableXYHoming:"Aktiviere kombiniertes X & Y homing",EstimatedExtrusionInfo:"Zeige Info zur geschätzten Extrusion",EstimatedExtrusionInfoDescription:"Anzeigen/ausblenden der Info zur geschätzten Extrusion, basierend auf Extrusionmenge und Extrusionsgeschwindigkeit",HideDuringPrint:"Achsensteuerung während des Drucks ausblenden",InvertXMovement:"Bewegung der X-Achse invertieren",InvertYMovement:"Bewegung der Y-Achse invertieren",InvertZMovement:"Bewegung der Z-Achse invertieren",IsDefault:" (standard)",MaximumValues:"Maximum: {maximum} Einträge",MaximumValuesVisibility:"Maximal {maximum} Einträge für beste Darstellung",MinimumValues:"Minimum: {minimum} Eintrag",MotorsOff:"Motoren aus{isDefault}",MoveDistancesEInMm:"Extrusionslängen (in mm)",MoveDistancesInMm:"Schrittweiten (in mm)",MoveDistancesXYInMm:"Schrittweiten X & Y-Achse (in mm)",MoveDistancesZInMm:"Schrittweiten Z-Achse (in mm)",QuadGantryLevel:"Quad Gantry Level{isDefault}",SpeedEInMms:"Extrusions-Geschwindigkeit (in mm/s)",SpeedXY:"Geschwindigkeit X & Y-Achse (in mm/s)",SpeedZ:"Geschwindigkeit Z-Achse (in mm/s)",Style:"Stil",ValueGreaterThan:"Wert muss größer als {value} sein",ZOffsetIncrements:"Schrittweiten Z-Versatz (in mm)",ZOffsetSaveOption:"Z-Versatz Speicheroption",ZOffsetSaveOptionDescription:"Wechsel die Option zum Speichern des Z-Versatzes.",ZTiltAdjust:"Z-Tilt Adjust{isDefault}"},DashboardTab:{Dashboard:"Dashboard",Desktop:"Desktop",Mobile:"Mobile",ResetLayout:"Layout zurücksetzen",Tablet:"Tablet",Widescreen:"Breitbild"},Edit:"Bearbeiten",EditorTab:{ConfirmUnsavedChanges:"Aufforderung zum Speichern oder Verwerfen nicht gespeicherter Änderungen",ConfirmUnsavedChangesDescription:"Wenn aktiviert, dann ist eine Bestätigung notwendig um ungespeicherte Änderungen zu speichern/verwerfen. Wenn deaktiviert,dann werden Änderungen im Hintergrund verworfen.",Editor:"Editor",KlipperRestartMethod:"Klipper Neustartmethode",KlipperRestartMethodDescription:"Wähle aus, welche Neustartmethode verwendet werden soll wenn 'Speichern & Neustarten' geklickt wir im Editor.",Spaces:"Leerzeichen: {count}",TabSize:"TAB Größe",TabSizeDescription:"Legt fest, um wie viele Leerzeichen für TAB eingerückt werden sollen",UseEscToClose:"ESC drücken um Editor zu schließen",UseEscToCloseDescription:"Erlaubt es den Editor mit ESC zu schließen."},GCodeViewerTab:{BackgroundColor:"Hintergrundfarbe",ExtruderColor:"Extruder Farben",GCodeViewer:"G-Code Betrachter",GridColor:"Gitterfarbe",MaxFeed:"Max Vorschub",MinFeed:"Min Vorschub",ProgressColor:"Fortschrittsfarbe",ShowAxes:"Zeige Achsen an"},GeneralTab:{"12hours":"12-Stunden ({time})","24hours":"24-Stunden ({time})",Backup:"Datensicherung",BackupDialog:"Bitte wähle alle Abschnitte aus, die du sichern möchtest:",CalcEstimateTime:"Berechnung der geschätzten Zeit",CalcEstimateTimeDescription:"Bei Mehrfachauswahl wird ein Durchschnitt berechnet",CalcEtaTime:"ETA Berechnung",CalcEtaTimeDescription:"Bei Mehrfachauswahl wird ein Durchschnitt berechnet",CalcPrintProgress:"Berechnung des Druckfortschritts",CalcPrintProgressDescription:"Methode zur Berechnung des Druckfortschritts.",CalcPrintProgressItems:{Filament:"Filament",FileAbsolute:"Dateiposition (absolut)",FileRelative:"Dateiposition (relativ)",Slicer:"Slicer (M73)"},CannotReadJson:"Sicherungsdatei kann nicht gelesen/analysiert werden.",DateFormat:"Datumsformat",DbConsoleHistory:"Verlauf der Konsole",DbHistoryJobs:"Historie Druckvorgänge",DbHistoryTotals:"Historie Gesamtzähler",DbMaintenance:"Wartung",DbNavigation:"Navigation",DbTimelapseSettings:"Zeitraffer Einstellungen",DbView:"Ansichtseinstellungen",EstimateValues:{Filament:"Filament",File:"Datei",Slicer:"Slicer"},Everything:"Alle",FactoryDialog:"Bitte wähle alle Abschnitte die du zurücksetzen möchtest:",FactoryReset:"Werkseinstellungen",General:"Allgemein",Language:"Sprache",MainsailSettingsMoonrakerDb:"Mainsail Einstellungen in Moonraker DB",PrinterName:"Druckername",Reset:"zurücksetzen",Restore:"Wiederherstellung",RestoreDialog:"Bitte wähle alle Abschnitte aus, die du wiederherstellen möchtest:",TimeFormat:"Zeitformat"},HeightmapTab:{ColorSchemes:"Farbschemen",DefaultOrientation:"Standardausrichtung",DefaultOrientationDescription:"Standardausrichtung für die Darstellung der Höhenkarte auswählen.",Heightmap:"Höhenkarte",IsDefault:"(Standard)",Orientations:{Front:"Vorne",LeftFront:"Links Vorne",RightFront:"Rechts Vorne",Top:"Oben"},Schemes:{GrayScale:"Graustufen",Hot:"Heiß",Hsv:"Hsv",Portland:"Portland",Spring:"Frühling"}},InterfaceSettings:"Interface Einstellungen",MacrosTab:{Add:"hinzufügen",AddGroup:"Gruppe hinzufügen",AvailableMacros:"Vorhandene Makros",ChangeMacroColor:"Farbe der Schaltfläche ändern.",Color:"Farbe",CountMacros:"keine Makros hinzugefügt | {count} Makro | {count} Makros",Custom:"benutzerdefiniert",CustomColor:"Benutzerdefinierte Farbe",DeletedMacro:"Makro gelöscht",DeleteMacroFromGroup:"Makro aus Gruppe entfernen.",EditGroup:"Gruppe bearbeiten",Error:"Fehler",Expert:"Experte",General:"Allgemein",Group:"Gruppe",GroupMacros:"Makros gruppieren",Macrogroups:"Gruppen",Macros:"Makros",Management:"Verwaltung",Name:"Name",NoAvailableMacros:"Keine verfügbaren Makros.",NoGroups:"Keine Gruppen gefunden...",NOMacros:"keine Makros gefunden...",NoMacrosInGroup:"Keine Makros in dieser Gruppe.",Primary:"primär",Search:"Suche",Secondary:"sekundär",ShowInStatePaused:"Anzeigen/ausblenden wenn der Drucker pausiert ist.",ShowInStatePrinting:"Anzeigen/ausblenden wenn der Drucker am drucken ist.",ShowInStateStandby:"Anzeigen/ausblenden wenn der Drucker im Standby ist.",Simple:"Einfach",Status:"Status",Success:"Erfolg",UnknownGroup:"Unbekannte Gruppe",Warning:"Warnung"},MiscellaneousTab:{AddGroup:"Gruppe hinzufügen",AddPreset:"Voreinstellung hinzufügen",Color:"Farbe",CreateGroup:"Gruppe erstellen",CreatePreset:"Voreinstellung erstellen",End:"Ende",EndDescription:"Letzte LED von dieser Gruppe.",Groups:"Gruppen",GroupSubTitle:"Start: {start}, Ende: {end}",LightGroups:"{name} - Gruppen",LightPresets:"{name} - Voreinstellungen",Miscellaneous:"Sonstiges",Name:"Name",NoDevicesFound:"Keine Komponente gefunden",NoGroupFound:"Keine Gruppe gefunden",NoPresetFound:"Keine Voreinstellungen gefunden",Presets:"Voreinstellungen",Start:"Start",StartDescription:"Erste LED von dieser Gruppe.",UnableToLoadLight:"Licht konnte nicht geladen werden",UnableToLoadPreset:"Voreinstellung konnte nicht geladen werden"},NavigationTab:{Navigation:"Navigation"},PresetsTab:{AddPreset:"Preset hinzufügen",Cooldown:"Abkühlen",CreateHeadline:"Voreinstellung erstellen",CustomGCode:"Benutzerdefinierter G-Code",EditCooldown:"Abkühlen bearbeiten",EditHeadline:"Voreinstellung bearbeiten",ErrorInvalidValue:"Ungültiger Wert",ErrorNameNotUnique:"Name existiert bereits",ErrorNameRequired:"Name erforderlich",Name:"Name",PreheatPresets:"Presets",PresetInfo:"Bitte mindestens eine Zieltemperatur oder einen benutzerdefinierten G-Code festlegen.",PresetNamePlaceholder:"Voreinstellungs-Name (erforderlich)",StoreButton:"Voreinstellung speichern",UpdateButton:"Voreinstellung ändern",UpdateCooldown:"Abkühlen ändern"},RemotePrintersTab:{AddPrinter:"Drucker hinzufügen",EditPrinter:"Drucker bearbeiten",Hostname:"Hostname",Name:"Name",NameDescription:"Dieser Name wird nicht im GUI angezeigt und wird nur für Weiterleitungen verwendet.",Path:"Pfad",Port:"Port",RemotePrinters:"Remote Drucker",UpdatePrinter:"Drucker aktualisieren",UseConfigJson:"InstanceDB = JSON erkannt. Bitte bearbeite die config.json um die Druckerliste zu modifizieren."},Store:"anlegen",TimelapseTab:{Autorender:"Autorender",AutorenderDescription:"Wenn diese Option aktiviert ist, wird das Zeitraffervideo am Ende des Druckvorgangs automatisch gerendert",Camera:"Kamera",CameraDescriptionWithSnapshotUrl:"Wähle aus, welche Kamera (mit Schnappschuss URL) verwendet werden soll.",CameraWarningAlreadySet:"Dieser Wert ist bereits in der Moonraker-Konfigurationsdatei festgelegt.",CameraWarningAlreadySetSmall:"snapshoturl ist in der [timelapse] Sektion",ConstantRateFactor:"Constant Rate Factor",ConstantRateFactorDescription:"Damit wird die Qualität im Verhältnis zur Dateigröße des gerenderten Videos konfiguriert. Die CRF-Skala reicht von 0-51, wobei 0 für verlustfrei, 23 für die Standardeinstellung und 51 für die schlechtestmögliche Qualität steht. Ein niedrigerer Wert führt im Allgemeinen zu höherer Qualität, und ein subjektiv vernünftiger Bereich ist 17-28. 17 oder 18 gelten als visuell verlustfrei.",duplicatelastframe:"Letztes Bild duplizieren",duplicatelastframeDescription:"Dupliziert das letzte Bild am Ende des Videos",Enabled:"Aktiviert",EnabledDescription:"Wenn diese Option deaktiviert ist, werden G-Code Makros ignoriert und Autorender wird übersprungen.",Extraoutputparams:"Extra-Ausgabeparameter",ExtraoutputparamsDescription:"Legt zusätzliche Ausgabeparameter für FFMPEG fest. Hinweis: Wenn Sie hier etwas angeben, wird die Rotationseinstellung deaktiviert",FwRetract:"Firmware Rückzug",FwRetractDescription:"Benutze Firmware Rückzug im Timelapse Makro",GcodeVerbose:"Ausführliche G-Codes",GcodeVerboseDescription:"Wenn aktiviert, schreiben G-Code Makros Informationen in die Konsole",General:"Allgemein",HyperlapseCycle:"Hyperlapse-Zyklusdauer",HyperlapseCycleDescription:"Es wird alle X Sekunden ein Schnappschuss gemacht",Mode:"Modus",ModeDescription:"Wähle zwischen Layermacro und Hyperlapse (zeitbasiert) Modus",NoWebcamFound:"Keine Webcam verfügbar",OutputFramerate:"Ausgabe Bildrate",OutputFramerateDescription:"Bestimmt die Framerate des Videos. Hinweis: Dies wird ignoriert, wenn variable_fps aktiviert ist",Parkhead:"Druckkopf parken",ParkheadDescription:"Wenn diese Option aktiviert ist, wird der Druckkopf vor der Aufnahme eines Bildes geparkt.",Parkpos:"Park-Position",ParkposDescription:"Wähle Park-Position",ParkTime:"Park Dauer",ParkTimeDescription:"Verlängern der Park Dauer",Pixelformat:"Pixelformat",PixelformatDescription:"Definiert das Pixelformat des Ausgabevideos",PosDZ:"Position Z",PosDZDescription:"Park-Postion Z (relativ)",PosX:"Position X",PosXDescription:"Park-Postion X (absolut)",PosY:"Position Y",PosYDescription:"Park-Postion Y (absolut)",PreviewImage:"Vorschaubild",PreviewImageDescription:"Speichert ein Vorschaubild mit demselben Namen wie das Video",RenderingOptions:"Rendering-Optionen",RetractDistance:"Rückzugslänge",RetractDistanceDescription:"Die Länge an Filament die der Extruder zurückzieht.",RetractSpeed:"Rückzuggeschwindigkeit",RetractSpeedDescription:"Geschwindigkeit mit der der Extruder das Filament zurückzieht.",RulesBetweenMinMax:"Der Wert muss zwischen {min} und {max} sein!",RulesMin:"Der Wert muss mindestens {min} sein!",RulesPositive:"Der Wert muss positiv sein!",RulesRequired:"Der Wert ist erforderlich!",RulesZeroAndPositive:"Der Wert muss 0 oder größer sein!",SaveFrames:"Bilder speichern",SaveFramesDescription:"Speichern der Bilder in einer Zip-Datei für externes Rendern",SelectWebcam:"Webcam wählen...",StreamDelayCompensation:"Stream-Verzögerungs-Kompensation",StreamDelayCompensationDescription:"Verzögern der Bildaufnahme",Targetlength:"Zieldauer",TargetlengthDescription:"Die Zieldauer wenn Variable FPS aktiviert ist",TimeFormatCode:"Zeitformat-Code",TimeFormatCodeDescription:"Legt fest, wie der Zeitstempel in der Ausgabedatei kodiert werden soll",Timelapse:"Zeitraffer",TravelSpeed:"Eilgang Geschwindigkeit",TravelSpeedDescription:"Eilgang Geschwindigkeit für die Fahrt zur Park-Position und Wiederaufnahme des Drucks",UnretractDistance:"Ausfahrlänge",UnretractDistanceDescription:"Die Länge an Filament die der Extruder nach einem Rückzuck vorschiebt.",UnretractSpeed:"Ausfahrgeschwindigkeit",UnretractSpeedDescription:"Geschwindigkeit mit der der Extruder das Filament nach einem Rückzug vorschiebt.",VariableFps:"Variable FPS",VariableFpsDescription:"Wenn diese Option aktiviert ist, wird die Framerate des Ausgabevideos anhand der Zieldauer berechnet.",VariableFpsMax:"Max. Variable FPS",VariableFpsMaxDescription:"Maximaler Wert für die variablen FPS",VariableFpsMin:"Min. Variable FPS",VariableFpsMinDescription:"Minimaler Wert für die variablen FPS"},UiSettingsTab:{BedScrewsDialog:"Hilfsfenster für Bettschraubenjustierung",BedScrewsDialogDescription:"Zeige ein Hilfsfenster für die Bettschraubenjustierung an.",BigThumbnailBackground:"Hintergrundfarbe vom großen Vorschaubild",BoolBigThumbnail:"Große Vorschaubilder",BoolBigThumbnailDescription:"Zeige ein großes Thumbnail in der Status-Anzeige während eines Drucks.",BoolHideUploadAndPrintButton:'"Hochladen & Drucken" Schaltfläche ausblenden',BoolHideUploadAndPrintButtonDescription:'Blendet die "Hochladen & Drucken" Schaltfläche in der Kopfleiste ein oder aus.',ConfirmOnCancelJob:"Bestätigung für Druck abbrechen erforderlich",ConfirmOnCancelJobDescription:"Zeige vor dem Druck abbrechen einen Bestätigungsdialog.",ConfirmOnCoolDown:"Bestätigung für Abkühlen erforderlich",ConfirmOnCoolDownDescription:"Zeige vor dem Abkühlen einen Bestätigungsdialog.",ConfirmOnEmergencyStop:"Bestätigung für Notstopp erforderlich",ConfirmOnEmergencyStopDescription:"Zeige vor einem Notstop einen Bestätigungsdialog.",ConfirmOnPowerDeviceChange:"Bestätigung für Änderung der Stromversorgung von Geräten",ConfirmOnPowerDeviceChangeDescription:"Zeige vor Änderung der Stromversorgung von Geräten einen Bestätigungsdialog.",DashboardFilesFilter:"Dashboard G-Code Filter",DashboardFilesFilterCompleted:"Abgeschlossen",DashboardFilesFilterDescription:"Filtere die Dateien im Status-Panel des Dashboards nach ihrem letzten Status.",DashboardFilesFilterFailed:"Fehlgeschlagen",DashboardFilesFilterNew:"Neue",DashboardFilesLimit:"Dashboard G-Code Limit",DashboardFilesLimitDescription:"Wähle die maximale Anzahl an Dateien, die im Status-Panel des Dashboards angezeigt werden sollen. (0 blendet den G-Code-Tab aus)",DashboardFilesLimitLabel:"{count} Dateien",DashboardHistoryLimit:"Dashboard Verlauf Limit",DashboardHistoryLimitDescription:"Wähle die maximale Anzahl an Aufträgen, die im Status-Panel des Dashboards angezeigt werden sollen. (0 blendet den Verlauf-Tab aus)",DashboardHistoryLimitLabel:"{count} Aufträge",DefaultNavigationState:"Standard Navigationszustand",DefaultNavigationStateAlwaysClosed:"immer geschlossen",DefaultNavigationStateAlwaysOpen:"immer geöffnet",DefaultNavigationStateDescription:"Welchen zustand soll die Navigation normalerweise haben?",DefaultNavigationStateLastState:"letzter Zustand",DisableFanAnimation:"Lüfteranimation deaktivieren",DisableFanAnimationDescription:"Dies kann die Last im Browser senken.",DisplayCANCEL_PRINT:"Zeige CANCEL_PRINT an",DisplayCANCEL_PRINTDescription:"Zeigt die CANCEL_PRINT Schaltfläche dauerhaft an - keine weitere Bestätigung erforderlich.",GcodeThumbnails:"G-Code Vorschaubilder",GcodeThumbnailsDescription:"Klicke auf die Schaltfläche um zum Leitfaden zu gelangen.",Guide:"Leitfaden",HideOtherInstances:"Verstecke andere Instanzen",HideOtherInstancesDescription:"Verstecke andere Instanzen von Klipper & Moonraker im Service-Menü.",HideSaveConfigButtonForBedMesh:"SAVE_CONFIG Schaltfläche ausblenden bei bed_mesh Änderungen",HideSaveConfigButtonForBedMeshDescription:"SAVE_CONFIG nicht anzeigen, wenn nur das Speichern eines bed_mesh in Klipper aussteht.",HideUpdateWarnings:"Aktualisierungswarnungen ausblenden",HideUpdateWarningsDescription:"Mit dieser Option werden alle Aktualisierungswarnungen im Aktualisierungsmanager ausgeblendet.",LockSliders:"Sperre Schieberegler auf Touchscreen Geräten",LockSlidersDelay:"Verzögerung der Sperre für Schieberegler",LockSlidersDelayDescription:"Schieberegler werden nach einer bestimmten Verzögerung gesperrt. Wenn 0 oder leer, dann sperren Schieberegler nur nach wechseln/neuladen der Seite.",LockSlidersDescription:"Schieberegler müssen zuerst entsperrt werden bevor Änderungen erlaubt werden.",Logo:"Logo",ManualProbeDialog:"Hilfsfenster für manuelle Messung",ManualProbeDialogDescription:"Zeige ein Hilfsfenster für PROBE_CALIBRATE oder Z_ENDSTOP_CALIBRATE an.",Mode:"Modus",ModeDescription:"Ändert das allgemeine Aussehen der Anwendung.",NavigationStyle:"Stil der Navigation",NavigationStyleDescription:"Erscheinungsbild der Navigation ändern",NavigationStyleIconsAndText:"Icons + Text",NavigationStyleIconsOnly:"Nur Icons",PowerDeviceName:"Stromversorgung für Drucker",PowerDeviceNameDescription:"Wähle aus, welches Moonraker Power-Device zum Einschalten des Druckers verwendet werden soll.",Primary:"Primärfarbe",PrintstatusThumbnailZoom:"Großes-Vorschaubild Vergrößerung",PrintstatusThumbnailZoomDescription:"Dadurch wird der Vergrößerungseffekt des Vorschaubildes im Statusfenster deaktiviert.",ProgressAsFavicon:"Fortschritt als Favicon anzeigen",ProgressAsFaviconDescription:"Ändere das Mainsail-Logo-Favicon in einen Fortschrittskreis.",ScrewsTiltAdjustDialog:"Hilfsfenster für Schrauben Neigunganpassung",ScrewsTiltAdjustDialogDescription:"Zeige ein Hilfsfenster für SCREWS_TILT_CALCULATE an.",TempchartHeight:"Temperatur-Chart Höhe",TempchartHeightDescription:"Verändert die Höhe vom Temperatur-Chart auf dem Dashboard.",Theme:"Theme",ThemeDark:"Dunkel",ThemeDescription:"Ändere das Branding von der Oberfläche.",ThemeLight:"Hell",UiSettings:"UI-Einstellungen"},Update:"speichern",WebcamsTab:{AddWebcam:"Webcam hinzufügen",Color:"Farbe",CreateWebcam:"Erstelle Webcam",EditCrowsnestConf:"crowsnest.conf bearbeiten",EditWebcam:"Webcam bearbeiten",Enable:"Aktivieren",EnableAudio:"Ton einschalten",FlipWebcam:"Webcam-Bild spiegeln:",HideFps:"FPS-Anzeige verstecken",Hlsstream:"HLS-Stream",Horizontally:"horizontal",IconBed:"Bett",IconCam:"Kamera",IconDoor:"Tür",IconFilament:"Filament",IconHot:"Heiß",IconMcu:"MCU",IconNozzle:"Düse",IconPrinter:"Drucker",Ipstream:"IP Kamera",JMuxerStream:"Roher h264 stream (jmuxer)",Mjpegstreamer:"MJPEG-Streamer",MjpegstreamerAdaptive:"Adaptive MJPEG-Streamer (experimental)",Name:"Name",NameAlreadyExists:"Name existiert bereits",NozzleCrosshair:"Düsen-Fadenkreuz",Required:"benötigt",Rotate:"Drehen",SaveWebcam:"Webcam speichern",Service:"Dienst",Size:"Größe",TargetFPS:"Ziel FPS",UpdateWebcam:"Webcam aktualisieren",UrlSnapshot:"Schnappschuss URL",UrlStream:"Stream URL",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"vertikal",Webcams:"Webcams",WebrtcCameraStreamer:"WebRTC (camera-streamer)",WebrtcGo2rtc:"WebRTC (go2rtc)",WebrtcJanus:"WebRTC (janus-gateway)",WebrtcMediaMTX:"WebRTC (MediaMTX)"}},v={AllFiles:"Alle",Autorender:"Autorender",Cancel:"Abbrechen",Create:"Erstellen",CreateNewDirectory:"Neues Verzeichnis",CurrentPath:"Aktueller Pfad",Delete:"Löschen",DeleteDirectory:"Verzeichnis löschen",DeleteDirectoryQuestion:'Willst du wirklich das Verzeichnis "{name}" mit seinem gesamten Inhalt löschen?',DeleteSelectedQuestion:"Sollen wirklich {count} ausgewählte Dateien gelöscht werden?",DeleteSingleFileQuestion:'Soll die Datei "{name}" wirklich gelöscht werden?',Download:"Download",DuplicateLastframe:"Letztes Bild duplizieren",Empty:"Keine fertigen Zeitraffer gefunden.",Enabled:"Aktiviert",EstimatedLength:"Geschätzte Länge",Files:"Dateien",Filesize:"Dateigröße",Fixed:"fix",Framerate:"Bildwiederholrate",Frames:"Bilder",Free:"Frei",FreeDisk:"Freier Speicherplatz",LastModified:"Zuletzt geändert",MaxFramerate:"Max. Bildwiederholrate",MinFramerate:"Min. Bildwiederholrate",Name:"Name",NewDirectory:"Neues Verzeichnis",NoActiveTimelapse:"Keine Aufzeichnungen verfügbar.",Preview:"Vorschau",RefreshCurrentDirectory:"Verzeichnis aktualisieren",Rename:"Umbenennen",RenameDirectory:"Verzeichnis umbenennen",RenameFile:"Datei umbenennen",Render:"render",RenderSettings:"Render Einstellungen",SaveFrames:"Bilder speichern",Search:"suche",StartRender:"Rendering starten",Status:"Status",TargetFps:"Ziel-FPS",Targetlength:"Zieldauer",TimelapseFiles:"Zeitraffer Dateien",TimelapseRendering:"Zeitraffer-Rendering",TimelapseRenderingSuccessful:"Zeitraffer-Rendering erfolgreich",Total:"Gesamt",Type:"Typ",Used:"Belegt",Variable:"Variabel",Video:"Video"},z="Deutsch",A={App:e,BedScrews:n,CancelJobDialog:t,ConnectionDialog:r,Console:i,CoolDownDialog:a,DevicesDialog:s,Dialogs:o,Editor:l,EmergencyStopDialog:u,Files:d,FullscreenUpload:c,GCodeViewer:g,Heightmap:m,History:h,JobQueue:p,Machine:b,ManualProbe:f,Panels:D,PowerDeviceChangeDialog:S,Router:k,ScrewsTiltAdjust:w,SelectPrinterDialog:C,Settings:F,Timelapse:v,title:z};export{e as App,n as BedScrews,t as CancelJobDialog,r as ConnectionDialog,i as Console,a as CoolDownDialog,s as DevicesDialog,o as Dialogs,l as Editor,u as EmergencyStopDialog,d as Files,c as FullscreenUpload,g as GCodeViewer,m as Heightmap,h as History,p as JobQueue,b as Machine,f as ManualProbe,D as Panels,S as PowerDeviceChangeDialog,k as Router,w as ScrewsTiltAdjust,C as SelectPrinterDialog,F as Settings,v as Timelapse,A as default,z as title}; diff --git a/assets/default.fragment-BQ0cgw4g.js b/assets/default.fragment-BQ0cgw4g.js new file mode 100644 index 0000000..bee8254 --- /dev/null +++ b/assets/default.fragment-BQ0cgw4g.js @@ -0,0 +1 @@ +import{S as e}from"./Viewer-DVCEMRp5.js";import"./mainUVVaryingDeclaration-DltpozJN.js";import"./helperFunctions-CmftqOHQ.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./index-Bku7SJna.js";import"./echarts-DzoUeqWp.js";import"./codemirror-ZSHHXwGs.js";import"./meshUboDeclaration-BEPmj8E0.js";const t="decalFragmentDeclaration",a="#ifdef DECAL\nuniform vec4 vDecalInfos;\n#endif\n";e.IncludesShadersStore[t]=a;const r="defaultFragmentDeclaration",n="uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;uniform vec4 vSpecularColor;uniform vec3 vEmissiveColor;uniform vec3 vAmbientColor;uniform float visibility;\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY \nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;uniform vec2 vTangentSpaceParams;\n#endif\n#ifdef ALPHATEST\nuniform float alphaCutOff;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION) || defined(PREPASS)\nuniform mat4 view;\n#endif\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\n#ifndef REFRACTIONMAP_3D\nuniform mat4 refractionMatrix;\n#endif\n#ifdef REFRACTIONFRESNEL\nuniform vec4 refractionLeftColor;uniform vec4 refractionRightColor;\n#endif\n#if defined(USE_LOCAL_REFRACTIONMAP_CUBIC) && defined(REFRACTIONMAP_3D)\nuniform vec3 vRefractionPosition;uniform vec3 vRefractionSize; \n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\n#endif\n#ifdef DIFFUSEFRESNEL\nuniform vec4 diffuseLeftColor;uniform vec4 diffuseRightColor;\n#endif\n#ifdef OPACITYFRESNEL\nuniform vec4 opacityParts;\n#endif\n#ifdef EMISSIVEFRESNEL\nuniform vec4 emissiveLeftColor;uniform vec4 emissiveRightColor;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION) || defined(REFLECTIONMAP_EQUIRECTANGULAR) || defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_SKYBOX)\nuniform mat4 reflectionMatrix;\n#endif\n#ifndef REFLECTIONMAP_SKYBOX\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;uniform vec3 vReflectionSize; \n#endif\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 reflectionLeftColor;uniform vec4 reflectionRightColor;\n#endif\n#endif\n#ifdef DETAIL\nuniform vec4 vDetailInfos;\n#endif\n#include\n#define ADDITIONAL_FRAGMENT_DECLARATION\n";e.IncludesShadersStore[r]=n;const l="prePassDeclaration",f="#ifdef PREPASS\n#extension GL_EXT_draw_buffers : require\nlayout(location=0) out highp vec4 glFragData[{X}];highp vec4 gl_FragColor;\n#ifdef PREPASS_LOCAL_POSITION\nvarying highp vec3 vPosition;\n#endif\n#ifdef PREPASS_DEPTH\nvarying highp vec3 vViewPos;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvarying highp vec4 vCurrentPosition;varying highp vec4 vPreviousPosition;\n#endif\n#endif\n";e.IncludesShadersStore[l]=f;const s="oitDeclaration",d="#ifdef ORDER_INDEPENDENT_TRANSPARENCY\n#extension GL_EXT_draw_buffers : require\nlayout(location=0) out vec2 depth; \nlayout(location=1) out vec4 frontColor;layout(location=2) out vec4 backColor;\n#define MAX_DEPTH 99999.0\nhighp vec4 gl_FragColor;uniform sampler2D oitDepthSampler;uniform sampler2D oitFrontColorSampler;\n#endif\n";e.IncludesShadersStore[s]=d;const c="lightFragmentDeclaration",v="#ifdef LIGHT{X}\nuniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec4 vLightSpecular{X};\n#else\nvec4 vLightSpecular{X}=vec4(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];uniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];uniform float cascadeBlendFactor{X};varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowTexture{X};uniform highp sampler2DArray depthTexture{X};uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowTexture{X};\n#else\nuniform highp sampler2DArray shadowTexture{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);vec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowTexture{X};\n#else\nvarying vec4 vPositionFromLight{X};varying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowTexture{X};uniform highp sampler2D depthTexture{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowTexture{X};\n#else\nuniform sampler2D shadowTexture{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};uniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};uniform sampler2D projectionLightTexture{X};\n#endif\n#endif\n";e.IncludesShadersStore[c]=v;const h="lightUboDeclaration",u="#ifdef LIGHT{X}\nuniform Light{X}\n{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;vec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\nvec4 shadowsInfo;vec2 depthValues;} light{X};\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};uniform sampler2D projectionLightTexture{X};\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];uniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];uniform float cascadeBlendFactor{X};varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowTexture{X};uniform highp sampler2DArray depthTexture{X};uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];uniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowTexture{X};\n#else\nuniform highp sampler2DArray shadowTexture{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);vec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowTexture{X}; \n#else\nvarying vec4 vPositionFromLight{X};varying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowTexture{X};uniform highp sampler2D depthTexture{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowTexture{X};\n#else\nuniform sampler2D shadowTexture{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif\n";e.IncludesShadersStore[h]=u;const p="lightsFragmentFunctions",m="struct lightingInfo\n{vec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef NDOTL\nfloat ndl;\n#endif\n};lightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {lightingInfo result;vec3 lightVectorW;float attenuation=1.0;if (lightData.w==0.)\n{vec3 direction=lightData.xyz-vPositionW;attenuation=max(0.,1.0-length(direction)/range);lightVectorW=normalize(direction);}\nelse\n{lightVectorW=normalize(-lightData.xyz);}\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightVectorW);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {lightingInfo result;vec3 direction=lightData.xyz-vPositionW;vec3 lightVectorW=normalize(direction);float attenuation=max(0.,1.0-length(direction)/range);float cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w)\n{cosAngle=max(0.,pow(cosAngle,lightData.w));attenuation*=cosAngle;float ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightVectorW);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nresult.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {lightingInfo result;float ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);float specComp=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor;\n#endif\nreturn result;}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix,vec3 posW){vec4 strq=textureProjectionMatrix*vec4(posW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return textureColor;}";e.IncludesShadersStore[p]=m;const S="shadowsFragmentFunctions",g="#ifdef SHADOWS\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define TEXTUREFUNC(s,c,l) texture2DLodEXT(s,c,l)\n#else\n#define TEXTUREFUNC(s,c,b) texture2D(s,c,b)\n#endif\n#ifndef SHADOWFLOAT\nfloat unpack(vec4 color)\n{const vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}\n#endif\nfloat computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)\n{float mask=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));return mix(value,1.0,mask);}\n#define inline\nfloat computeShadowCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues)\n{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadow=textureCube(shadowSampler,directionToLight).x;\n#endif\nreturn depth>shadow ? darkness : 1.0;}\n#define inline\nfloat computeShadowWithPoissonSamplingCube(vec3 worldPos,vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues)\n{vec3 directionToLight=worldPos-lightPosition;float depth=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;float visibility=1.;vec3 poissonDisk[4];poissonDisk[0]=vec3(-1.0,1.0,-1.0);poissonDisk[1]=vec3(1.0,-1.0,-1.0);poissonDisk[2]=vec3(-1.0,-1.0,-1.0);poissonDisk[3]=vec3(1.0,-1.0,1.0);\n#ifndef SHADOWFLOAT\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;}\n#endif\n#define inline\nfloat computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{float shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(TEXTUREFUNC(shadowSampler,uv,0.));\n#else\nfloat shadow=TEXTUREFUNC(shadowSampler,uv,0.).x;\n#endif\nreturn shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;}}\n#define inline\nfloat computeShadowWithPoissonSampling(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{float shadowPixelDepth=clamp(depthMetric,0.,1.0);float visibility=1.;vec2 poissonDisk[4];poissonDisk[0]=vec2(-0.94201624,-0.39906216);poissonDisk[1]=vec2(0.94558609,-0.76890725);poissonDisk[2]=vec2(-0.094184101,-0.92938870);poissonDisk[3]=vec2(0.34495938,0.29387760);\n#ifndef SHADOWFLOAT\nif (unpack(TEXTUREFUNC(shadowSampler,uv+poissonDisk[0]*mapSize,0.))1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{float shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.));\n#else\nfloat shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}\n#define inline\nfloat computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec2 uv=0.5*clipSpace.xy+vec2(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{return 1.0;}\nelse\n{float shadowPixelDepth=clamp(depthMetric,0.,1.0); \n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(TEXTUREFUNC(shadowSampler,uv,0.));\n#else\nfloat shadowMapSample=TEXTUREFUNC(shadowSampler,uv,0.).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}\n#ifdef IS_NDC_HALF_ZRANGE\n#define ZINCLIP clipSpace.z\n#else\n#define ZINCLIP uvDepth.z\n#endif\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define GREATEST_LESS_THAN_ONE 0.99999994\n#define DISABLE_UNIFORMITY_ANALYSIS\n#define inline\nfloat computeShadowWithCSMPCF1(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);float shadow=texture2D(shadowSampler,uvDepthLayer);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}\n#define inline\nfloat computeShadowWithCSMPCF3(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvec2 uvw0=3.-2.*st;vec2 uvw1=1.+2.*st;vec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;vec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));shadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));shadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));shadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}\n#define inline\nfloat computeShadowWithCSMPCF5(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvec2 uvw0=4.-3.*st;vec2 uvw1=vec2(7.);vec2 uvw2=1.+3.*st;vec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;vec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));shadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));shadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[0]),layer,uvDepth.z));shadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));shadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));shadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[1]),layer,uvDepth.z));shadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[2]),layer,uvDepth.z));shadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[2]),layer,uvDepth.z));shadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[2]),layer,uvDepth.z));shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}\n#define inline\nfloat computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;float shadow=TEXTUREFUNC(shadowSampler,uvDepth,0.);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\n#define inline\nfloat computeShadowWithPCF3(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvec2 uvw0=3.-2.*st;vec2 uvw1=1.+2.*st;vec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;vec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);shadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);shadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);shadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\n#define inline\nfloat computeShadowWithPCF5(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{if (depthMetric>1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;vec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x; \nuv+=0.5; \nvec2 st=fract(uv); \nvec2 base_uv=floor(uv)-0.5; \nbase_uv*=shadowMapSizeAndInverse.y; \nvec2 uvw0=4.-3.*st;vec2 uvw1=vec2(7.);vec2 uvw2=1.+3.*st;vec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;vec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;float shadow=0.;shadow+=uvw0.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z),0.);shadow+=uvw1.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z),0.);shadow+=uvw2.x*uvw0.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[0]),uvDepth.z),0.);shadow+=uvw0.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z),0.);shadow+=uvw1.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z),0.);shadow+=uvw2.x*uvw1.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[1]),uvDepth.z),0.);shadow+=uvw0.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[2]),uvDepth.z),0.);shadow+=uvw1.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[2]),uvDepth.z),0.);shadow+=uvw2.x*uvw2.y*TEXTUREFUNC(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[2]),uvDepth.z),0.);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}\nconst vec3 PoissonSamplers32[64]=vec3[64](\nvec3(0.06407013,0.05409927,0.),\nvec3(0.7366577,0.5789394,0.),\nvec3(-0.6270542,-0.5320278,0.),\nvec3(-0.4096107,0.8411095,0.),\nvec3(0.6849564,-0.4990818,0.),\nvec3(-0.874181,-0.04579735,0.),\nvec3(0.9989998,0.0009880066,0.),\nvec3(-0.004920578,-0.9151649,0.),\nvec3(0.1805763,0.9747483,0.),\nvec3(-0.2138451,0.2635818,0.),\nvec3(0.109845,0.3884785,0.),\nvec3(0.06876755,-0.3581074,0.),\nvec3(0.374073,-0.7661266,0.),\nvec3(0.3079132,-0.1216763,0.),\nvec3(-0.3794335,-0.8271583,0.),\nvec3(-0.203878,-0.07715034,0.),\nvec3(0.5912697,0.1469799,0.),\nvec3(-0.88069,0.3031784,0.),\nvec3(0.5040108,0.8283722,0.),\nvec3(-0.5844124,0.5494877,0.),\nvec3(0.6017799,-0.1726654,0.),\nvec3(-0.5554981,0.1559997,0.),\nvec3(-0.3016369,-0.3900928,0.),\nvec3(-0.5550632,-0.1723762,0.),\nvec3(0.925029,0.2995041,0.),\nvec3(-0.2473137,0.5538505,0.),\nvec3(0.9183037,-0.2862392,0.),\nvec3(0.2469421,0.6718712,0.),\nvec3(0.3916397,-0.4328209,0.),\nvec3(-0.03576927,-0.6220032,0.),\nvec3(-0.04661255,0.7995201,0.),\nvec3(0.4402924,0.3640312,0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.),\nvec3(0.)\n);const vec3 PoissonSamplers64[64]=vec3[64](\nvec3(-0.613392,0.617481,0.),\nvec3(0.170019,-0.040254,0.),\nvec3(-0.299417,0.791925,0.),\nvec3(0.645680,0.493210,0.),\nvec3(-0.651784,0.717887,0.),\nvec3(0.421003,0.027070,0.),\nvec3(-0.817194,-0.271096,0.),\nvec3(-0.705374,-0.668203,0.),\nvec3(0.977050,-0.108615,0.),\nvec3(0.063326,0.142369,0.),\nvec3(0.203528,0.214331,0.),\nvec3(-0.667531,0.326090,0.),\nvec3(-0.098422,-0.295755,0.),\nvec3(-0.885922,0.215369,0.),\nvec3(0.566637,0.605213,0.),\nvec3(0.039766,-0.396100,0.),\nvec3(0.751946,0.453352,0.),\nvec3(0.078707,-0.715323,0.),\nvec3(-0.075838,-0.529344,0.),\nvec3(0.724479,-0.580798,0.),\nvec3(0.222999,-0.215125,0.),\nvec3(-0.467574,-0.405438,0.),\nvec3(-0.248268,-0.814753,0.),\nvec3(0.354411,-0.887570,0.),\nvec3(0.175817,0.382366,0.),\nvec3(0.487472,-0.063082,0.),\nvec3(-0.084078,0.898312,0.),\nvec3(0.488876,-0.783441,0.),\nvec3(0.470016,0.217933,0.),\nvec3(-0.696890,-0.549791,0.),\nvec3(-0.149693,0.605762,0.),\nvec3(0.034211,0.979980,0.),\nvec3(0.503098,-0.308878,0.),\nvec3(-0.016205,-0.872921,0.),\nvec3(0.385784,-0.393902,0.),\nvec3(-0.146886,-0.859249,0.),\nvec3(0.643361,0.164098,0.),\nvec3(0.634388,-0.049471,0.),\nvec3(-0.688894,0.007843,0.),\nvec3(0.464034,-0.188818,0.),\nvec3(-0.440840,0.137486,0.),\nvec3(0.364483,0.511704,0.),\nvec3(0.034028,0.325968,0.),\nvec3(0.099094,-0.308023,0.),\nvec3(0.693960,-0.366253,0.),\nvec3(0.678884,-0.204688,0.),\nvec3(0.001801,0.780328,0.),\nvec3(0.145177,-0.898984,0.),\nvec3(0.062655,-0.611866,0.),\nvec3(0.315226,-0.604297,0.),\nvec3(-0.780145,0.486251,0.),\nvec3(-0.371868,0.882138,0.),\nvec3(0.200476,0.494430,0.),\nvec3(-0.494552,-0.711051,0.),\nvec3(0.612476,0.705252,0.),\nvec3(-0.578845,-0.768792,0.),\nvec3(-0.772454,-0.090976,0.),\nvec3(0.504440,0.372295,0.),\nvec3(0.155736,0.065157,0.),\nvec3(0.391522,0.849605,0.),\nvec3(-0.620106,-0.328104,0.),\nvec3(0.789239,-0.419965,0.),\nvec3(-0.545396,0.538133,0.),\nvec3(-0.178564,-0.596057,0.)\n);\n#define inline\nfloat computeShadowWithCSMPCSS(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=clamp(ZINCLIP,0.,GREATEST_LESS_THAN_ONE);vec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);float blockerDepth=0.0;float sumBlockerDepth=0.0;float numBlocker=0.0;for (int i=0; i1.0 || depthMetric<0.0) {return 1.0;}\nelse\n{vec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;vec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));uvDepth.z=ZINCLIP;float blockerDepth=0.0;float sumBlockerDepth=0.0;float numBlocker=0.0;for (int i=0; i=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function B2(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var i=e.call(r),n,a=[],o;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a}function F2(r,t,e){if(arguments.length===2)for(var i=0,n=t.length,a;i"u"&&typeof self<"u"?K.worker=!0:typeof navigator>"u"||navigator.userAgent.indexOf("Node.js")===0?(K.node=!0,K.svgSupported=!0):j_(navigator.userAgent,K);function j_(r,t){var e=t.browser,i=r.match(/Firefox\/([\d.]+)/),n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);i&&(e.firefox=!0,e.version=i[1]),n&&(e.ie=!0,e.version=n[1]),a&&(e.edge=!0,e.version=a[1],e.newEdge=+a[1].split(".")[0]>18),o&&(e.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!e.ie&&!e.edge,t.pointerEventsSupported="onpointerdown"in window&&(e.edge||e.ie&&+e.version>=11),t.domSupported=typeof document<"u";var s=document.documentElement.style;t.transform3dSupported=(e.ie&&"transition"in s||e.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||e.ie&&+e.version>=9}var rh=12,Ag="sans-serif",Br=rh+"px "+Ag,t1=20,e1=100,r1="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function i1(r){var t={};if(typeof JSON>"u")return t;for(var e=0;e=0)s=o*e.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",n[u]+":0",i[1-l]+":auto",n[1-u]+":auto",""].join("!important;"),r.appendChild(o),e.push(o)}return e}function C1(r,t,e){for(var i=e?"invTrans":"trans",n=t[i],a=t.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var f=r[u].getBoundingClientRect(),h=2*u,c=f.left,v=f.top;o.push(c,v),l=l&&a&&c===a[h]&&v===a[h+1],s.push(r[u].offsetLeft,r[u].offsetTop)}return l&&n?n:(t.srcCoords=o,t[i]=e?bv(s,o):bv(o,s))}function Ng(r){return r.nodeName.toUpperCase()==="CANVAS"}var D1=/([&<>"'])/g,A1={"&":"&","<":"<",">":">",'"':""","'":"'"};function ne(r){return r==null?"":(r+"").replace(D1,function(t,e){return A1[e]})}var L1=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,cl=[],I1=K.browser.firefox&&+K.browser.version.split(".")[0]<39;function $u(r,t,e,i){return e=e||{},i?Tv(r,t,e):I1&&t.layerX!=null&&t.layerX!==t.offsetX?(e.zrX=t.layerX,e.zrY=t.layerY):t.offsetX!=null?(e.zrX=t.offsetX,e.zrY=t.offsetY):Tv(r,t,e),e}function Tv(r,t,e){if(K.domSupported&&r.getBoundingClientRect){var i=t.clientX,n=t.clientY;if(Ng(r)){var a=r.getBoundingClientRect();e.zrX=i-a.left,e.zrY=n-a.top;return}else if(Xu(cl,r,i,n)){e.zrX=cl[0],e.zrY=cl[1];return}}e.zrX=e.zrY=0}function sh(r){return r||window.event}function fe(r,t,e){if(t=sh(t),t.zrX!=null)return t;var i=t.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&$u(r,o,t,e)}else{$u(r,t,t,e);var a=P1(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&L1.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function P1(r){var t=r.wheelDelta;if(t)return t;var e=r.deltaX,i=r.deltaY;if(e==null||i==null)return t;var n=Math.abs(i!==0?i:e),a=i>0?-1:i<0?1:e>0?-1:1;return 3*n*a}function R1(r,t,e,i){r.addEventListener(t,e,i)}function E1(r,t,e,i){r.removeEventListener(t,e,i)}var ua=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0},k1=function(){function r(){this._track=[]}return r.prototype.recognize=function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},r.prototype.clear=function(){return this._track.length=0,this},r.prototype._doTrack=function(t,e,i){var n=t.touches;if(n){for(var a={points:[],touches:[],target:e,event:t},o=0,s=n.length;o1&&i&&i.length>1){var a=Mv(i)/Mv(n);!isFinite(a)&&(a=1),t.pinchScale=a;var o=O1(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:r[0].target,event:t}}}}};function ji(){return[1,0,0,1,0,0]}function lh(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function N1(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function tn(r,t,e){var i=t[0]*e[0]+t[2]*e[1],n=t[1]*e[0]+t[3]*e[1],a=t[0]*e[2]+t[2]*e[3],o=t[1]*e[2]+t[3]*e[3],s=t[0]*e[4]+t[2]*e[5]+t[4],l=t[1]*e[4]+t[3]*e[5]+t[5];return r[0]=i,r[1]=n,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r}function Zu(r,t,e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4]+e[0],r[5]=t[5]+e[1],r}function uh(r,t,e,i){i===void 0&&(i=[0,0]);var n=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],f=Math.sin(e),h=Math.cos(e);return r[0]=n*h+s*f,r[1]=-n*f+s*h,r[2]=a*h+l*f,r[3]=-a*f+h*l,r[4]=h*(o-i[0])+f*(u-i[1])+i[0],r[5]=h*(u-i[1])-f*(o-i[0])+i[1],r}function B1(r,t,e){var i=e[0],n=e[1];return r[0]=t[0]*i,r[1]=t[1]*n,r[2]=t[2]*i,r[3]=t[3]*n,r[4]=t[4]*i,r[5]=t[5]*n,r}function Ps(r,t){var e=t[0],i=t[2],n=t[4],a=t[1],o=t[3],s=t[5],l=e*o-a*i;return l?(l=1/l,r[0]=o*l,r[1]=-a*l,r[2]=-i*l,r[3]=e*l,r[4]=(i*s-o*n)*l,r[5]=(a*n-e*s)*l,r):null}var q=function(){function r(t,e){this.x=t||0,this.y=e||0}return r.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(t,e){return this.x=t,this.y=e,this},r.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},r.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},r.prototype.scale=function(t){this.x*=t,this.y*=t},r.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},r.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},r.prototype.dot=function(t){return this.x*t.x+this.y*t.y},r.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},r.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},r.prototype.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},r.prototype.distanceSquare=function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.transform=function(t){if(t){var e=this.x,i=this.y;return this.x=t[0]*e+t[2]*i+t[4],this.y=t[1]*e+t[3]*i+t[5],this}},r.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},r.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},r.set=function(t,e,i){t.x=e,t.y=i},r.copy=function(t,e){t.x=e.x,t.y=e.y},r.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},r.lenSquare=function(t){return t.x*t.x+t.y*t.y},r.dot=function(t,e){return t.x*e.x+t.y*e.y},r.add=function(t,e,i){t.x=e.x+i.x,t.y=e.y+i.y},r.sub=function(t,e,i){t.x=e.x-i.x,t.y=e.y-i.y},r.scale=function(t,e,i){t.x=e.x*i,t.y=e.y*i},r.scaleAndAdd=function(t,e,i,n){t.x=e.x+i.x*n,t.y=e.y+i.y*n},r.lerp=function(t,e,i,n){var a=1-n;t.x=a*e.x+n*i.x,t.y=a*e.y+n*i.y},r}(),Ha=Math.min,Ga=Math.max,Hr=new q,Gr=new q,Wr=new q,Ur=new q,_n=new q,Sn=new q,ot=function(){function r(t,e,i,n){i<0&&(t=t+i,i=-i),n<0&&(e=e+n,n=-n),this.x=t,this.y=e,this.width=i,this.height=n}return r.prototype.union=function(t){var e=Ha(t.x,this.x),i=Ha(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Ga(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Ga(t.y+t.height,this.y+this.height)-i:this.height=t.height,this.x=e,this.y=i},r.prototype.applyTransform=function(t){r.applyTransform(this,this,t)},r.prototype.calculateTransform=function(t){var e=this,i=t.width/e.width,n=t.height/e.height,a=ji();return Zu(a,a,[-e.x,-e.y]),B1(a,a,[i,n]),Zu(a,a,[t.x,t.y]),a},r.prototype.intersect=function(t,e){if(!t)return!1;t instanceof r||(t=r.create(t));var i=this,n=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=t.x,u=t.x+t.width,f=t.y,h=t.y+t.height,c=!(ad&&(d=_,gd&&(d=S,y=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copy=function(t){r.copy(this,t)},r.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},r.prototype.isZero=function(){return this.width===0||this.height===0},r.create=function(t){return new r(t.x,t.y,t.width,t.height)},r.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},r.applyTransform=function(t,e,i){if(!i){t!==e&&r.copy(t,e);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],a=i[3],o=i[4],s=i[5];t.x=e.x*n+o,t.y=e.y*a+s,t.width=e.width*n,t.height=e.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}Hr.x=Wr.x=e.x,Hr.y=Ur.y=e.y,Gr.x=Ur.x=e.x+e.width,Gr.y=Wr.y=e.y+e.height,Hr.transform(i),Ur.transform(i),Gr.transform(i),Wr.transform(i),t.x=Ha(Hr.x,Gr.x,Wr.x,Ur.x),t.y=Ha(Hr.y,Gr.y,Wr.y,Ur.y);var l=Ga(Hr.x,Gr.x,Wr.x,Ur.x),u=Ga(Hr.y,Gr.y,Wr.y,Ur.y);t.width=l-t.x,t.height=u-t.y},r}(),Bg="silent";function F1(r,t,e){return{type:r,event:e,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:e.zrX,offsetY:e.zrY,gestureEvent:e.gestureEvent,pinchX:e.pinchX,pinchY:e.pinchY,pinchScale:e.pinchScale,wheelDelta:e.zrDelta,zrByTouch:e.zrByTouch,which:e.which,stop:V1}}function V1(){ua(this.event)}var z1=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.handler=null,e}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(nr),wn=function(){function r(t,e){this.x=t,this.y=e}return r}(),H1=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],pl=new ot(0,0,0,0),Fg=function(r){B(t,r);function t(e,i,n,a,o){var s=r.call(this)||this;return s._hovered=new wn(0,0),s.storage=e,s.painter=i,s.painterRoot=a,s._pointerSize=o,n=n||new z1,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new b1(s),s}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(A(H1,function(i){e.on&&e.on(i,this[i],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var i=e.zrX,n=e.zrY,a=Vg(this,i,n),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new wn(i,n):this.findHover(i,n),u=l.target,f=this.proxy;f.setCursor&&f.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",e),this.dispatchToElement(l,"mousemove",e),u&&u!==s&&this.dispatchToElement(l,"mouseover",e)},t.prototype.mouseout=function(e){var i=e.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",e),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new wn(0,0)},t.prototype.dispatch=function(e,i){var n=this[e];n&&n.call(this,i)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var i=this.proxy;i.setCursor&&i.setCursor(e)},t.prototype.dispatchToElement=function(e,i,n){e=e||{};var a=e.target;if(!(a&&a.silent)){for(var o="on"+i,s=F1(i,e,n);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(i,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(i,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(i,s)}))}},t.prototype.findHover=function(e,i,n){var a=this.storage.getDisplayList(),o=new wn(e,i);if(Cv(a,o,e,i,n),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,f=new ot(e-u,i-u,l,l),h=a.length-1;h>=0;h--){var c=a[h];c!==n&&!c.ignore&&!c.ignoreCoarsePointer&&(!c.parent||!c.parent.ignoreCoarsePointer)&&(pl.copy(c.getBoundingRect()),c.transform&&pl.applyTransform(c.transform),pl.intersect(f)&&s.push(c))}if(s.length)for(var v=4,d=Math.PI/12,g=Math.PI*2,p=0;p4)return;this._downPoint=null}this.dispatchToElement(a,r,t)}});function G1(r,t,e){if(r[r.rectHover?"rectContain":"contain"](t,e)){for(var i=r,n=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(t,e))return!1}i.silent&&(n=!0);var s=i.__hostTarget;i=s||i.parent}return n?Bg:!0}return!1}function Cv(r,t,e,i,n){for(var a=r.length-1;a>=0;a--){var o=r[a],s=void 0;if(o!==n&&!o.ignore&&(s=G1(o,e,i))&&(!t.topTarget&&(t.topTarget=o),s!==Bg)){t.target=o;break}}}function Vg(r,t,e){var i=r.painter;return t<0||t>i.getWidth()||e<0||e>i.getHeight()}var zg=32,bn=7;function W1(r){for(var t=0;r>=zg;)t|=r&1,r>>=1;return r+t}function Dv(r,t,e,i){var n=t+1;if(n===e)return 1;if(i(r[n++],r[t])<0){for(;n=0;)n++;return n-t}function U1(r,t,e){for(e--;t>>1,n(a,r[l])<0?s=l:o=l+1;var u=i-o;switch(u){case 3:r[o+3]=r[o+2];case 2:r[o+2]=r[o+1];case 1:r[o+1]=r[o];break;default:for(;u>0;)r[o+u]=r[o+u-1],u--}r[o]=a}}function gl(r,t,e,i,n,a){var o=0,s=0,l=1;if(a(r,t[e+n])>0){for(s=i-n;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}else{for(s=n+1;ls&&(l=s);var u=o;o=n-l,l=n-u}for(o++;o>>1);a(r,t[e+f])>0?o=f+1:l=f}return l}function yl(r,t,e,i,n,a){var o=0,s=0,l=1;if(a(r,t[e+n])<0){for(s=n+1;ls&&(l=s);var u=o;o=n-l,l=n-u}else{for(s=i-n;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}for(o++;o>>1);a(r,t[e+f])<0?l=f:o=f+1}return l}function Y1(r,t){var e=bn,i,n,a=0,o=[];i=[],n=[];function s(v,d){i[a]=v,n[a]=d,a+=1}function l(){for(;a>1;){var v=a-2;if(v>=1&&n[v-1]<=n[v]+n[v+1]||v>=2&&n[v-2]<=n[v]+n[v-1])n[v-1]n[v+1])break;f(v)}}function u(){for(;a>1;){var v=a-2;v>0&&n[v-1]=bn||x>=bn);if(T)break;b<0&&(b=0),b+=2}if(e=b,e<1&&(e=1),d===1){for(y=0;y=0;y--)r[w+y]=r[b+y];r[S]=o[_];return}for(var x=e;;){var T=0,M=0,C=!1;do if(t(o[_],r[m])<0){if(r[S--]=r[m--],T++,M=0,--d===0){C=!0;break}}else if(r[S--]=o[_--],M++,T=0,--p===1){C=!0;break}while((T|M)=0;y--)r[w+y]=r[b+y];if(d===0){C=!0;break}}if(r[S--]=o[_--],--p===1){C=!0;break}if(M=p-gl(r[m],o,0,p,p-1,t),M!==0){for(S-=M,_-=M,p-=M,w=S+1,b=_+1,y=0;y=bn||M>=bn);if(C)break;x<0&&(x=0),x+=2}if(e=x,e<1&&(e=1),p===1){for(S-=d,m-=d,w=S+1,b=m+1,y=d-1;y>=0;y--)r[w+y]=r[b+y];r[S]=o[_]}else{if(p===0)throw new Error;for(b=S-(p-1),y=0;ys&&(l=s),Av(r,e,e+l,e+a,t),a=l}o.pushRun(e,a),o.mergeRuns(),n-=a,e+=a}while(n!==0);o.forceMergeRuns()}}var Je=1,Eo=2,Hn=4,Lv=!1;function ml(){Lv||(Lv=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Iv(r,t){return r.zlevel===t.zlevel?r.z===t.z?r.z2-t.z2:r.z-t.z:r.zlevel-t.zlevel}var X1=function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Iv}return r.prototype.traverse=function(t,e){for(var i=0;i0&&(f.__clipPaths=[]),isNaN(f.z)&&(ml(),f.z=0),isNaN(f.z2)&&(ml(),f.z2=0),isNaN(f.zlevel)&&(ml(),f.zlevel=0),this._displayList[this._displayListLen++]=f}var h=t.getDecalElement&&t.getDecalElement();h&&this._updateAndAddDisplayable(h,e,i);var c=t.getTextGuideLine();c&&this._updateAndAddDisplayable(c,e,i);var v=t.getTextContent();v&&this._updateAndAddDisplayable(v,e,i)}},r.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},r.prototype.delRoot=function(t){if(t instanceof Array){for(var e=0,i=t.length;e=0&&this._roots.splice(n,1)},r.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},r.prototype.getRoots=function(){return this._roots},r.prototype.dispose=function(){this._displayList=null,this._roots=null},r}(),Ko;Ko=K.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};var Jn={linear:function(r){return r},quadraticIn:function(r){return r*r},quadraticOut:function(r){return r*(2-r)},quadraticInOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},cubicIn:function(r){return r*r*r},cubicOut:function(r){return--r*r*r+1},cubicInOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},quarticIn:function(r){return r*r*r*r},quarticOut:function(r){return 1- --r*r*r*r},quarticInOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},quinticIn:function(r){return r*r*r*r*r},quinticOut:function(r){return--r*r*r*r*r+1},quinticInOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},sinusoidalIn:function(r){return 1-Math.cos(r*Math.PI/2)},sinusoidalOut:function(r){return Math.sin(r*Math.PI/2)},sinusoidalInOut:function(r){return .5*(1-Math.cos(Math.PI*r))},exponentialIn:function(r){return r===0?0:Math.pow(1024,r-1)},exponentialOut:function(r){return r===1?1:1-Math.pow(2,-10*r)},exponentialInOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},circularIn:function(r){return 1-Math.sqrt(1-r*r)},circularOut:function(r){return Math.sqrt(1- --r*r)},circularInOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},elasticIn:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),-(e*Math.pow(2,10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)))},elasticOut:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*r)*Math.sin((r-t)*(2*Math.PI)/i)+1)},elasticInOut:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),(r*=2)<1?-.5*(e*Math.pow(2,10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)):e*Math.pow(2,-10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)*.5+1)},backIn:function(r){var t=1.70158;return r*r*((t+1)*r-t)},backOut:function(r){var t=1.70158;return--r*r*((t+1)*r+t)+1},backInOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)},bounceIn:function(r){return 1-Jn.bounceOut(1-r)},bounceOut:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},bounceInOut:function(r){return r<.5?Jn.bounceIn(r*2)*.5:Jn.bounceOut(r*2-1)*.5+.5}},Wa=Math.pow,kr=Math.sqrt,Hg=1e-8,Gg=1e-4,Pv=kr(3),Ua=1/3,$e=dn(),ce=dn(),en=dn();function Ir(r){return r>-1e-8&&rHg||r<-1e-8}function Lt(r,t,e,i,n){var a=1-n;return a*a*(a*r+3*n*t)+n*n*(n*i+3*a*e)}function Rv(r,t,e,i,n){var a=1-n;return 3*(((t-r)*a+2*(e-t)*n)*a+(i-e)*n*n)}function Qo(r,t,e,i,n,a){var o=i+3*(t-e)-r,s=3*(e-t*2+r),l=3*(t-r),u=r-n,f=s*s-3*o*l,h=s*l-9*o*u,c=l*l-3*s*u,v=0;if(Ir(f)&&Ir(h))if(Ir(s))a[0]=0;else{var d=-l/s;d>=0&&d<=1&&(a[v++]=d)}else{var g=h*h-4*f*c;if(Ir(g)){var p=h/f,d=-s/o+p,y=-p/2;d>=0&&d<=1&&(a[v++]=d),y>=0&&y<=1&&(a[v++]=y)}else if(g>0){var m=kr(g),_=f*s+1.5*o*(-h+m),S=f*s+1.5*o*(-h-m);_<0?_=-Wa(-_,Ua):_=Wa(_,Ua),S<0?S=-Wa(-S,Ua):S=Wa(S,Ua);var d=(-s-(_+S))/(3*o);d>=0&&d<=1&&(a[v++]=d)}else{var b=(2*f*s-3*o*h)/(2*kr(f*f*f)),w=Math.acos(b)/3,x=kr(f),T=Math.cos(w),d=(-s-2*x*T)/(3*o),y=(-s+x*(T+Pv*Math.sin(w)))/(3*o),M=(-s+x*(T-Pv*Math.sin(w)))/(3*o);d>=0&&d<=1&&(a[v++]=d),y>=0&&y<=1&&(a[v++]=y),M>=0&&M<=1&&(a[v++]=M)}}return v}function Ug(r,t,e,i,n){var a=6*e-12*t+6*r,o=9*t+3*i-3*r-9*e,s=3*t-3*r,l=0;if(Ir(o)){if(Wg(a)){var u=-s/a;u>=0&&u<=1&&(n[l++]=u)}}else{var f=a*a-4*o*s;if(Ir(f))n[0]=-a/(2*o);else if(f>0){var h=kr(f),u=(-a+h)/(2*o),c=(-a-h)/(2*o);u>=0&&u<=1&&(n[l++]=u),c>=0&&c<=1&&(n[l++]=c)}}return l}function Jo(r,t,e,i,n,a){var o=(t-r)*n+r,s=(e-t)*n+t,l=(i-e)*n+e,u=(s-o)*n+o,f=(l-s)*n+s,h=(f-u)*n+u;a[0]=r,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=f,a[6]=l,a[7]=i}function Yg(r,t,e,i,n,a,o,s,l,u,f){var h,c=.005,v=1/0,d,g,p,y;$e[0]=l,$e[1]=u;for(var m=0;m<1;m+=.05)ce[0]=Lt(r,e,n,o,m),ce[1]=Lt(t,i,a,s,m),p=Ji($e,ce),p=0&&p=0&&u<=1&&(n[l++]=u)}}else{var f=o*o-4*a*s;if(Ir(f)){var u=-o/(2*a);u>=0&&u<=1&&(n[l++]=u)}else if(f>0){var h=kr(f),u=(-o+h)/(2*a),c=(-o-h)/(2*a);u>=0&&u<=1&&(n[l++]=u),c>=0&&c<=1&&(n[l++]=c)}}return l}function Xg(r,t,e){var i=r+e-2*t;return i===0?.5:(r-t)/i}function jo(r,t,e,i,n){var a=(t-r)*i+r,o=(e-t)*i+t,s=(o-a)*i+a;n[0]=r,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=e}function $g(r,t,e,i,n,a,o,s,l){var u,f=.005,h=1/0;$e[0]=o,$e[1]=s;for(var c=0;c<1;c+=.05){ce[0]=Vt(r,e,n,c),ce[1]=Vt(t,i,a,c);var v=Ji($e,ce);v=0&&v=1?1:Qo(0,i,a,1,l,s)&&Lt(0,n,o,1,s[0])}}}var Q1=function(){function r(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||Ht,this.ondestroy=t.ondestroy||Ht,this.onrestart=t.onrestart||Ht,t.easing&&this.setEasing(t.easing)}return r.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=e;return}var i=this._life,n=t-this._startTime-this._pausedTime,a=n/i;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=n%i;this._startTime=t-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1},r.prototype.setEasing=function(t){this.easing=t,this.easingFunc=Z(t)?t:Jn[t]||fh(t)},r}(),Zg=function(){function r(t){this.value=t}return r}(),J1=function(){function r(){this._len=0}return r.prototype.insert=function(t){var e=new Zg(t);return this.insertEntry(e),e},r.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},r.prototype.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},r.prototype.len=function(){return this._len},r.prototype.clear=function(){this.head=this.tail=null,this._len=0},r}(),Ia=function(){function r(t){this._list=new J1,this._maxSize=10,this._map={},this._maxSize=t}return r.prototype.put=function(t,e){var i=this._list,n=this._map,a=null;if(n[t]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=e:s=new Zg(e),s.key=t,i.insertEntry(s),n[t]=s}return a},r.prototype.get=function(t){var e=this._map[t],i=this._list;if(e!=null)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},r.prototype.clear=function(){this._list.clear(),this._map={}},r.prototype.len=function(){return this._list.len()},r}(),kv={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ee(r){return r=Math.round(r),r<0?0:r>255?255:r}function j1(r){return r=Math.round(r),r<0?0:r>360?360:r}function fa(r){return r<0?0:r>1?1:r}function _l(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?Ee(parseFloat(t)/100*255):Ee(parseInt(t,10))}function mi(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?fa(parseFloat(t)/100):fa(parseFloat(t))}function Sl(r,t,e){return e<0?e+=1:e>1&&(e-=1),e*6<1?r+(t-r)*e*6:e*2<1?t:e*3<2?r+(t-r)*(2/3-e)*6:r}function Pr(r,t,e){return r+(t-r)*e}function ue(r,t,e,i,n){return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r}function qu(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}var qg=new Ia(20),Ya=null;function Li(r,t){Ya&&qu(Ya,t),Ya=qg.put(r,Ya||t.slice())}function ae(r,t){if(r){t=t||[];var e=qg.get(r);if(e)return qu(t,e);r=r+"";var i=r.replace(/ /g,"").toLowerCase();if(i in kv)return qu(t,kv[i]),Li(r,t),t;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var a=parseInt(i.slice(1,4),16);if(!(a>=0&&a<=4095)){ue(t,0,0,0,1);return}return ue(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),Li(r,t),t}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){ue(t,0,0,0,1);return}return ue(t,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),Li(r,t),t}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===n){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),f=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?ue(t,+u[0],+u[1],+u[2],1):ue(t,0,0,0,1);f=mi(u.pop());case"rgb":if(u.length>=3)return ue(t,_l(u[0]),_l(u[1]),_l(u[2]),u.length===3?f:mi(u[3])),Li(r,t),t;ue(t,0,0,0,1);return;case"hsla":if(u.length!==4){ue(t,0,0,0,1);return}return u[3]=mi(u[3]),Ku(u,t),Li(r,t),t;case"hsl":if(u.length!==3){ue(t,0,0,0,1);return}return Ku(u,t),Li(r,t),t;default:return}}ue(t,0,0,0,1)}}function Ku(r,t){var e=(parseFloat(r[0])%360+360)%360/360,i=mi(r[1]),n=mi(r[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return t=t||[],ue(t,Ee(Sl(o,a,e+1/3)*255),Ee(Sl(o,a,e)*255),Ee(Sl(o,a,e-1/3)*255),1),r.length===4&&(t[3]=r[3]),t}function tS(r){if(r){var t=r[0]/255,e=r[1]/255,i=r[2]/255,n=Math.min(t,e,i),a=Math.max(t,e,i),o=a-n,s=(a+n)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+n):u=o/(2-a-n);var f=((a-t)/6+o/2)/o,h=((a-e)/6+o/2)/o,c=((a-i)/6+o/2)/o;t===a?l=c-h:e===a?l=1/3+f-c:i===a&&(l=2/3+h-f),l<0&&(l+=1),l>1&&(l-=1)}var v=[l*360,u,s];return r[3]!=null&&v.push(r[3]),v}}function Ov(r,t){var e=ae(r);if(e){for(var i=0;i<3;i++)e[i]=e[i]*(1-t)|0,e[i]>255?e[i]=255:e[i]<0&&(e[i]=0);return pr(e,e.length===4?"rgba":"rgb")}}function wl(r,t,e){if(!(!(t&&t.length)||!(r>=0&&r<=1))){e=e||[];var i=r*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=t[n],s=t[a],l=i-n;return e[0]=Ee(Pr(o[0],s[0],l)),e[1]=Ee(Pr(o[1],s[1],l)),e[2]=Ee(Pr(o[2],s[2],l)),e[3]=fa(Pr(o[3],s[3],l)),e}}function eS(r,t,e){if(!(!(t&&t.length)||!(r>=0&&r<=1))){var i=r*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=ae(t[n]),s=ae(t[a]),l=i-n,u=pr([Ee(Pr(o[0],s[0],l)),Ee(Pr(o[1],s[1],l)),Ee(Pr(o[2],s[2],l)),fa(Pr(o[3],s[3],l))],"rgba");return e?{color:u,leftIndex:n,rightIndex:a,value:i}:u}}function bl(r,t,e,i){var n=ae(r);if(r)return n=tS(n),t!=null&&(n[0]=j1(t)),e!=null&&(n[1]=mi(e)),i!=null&&(n[2]=mi(i)),pr(Ku(n),"rgba")}function rS(r,t){var e=ae(r);if(e&&t!=null)return e[3]=fa(t),pr(e,"rgba")}function pr(r,t){if(!(!r||!r.length)){var e=r[0]+","+r[1]+","+r[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(e+=","+r[3]),t+"("+e+")"}}function ts(r,t){var e=ae(r);return e?(.299*e[0]+.587*e[1]+.114*e[2])*e[3]/255+(1-e[3])*t:0}var Nv=new Ia(100);function Qu(r){if(H(r)){var t=Nv.get(r);return t||(t=Ov(r,-.1),Nv.put(r,t)),t}else if(Ls(r)){var e=O({},r);return e.colorStops=G(r.colorStops,function(i){return{offset:i.offset,color:Ov(i.color,-.1)}}),e}return r}var es=Math.round;function ha(r){var t;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var e=ae(r);e&&(r="rgb("+e[0]+","+e[1]+","+e[2]+")",t=e[3])}return{color:r,opacity:t==null?1:t}}var iS=1e-4;function Rr(r){return r-1e-4}function Xa(r){return es(r*1e3)/1e3}function Ju(r){return es(r*1e4)/1e4}function nS(r){return"matrix("+Xa(r[0])+","+Xa(r[1])+","+Xa(r[2])+","+Xa(r[3])+","+Ju(r[4])+","+Ju(r[5])+")"}var aS={left:"start",right:"end",center:"middle",middle:"middle"};function oS(r,t,e){return e==="top"?r+=t/2:e==="bottom"&&(r-=t/2),r}function sS(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function lS(r){var t=r.style,e=r.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),e[0],e[1]].join(",")}function Kg(r){return r&&!!r.image}function uS(r){return r&&!!r.svgElement}function hh(r){return Kg(r)||uS(r)}function Qg(r){return r.type==="linear"}function Jg(r){return r.type==="radial"}function jg(r){return r&&(r.type==="linear"||r.type==="radial")}function Rs(r){return"url(#"+r+")"}function ty(r){var t=r.getGlobalScale(),e=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(e)/Math.log(10)),1)}function ey(r){var t=r.x||0,e=r.y||0,i=(r.rotation||0)*Po,n=$(r.scaleX,1),a=$(r.scaleY,1),o=r.skewX||0,s=r.skewY||0,l=[];return(t||e)&&l.push("translate("+t+"px,"+e+"px)"),i&&l.push("rotate("+i+")"),(n!==1||a!==1)&&l.push("scale("+n+","+a+")"),(o||s)&&l.push("skew("+es(o*Po)+"deg, "+es(s*Po)+"deg)"),l.join(" ")}var fS=function(){return K.hasGlobalWindow&&Z(window.btoa)?function(r){return window.btoa(unescape(encodeURIComponent(r)))}:typeof Buffer<"u"?function(r){return Buffer.from(r).toString("base64")}:function(r){return null}}(),ju=Array.prototype.slice;function fr(r,t,e){return(t-r)*e+r}function xl(r,t,e,i){for(var n=t.length,a=0;ai?t:r,a=Math.min(e,i),o=n[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)i.length=o;else for(var l=a;l=1},r.prototype.getAdditiveTrack=function(){return this._additiveTrack},r.prototype.addKeyframe=function(t,e,i){this._needsSort=!0;var n=this.keyframes,a=n.length,o=!1,s=Fv,l=e;if(ee(e)){var u=dS(e);s=u,(u===1&&!dt(e[0])||u===2&&!dt(e[0][0]))&&(o=!0)}else if(dt(e)&&!Zo(e))s=Za;else if(H(e))if(!isNaN(+e))s=Za;else{var f=ae(e);f&&(l=f,s=Gn)}else if(Ls(e)){var h=O({},l);h.colorStops=G(e.colorStops,function(v){return{offset:v.offset,color:ae(v.color)}}),Qg(e)?s=tf:Jg(e)&&(s=ef),l=h}a===0?this.valType=s:(s!==this.valType||s===Fv)&&(o=!0),this.discrete=this.discrete||o;var c={time:t,value:l,rawValue:e,percent:0};return i&&(c.easing=i,c.easingFunc=Z(i)?i:Jn[i]||fh(i)),n.push(c),c},r.prototype.prepare=function(t,e){var i=this.keyframes;this._needsSort&&i.sort(function(g,p){return g.time-p.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,l=qa(n),u=Vv(n),f=0;f=0&&!(o[f].percent<=e);f--);f=c(f,s-2)}else{for(f=h;fe);f++);f=c(f-1,s-2)}d=o[f+1],v=o[f]}if(v&&d){this._lastFr=f,this._lastFrP=e;var p=d.percent-v.percent,y=p===0?1:c((e-v.percent)/p,1);d.easingFunc&&(y=d.easingFunc(y));var m=i?this._additiveValue:u?xn:t[l];if((qa(a)||u)&&!m&&(m=this._additiveValue=[]),this.discrete)t[l]=y<1?v.rawValue:d.rawValue;else if(qa(a))a===No?xl(m,v[n],d[n],y):hS(m,v[n],d[n],y);else if(Vv(a)){var _=v[n],S=d[n],b=a===tf;t[l]={type:b?"linear":"radial",x:fr(_.x,S.x,y),y:fr(_.y,S.y,y),colorStops:G(_.colorStops,function(x,T){var M=S.colorStops[T];return{offset:fr(x.offset,M.offset,y),color:Oo(xl([],x.color,M.color,y))}}),global:S.global},b?(t[l].x2=fr(_.x2,S.x2,y),t[l].y2=fr(_.y2,S.y2,y)):t[l].r=fr(_.r,S.r,y)}else if(u)xl(m,v[n],d[n],y),i||(t[l]=Oo(m));else{var w=fr(v[n],d[n],y);i?this._additiveValue=w:t[l]=w}i&&this._addToTarget(t)}}},r.prototype._addToTarget=function(t){var e=this.valType,i=this.propName,n=this._additiveValue;e===Za?t[i]=t[i]+n:e===Gn?(ae(t[i],xn),$a(xn,xn,n,1),t[i]=Oo(xn)):e===No?$a(t[i],t[i],n,1):e===ry&&Bv(t[i],t[i],n,1)},r}(),vh=function(){function r(t,e,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&n){ah("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return r.prototype.getMaxTime=function(){return this._maxTime},r.prototype.getDelay=function(){return this._delay},r.prototype.getLoop=function(){return this._loop},r.prototype.getTarget=function(){return this._target},r.prototype.changeTarget=function(t){this._target=t},r.prototype.when=function(t,e,i){return this.whenWithKeys(t,e,it(e),i)},r.prototype.whenWithKeys=function(t,e,i,n){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,ko(u),n),this._trackKeys.push(s)}l.addKeyframe(t,ko(e[s]),n)}return this._maxTime=Math.max(this._maxTime,t),this},r.prototype.pause=function(){this._clip.pause(),this._paused=!0},r.prototype.resume=function(){this._clip.resume(),this._paused=!1},r.prototype.isPaused=function(){return!!this._paused},r.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},r.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,i=0;i0)){this._started=1;for(var e=this,i=[],n=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,t[n]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},r}();function Zi(){return new Date().getTime()}var gS=function(r){B(t,r);function t(e){var i=r.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,e=e||{},i.stage=e.stage||{},i}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var i=e.getClip();i&&this.addClip(i)},t.prototype.removeClip=function(e){if(e.animation){var i=e.prev,n=e.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var i=e.getClip();i&&this.removeClip(i),e.animation=null},t.prototype.update=function(e){for(var i=Zi()-this._pausedTime,n=i-this._time,a=this._head;a;){var o=a.next,s=a.step(i,n);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=i,e||(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function i(){e._running&&(Ko(i),!e._paused&&e.update())}Ko(i)},t.prototype.start=function(){this._running||(this._time=Zi(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Zi(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Zi()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var i=e.next;e.prev=e.next=e.animation=null,e=i}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,i){i=i||{},this.start();var n=new vh(e,i.loop);return this.addAnimator(n),n},t}(nr),yS=300,Tl=K.domSupported,Ml=function(){var r=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],e={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=G(r,function(n){var a=n.replace("mouse","pointer");return e.hasOwnProperty(a)?a:n});return{mouse:r,touch:t,pointer:i}}(),zv={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},Hv=!1;function rf(r){var t=r.pointerType;return t==="pen"||t==="touch"}function mS(r){r.touching=!0,r.touchTimer!=null&&(clearTimeout(r.touchTimer),r.touchTimer=null),r.touchTimer=setTimeout(function(){r.touching=!1,r.touchTimer=null},700)}function Cl(r){r&&(r.zrByTouch=!0)}function _S(r,t){return fe(r.dom,new SS(r,t),!0)}function iy(r,t){for(var e=t,i=!1;e&&e.nodeType!==9&&!(i=e.domBelongToZr||e!==t&&e===r.painterRoot);)e=e.parentNode;return i}var SS=function(){function r(t,e){this.stopPropagation=Ht,this.stopImmediatePropagation=Ht,this.preventDefault=Ht,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}return r}(),Ae={mousedown:function(r){r=fe(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=fe(this.dom,r);var t=this.__mayPointerCapture;t&&(r.zrX!==t[0]||r.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",r)},mouseup:function(r){r=fe(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=fe(this.dom,r);var t=r.toElement||r.relatedTarget;iy(this,t)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){Hv=!0,r=fe(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){Hv||(r=fe(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=fe(this.dom,r),Cl(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),Ae.mousemove.call(this,r),Ae.mousedown.call(this,r)},touchmove:function(r){r=fe(this.dom,r),Cl(r),this.handler.processGesture(r,"change"),Ae.mousemove.call(this,r)},touchend:function(r){r=fe(this.dom,r),Cl(r),this.handler.processGesture(r,"end"),Ae.mouseup.call(this,r),+new Date-+this.__lastTouchMomentMS||r<-5e-5}var Xr=[],Ii=[],Al=ji(),Ll=Math.abs,Es=function(){function r(){}return r.prototype.getLocalTransform=function(t){return r.getLocalTransform(this,t)},r.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},r.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},r.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},r.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},r.prototype.needLocalTransform=function(){return Yr(this.rotation)||Yr(this.x)||Yr(this.y)||Yr(this.scaleX-1)||Yr(this.scaleY-1)||Yr(this.skewX)||Yr(this.skewY)},r.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),i=this.transform;if(!(e||t)){i&&(Wv(i),this.invTransform=null);return}i=i||ji(),e?this.getLocalTransform(i):Wv(i),t&&(e?tn(i,t,i):N1(i,t)),this.transform=i,this._resolveGlobalScaleRatio(i)},r.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(e!=null&&e!==1){this.getGlobalScale(Xr);var i=Xr[0]<0?-1:1,n=Xr[1]<0?-1:1,a=((Xr[0]-i)*e+i)/Xr[0]||0,o=((Xr[1]-n)*e+n)/Xr[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||ji(),Ps(this.invTransform,t)},r.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},r.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],n=Math.atan2(t[1],t[0]),a=Math.PI/2+n-Math.atan2(t[3],t[2]);i=Math.sqrt(i)*Math.cos(a),e=Math.sqrt(e),this.skewX=a,this.skewY=0,this.rotation=-n,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=i,this.originX=0,this.originY=0}},r.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||ji(),tn(Ii,t.invTransform,e),e=Ii);var i=this.originX,n=this.originY;(i||n)&&(Al[4]=i,Al[5]=n,tn(Ii,e,Al),Ii[4]-=i,Ii[5]-=n,e=Ii),this.setLocalTransform(e)}},r.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},r.prototype.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&ye(i,i,n),i},r.prototype.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&ye(i,i,n),i},r.prototype.getLineScale=function(){var t=this.transform;return t&&Ll(t[0]-1)>1e-10&&Ll(t[3]-1)>1e-10?Math.sqrt(Ll(t[0]*t[3]-t[2]*t[1])):1},r.prototype.copyTransform=function(t){ay(this,t)},r.getLocalTransform=function(t,e){e=e||[];var i=t.originX||0,n=t.originY||0,a=t.scaleX,o=t.scaleY,s=t.anchorX,l=t.anchorY,u=t.rotation||0,f=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,v=t.skewY?Math.tan(-t.skewY):0;if(i||n||s||l){var d=i+s,g=n+l;e[4]=-d*a-c*g*o,e[5]=-g*o-v*d*a}else e[4]=e[5]=0;return e[0]=a,e[3]=o,e[1]=v*a,e[2]=c*o,u&&uh(e,e,u),e[4]+=i+f,e[5]+=n+h,e},r.initDefaultProps=function(){var t=r.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),r}(),va=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function ay(r,t){for(var e=0;e=0?parseFloat(r)/100*t:parseFloat(r):r}function is(r,t,e){var i=t.position||"inside",n=t.distance!=null?t.distance:5,a=e.height,o=e.width,s=a/2,l=e.x,u=e.y,f="left",h="top";if(i instanceof Array)l+=er(i[0],e.width),u+=er(i[1],e.height),f=null,h=null;else switch(i){case"left":l-=n,u+=s,f="right",h="middle";break;case"right":l+=n+o,u+=s,h="middle";break;case"top":l+=o/2,u-=n,f="center",h="bottom";break;case"bottom":l+=o/2,u+=a+n,f="center";break;case"inside":l+=o/2,u+=s,f="center",h="middle";break;case"insideLeft":l+=n,u+=s,h="middle";break;case"insideRight":l+=o-n,u+=s,f="right",h="middle";break;case"insideTop":l+=o/2,u+=n,f="center";break;case"insideBottom":l+=o/2,u+=a-n,f="center",h="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,f="right";break;case"insideBottomLeft":l+=n,u+=a-n,h="bottom";break;case"insideBottomRight":l+=o-n,u+=a-n,f="right",h="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=f,r.verticalAlign=h,r}var Il="__zr_normal__",Pl=va.concat(["ignore"]),CS=Fr(va,function(r,t){return r[t]=!0,r},{ignore:!1}),Pi={},DS=new ot(0,0,0,0),Os=function(){function r(t){this.id=Pg(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return r.prototype._init=function(t){this.attr(t)},r.prototype.drift=function(t,e,i){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=t,n[5]+=e,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=e.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=n?this:null;var u=!1;if(a.copyTransform(e),i.position!=null){var f=DS;i.layoutRect?f.copy(i.layoutRect):f.copy(this.getBoundingRect()),n||f.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Pi,i,f):is(Pi,i,f),a.x=Pi.x,a.y=Pi.y,o=Pi.align,s=Pi.verticalAlign;var h=i.origin;if(h&&i.rotation!=null){var c=void 0,v=void 0;h==="center"?(c=f.width*.5,v=f.height*.5):(c=er(h[0],f.width),v=er(h[1],f.height)),u=!0,a.originX=-a.x+c+(n?0:f.x),a.originY=-a.y+v+(n?0:f.y)}}i.rotation!=null&&(a.rotation=i.rotation);var d=i.offset;d&&(a.x+=d[0],a.y+=d[1],u||(a.originX=-d[0],a.originY=-d[1]));var g=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,p=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),y=void 0,m=void 0,_=void 0;g&&this.canBeInsideText()?(y=i.insideFill,m=i.insideStroke,(y==null||y==="auto")&&(y=this.getInsideTextFill()),(m==null||m==="auto")&&(m=this.getInsideTextStroke(y),_=!0)):(y=i.outsideFill,m=i.outsideStroke,(y==null||y==="auto")&&(y=this.getOutsideFill()),(m==null||m==="auto")&&(m=this.getOutsideStroke(y),_=!0)),y=y||"#000",(y!==p.fill||m!==p.stroke||_!==p.autoStroke||o!==p.align||s!==p.verticalAlign)&&(l=!0,p.fill=y,p.stroke=m,p.autoStroke=_,p.align=o,p.verticalAlign=s,e.setDefaultTextStyle(p)),e.__dirty|=Je,l&&e.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(t){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?sf:of},r.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),i=typeof e=="string"&&ae(e);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,pr(i,"rgba")},r.prototype.traverse=function(t,e){},r.prototype.attrKV=function(t,e){t==="textConfig"?this.setTextConfig(e):t==="textContent"?this.setTextContent(e):t==="clipPath"?this.setClipPath(e):t==="extra"?(this.extra=this.extra||{},O(this.extra,e)):this[t]=e},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(t,e){if(typeof t=="string")this.attrKV(t,e);else if(W(t))for(var i=t,n=it(i),a=0;a0},r.prototype.getState=function(t){return this.states[t]},r.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},r.prototype.clearStates=function(t){this.useState(Il,!1,t)},r.prototype.useState=function(t,e,i,n){var a=t===Il,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(ht(s,t)>=0&&(e||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(t)),u||(u=this.states&&this.states[t]),!u&&!a){ah("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(u);var f=!!(u&&u.hoverLayer||n);f&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,u,this._normalState,e,!i&&!this.__inHover&&l&&l.duration>0,l);var h=this._textContent,c=this._textGuide;return h&&h.useState(t,e,i,f),c&&c.useState(t,e,i,f),a?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),u}}},r.prototype.useStates=function(t,e,i){if(!t.length)this.clearStates();else{var n=[],a=this.currentStates,o=t.length,s=o===a.length;if(s){for(var l=0;l0,d);var g=this._textContent,p=this._textGuide;g&&g.useStates(t,e,c),p&&p.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}},r.prototype.isSilent=function(){for(var t=this.silent,e=this.parent;!t&&e;){if(e.silent){t=!0;break}e=e.parent}return t},r.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var i=this.currentStates.slice();i.splice(e,1),this.useStates(i)}},r.prototype.replaceState=function(t,e,i){var n=this.currentStates.slice(),a=ht(n,t),o=ht(n,e)>=0;a>=0?o?n.splice(a,1):n[a]=e:i&&!o&&n.push(e),this.useStates(n)},r.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},r.prototype._mergeStates=function(t){for(var e={},i,n=0;n=0&&a.splice(o,1)}),this.animators.push(t),i&&i.animation.addAnimator(t),i&&i.wakeUp()},r.prototype.updateDuringAnimation=function(t){this.markRedraw()},r.prototype.stopAnimation=function(t,e){for(var i=this.animators,n=i.length,a=[],o=0;o0&&e.during&&a[0].during(function(d,g){e.during(g)});for(var c=0;c0||n.force&&!o.length){var T=void 0,M=void 0,C=void 0;if(s){M={},c&&(T={});for(var S=0;S<_;S++){var y=g[S];M[y]=e[y],c?T[y]=i[y]:e[y]=i[y]}}else if(c){C={};for(var S=0;S<_;S++){var y=g[S];C[y]=ko(e[y]),LS(e,i,y)}}var b=new vh(e,!1,!1,h?It(d,function(L){return L.targetName===t}):null);b.targetName=t,n.scope&&(b.scope=n.scope),c&&T&&b.whenWithKeys(0,T,g),C&&b.whenWithKeys(0,C,g),b.whenWithKeys(u==null?500:u,s?M:i,g).delay(f||0),r.addAnimator(b,t),o.push(b)}}var Ct=function(r){B(t,r);function t(e){var i=r.call(this)||this;return i.isGroup=!0,i._children=[],i.attr(e),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var i=this._children,n=0;n=0&&(n.splice(a,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,i){var n=ht(this._children,e);return n>=0&&this.replaceAt(i,n),this},t.prototype.replaceAt=function(e,i){var n=this._children,a=n[i];if(e&&e!==this&&e.parent!==this&&e!==a){n[i]=e,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var i=this.__zr;i&&i!==e.__zr&&e.addSelfToZr(i),i&&i.refresh()},t.prototype.remove=function(e){var i=this.__zr,n=this._children,a=ht(n,e);return a<0?this:(n.splice(a,1),e.parent=null,i&&e.removeSelfFromZr(i),i&&i.refresh(),this)},t.prototype.removeAll=function(){for(var e=this._children,i=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},r.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},r.prototype.on=function(t,e,i){return this._disposed||this.handler.on(t,e,i),this},r.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},r.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},r.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e0){if(r<=n)return o;if(r>=a)return s}else{if(r>=n)return o;if(r<=a)return s}else{if(r===n)return o;if(r===a)return s}return(r-n)/l*u+o}function pt(r,t){switch(r){case"center":case"middle":r="50%";break;case"left":case"top":r="0%";break;case"right":case"bottom":r="100%";break}return H(r)?VS(r).match(/%$/)?parseFloat(r)/100*t:parseFloat(r):r==null?NaN:+r}function Dt(r,t,e){return t==null&&(t=10),t=Math.min(Math.max(0,t),ly),r=(+r).toFixed(t),e?r:+r}function uy(r){return r.sort(function(t,e){return t-e}),r}function hr(r){if(r=+r,isNaN(r))return 0;if(r>1e-14){for(var t=1,e=0;e<15;e++,t*=10)if(Math.round(r*t)/t===r)return e}return zS(r)}function zS(r){var t=r.toString().toLowerCase(),e=t.indexOf("e"),i=e>0?+t.slice(e+1):0,n=e>0?e:t.length,a=t.indexOf("."),o=a<0?0:n-1-a;return Math.max(0,o-i)}function HS(r,t){var e=Math.log,i=Math.LN10,n=Math.floor(e(r[1]-r[0])/i),a=Math.round(e(Math.abs(t[1]-t[0]))/i),o=Math.min(Math.max(-n+a,0),20);return isFinite(o)?o:20}function GS(r,t){var e=Fr(r,function(v,d){return v+(isNaN(d)?0:d)},0);if(e===0)return[];for(var i=Math.pow(10,t),n=G(r,function(v){return(isNaN(v)?0:v)/e*i*100}),a=i*100,o=G(n,function(v){return Math.floor(v)}),s=Fr(o,function(v,d){return v+d},0),l=G(n,function(v,d){return v-o[d]});su&&(u=l[h],f=h);++o[f],l[f]=0,++s}return G(o,function(v){return v/i})}function WS(r,t){var e=Math.max(hr(r),hr(t)),i=r+t;return e>ly?i:Dt(i,e)}function fy(r){var t=Math.PI*2;return(r%t+t)%t}function ns(r){return r>-1e-4&&r=10&&t++,t}function hy(r,t){var e=dh(r),i=Math.pow(10,e),n=r/i,a;return n<1.5?a=1:n<2.5?a=2:n<4?a=3:n<7?a=5:a=10,r=a*i,e>=-20?+r.toFixed(e<0?-e:0):r}function $v(r){r.sort(function(l,u){return s(l,u,0)?-1:1});for(var t=-1/0,e=1,i=0;i=0||a&&ht(a,l)<0)){var u=i.getShallow(l,t);u!=null&&(o[r[s][0]]=u)}}return o}}var gw=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],yw=da(gw),mw=function(){function r(){}return r.prototype.getAreaStyle=function(t,e){return yw(this,t,e)},r}(),ff=new Ia(50);function _w(r){if(typeof r=="string"){var t=ff.get(r);return t&&t.image}else return r}function mh(r,t,e,i,n){if(r)if(typeof r=="string"){if(t&&t.__zrImageSrc===r||!e)return t;var a=ff.get(r),o={hostEl:e,cb:i,cbPayload:n};return a?(t=a.image,!Bs(t)&&a.pending.push(o)):(t=cn.loadImage(r,Qv,Qv),t.__zrImageSrc=r,ff.put(r,t.__cachedImgObj={image:t,pending:[o]})),t}else return r;else return t}function Qv(){var r=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=o;l++)s-=o;var u=oe(e,t);return u>s&&(e="",u=0),s=r-u,n.ellipsis=e,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=r,n}function wy(r,t){var e=t.containerWidth,i=t.font,n=t.contentWidth;if(!e)return"";var a=oe(r,i);if(a<=e)return r;for(var o=0;;o++){if(a<=n||o>=t.maxIterations){r+=t.ellipsis;break}var s=o===0?ww(r,n,t.ascCharWidth,t.cnCharWidth):a>0?Math.floor(r.length*n/a):0;r=r.substr(0,s),a=oe(r,i)}return r===""&&(r=t.placeholder),r}function ww(r,t,e,i){for(var n=0,a=0,o=r.length;av&&u){var d=Math.floor(v/s);h=h.slice(0,d)}if(r&&a&&f!=null)for(var g=Sy(f,n,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),p=0;ps&&Nl(e,r.substring(s,u),t,o),Nl(e,l[2],t,o,l[1]),s=Ol.lastIndex}sn){b>0?(m.tokens=m.tokens.slice(0,b),p(m,S,_),e.lines=e.lines.slice(0,y+1)):e.lines=e.lines.slice(0,y);break t}var L=x.width,I=L==null||L==="auto";if(typeof L=="string"&&L.charAt(L.length-1)==="%")w.percentWidth=L,f.push(w),w.contentWidth=oe(w.text,C);else{if(I){var P=x.backgroundColor,R=P&&P.image;R&&(R=_w(R),Bs(R)&&(w.width=Math.max(w.width,R.width*D/R.height)))}var E=d&&i!=null?i-S:null;E!=null&&E0&&d+i.accumWidth>i.width&&(f=t.split("\n"),u=!0),i.accumWidth=d}else{var g=by(t,l,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+v,h=g.linesWidths,f=g.lines}}else f=t.split("\n");for(var p=0;p=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var Dw=Fr(",&?/;] ".split(""),function(r,t){return r[t]=!0,r},{});function Aw(r){return Cw(r)?!!Dw[r]:!0}function by(r,t,e,i,n){for(var a=[],o=[],s="",l="",u=0,f=0,h=0;he:n+f+v>e){f?(s||l)&&(d?(s||(s=l,l="",u=0,f=u),a.push(s),o.push(f-u),l+=c,u+=v,s="",f=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(f),s=c,f=v)):d?(a.push(l),o.push(u),l=c,u=v):(a.push(c),o.push(v));continue}f+=v,d?(l+=c,u+=v):(l&&(s+=l,l="",u=0),s+=c)}return!a.length&&!s&&(s=r,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(f)),a.length===1&&(f+=n),{accumWidth:f,lines:a,linesWidths:o}}var hf="__zr_style_"+Math.round(Math.random()*10),_i={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Fs={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};_i[hf]=!0;var jv=["z","z2","invisible"],Lw=["invisible"],Ea=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype._init=function(e){for(var i=it(e),n=0;n1e-4){s[0]=r-e,s[1]=t-i,l[0]=r+e,l[1]=t+i;return}if(Ka[0]=zl(n)*e+r,Ka[1]=Vl(n)*i+t,Qa[0]=zl(a)*e+r,Qa[1]=Vl(a)*i+t,u(s,Ka,Qa),f(l,Ka,Qa),n=n%Zr,n<0&&(n=n+Zr),a=a%Zr,a<0&&(a=a+Zr),n>a&&!o?a+=Zr:nn&&(Ja[0]=zl(v)*e+r,Ja[1]=Vl(v)*i+t,u(s,Ja,s),f(l,Ja,l))}var ut={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},qr=[],Kr=[],He=[],Sr=[],Ge=[],We=[],Hl=Math.min,Gl=Math.max,Qr=Math.cos,Jr=Math.sin,lr=Math.abs,vf=Math.PI,Ar=vf*2,Wl=typeof Float32Array<"u",Tn=[];function Ul(r){var t=Math.round(r/vf*1e8)/1e8;return t%2*vf}function xy(r,t){var e=Ul(r[0]);e<0&&(e+=Ar);var i=e-r[0],n=r[1];n+=i,!t&&n-e>=Ar?n=e+Ar:t&&e-n>=Ar?n=e-Ar:!t&&e>n?n=e+(Ar-Ul(e-n)):t&&e0&&(this._ux=lr(i/rs/t)||0,this._uy=lr(i/rs/e)||0)},r.prototype.setDPR=function(t){this.dpr=t},r.prototype.setContext=function(t){this._ctx=t},r.prototype.getContext=function(){return this._ctx},r.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},r.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},r.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(ut.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},r.prototype.lineTo=function(t,e){var i=lr(t-this._xi),n=lr(e-this._yi),a=i>this._ux||n>this._uy;if(this.addData(ut.L,t,e),this._ctx&&a&&this._ctx.lineTo(t,e),a)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},r.prototype.bezierCurveTo=function(t,e,i,n,a,o){return this._drawPendingPt(),this.addData(ut.C,t,e,i,n,a,o),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,a,o),this._xi=a,this._yi=o,this},r.prototype.quadraticCurveTo=function(t,e,i,n){return this._drawPendingPt(),this.addData(ut.Q,t,e,i,n),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this._xi=i,this._yi=n,this},r.prototype.arc=function(t,e,i,n,a,o){this._drawPendingPt(),Tn[0]=n,Tn[1]=a,xy(Tn,o),n=Tn[0],a=Tn[1];var s=a-n;return this.addData(ut.A,t,e,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(t,e,i,n,a,o),this._xi=Qr(a)*i+t,this._yi=Jr(a)*i+e,this},r.prototype.arcTo=function(t,e,i,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,i,n,a),this},r.prototype.rect=function(t,e,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,i,n),this.addData(ut.R,t,e,i,n),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(ut.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&t.closePath(),this._xi=e,this._yi=i,this},r.prototype.fill=function(t){t&&t.fill(),this.toStatic()},r.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},r.prototype.len=function(){return this._len},r.prototype.setData=function(t){var e=t.length;!(this.data&&this.data.length===e)&&Wl&&(this.data=new Float32Array(e));for(var i=0;if.length&&(this._expandData(),f=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},r.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},r.prototype.getBoundingRect=function(){He[0]=He[1]=Ge[0]=Ge[1]=Number.MAX_VALUE,Sr[0]=Sr[1]=We[0]=We[1]=-Number.MAX_VALUE;var t=this.data,e=0,i=0,n=0,a=0,o;for(o=0;oi||lr(_)>n||c===e-1)&&(g=Math.sqrt(m*m+_*_),a=p,o=y);break}case ut.C:{var S=t[c++],b=t[c++],p=t[c++],y=t[c++],w=t[c++],x=t[c++];g=$1(a,o,S,b,p,y,w,x,10),a=w,o=x;break}case ut.Q:{var S=t[c++],b=t[c++],p=t[c++],y=t[c++];g=q1(a,o,S,b,p,y,10),a=p,o=y;break}case ut.A:var T=t[c++],M=t[c++],C=t[c++],D=t[c++],L=t[c++],I=t[c++],P=I+L;c+=1,d&&(s=Qr(L)*C+T,l=Jr(L)*D+M),g=Gl(C,D)*Hl(Ar,Math.abs(I)),a=Qr(P)*C+T,o=Jr(P)*D+M;break;case ut.R:{s=a=t[c++],l=o=t[c++];var R=t[c++],E=t[c++];g=R*2+E*2;break}case ut.Z:{var m=s-a,_=l-o;g=Math.sqrt(m*m+_*_),a=s,o=l;break}}g>=0&&(u[h++]=g,f+=g)}return this._pathLen=f,f},r.prototype.rebuildPath=function(t,e){var i=this.data,n=this._ux,a=this._uy,o=this._len,s,l,u,f,h,c,v=e<1,d,g,p=0,y=0,m,_=0,S,b;if(!(v&&(this._pathSegLen||this._calculateLength(),d=this._pathSegLen,g=this._pathLen,m=e*g,!m)))t:for(var w=0;w0&&(t.lineTo(S,b),_=0),x){case ut.M:s=u=i[w++],l=f=i[w++],t.moveTo(u,f);break;case ut.L:{h=i[w++],c=i[w++];var M=lr(h-u),C=lr(c-f);if(M>n||C>a){if(v){var D=d[y++];if(p+D>m){var L=(m-p)/D;t.lineTo(u*(1-L)+h*L,f*(1-L)+c*L);break t}p+=D}t.lineTo(h,c),u=h,f=c,_=0}else{var I=M*M+C*C;I>_&&(S=h,b=c,_=I)}break}case ut.C:{var P=i[w++],R=i[w++],E=i[w++],z=i[w++],k=i[w++],N=i[w++];if(v){var D=d[y++];if(p+D>m){var L=(m-p)/D;Jo(u,P,E,k,L,qr),Jo(f,R,z,N,L,Kr),t.bezierCurveTo(qr[1],Kr[1],qr[2],Kr[2],qr[3],Kr[3]);break t}p+=D}t.bezierCurveTo(P,R,E,z,k,N),u=k,f=N;break}case ut.Q:{var P=i[w++],R=i[w++],E=i[w++],z=i[w++];if(v){var D=d[y++];if(p+D>m){var L=(m-p)/D;jo(u,P,E,L,qr),jo(f,R,z,L,Kr),t.quadraticCurveTo(qr[1],Kr[1],qr[2],Kr[2]);break t}p+=D}t.quadraticCurveTo(P,R,E,z),u=E,f=z;break}case ut.A:var V=i[w++],U=i[w++],X=i[w++],J=i[w++],nt=i[w++],bt=i[w++],ct=i[w++],Nt=!i[w++],Rt=X>J?X:J,_t=lr(X-J)>.001,gt=nt+bt,Y=!1;if(v){var D=d[y++];p+D>m&&(gt=nt+bt*(m-p)/D,Y=!0),p+=D}if(_t&&t.ellipse?t.ellipse(V,U,X,J,ct,nt,gt,Nt):t.arc(V,U,Rt,nt,gt,Nt),Y)break t;T&&(s=Qr(nt)*X+V,l=Jr(nt)*J+U),u=Qr(gt)*X+V,f=Jr(gt)*J+U;break;case ut.R:s=u=i[w],l=f=i[w+1],h=i[w++],c=i[w++];var j=i[w++],qt=i[w++];if(v){var D=d[y++];if(p+D>m){var St=m-p;t.moveTo(h,c),t.lineTo(h+Hl(St,j),c),St-=j,St>0&&t.lineTo(h+j,c+Hl(St,qt)),St-=qt,St>0&&t.lineTo(h+Gl(j-St,0),c+qt),St-=j,St>0&&t.lineTo(h,c+Gl(qt-St,0));break t}p+=D}t.rect(h,c,j,qt);break;case ut.Z:if(v){var D=d[y++];if(p+D>m){var L=(m-p)/D;t.lineTo(u*(1-L)+s*L,f*(1-L)+l*L);break t}p+=D}t.closePath(),u=s,f=l}}},r.prototype.clone=function(){var t=new r,e=this.data;return t.data=e.slice?e.slice():Array.prototype.slice.call(e),t._len=this._len,t},r.CMD=ut,r.initDefaultProps=function(){var t=r.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),r}();function Ri(r,t,e,i,n,a,o){if(n===0)return!1;var s=n,l=0,u=r;if(o>t+s&&o>i+s||or+s&&a>e+s||at+h&&f>i+h&&f>a+h&&f>s+h||fr+h&&u>e+h&&u>n+h&&u>o+h||ut+u&&l>i+u&&l>a+u||lr+u&&s>e+u&&s>n+u||se||f+un&&(n+=Mn);var c=Math.atan2(l,s);return c<0&&(c+=Mn),c>=i&&c<=n||c+Mn>=i&&c+Mn<=n}function jr(r,t,e,i,n,a){if(a>t&&a>i||an?s:0}var wr=gr.CMD,ti=Math.PI*2,Bw=1e-4;function Fw(r,t){return Math.abs(r-t)t&&u>i&&u>a&&u>s||u1&&Vw(),v=Lt(t,i,a,s,ve[0]),c>1&&(d=Lt(t,i,a,s,ve[1]))),c===2?pt&&s>i&&s>a||s=0&&u<=1){for(var f=0,h=Vt(t,i,a,u),c=0;ce||s<-e)return 0;var l=Math.sqrt(e*e-s*s);Yt[0]=-l,Yt[1]=l;var u=Math.abs(i-n);if(u<1e-4)return 0;if(u>=ti-1e-4){i=0,n=ti;var f=a?1:-1;return o>=Yt[0]+r&&o<=Yt[1]+r?f:0}if(i>n){var h=i;i=n,n=h}i<0&&(i+=ti,n+=ti);for(var c=0,v=0;v<2;v++){var d=Yt[v];if(d+r>o){var g=Math.atan2(s,d),f=a?1:-1;g<0&&(g=ti+g),(g>=i&&g<=n||g+ti>=i&&g+ti<=n)&&(g>Math.PI/2&&g1&&(e||(s+=jr(l,u,f,h,i,n))),p&&(l=a[d],u=a[d+1],f=l,h=u),g){case wr.M:f=a[d++],h=a[d++],l=f,u=h;break;case wr.L:if(e){if(Ri(l,u,a[d],a[d+1],t,i,n))return!0}else s+=jr(l,u,a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case wr.C:if(e){if(kw(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],t,i,n))return!0}else s+=zw(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case wr.Q:if(e){if(Ow(l,u,a[d++],a[d++],a[d],a[d+1],t,i,n))return!0}else s+=Hw(l,u,a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case wr.A:var y=a[d++],m=a[d++],_=a[d++],S=a[d++],b=a[d++],w=a[d++];d+=1;var x=!!(1-a[d++]);c=Math.cos(b)*_+y,v=Math.sin(b)*S+m,p?(f=c,h=v):s+=jr(l,u,c,v,i,n);var T=(i-y)*S/_+y;if(e){if(Nw(y,m,S,b,b+w,x,t,T,n))return!0}else s+=Gw(y,m,S,b,b+w,x,T,n);l=Math.cos(b+w)*_+y,u=Math.sin(b+w)*S+m;break;case wr.R:f=l=a[d++],h=u=a[d++];var M=a[d++],C=a[d++];if(c=f+M,v=h+C,e){if(Ri(f,h,c,h,t,i,n)||Ri(c,h,c,v,t,i,n)||Ri(c,v,f,v,t,i,n)||Ri(f,v,f,h,t,i,n))return!0}else s+=jr(c,h,c,v,i,n),s+=jr(f,v,f,h,i,n);break;case wr.Z:if(e){if(Ri(l,u,f,h,t,i,n))return!0}else s+=jr(l,u,f,h,i,n);l=f,u=h;break}}return!e&&!Fw(u,h)&&(s+=jr(l,u,f,h,i,n)||0),s!==0}function Ww(r,t,e){return Ty(r,0,!1,t,e)}function Uw(r,t,e,i){return Ty(r,t,!0,e,i)}var os=st({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},_i),Yw={style:st({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Fs.style)},Yl=va.concat(["invisible","culling","z","z2","zlevel","parent"]),lt=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.update=function(){var e=this;r.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new t;n.buildPath===t.prototype.buildPath&&(n.buildPath=function(l){e.buildPath(l,e.shape)}),n.silent=!0;var a=n.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s.5?of:i>.2?TS:sf}else if(e)return sf}return of},t.prototype.getInsideTextStroke=function(e){var i=this.style.fill;if(H(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=ts(e,0)0))},t.prototype.hasFill=function(){var e=this.style,i=e.fill;return i!=null&&i!=="none"},t.prototype.getBoundingRect=function(){var e=this._rect,i=this.style,n=!e;if(n){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&Hn)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),e=o.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||n){s.copy(e);var l=i.strokeNoScale?this.getLineScale():1,u=i.lineWidth;if(!this.hasFill()){var f=this.strokeContainThreshold;u=Math.max(u,f==null?4:f)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return e},t.prototype.contain=function(e,i){var n=this.transformCoordToLocal(e,i),a=this.getBoundingRect(),o=this.style;if(e=n[0],i=n[1],a.contain(e,i)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),Uw(s,l/u,e,i)))return!0}if(this.hasFill())return Ww(s,e,i)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=Hn,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){e==="style"?this.dirtyStyle():e==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(e,i){e==="shape"?this.setShape(i):r.prototype.attrKV.call(this,e,i)},t.prototype.setShape=function(e,i){var n=this.shape;return n||(n=this.shape={}),typeof e=="string"?n[e]=i:O(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&Hn)},t.prototype.createStyle=function(e){return Is(os,e)},t.prototype._innerSaveToNormal=function(e){r.prototype._innerSaveToNormal.call(this,e);var i=this._normalState;e.shape&&!i.shape&&(i.shape=O({},this.shape))},t.prototype._applyStateObj=function(e,i,n,a,o,s){r.prototype._applyStateObj.call(this,e,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.shape?o?a?u=i.shape:(u=O({},n.shape),O(u,i.shape)):(u=O({},a?this.shape:n.shape),O(u,i.shape)):l&&(u=n.shape),u)if(o){this.shape=O({},this.shape);for(var f={},h=it(u),c=0;c0},t.prototype.hasFill=function(){var e=this.style,i=e.fill;return i!=null&&i!=="none"},t.prototype.createStyle=function(e){return Is(Xw,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var i=e.text;i!=null?i+="":i="";var n=ch(i,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var a=e.lineWidth;n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a}this._rect=n}return this._rect},t.initDefaultProps=function(){var e=t.prototype;e.dirtyRectTolerance=10}(),t}(Ea);pa.prototype.type="tspan";var $w=st({x:0,y:0},_i),Zw={style:st({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Fs.style)};function qw(r){return!!(r&&typeof r!="string"&&r.width&&r.height)}var Fe=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.createStyle=function(e){return Is($w,e)},t.prototype._getSize=function(e){var i=this.style,n=i[e];if(n!=null)return n;var a=qw(i.image)?i.image:this.__image;if(!a)return 0;var o=e==="width"?"height":"width",s=i[o];return s==null?a[e]:a[e]/a[o]*s},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return Zw},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new ot(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(Ea);Fe.prototype.type="image";function Kw(r,t){var e=t.x,i=t.y,n=t.width,a=t.height,o=t.r,s,l,u,f;n<0&&(e=e+n,n=-n),a<0&&(i=i+a,a=-a),typeof o=="number"?s=l=u=f=o:o instanceof Array?o.length===1?s=l=u=f=o[0]:o.length===2?(s=u=o[0],l=f=o[1]):o.length===3?(s=o[0],l=f=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],f=o[3]):s=l=u=f=0;var h;s+l>n&&(h=s+l,s*=n/h,l*=n/h),u+f>n&&(h=u+f,u*=n/h,f*=n/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+f>a&&(h=s+f,s*=a/h,f*=a/h),r.moveTo(e+s,i),r.lineTo(e+n-l,i),l!==0&&r.arc(e+n-l,i+l,l,-Math.PI/2,0),r.lineTo(e+n,i+a-u),u!==0&&r.arc(e+n-u,i+a-u,u,0,Math.PI/2),r.lineTo(e+f,i+a),f!==0&&r.arc(e+f,i+a-f,f,Math.PI/2,Math.PI),r.lineTo(e,i+s),s!==0&&r.arc(e+s,i+s,s,Math.PI,Math.PI*1.5)}var qi=Math.round;function My(r,t,e){if(t){var i=t.x1,n=t.x2,a=t.y1,o=t.y2;r.x1=i,r.x2=n,r.y1=a,r.y2=o;var s=e&&e.lineWidth;return s&&(qi(i*2)===qi(n*2)&&(r.x1=r.x2=pi(i,s,!0)),qi(a*2)===qi(o*2)&&(r.y1=r.y2=pi(a,s,!0))),r}}function Cy(r,t,e){if(t){var i=t.x,n=t.y,a=t.width,o=t.height;r.x=i,r.y=n,r.width=a,r.height=o;var s=e&&e.lineWidth;return s&&(r.x=pi(i,s,!0),r.y=pi(n,s,!0),r.width=Math.max(pi(i+a,s,!1)-r.x,a===0?0:1),r.height=Math.max(pi(n+o,s,!1)-r.y,o===0?0:1)),r}}function pi(r,t,e){if(!t)return r;var i=qi(r*2);return(i+qi(t))%2===0?i/2:(i+(e?1:-1))/2}var Qw=function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r}(),Jw={},Mt=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new Qw},t.prototype.buildPath=function(e,i){var n,a,o,s;if(this.subPixelOptimize){var l=Cy(Jw,i,this.style);n=l.x,a=l.y,o=l.width,s=l.height,l.r=i.r,i=l}else n=i.x,a=i.y,o=i.width,s=i.height;i.r?Kw(e,i):e.rect(n,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(lt);Mt.prototype.type="rect";var nc={fill:"#000"},ac=2,jw={style:st({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Fs.style)},At=function(r){B(t,r);function t(e){var i=r.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=nc,i.attr(e),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){r.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;e0,L=e.width!=null&&(e.overflow==="truncate"||e.overflow==="break"||e.overflow==="breakAll"),I=o.calculatedLineHeight,P=0;P=0&&(P=w[I],P.align==="right");)this._placeToken(P,e,T,y,L,"right",_),M-=P.width,L-=P.width,I--;for(D+=(a-(D-p)-(m-L)-M)/2;C<=I;)P=w[C],this._placeToken(P,e,T,y,D+P.width/2,"center",_),D+=P.width,C++;y+=T}},t.prototype._placeToken=function(e,i,n,a,o,s,l){var u=i.rich[e.styleName]||{};u.text=e.text;var f=e.verticalAlign,h=a+n/2;f==="top"?h=a+e.height/2:f==="bottom"&&(h=a+n-e.height/2);var c=!e.isLineHolder&&Xl(u);c&&this._renderBackground(u,i,s==="right"?o-e.width:s==="center"?o-e.width/2:o,h-e.height/2,e.width,e.height);var v=!!u.backgroundColor,d=e.textPadding;d&&(o=hc(o,s,d),h-=e.height/2-d[0]-e.innerHeight/2);var g=this._getOrCreateChild(pa),p=g.createStyle();g.useStyle(p);var y=this._defaultStyle,m=!1,_=0,S=fc("fill"in u?u.fill:"fill"in i?i.fill:(m=!0,y.fill)),b=uc("stroke"in u?u.stroke:"stroke"in i?i.stroke:!v&&!l&&(!y.autoStroke||m)?(_=ac,y.stroke):null),w=u.textShadowBlur>0||i.textShadowBlur>0;p.text=e.text,p.x=o,p.y=h,w&&(p.shadowBlur=u.textShadowBlur||i.textShadowBlur||0,p.shadowColor=u.textShadowColor||i.textShadowColor||"transparent",p.shadowOffsetX=u.textShadowOffsetX||i.textShadowOffsetX||0,p.shadowOffsetY=u.textShadowOffsetY||i.textShadowOffsetY||0),p.textAlign=s,p.textBaseline="middle",p.font=e.font||Br,p.opacity=Kn(u.opacity,i.opacity,1),sc(p,u),b&&(p.lineWidth=Kn(u.lineWidth,i.lineWidth,_),p.lineDash=$(u.lineDash,i.lineDash),p.lineDashOffset=i.lineDashOffset||0,p.stroke=b),S&&(p.fill=S);var x=e.contentWidth,T=e.contentHeight;g.setBoundingRect(new ot(Wn(p.x,x,p.textAlign),Ui(p.y,T,p.textBaseline),x,T))},t.prototype._renderBackground=function(e,i,n,a,o,s){var l=e.backgroundColor,u=e.borderWidth,f=e.borderColor,h=l&&l.image,c=l&&!h,v=e.borderRadius,d=this,g,p;if(c||e.lineHeight||u&&f){g=this._getOrCreateChild(Mt),g.useStyle(g.createStyle()),g.style.fill=null;var y=g.shape;y.x=n,y.y=a,y.width=o,y.height=s,y.r=v,g.dirtyShape()}if(c){var m=g.style;m.fill=l||null,m.fillOpacity=$(e.fillOpacity,1)}else if(h){p=this._getOrCreateChild(Fe),p.onload=function(){d.dirtyStyle()};var _=p.style;_.image=l.image,_.x=n,_.y=a,_.width=o,_.height=s}if(u&&f){var m=g.style;m.lineWidth=u,m.stroke=f,m.strokeOpacity=$(e.strokeOpacity,1),m.lineDash=e.borderDash,m.lineDashOffset=e.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(m.strokeFirst=!0,m.lineWidth*=2)}var S=(g||p).style;S.shadowBlur=e.shadowBlur||0,S.shadowColor=e.shadowColor||"transparent",S.shadowOffsetX=e.shadowOffsetX||0,S.shadowOffsetY=e.shadowOffsetY||0,S.opacity=Kn(e.opacity,i.opacity,1)},t.makeFont=function(e){var i="";return Ay(e)&&(i=[e.fontStyle,e.fontWeight,Dy(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),i&&qe(i)||e.textFont||e.font},t}(Ea),tb={left:!0,right:1,center:1},eb={top:1,bottom:1,middle:1},oc=["fontStyle","fontWeight","fontSize","fontFamily"];function Dy(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?rh+"px":r+"px"}function sc(r,t){for(var e=0;e=0,a=!1;if(r instanceof lt){var o=Ly(r),s=n&&o.selectFill||o.normalFill,l=n&&o.selectStroke||o.normalStroke;if(Ei(s)||Ei(l)){i=i||{};var u=i.style||{};u.fill==="inherit"?(a=!0,i=O({},i),u=O({},u),u.fill=s):!Ei(u.fill)&&Ei(s)?(a=!0,i=O({},i),u=O({},u),u.fill=Qu(s)):!Ei(u.stroke)&&Ei(l)&&(a||(i=O({},i),u=O({},u)),u.stroke=Qu(l)),i.style=u}}if(i&&i.z2==null){a||(i=O({},i));var f=r.z2EmphasisLift;i.z2=r.z2+(f!=null?f:nb)}return i}function fb(r,t,e){if(e&&e.z2==null){e=O({},e);var i=r.z2SelectLift;e.z2=r.z2+(i!=null?i:ab)}return e}function hb(r,t,e){var i=ht(r.currentStates,t)>=0,n=r.style.opacity,a=i?null:lb(r,["opacity"],t,{opacity:1});e=e||{};var o=e.style||{};return o.opacity==null&&(e=O({},e),o=O({opacity:i?n:a.opacity*.1},o),e.style=o),e}function $l(r,t){var e=this.states[r];if(this.style){if(r==="emphasis")return ub(this,r,t,e);if(r==="blur")return hb(this,r,e);if(r==="select")return fb(this,r,e)}return e}function vb(r){r.stateProxy=$l;var t=r.getTextContent(),e=r.getTextGuideLine();t&&(t.stateProxy=$l),e&&(e.stateProxy=$l)}function yc(r,t){!Ny(r,t)&&!r.__highByOuter&&mr(r,Iy)}function mc(r,t){!Ny(r,t)&&!r.__highByOuter&&mr(r,Py)}function ls(r,t){r.__highByOuter|=1<<(t||0),mr(r,Iy)}function us(r,t){!(r.__highByOuter&=~(1<<(t||0)))&&mr(r,Py)}function cb(r){mr(r,wh)}function Ey(r){mr(r,Ry)}function ky(r){mr(r,ob)}function Oy(r){mr(r,sb)}function Ny(r,t){return r.__highDownSilentOnTouch&&t.zrByTouch}function By(r){var t=r.getModel(),e=[],i=[];t.eachComponent(function(n,a){var o=_h(a),s=n==="series",l=s?r.getViewOfSeriesModel(a):r.getViewOfComponentModel(a);!s&&i.push(l),o.isBlured&&(l.group.traverse(function(u){Ry(u)}),s&&e.push(a)),o.isBlured=!1}),A(i,function(n){n&&n.toggleBlurSeries&&n.toggleBlurSeries(e,!1,t)})}function cf(r,t,e,i){var n=i.getModel();e=e||"coordinateSystem";function a(u,f){for(var h=0;h0){var s={dataIndex:o,seriesIndex:e.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function pf(r,t,e){xh(r,!0),mr(r,vb),Sb(r,t,e)}function _b(r){xh(r,!1)}function ga(r,t,e,i){i?_b(r):pf(r,t,e)}function Sb(r,t,e){var i=rt(r);t!=null?(i.focus=t,i.blurScope=e):i.focus&&(i.focus=null)}var Sc=["emphasis","blur","select"],wb={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function fs(r,t,e,i){e=e||"itemStyle";for(var n=0;n1&&(o*=Zl(d),s*=Zl(d));var g=(n===a?-1:1)*Zl((o*o*(s*s)-o*o*(v*v)-s*s*(c*c))/(o*o*(v*v)+s*s*(c*c)))||0,p=g*o*v/s,y=g*-s*c/o,m=(r+e)/2+to(h)*p-ja(h)*y,_=(t+i)/2+ja(h)*p+to(h)*y,S=Tc([1,0],[(c-p)/o,(v-y)/s]),b=[(c-p)/o,(v-y)/s],w=[(-1*c-p)/o,(-1*v-y)/s],x=Tc(b,w);if(mf(b,w)<=-1&&(x=Cn),mf(b,w)>=1&&(x=0),x<0){var T=Math.round(x/Cn*1e6)/1e6;x=Cn*2+T%2*Cn}f.addData(u,m,_,o,s,S,x,h,a)}var Db=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,Ab=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Lb(r){var t=new gr;if(!r)return t;var e=0,i=0,n=e,a=i,o,s=gr.CMD,l=r.match(Db);if(!l)return t;for(var u=0;uP*P+R*R&&(T=C,M=D),{cx:T,cy:M,x0:-f,y0:-h,x1:T*(n/b-1),y1:M*(n/b-1)}}function Bb(r){var t;if(F(r)){var e=r.length;if(!e)return r;e===1?t=[r[0],r[0],0,0]:e===2?t=[r[0],r[0],r[1],r[1]]:e===3?t=r.concat(r[2]):t=r}else t=[r,r,r,r];return t}function Fb(r,t){var e,i=Un(t.r,0),n=Un(t.r0||0,0),a=i>0,o=n>0;if(!(!a&&!o)){if(a||(i=n,n=0),n>i){var s=i;i=n,n=s}var l=t.startAngle,u=t.endAngle;if(!(isNaN(l)||isNaN(u))){var f=t.cx,h=t.cy,c=!!t.clockwise,v=Cc(u-l),d=v>ql&&v%ql;if(d>De&&(v=d),!(i>De))r.moveTo(f,h);else if(v>ql-De)r.moveTo(f+i*Oi(l),h+i*ei(l)),r.arc(f,h,i,l,u,!c),n>De&&(r.moveTo(f+n*Oi(u),h+n*ei(u)),r.arc(f,h,n,u,l,c));else{var g=void 0,p=void 0,y=void 0,m=void 0,_=void 0,S=void 0,b=void 0,w=void 0,x=void 0,T=void 0,M=void 0,C=void 0,D=void 0,L=void 0,I=void 0,P=void 0,R=i*Oi(l),E=i*ei(l),z=n*Oi(u),k=n*ei(u),N=v>De;if(N){var V=t.cornerRadius;V&&(e=Bb(V),g=e[0],p=e[1],y=e[2],m=e[3]);var U=Cc(i-n)/2;if(_=Ue(U,y),S=Ue(U,m),b=Ue(U,g),w=Ue(U,p),M=x=Un(_,S),C=T=Un(b,w),(x>De||T>De)&&(D=i*Oi(u),L=i*ei(u),I=n*Oi(l),P=n*ei(l),vDe){var _t=Ue(y,M),gt=Ue(m,M),Y=eo(I,P,R,E,i,_t,c),j=eo(D,L,z,k,i,gt,c);r.moveTo(f+Y.cx+Y.x0,h+Y.cy+Y.y0),M0&&r.arc(f+Y.cx,h+Y.cy,_t,Bt(Y.y0,Y.x0),Bt(Y.y1,Y.x1),!c),r.arc(f,h,i,Bt(Y.cy+Y.y1,Y.cx+Y.x1),Bt(j.cy+j.y1,j.cx+j.x1),!c),gt>0&&r.arc(f+j.cx,h+j.cy,gt,Bt(j.y1,j.x1),Bt(j.y0,j.x0),!c))}else r.moveTo(f+R,h+E),r.arc(f,h,i,l,u,!c);if(!(n>De)||!N)r.lineTo(f+z,h+k);else if(C>De){var _t=Ue(g,C),gt=Ue(p,C),Y=eo(z,k,D,L,n,-gt,c),j=eo(R,E,I,P,n,-_t,c);r.lineTo(f+Y.cx+Y.x0,h+Y.cy+Y.y0),C0&&r.arc(f+Y.cx,h+Y.cy,gt,Bt(Y.y0,Y.x0),Bt(Y.y1,Y.x1),!c),r.arc(f,h,n,Bt(Y.cy+Y.y1,Y.cx+Y.x1),Bt(j.cy+j.y1,j.cx+j.x1),c),_t>0&&r.arc(f+j.cx,h+j.cy,_t,Bt(j.y1,j.x1),Bt(j.y0,j.x0),!c))}else r.lineTo(f+z,h+k),r.arc(f,h,n,u,l,c)}r.closePath()}}}var Vb=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return r}(),zr=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new Vb},t.prototype.buildPath=function(e,i){Fb(e,i)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(lt);zr.prototype.type="sector";var zb=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r}(),Mh=function(r){B(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new zb},t.prototype.buildPath=function(e,i){var n=i.cx,a=i.cy,o=Math.PI*2;e.moveTo(n+i.r,a),e.arc(n,a,i.r,0,o,!1),e.moveTo(n+i.r0,a),e.arc(n,a,i.r0,0,o,!0)},t}(lt);Mh.prototype.type="ring";function Hb(r,t,e,i){var n=[],a=[],o=[],s=[],l,u,f,h;if(i){f=[1/0,1/0],h=[-1/0,-1/0];for(var c=0,v=r.length;c=2){if(i){var a=Hb(n,i,e,t.smoothConstraint);r.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(e?o:o-1);s++){var l=a[s*2],u=a[s*2+1],f=n[(s+1)%o];r.bezierCurveTo(l[0],l[1],u[0],u[1],f[0],f[1])}}else{r.moveTo(n[0][0],n[0][1]);for(var s=1,h=n.length;sii[1]){if(s=!1,a)return s;var f=Math.abs(ii[0]-ri[1]),h=Math.abs(ri[0]-ii[1]);Math.min(f,h)>n.len()&&(f0){var h=f.duration,c=f.delay,v=f.easing,d={duration:h,delay:c||0,easing:v,done:a,force:!!a||!!o,setToFinal:!u,scope:r,during:o};s?t.animateFrom(e,d):t.animateTo(e,d)}else t.stopAnimation(),!s&&t.attr(e),o&&o(1),a&&a()}function Et(r,t,e,i,n,a){Ah("update",r,t,e,i,n,a)}function Zt(r,t,e,i,n,a){Ah("enter",r,t,e,i,n,a)}function rn(r){if(!r.__zr)return!0;for(var t=0;tMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Lc(r){return!r.isGroup}function ox(r){return r.shape!=null}function qy(r,t,e){if(!r||!t)return;function i(o){var s={};return o.traverse(function(l){Lc(l)&&l.anid&&(s[l.anid]=l)}),s}function n(o){var s={x:o.x,y:o.y,rotation:o.rotation};return ox(o)&&(s.shape=O({},o.shape)),s}var a=i(r);t.traverse(function(o){if(Lc(o)&&o.anid){var s=a[o.anid];if(s){var l=n(o);o.attr(n(s)),Et(o,l,e,rt(o).dataIndex)}}})}function sx(r,t){return G(r,function(e){var i=e[0];i=ds(i,t.x),i=ps(i,t.x+t.width);var n=e[1];return n=ds(n,t.y),n=ps(n,t.y+t.height),[i,n]})}function lx(r,t){var e=ds(r.x,t.x),i=ps(r.x+r.width,t.x+t.width),n=ds(r.y,t.y),a=ps(r.y+r.height,t.y+t.height);if(i>=e&&a>=n)return{x:e,y:n,width:i-e,height:a-n}}function Ph(r,t,e){var i=O({rectHover:!0},t),n=i.style={strokeNoScale:!0};if(e=e||{x:-1,y:-1,width:2,height:2},r)return r.indexOf("image://")===0?(n.image=r.slice(8),st(n,e),new Fe(i)):Ih(r.replace("path://",""),i,e,"center")}function ux(r,t,e,i,n){for(var a=0,o=n[n.length-1];a1)return!1;var p=Kl(v,d,f,h)/c;return!(p<0||p>1)}function Kl(r,t,e,i){return r*i-e*t}function fx(r){return r<=1e-6&&r>=-1e-6}function Rh(r){var t=r.itemTooltipOption,e=r.componentModel,i=r.itemName,n=H(t)?{formatter:t}:t,a=e.mainType,o=e.componentIndex,s={componentType:a,name:i,$vars:["name"]};s[a+"Index"]=o;var l=r.formatterParamsExtra;l&&A(it(l),function(f){fn(s,f)||(s[f]=l[f],s.$vars.push(f))});var u=rt(r.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:st({content:i,formatterParams:s},n)}}function Ic(r,t){var e;r.isGroup&&(e=t(r)),e||r.traverse(t)}function Ys(r,t){if(r)if(F(r))for(var e=0;e=0&&s.push(l)}),s}}function Zs(r,t){return at(at({},r,!0),t,!0)}const Dx={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},Ax={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var gs="ZH",Eh="EN",an=Eh,Go={},kh={},tm=K.domSupported?function(){var r=(document.documentElement.lang||navigator.language||navigator.browserLanguage||an).toUpperCase();return r.indexOf(gs)>-1?gs:an}():an;function em(r,t){r=r.toUpperCase(),kh[r]=new yt(t),Go[r]=t}function Lx(r){if(H(r)){var t=Go[r.toUpperCase()]||{};return r===gs||r===Eh?Q(t):at(Q(t),Q(Go[an]),!1)}else return at(Q(r),Q(Go[an]),!1)}function Ix(r){return kh[r]}function Px(){return kh[an]}em(Eh,Dx);em(gs,Ax);var Oh=1e3,Nh=Oh*60,ia=Nh*60,ge=ia*24,Nc=ge*365,Yn={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},no="{yyyy}-{MM}-{dd}",Bc={year:"{yyyy}",month:"{yyyy}-{MM}",day:no,hour:no+" "+Yn.hour,minute:no+" "+Yn.minute,second:no+" "+Yn.second,millisecond:Yn.none},jl=["year","month","day","hour","minute","second","millisecond"],rm=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Xt(r,t){return r+="","0000".substr(0,t-r.length)+r}function on(r){switch(r){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return r}}function Rx(r){return r===on(r)}function Ex(r){switch(r){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function qs(r,t,e,i){var n=ir(r),a=n[Bh(e)](),o=n[sn(e)]()+1,s=Math.floor((o-1)/3)+1,l=n[Ks(e)](),u=n["get"+(e?"UTC":"")+"Day"](),f=n[ma(e)](),h=(f-1)%12+1,c=n[Qs(e)](),v=n[Js(e)](),d=n[js(e)](),g=i instanceof yt?i:Ix(i||tm)||Px(),p=g.getModel("time"),y=p.get("month"),m=p.get("monthAbbr"),_=p.get("dayOfWeek"),S=p.get("dayOfWeekAbbr");return(t||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,Xt(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[o-1]).replace(/{MMM}/g,m[o-1]).replace(/{MM}/g,Xt(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Xt(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,_[u]).replace(/{ee}/g,S[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Xt(f,2)).replace(/{H}/g,f+"").replace(/{hh}/g,Xt(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,Xt(c,2)).replace(/{m}/g,c+"").replace(/{ss}/g,Xt(v,2)).replace(/{s}/g,v+"").replace(/{SSS}/g,Xt(d,3)).replace(/{S}/g,d+"")}function kx(r,t,e,i,n){var a=null;if(H(e))a=e;else if(Z(e))a=e(r.value,t,{level:r.level});else{var o=O({},Yn);if(r.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(F(a)){var h=r.level==null?0:r.level>=0?r.level:a.length+r.level;h=Math.min(h,a.length-1),a=a[h]}}return qs(new Date(r.value),a,n,i)}function im(r,t){var e=ir(r),i=e[sn(t)]()+1,n=e[Ks(t)](),a=e[ma(t)](),o=e[Qs(t)](),s=e[Js(t)](),l=e[js(t)](),u=l===0,f=u&&s===0,h=f&&o===0,c=h&&a===0,v=c&&n===1,d=v&&i===1;return d?"year":v?"month":c?"day":h?"hour":f?"minute":u?"second":"millisecond"}function Fc(r,t,e){var i=dt(r)?ir(r):r;switch(t=t||im(r,e),t){case"year":return i[Bh(e)]();case"half-year":return i[sn(e)]()>=6?1:0;case"quarter":return Math.floor((i[sn(e)]()+1)/4);case"month":return i[sn(e)]();case"day":return i[Ks(e)]();case"half-day":return i[ma(e)]()/24;case"hour":return i[ma(e)]();case"minute":return i[Qs(e)]();case"second":return i[Js(e)]();case"millisecond":return i[js(e)]()}}function Bh(r){return r?"getUTCFullYear":"getFullYear"}function sn(r){return r?"getUTCMonth":"getMonth"}function Ks(r){return r?"getUTCDate":"getDate"}function ma(r){return r?"getUTCHours":"getHours"}function Qs(r){return r?"getUTCMinutes":"getMinutes"}function Js(r){return r?"getUTCSeconds":"getSeconds"}function js(r){return r?"getUTCMilliseconds":"getMilliseconds"}function Ox(r){return r?"setUTCFullYear":"setFullYear"}function nm(r){return r?"setUTCMonth":"setMonth"}function am(r){return r?"setUTCDate":"setDate"}function om(r){return r?"setUTCHours":"setHours"}function sm(r){return r?"setUTCMinutes":"setMinutes"}function lm(r){return r?"setUTCSeconds":"setSeconds"}function um(r){return r?"setUTCMilliseconds":"setMilliseconds"}function fm(r){if(!XS(r))return H(r)?r:"-";var t=(r+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function hm(r,t){return r=(r||"").toLowerCase().replace(/-(.)/g,function(e,i){return i.toUpperCase()}),t&&r&&(r=r.charAt(0).toUpperCase()+r.slice(1)),r}var Ba=Rg;function wf(r,t,e){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function n(f){return f&&qe(f)?f:"-"}function a(f){return!!(f!=null&&!isNaN(f)&&isFinite(f))}var o=t==="time",s=r instanceof Date;if(o||s){var l=o?ir(r):r;if(isNaN(+l)){if(s)return"-"}else return qs(l,i,e)}if(t==="ordinal")return Gu(r)?n(r):dt(r)&&a(r)?r+"":"-";var u=as(r);return a(u)?fm(u):Gu(r)?n(r):typeof r=="boolean"?r+"":"-"}var Vc=["a","b","c","d","e","f","g"],tu=function(r,t){return"{"+r+(t==null?"":t)+"}"};function vm(r,t,e){F(t)||(t=[t]);var i=t.length;if(!i)return"";for(var n=t[0].$vars||[],a=0;a':'';var o=e.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:n==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function V2(r,t,e){(r==="week"||r==="month"||r==="quarter"||r==="half-year"||r==="year")&&(r="MM-dd\nyyyy");var i=ir(t),n="get",a=i[n+"FullYear"](),o=i[n+"Month"]()+1,s=i[n+"Date"](),l=i[n+"Hours"](),u=i[n+"Minutes"](),f=i[n+"Seconds"](),h=i[n+"Milliseconds"]();return r=r.replace("MM",Xt(o,2)).replace("M",o).replace("yyyy",a).replace("yy",Xt(a%100+"",2)).replace("dd",Xt(s,2)).replace("d",s).replace("hh",Xt(l,2)).replace("h",l).replace("mm",Xt(u,2)).replace("m",u).replace("ss",Xt(f,2)).replace("s",f).replace("SSS",Xt(h,3)),r}function xi(r,t){return t=t||"transparent",H(r)?r:W(r)&&r.colorStops&&(r.colorStops[0]||{}).color||t}var Wo=A,Bx=["left","right","top","bottom","width","height"],ao=[["width","left","right"],["height","top","bottom"]];function Fh(r,t,e,i,n){var a=0,o=0;i==null&&(i=1/0),n==null&&(n=1/0);var s=0;t.eachChild(function(l,u){var f=l.getBoundingRect(),h=t.childAt(u+1),c=h&&h.getBoundingRect(),v,d;if(r==="horizontal"){var g=f.width+(c?-c.x+f.x:0);v=a+g,v>i||l.newline?(a=0,v=g,o+=s+e,s=f.height):s=Math.max(s,f.height)}else{var p=f.height+(c?-c.y+f.y:0);d=o+p,d>n||l.newline?(a+=s+e,o=0,d=p,s=f.width):s=Math.max(s,f.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),r==="horizontal"?a=v+e:o=d+e)})}var ln=Fh;Tt(Fh,"vertical");Tt(Fh,"horizontal");function Ti(r,t,e){e=Ba(e||0);var i=t.width,n=t.height,a=pt(r.left,i),o=pt(r.top,n),s=pt(r.right,i),l=pt(r.bottom,n),u=pt(r.width,i),f=pt(r.height,n),h=e[2]+e[0],c=e[1]+e[3],v=r.aspect;switch(isNaN(u)&&(u=i-s-c-a),isNaN(f)&&(f=n-l-h-o),v!=null&&(isNaN(u)&&isNaN(f)&&(v>i/n?u=i*.8:f=n*.8),isNaN(u)&&(u=v*f),isNaN(f)&&(f=u/v)),isNaN(a)&&(a=i-s-u-c),isNaN(o)&&(o=n-l-f-h),r.left||r.right){case"center":a=i/2-u/2-e[3];break;case"right":a=i-u-c;break}switch(r.top||r.bottom){case"middle":case"center":o=n/2-f/2-e[0];break;case"bottom":o=n-f-h;break}a=a||0,o=o||0,isNaN(u)&&(u=i-c-a-(s||0)),isNaN(f)&&(f=n-h-o-(l||0));var d=new ot(a+e[3],o+e[0],u,f);return d.margin=e,d}function Fx(r,t,e,i,n,a){a=a||r,a.x=r.x,a.y=r.y;var o;if(o=r.getBoundingRect(),r.needLocalTransform()){var s=r.getLocalTransform();o=o.clone(),o.applyTransform(s)}var l=Ti(st({width:o.width,height:o.height},t),e,i),u=l.x-o.x,f=l.y-o.y;return a.x+=u,a.y+=f,a===r&&r.markRedraw(),!0}function _a(r){var t=r.layoutMode||r.constructor.layoutMode;return W(t)?t:t?{type:t}:null}function hn(r,t,e){var i=e&&e.ignoreSize;!F(i)&&(i=[i,i]);var n=o(ao[0],0),a=o(ao[1],1);u(ao[0],r,n),u(ao[1],r,a);function o(f,h){var c={},v=0,d={},g=0,p=2;if(Wo(f,function(_){d[_]=r[_]}),Wo(f,function(_){s(t,_)&&(c[_]=d[_]=t[_]),l(c,_)&&v++,l(d,_)&&g++}),i[h])return l(t,f[1])?d[f[2]]=null:l(t,f[2])&&(d[f[1]]=null),d;if(g===p||!v)return d;if(v>=p)return c;for(var y=0;y=0;l--)s=at(s,n[l],!0);i.defaultOption=s}return i.defaultOption},t.prototype.getReferringComponents=function(e,i){var n=e+"Index",a=e+"Id";return Ra(this.ecModel,e,{index:this.get(n,!0),id:this.get(a,!0)},i)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")}},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type="component",e.id="",e.name="",e.mainType="",e.subType="",e.componentIndex=0}(),t}(yt);_y(ft,yt);Ns(ft);Mx(ft);Cx(ft,Hx);function Hx(r){var t=[];return A(ft.getClassesByMainType(r),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=G(t,function(e){return Ke(e).main}),r!=="dataset"&&ht(t,"dataset")<=0&&t.unshift("dataset"),t}var cm="";typeof navigator<"u"&&(cm=navigator.platform||"");var Ni="rgba(0, 0, 0, 0.2)";const Gx={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Ni,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Ni,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Ni,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Ni,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Ni,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Ni,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:cm.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var dm=tt(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),be="original",ie="arrayRows",ze="objectRows",ar="keyedColumns",Or="typedArray",pm="unknown",tr="column",gn="row",kt={Must:1,Might:2,Not:3},gm=mt();function Wx(r){gm(r).datasetMap=tt()}function Ux(r,t,e){var i={},n=Vh(t);if(!n||!r)return i;var a=[],o=[],s=t.ecModel,l=gm(s).datasetMap,u=n.uid+"_"+e.seriesLayoutBy,f,h;r=r.slice(),A(r,function(g,p){var y=W(g)?g:r[p]={name:g};y.type==="ordinal"&&f==null&&(f=p,h=d(y)),i[y.name]=[]});var c=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});A(r,function(g,p){var y=g.name,m=d(g);if(f==null){var _=c.valueWayDim;v(i[y],_,m),v(o,_,m),c.valueWayDim+=m}else if(f===p)v(i[y],0,m),v(a,0,m);else{var _=c.categoryWayDim;v(i[y],_,m),v(o,_,m),c.categoryWayDim+=m}});function v(g,p,y){for(var m=0;mt)return r[i];return r[e-1]}function Kx(r,t,e,i,n,a,o){a=a||r;var s=t(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(n))return u[n];var f=o==null||!i?e:qx(i,o);if(f=f||e,!(!f||!f.length)){var h=f[l];return n&&(u[n]=h),s.paletteIdx=(l+1)%f.length,h}}function Qx(r,t){t(r).paletteIdx=0,t(r).paletteNameMap={}}var oo,Dn,Hc,Gc="\0_ec_inner",Jx=1,Hh=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.init=function(e,i,n,a,o,s){a=a||{},this.option=null,this._theme=new yt(a),this._locale=new yt(o),this._optionManager=s},t.prototype.setOption=function(e,i,n){var a=Yc(i);this._optionManager.setOption(e,n,a),this._resetOption(null,a)},t.prototype.resetOption=function(e,i){return this._resetOption(e,Yc(i))},t.prototype._resetOption=function(e,i){var n=!1,a=this._optionManager;if(!e||e==="recreate"){var o=a.mountOption(e==="recreate");!this.option||e==="recreate"?Hc(this,o):(this.restoreData(),this._mergeOption(o,i)),n=!0}if((e==="timeline"||e==="media")&&this.restoreData(),!e||e==="recreate"||e==="timeline"){var s=a.getTimelineOption(this);s&&(n=!0,this._mergeOption(s,i))}if(!e||e==="recreate"||e==="media"){var l=a.getMediaOption(this);l.length&&A(l,function(u){n=!0,this._mergeOption(u,i)},this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,i){var n=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=tt(),u=i&&i.replaceMergeMainTypeMap;Wx(this),A(e,function(h,c){h!=null&&(ft.hasClass(c)?c&&(s.push(c),l.set(c,!0)):n[c]=n[c]==null?Q(h):at(n[c],h,!0))}),u&&u.each(function(h,c){ft.hasClass(c)&&!l.get(c)&&(s.push(c),l.set(c,!0))}),ft.topologicalTravel(s,ft.getAllClassMainTypes(),f,this);function f(h){var c=Zx(this,h,Ot(e[h])),v=a.get(h),d=v?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",g=qS(v,c,d);rw(g,h,ft),n[h]=null,a.set(h,null),o.set(h,0);var p=[],y=[],m=0,_;A(g,function(S,b){var w=S.existing,x=S.newOption;if(!x)w&&(w.mergeOption({},this),w.optionUpdated({},!1));else{var T=h==="series",M=ft.getClass(h,S.keyInfo.subType,!T);if(!M)return;if(h==="tooltip"){if(_)return;_=!0}if(w&&w.constructor===M)w.name=S.keyInfo.name,w.mergeOption(x,this),w.optionUpdated(x,!1);else{var C=O({componentIndex:b},S.keyInfo);w=new M(x,this,this,C),O(w,C),S.brandNew&&(w.__requireNewView=!0),w.init(x,this,this),w.optionUpdated(null,!0)}}w?(p.push(w.option),y.push(w),m++):(p.push(void 0),y.push(void 0))},this),n[h]=p,a.set(h,y),o.set(h,m),h==="series"&&oo(this)}this._seriesIndices||oo(this)},t.prototype.getOption=function(){var e=Q(this.option);return A(e,function(i,n){if(ft.hasClass(n)){for(var a=Ot(i),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!ca(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,e[n]=a}}),delete e[Gc],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,i){var n=this._componentsMap.get(e);if(n){var a=n[i||0];if(a)return a;if(i==null){for(var o=0;o=t:e==="max"?r<=t:r===t}function sT(r,t){return r.join(",")===t.join(",")}var Me=A,Sa=W,Xc=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function ru(r){var t=r&&r.itemStyle;if(t)for(var e=0,i=Xc.length;e=0;p--){var y=r[p];if(s||(d=y.data.rawIndexOf(y.stackedByDimension,v)),d>=0){var m=y.data.getByRawIndex(y.stackResultDimension,d);if(l==="all"||l==="positive"&&m>0||l==="negative"&&m<0||l==="samesign"&&c>=0&&m>0||l==="samesign"&&c<=0&&m<0){c=WS(c,m),g=m;break}}}return i[0]=c,i[1]=g,i})})}var rl=function(){function r(t){this.data=t.data||(t.sourceFormat===ar?{}:[]),this.sourceFormat=t.sourceFormat||pm,this.seriesLayoutBy=t.seriesLayoutBy||tr,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var i=0;ig&&(g=_)}v[0]=d,v[1]=g}},n=function(){return this._data?this._data.length/this._dimSize:0};jc=(t={},t[ie+"_"+tr]={pure:!0,appendData:a},t[ie+"_"+gn]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[ze]={pure:!0,appendData:a},t[ar]={pure:!0,appendData:function(o){var s=this._data;A(o,function(l,u){for(var f=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)f.push(l[h])})}},t[be]={appendData:a},t[Or]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},t);function a(o){for(var s=0;s=0&&(g=o.interpolatedValue[p])}return g!=null?g+"":""})}},r.prototype.getRawValue=function(t,e){return vn(this.getData(e),t)},r.prototype.formatTooltip=function(t,e,i){},r}();function id(r){var t,e;return W(r)?r.type&&(e=r):t=r,{text:t,frag:e}}function na(r){return new MT(r)}var MT=function(){function r(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return r.prototype.perform=function(t){var e=this._upstream,i=t&&t.skip;if(this._dirty&&e){var n=this.context;n.data=n.outputData=e.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!i&&(a=this._plan(this.context));var o=f(this._modBy),s=this._modDataCount||0,l=f(t&&t.modBy),u=t&&t.modDataCount||0;(o!==l||s!==u)&&(a="reset");function f(m){return!(m>=1)&&(m=1),m}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(i)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(e?this._dueEnd=e._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var v=this._dueIndex,d=Math.min(c!=null?this._dueIndex+c:1/0,this._dueEnd);if(!i&&(h||v1&&i>0?s:o}};return a;function o(){return t=r?null:ln?-this._resultLT:0},r}(),DT=function(){function r(){}return r.prototype.getRawData=function(){throw new Error("not supported")},r.prototype.getRawDataItem=function(t){throw new Error("not supported")},r.prototype.cloneRawData=function(){},r.prototype.getDimensionInfo=function(t){},r.prototype.cloneAllDimensionInfo=function(){},r.prototype.count=function(){},r.prototype.retrieveValue=function(t,e){},r.prototype.retrieveValueFromItem=function(t,e){},r.prototype.convertValue=function(t,e){return Uo(t,e)},r}();function AT(r,t){var e=new DT,i=r.data,n=e.sourceFormat=r.sourceFormat,a=r.startIndex,o="";r.seriesLayoutBy!==tr&&jt(o);var s=[],l={},u=r.dimensionsDefine;if(u)A(u,function(g,p){var y=g.name,m={index:p,name:y,displayName:g.displayName};if(s.push(m),y!=null){var _="";fn(l,y)&&jt(_),l[y]=m}});else for(var f=0;f65535?NT:BT}function Bi(){return[1/0,-1/0]}function FT(r){var t=r.constructor;return t===Array?r.slice():new t(r)}function od(r,t,e,i,n){var a=Pm[e||"float"];if(n){var o=r[t],s=o&&o.length;if(s!==i){for(var l=new a(i),u=0;up[1]&&(p[1]=g)}return this._rawCount=this._count=l,{start:s,end:l}},r.prototype._initDataFromProvider=function(t,e,i){for(var n=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=G(o,function(m){return m.property}),f=0;fy[1]&&(y[1]=p)}}!n.persistent&&n.clean&&n.clean(),this._rawCount=this._count=e,this._extent=[]},r.prototype.count=function(){return this._count},r.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,i=e[t];if(i!=null&&it)a=o-1;else return o}return-1},r.prototype.indicesOfNearest=function(t,e,i){var n=this._chunks,a=n[t],o=[];if(!a)return o;i==null&&(i=1/0);for(var s=1/0,l=-1,u=0,f=0,h=this.count();f=0&&l<0)&&(s=d,l=v,u=0),v===l&&(o[u++]=f))}return o.length=u,o},r.prototype.getIndices=function(){var t,e=this._indices;if(e){var i=e.constructor,n=this._count;if(i===Array){t=new i(n);for(var a=0;a=h&&m<=c||isNaN(m))&&(l[u++]=g),g++}d=!0}else if(a===2){for(var p=v[n[0]],_=v[n[1]],S=t[n[1]][0],b=t[n[1]][1],y=0;y=h&&m<=c||isNaN(m))&&(w>=S&&w<=b||isNaN(w))&&(l[u++]=g),g++}d=!0}}if(!d)if(a===1)for(var y=0;y=h&&m<=c||isNaN(m))&&(l[u++]=x)}else for(var y=0;yt[C][1])&&(T=!1)}T&&(l[u++]=e.getRawIndex(y))}return uy[1]&&(y[1]=p)}}}},r.prototype.lttbDownSample=function(t,e){var i=this.clone([t],!0),n=i._chunks,a=n[t],o=this.count(),s=0,l=Math.floor(1/e),u=this.getRawIndex(0),f,h,c,v=new(Ln(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));v[s++]=u;for(var d=1;df&&(f=h,c=S)}D>0&&Df-d&&(l=f-d,s.length=l);for(var g=0;gh[1]&&(h[1]=y),c[v++]=m}return a._count=v,a._indices=c,a._updateGetRawIdx(),a},r.prototype.each=function(t,e){if(this._count)for(var i=t.length,n=this._chunks,a=0,o=this.count();al&&(l=h)}return o=[s,l],this._extent[t]=o,o},r.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var i=[],n=this._chunks,a=0;a=0?this._indices[t]:-1},r.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},r.internalField=function(){function t(e,i,n,a){return Uo(e[a],this._dimensions[a])}au={arrayRows:t,objectRows:function(e,i,n,a){return Uo(e[i],this._dimensions[a])},keyedColumns:t,original:function(e,i,n,a){var o=e&&(e.value==null?e:e.value);return Uo(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(e,i,n,a){return e[a]}}}(),r}(),Rm=function(){function r(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return r.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},r.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},r.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},r.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},r.prototype._createSource=function(){this._setLocalSource([],[]);var t=this._sourceHost,e=this._getUpstreamSourceManagers(),i=!!e.length,n,a;if(so(t)){var o=t,s=void 0,l=void 0,u=void 0;if(i){var f=e[0];f.prepareSource(),u=f.getSource(),s=u.data,l=u.sourceFormat,a=[f._getVersionSign()]}else s=o.get("data",!0),l=re(s)?Or:be,a=[];var h=this._getSourceMetaRawOption()||{},c=u&&u.metaRawOption||{},v=$(h.seriesLayoutBy,c.seriesLayoutBy)||null,d=$(h.sourceHeader,c.sourceHeader),g=$(h.dimensions,c.dimensions),p=v!==c.seriesLayoutBy||!!d!=!!c.sourceHeader||g;n=p?[bf(s,{seriesLayoutBy:v,sourceHeader:d,dimensions:g},l)]:[]}else{var y=t;if(i){var m=this._applyTransform(e);n=m.sourceList,a=m.upstreamSignList}else{var _=y.get("source",!0);n=[bf(_,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(n,a)},r.prototype._applyTransform=function(t){var e=this._sourceHost,i=e.get("transform",!0),n=e.get("fromTransformResult",!0);if(n!=null){var a="";t.length!==1&&ld(a)}var o,s=[],l=[];return A(t,function(u){u.prepareSource();var f=u.getSource(n||0),h="";n!=null&&!f&&ld(h),s.push(f),l.push(u._getVersionSign())}),i?o=kT(i,s,{datasetIndex:e.componentIndex}):n!=null&&(o=[yT(s[0])]),{sourceList:o,upstreamSignList:l}},r.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),e=0;e1||e>0&&!r.noHeader;return A(r.blocks,function(n){var a=Nm(n);a>=t&&(t=a+ +(i&&(!a||Tf(n)&&!n.noHeader)))}),t}return 0}function HT(r,t,e,i){var n=t.noHeader,a=WT(Nm(t)),o=[],s=t.blocks||[];_e(!s||F(s)),s=s||[];var l=r.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(fn(u,l)){var f=new CT(u[l],null);s.sort(function(d,g){return f.evaluate(d.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}A(s,function(d,g){var p=t.valueFormatter,y=Om(d)(p?O(O({},r),{valueFormatter:p}):r,d,g>0?a.html:0,i);y!=null&&o.push(y)});var h=r.renderMode==="richText"?o.join(a.richText):Mf(o.join(""),n?e:a.html);if(n)return h;var c=wf(t.header,"ordinal",r.useUTC),v=km(i,r.renderMode).nameStyle;return r.renderMode==="richText"?Bm(r,c,v)+a.richText+h:Mf('
'+ne(c)+"
"+h,e)}function GT(r,t,e,i){var n=r.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,l=t.name,u=r.useUTC,f=t.valueFormatter||r.valueFormatter||function(S){return S=F(S)?S:[S],G(S,function(b,w){return wf(b,F(v)?v[w]:v,u)})};if(!(a&&o)){var h=s?"":r.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",n),c=a?"":wf(l,"ordinal",u),v=t.valueType,d=o?[]:f(t.value,t.dataIndex),g=!s||!a,p=!s&&a,y=km(i,n),m=y.nameStyle,_=y.valueStyle;return n==="richText"?(s?"":h)+(a?"":Bm(r,c,m))+(o?"":XT(r,d,g,p,_)):Mf((s?"":h)+(a?"":UT(c,!s,m))+(o?"":YT(d,g,p,_)),e)}}function ud(r,t,e,i,n,a){if(r){var o=Om(r),s={useUTC:n,renderMode:e,orderMode:i,markupStyleCreator:t,valueFormatter:r.valueFormatter};return o(s,r,0,a)}}function WT(r){return{html:VT[r],richText:zT[r]}}function Mf(r,t){var e='
',i="margin: "+t+"px 0 0";return'
'+r+e+"
"}function UT(r,t,e){var i=t?"margin-left:2px":"";return''+ne(r)+""}function YT(r,t,e,i){var n=e?"10px":"20px",a=t?"float:right;margin-left:"+n:"";return r=F(r)?r:[r],''+G(r,function(o){return ne(o)}).join("  ")+""}function Bm(r,t,e){return r.markupStyleCreator.wrapRichTextStyle(t,e)}function XT(r,t,e,i,n){var a=[n],o=i?10:20;return e&&a.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(F(t)?t.join(" "):t,a)}function $T(r,t){var e=r.getData().getItemVisual(t,"style"),i=e[r.visualDrawType];return xi(i)}function Fm(r,t){var e=r.get("padding");return e!=null?e:t==="richText"?[8,10]:10}var ou=function(){function r(){this.richTextStyles={},this._nextStyleNameId=vy()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(t,e,i){var n=i==="richText"?this._generateStyleName():null,a=Nx({color:e,type:t,renderMode:i,markerId:n});return H(a)?a:(this.richTextStyles[n]=a.style,a.content)},r.prototype.wrapRichTextStyle=function(t,e){var i={};F(e)?A(e,function(a){return O(i,a)}):O(i,e);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+t+"}"},r}();function ZT(r){var t=r.series,e=r.dataIndex,i=r.multipleSeries,n=t.getData(),a=n.mapDimensionsAll("defaultedTooltip"),o=a.length,s=t.getRawValue(e),l=F(s),u=$T(t,e),f,h,c,v;if(o>1||l&&!o){var d=qT(s,t,e,a,u);f=d.inlineValues,h=d.inlineValueTypes,c=d.blocks,v=d.inlineValues[0]}else if(o){var g=n.getDimensionInfo(a[0]);v=f=vn(n,e,a[0]),h=g.type}else v=f=l?s[0]:s;var p=ph(t),y=p&&t.name||"",m=n.getName(e),_=i?y:m;return wa("section",{header:y,noHeader:i||!p,sortParam:v,blocks:[wa("nameValue",{markerType:"item",markerColor:u,name:_,noName:!qe(_),value:f,valueType:h,dataIndex:e})].concat(c||[])})}function qT(r,t,e,i,n){var a=t.getData(),o=Fr(r,function(h,c,v){var d=a.getDimensionInfo(v);return h=h||d&&d.tooltip!==!1&&d.displayName!=null},!1),s=[],l=[],u=[];i.length?A(i,function(h){f(vn(a,e,h),h)}):A(r,f);function f(h,c){var v=a.getDimensionInfo(c);!v||v.otherDims.tooltip===!1||(o?u.push(wa("nameValue",{markerType:"subItem",markerColor:n,name:v.displayName,value:h,valueType:v.type})):(s.push(h),l.push(v.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var br=mt();function lo(r,t){return r.getName(t)||r.getId(t)}var KT="__universalTransitionEnabled",Oe=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return t.prototype.init=function(e,i,n){this.seriesIndex=this.componentIndex,this.dataTask=na({count:JT,reset:jT}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n);var a=br(this).sourceManager=new Rm(this);a.prepareSource();var o=this.getInitialData(e,n);hd(o,this),this.dataTask.context.data=o,br(this).dataBeforeProcessed=o,fd(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(e,i){var n=_a(this),a=n?tl(e):{},o=this.subType;ft.hasClass(o)&&(o+="Series"),at(e,i.getTheme().get(this.subType)),at(e,this.getDefaultOption()),uf(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&hn(e,a,n)},t.prototype.mergeOption=function(e,i){e=at(this.option,e,!0),this.fillDataTextStyle(e.data);var n=_a(this);n&&hn(this.option,e,n);var a=br(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(e,i);hd(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,br(this).dataBeforeProcessed=o,fd(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(e){if(e&&!re(e))for(var i=["show"],n=0;nthis.getShallow("animationThreshold")&&(i=!1),!!i},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,i,n){var a=this.ecModel,o=zh.prototype.getColorFromPalette.call(this,e,i,n);return o||(o=a.getColorFromPalette(e,i,n)),o},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(e,i){this._innerSelect(this.getData(i),e)},t.prototype.unselect=function(e,i){var n=this.option.selectedMap;if(n){var a=this.option.selectedMode,o=this.getData(i);if(a==="series"||n==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&n.push(o)}return n},t.prototype.isSelected=function(e,i){var n=this.option.selectedMap;if(!n)return!1;var a=this.getData(i);return(n==="all"||n[lo(a,e)])&&!a.getItemModel(e).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[KT])return!0;var e=this.option.universalTransition;return e?e===!0?!0:e&&e.enabled:!1},t.prototype._innerSelect=function(e,i){var n,a,o=this.option,s=o.selectedMode,l=i.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){W(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,f=0;f0&&this._innerSelect(e,i)}},t.registerClass=function(e){return ft.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type="series.__base__",e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol="circle",e.visualStyleAccessPath="itemStyle",e.visualDrawType="fill"}(),t}(ft);Be(Oe,TT);Be(Oe,zh);_y(Oe,ft);function fd(r){var t=r.name;ph(r)||(r.name=QT(r)||t)}function QT(r){var t=r.getRawData(),e=t.mapDimensionsAll("seriesName"),i=[];return A(e,function(n){var a=t.getDimensionInfo(n);a.displayName&&i.push(a.displayName)}),i.join(" ")}function JT(r){return r.model.getRawData().count()}function jT(r){var t=r.model;return t.setData(t.getRawData().cloneShallow()),tM}function tM(r,t){t.outputData&&r.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function hd(r,t){A(p1(r.CHANGABLE_METHODS,r.DOWNSAMPLE_METHODS),function(e){r.wrapMethod(e,Tt(eM,t))})}function eM(r,t){var e=Cf(r);return e&&e.setOutputEnd((t||this).count()),t}function Cf(r){var t=(r.ecModel||{}).scheduler,e=t&&t.getPipeline(r.uid);if(e){var i=e.currentTask;if(i){var n=i.agentStubMap;n&&(i=n.get(r.uid))}return i}}var we=function(){function r(){this.group=new Ct,this.uid=$s("viewComponent")}return r.prototype.init=function(t,e){},r.prototype.render=function(t,e,i,n){},r.prototype.dispose=function(t,e){},r.prototype.updateView=function(t,e,i,n){},r.prototype.updateLayout=function(t,e,i,n){},r.prototype.updateVisual=function(t,e,i,n){},r.prototype.toggleBlurSeries=function(t,e,i){},r.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},r}();yh(we);Ns(we);function Yh(){var r=mt();return function(t){var e=r(t),i=t.pipelineContext,n=!!e.large,a=!!e.progressiveRender,o=e.large=!!(i&&i.large),s=e.progressiveRender=!!(i&&i.progressiveRender);return(n!==o||a!==s)&&"reset"}}var Vm=mt(),rM=Yh(),me=function(){function r(){this.group=new Ct,this.uid=$s("viewChart"),this.renderTask=na({plan:iM,reset:nM}),this.renderTask.context={view:this}}return r.prototype.init=function(t,e){},r.prototype.render=function(t,e,i,n){},r.prototype.highlight=function(t,e,i,n){var a=t.getData(n&&n.dataType);a&&cd(a,n,"emphasis")},r.prototype.downplay=function(t,e,i,n){var a=t.getData(n&&n.dataType);a&&cd(a,n,"normal")},r.prototype.remove=function(t,e){this.group.removeAll()},r.prototype.dispose=function(t,e){},r.prototype.updateView=function(t,e,i,n){this.render(t,e,i,n)},r.prototype.updateLayout=function(t,e,i,n){this.render(t,e,i,n)},r.prototype.updateVisual=function(t,e,i,n){this.render(t,e,i,n)},r.prototype.eachRendered=function(t){Ys(this.group,t)},r.markUpdateMethod=function(t,e){Vm(t).updateMethod=e},r.protoInitialize=function(){var t=r.prototype;t.type="chart"}(),r}();function vd(r,t,e){r&&gf(r)&&(t==="emphasis"?ls:us)(r,e)}function cd(r,t,e){var i=bi(r,t),n=t&&t.highlightKey!=null?bb(t.highlightKey):null;i!=null?A(Ot(i),function(a){vd(r.getItemGraphicEl(a),e,n)}):r.eachItemGraphicEl(function(a){vd(a,e,n)})}yh(me);Ns(me);function iM(r){return rM(r.model)}function nM(r){var t=r.model,e=r.ecModel,i=r.api,n=r.payload,a=t.pipelineContext.progressiveRender,o=r.view,s=n&&Vm(n).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,e,i,n),aM[l]}var aM={incrementalPrepareRender:{progress:function(r,t){t.view.incrementalRender(r,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(r,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},ys="\0__throttleOriginMethod",dd="\0__throttleRate",pd="\0__throttleType";function Xh(r,t,e){var i,n=0,a=0,o=null,s,l,u,f;t=t||0;function h(){a=new Date().getTime(),o=null,r.apply(l,u||[])}var c=function(){for(var v=[],d=0;d=0?h():o=setTimeout(h,-s),n=i};return c.clear=function(){o&&(clearTimeout(o),o=null)},c.debounceNextCall=function(v){f=v},c}function zm(r,t,e,i){var n=r[t];if(n){var a=n[ys]||n,o=n[pd],s=n[dd];if(s!==e||o!==i){if(e==null)return r[t]=a;n=r[t]=Xh(a,e,i==="debounce"),n[ys]=a,n[pd]=i,n[dd]=e}return n}}function Df(r,t){var e=r[t];e&&e[ys]&&(e.clear&&e.clear(),r[t]=e[ys])}var gd=mt(),yd={itemStyle:da(jy,!0),lineStyle:da(Jy,!0)},oM={lineStyle:"stroke",itemStyle:"fill"};function Hm(r,t){var e=r.visualStyleMapper||yd[t];return e||(console.warn("Unknown style type '"+t+"'."),yd.itemStyle)}function Gm(r,t){var e=r.visualDrawType||oM[t];return e||(console.warn("Unknown style type '"+t+"'."),"fill")}var sM={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){var e=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=r.getModel(i),a=Hm(r,i),o=a(n),s=n.getShallow("decal");s&&(e.setVisual("decal",s),s.dirty=!0);var l=Gm(r,i),u=o[l],f=Z(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||f||h){var c=r.getColorFromPalette(r.name,null,t.getSeriesCount());o[l]||(o[l]=c,e.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||Z(o.fill)?c:o.fill,o.stroke=o.stroke==="auto"||Z(o.stroke)?c:o.stroke}if(e.setVisual("style",o),e.setVisual("drawType",l),!t.isSeriesFiltered(r)&&f)return e.setVisual("colorFromPalette",!1),{dataEach:function(v,d){var g=r.getDataParams(d),p=O({},o);p[l]=f(g),v.setItemVisual(d,"style",p)}}}},In=new yt,lM={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){if(!(r.ignoreStyleOnData||t.isSeriesFiltered(r))){var e=r.getData(),i=r.visualStyleAccessPath||"itemStyle",n=Hm(r,i),a=e.getVisual("drawType");return{dataEach:e.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[i]){In.option=l[i];var u=n(In),f=o.ensureUniqueItemVisual(s,"style");O(f,u),In.option.decal&&(o.setItemVisual(s,"decal",In.option.decal),In.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},uM={performRawSeries:!0,overallReset:function(r){var t=tt();r.eachSeries(function(e){var i=e.getColorBy();if(!e.isColorBySeries()){var n=e.type+"-"+i,a=t.get(n);a||(a={},t.set(n,a)),gd(e).scope=a}}),r.eachSeries(function(e){if(!(e.isColorBySeries()||r.isSeriesFiltered(e))){var i=e.getRawData(),n={},a=e.getData(),o=gd(e).scope,s=e.visualStyleAccessPath||"itemStyle",l=Gm(e,s);a.each(function(u){var f=a.getRawIndex(u);n[f]=u}),i.each(function(u){var f=n[u],h=a.getItemVisual(f,"colorFromPalette");if(h){var c=a.ensureUniqueItemVisual(f,"style"),v=i.getName(u)||u+"",d=i.count();c[l]=e.getColorFromPalette(v,o,d)}})}})}},uo=Math.PI;function fM(r,t){t=t||{},st(t,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var e=new Ct,i=new Mt({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});e.add(i);var n=new At({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new Mt({style:{fill:"none"},textContent:n,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});e.add(a);var o;return t.showSpinner&&(o=new Us({shape:{startAngle:-uo/2,endAngle:-uo/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:uo*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:uo*3/2}).delay(300).start("circularInOut"),e.add(o)),e.resize=function(){var s=n.getBoundingRect().width,l=t.showSpinner?t.spinnerRadius:0,u=(r.getWidth()-l*2-(t.showSpinner&&s?10:0)-s)/2-(t.showSpinner&&s?0:5+s/2)+(t.showSpinner?0:s/2)+(s?0:l),f=r.getHeight()/2;t.showSpinner&&o.setShape({cx:u,cy:f}),a.setShape({x:u-l,y:f-l,width:l*2,height:l*2}),i.setShape({x:0,y:0,width:r.getWidth(),height:r.getHeight()})},e.resize(),e}var Wm=function(){function r(t,e,i,n){this._stageTaskMap=tt(),this.ecInstance=t,this.api=e,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n)}return r.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each(function(i){var n=i.overallTask;n&&n.dirty()})},r.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var i=this._pipelineMap.get(t.__pipeline.id),n=i.context,a=!e&&i.progressiveEnabled&&(!n||n.progressiveRender)&&t.__idxInPipeline>i.blockIndex,o=a?i.step:null,s=n&&n.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},r.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},r.prototype.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData(),a=n.count(),o=i.progressiveEnabled&&e.incrementalPrepareRender&&a>=i.threshold,s=t.get("large")&&a>=t.get("largeThreshold"),l=t.get("progressiveChunkMode")==="mod"?a:null;t.pipelineContext=i.context={progressiveRender:o,modDataCount:l,large:s}},r.prototype.restorePipelines=function(t){var e=this,i=e._pipelineMap=tt();t.eachSeries(function(n){var a=n.getProgressive(),o=n.uid;i.set(o,{id:o,head:null,tail:null,threshold:n.getProgressiveThreshold(),progressiveEnabled:a&&!(n.preventIncremental&&n.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),e._pipe(n,n.dataTask)})},r.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),i=this.api;A(this._allHandlers,function(n){var a=t.get(n.uid)||t.set(n.uid,{}),o="";_e(!(n.reset&&n.overallReset),o),n.reset&&this._createSeriesStageTask(n,a,e,i),n.overallReset&&this._createOverallStageTask(n,a,e,i)},this)},r.prototype.prepareView=function(t,e,i,n){var a=t.renderTask,o=a.context;o.model=e,o.ecModel=i,o.api=n,a.__block=!t.incrementalPrepareRender,this._pipe(e,a)},r.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},r.prototype.performVisualTasks=function(t,e,i){this._performStageTasks(this._visualHandlers,t,e,i)},r.prototype._performStageTasks=function(t,e,i,n){n=n||{};var a=!1,o=this;A(t,function(l,u){if(!(n.visualType&&n.visualType!==l.visualType)){var f=o._stageTaskMap.get(l.uid),h=f.seriesTaskMap,c=f.overallTask;if(c){var v,d=c.agentStubMap;d.each(function(p){s(n,p)&&(p.dirty(),v=!0)}),v&&c.dirty(),o.updatePayload(c,i);var g=o.getPerformArgs(c,n.block);d.each(function(p){p.perform(g)}),c.perform(g)&&(a=!0)}else h&&h.each(function(p,y){s(n,p)&&p.dirty();var m=o.getPerformArgs(p,n.block);m.skip=!l.performRawSeries&&e.isSeriesFiltered(p.context.model),o.updatePayload(p,i),p.perform(m)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},r.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(i){e=i.dataTask.perform()||e}),this.unfinished=e||this.unfinished},r.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})},r.prototype.updatePayload=function(t,e){e!=="remain"&&(t.context.payload=e)},r.prototype._createSeriesStageTask=function(t,e,i,n){var a=this,o=e.seriesTaskMap,s=e.seriesTaskMap=tt(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?i.eachRawSeries(f):l?i.eachRawSeriesByType(l,f):u&&u(i,n).each(f);function f(h){var c=h.uid,v=s.set(c,o&&o.get(c)||na({plan:pM,reset:gM,count:mM}));v.context={model:h,ecModel:i,api:n,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(h,v)}},r.prototype._createOverallStageTask=function(t,e,i,n){var a=this,o=e.overallTask=e.overallTask||na({reset:hM});o.context={ecModel:i,api:n,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=tt(),u=t.seriesType,f=t.getTargetSeries,h=!0,c=!1,v="";_e(!t.createOnAllSeries,v),u?i.eachRawSeriesByType(u,d):f?f(i,n).each(d):(h=!1,A(i.getSeries(),d));function d(g){var p=g.uid,y=l.set(p,s&&s.get(p)||(c=!0,na({reset:vM,onDirty:dM})));y.context={model:g,overallProgress:h},y.agent=o,y.__block=h,a._pipe(g,y)}c&&o.dirty()},r.prototype._pipe=function(t,e){var i=t.uid,n=this._pipelineMap.get(i);!n.head&&(n.head=e),n.tail&&n.tail.pipe(e),n.tail=e,e.__idxInPipeline=n.count++,e.__pipeline=n},r.wrapStageHandler=function(t,e){return Z(t)&&(t={overallReset:t,seriesType:_M(t)}),t.uid=$s("stageHandler"),e&&(t.visualType=e),t},r}();function hM(r){r.overallReset(r.ecModel,r.api,r.payload)}function vM(r){return r.overallProgress&&cM}function cM(){this.agent.dirty(),this.getDownstream().dirty()}function dM(){this.agent&&this.agent.dirty()}function pM(r){return r.plan?r.plan(r.model,r.ecModel,r.api,r.payload):null}function gM(r){r.useClearVisual&&r.data.clearAllVisual();var t=r.resetDefines=Ot(r.reset(r.model,r.ecModel,r.api,r.payload));return t.length>1?G(t,function(e,i){return Um(i)}):yM}var yM=Um(0);function Um(r){return function(t,e){var i=e.data,n=e.resetDefines[r];if(n&&n.dataEach)for(var a=t.start;a0&&v===u.length-c.length){var d=u.slice(0,v);d!=="data"&&(e.mainType=d,e[c.toLowerCase()]=l,f=!0)}}s.hasOwnProperty(u)&&(i[u]=l,f=!0),f||(n[u]=l)})}return{cptQuery:e,dataQuery:i,otherQuery:n}},r.prototype.filter=function(t,e){var i=this.eventInfo;if(!i)return!0;var n=i.targetEl,a=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var l=e.cptQuery,u=e.dataQuery;return f(l,o,"mainType")&&f(l,o,"subType")&&f(l,o,"index","componentIndex")&&f(l,o,"name")&&f(l,o,"id")&&f(u,a,"name")&&f(u,a,"dataIndex")&&f(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,n,a));function f(h,c,v,d){return h[v]==null||c[d||v]===h[v]}},r.prototype.afterTrigger=function(){this.eventInfo=null},r}(),Af=["symbol","symbolSize","symbolRotate","symbolOffset"],wd=Af.concat(["symbolKeepAspect"]),bM={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,t){var e=r.getData();if(r.legendIcon&&e.setVisual("legendIcon",r.legendIcon),!r.hasSymbolVisual)return;for(var i={},n={},a=!1,o=0;o=0&&gi(l)?l:.5;var u=r.createRadialGradient(o,s,0,o,s,l);return u}function If(r,t,e){for(var i=t.type==="radial"?zM(r,t,e):VM(r,t,e),n=t.colorStops,a=0;a0)?null:r==="dashed"?[4*t,2*t]:r==="dotted"?[t]:dt(r)?[r]:F(r)?r:null}function $h(r){var t=r.style,e=t.lineDash&&t.lineWidth>0&&GM(t.lineDash,t.lineWidth),i=t.lineDashOffset;if(e){var n=t.strokeNoScale&&r.getLineScale?r.getLineScale():1;n&&n!==1&&(e=G(e,function(a){return a/n}),i/=n)}return[e,i]}var WM=new gr(!0);function _s(r){var t=r.stroke;return!(t==null||t==="none"||!(r.lineWidth>0))}function bd(r){return typeof r=="string"&&r!=="none"}function Ss(r){var t=r.fill;return t!=null&&t!=="none"}function xd(r,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var e=r.globalAlpha;r.globalAlpha=t.fillOpacity*t.opacity,r.fill(),r.globalAlpha=e}else r.fill()}function Td(r,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var e=r.globalAlpha;r.globalAlpha=t.strokeOpacity*t.opacity,r.stroke(),r.globalAlpha=e}else r.stroke()}function Pf(r,t,e){var i=mh(t.image,t.__image,e);if(Bs(i)){var n=r.createPattern(i,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&n&&n.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*Po),a.scaleSelf(t.scaleX||1,t.scaleY||1),n.setTransform(a)}return n}}function UM(r,t,e,i){var n,a=_s(e),o=Ss(e),s=e.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var f=t.path||WM,h=t.__dirty;if(!i){var c=e.fill,v=e.stroke,d=o&&!!c.colorStops,g=a&&!!v.colorStops,p=o&&!!c.image,y=a&&!!v.image,m=void 0,_=void 0,S=void 0,b=void 0,w=void 0;(d||g)&&(w=t.getBoundingRect()),d&&(m=h?If(r,c,w):t.__canvasFillGradient,t.__canvasFillGradient=m),g&&(_=h?If(r,v,w):t.__canvasStrokeGradient,t.__canvasStrokeGradient=_),p&&(S=h||!t.__canvasFillPattern?Pf(r,c,t):t.__canvasFillPattern,t.__canvasFillPattern=S),y&&(b=h||!t.__canvasStrokePattern?Pf(r,v,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),d?r.fillStyle=m:p&&(S?r.fillStyle=S:o=!1),g?r.strokeStyle=_:y&&(b?r.strokeStyle=b:a=!1)}var x=t.getGlobalScale();f.setScale(x[0],x[1],t.segmentIgnoreThreshold);var T,M;r.setLineDash&&e.lineDash&&(n=$h(t),T=n[0],M=n[1]);var C=!0;(u||h&Hn)&&(f.setDPR(r.dpr),l?f.setContext(null):(f.setContext(r),C=!1),f.reset(),t.buildPath(f,t.shape,i),f.toStatic(),t.pathUpdated()),C&&f.rebuildPath(r,l?s:1),T&&(r.setLineDash(T),r.lineDashOffset=M),i||(e.strokeFirst?(a&&Td(r,e),o&&xd(r,e)):(o&&xd(r,e),a&&Td(r,e))),T&&r.setLineDash([])}function YM(r,t,e){var i=t.__image=mh(e.image,t.__image,t,t.onload);if(!(!i||!Bs(i))){var n=e.x||0,a=e.y||0,o=t.getWidth(),s=t.getHeight(),l=i.width/i.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=i.width,s=i.height),e.sWidth&&e.sHeight){var u=e.sx||0,f=e.sy||0;r.drawImage(i,u,f,e.sWidth,e.sHeight,n,a,o,s)}else if(e.sx&&e.sy){var u=e.sx,f=e.sy,h=o-u,c=s-f;r.drawImage(i,u,f,h,c,n,a,o,s)}else r.drawImage(i,n,a,o,s)}}function XM(r,t,e){var i,n=e.text;if(n!=null&&(n+=""),n){r.font=e.font||Br,r.textAlign=e.textAlign,r.textBaseline=e.textBaseline;var a=void 0,o=void 0;r.setLineDash&&e.lineDash&&(i=$h(t),a=i[0],o=i[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),e.strokeFirst?(_s(e)&&r.strokeText(n,e.x,e.y),Ss(e)&&r.fillText(n,e.x,e.y)):(Ss(e)&&r.fillText(n,e.x,e.y),_s(e)&&r.strokeText(n,e.x,e.y)),a&&r.setLineDash([])}}var Md=["shadowBlur","shadowOffsetX","shadowOffsetY"],Cd=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function Qm(r,t,e,i,n){var a=!1;if(!i&&(e=e||{},t===e))return!1;if(i||t.opacity!==e.opacity){te(r,n),a=!0;var o=Math.max(Math.min(t.opacity,1),0);r.globalAlpha=isNaN(o)?_i.opacity:o}(i||t.blend!==e.blend)&&(a||(te(r,n),a=!0),r.globalCompositeOperation=t.blend||_i.blend);for(var s=0;s0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,i,n){if(!this[Ft]){if(this._disposed){this.id;return}var a,o,s;if(W(i)&&(n=i.lazyUpdate,a=i.silent,o=i.replaceMerge,s=i.transition,i=i.notMerge),this[Ft]=!0,!this._model||i){var l=new iT(this._api),u=this._theme,f=this._model=new Hh;f.scheduler=this._scheduler,f.ssr=this._ssr,f.init(null,null,null,u,this._locale,l)}this._model.setOption(e,{replaceMerge:o},kf);var h={seriesTransition:s,optionChanged:!0};if(n)this[Jt]={silent:a,updateParams:h},this[Ft]=!1,this.getZr().wakeUp();else{try{Vi(this),xr.update.call(this,null,h)}catch(c){throw this[Jt]=null,this[Ft]=!1,c}this._ssr||this._zr.flush(),this[Jt]=null,this[Ft]=!1,Pn.call(this,a),Rn.call(this,a)}}},t.prototype.setTheme=function(){},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||K.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){e=e||{};var i=this._zr.painter;return i.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get("backgroundColor"),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){e=e||{};var i=this._zr.painter;return i.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){if(K.svgSupported){var e=this._zr,i=e.storage.getDisplayList();return A(i,function(n){n.stopAnimation(null,!0)}),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(this._disposed){this.id;return}e=e||{};var i=e.excludeComponents,n=this._model,a=[],o=this;A(i,function(l){n.eachComponent({mainType:l},function(u){var f=o._componentsMap[u.__viewId];f.group.ignore||(a.push(f),f.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return A(a,function(l){l.group.ignore=!1}),s},t.prototype.getConnectedDataURL=function(e){if(this._disposed){this.id;return}var i=e.type==="svg",n=this.group,a=Math.min,o=Math.max,s=1/0;if(Hd[n]){var l=s,u=s,f=-s,h=-s,c=[],v=e&&e.pixelRatio||this.getDevicePixelRatio();A(oa,function(_,S){if(_.group===n){var b=i?_.getZr().painter.getSvgDom().innerHTML:_.renderToCanvas(Q(e)),w=_.getDom().getBoundingClientRect();l=a(w.left,l),u=a(w.top,u),f=o(w.right,f),h=o(w.bottom,h),c.push({dom:b,left:w.left,top:w.top})}}),l*=v,u*=v,f*=v,h*=v;var d=f-l,g=h-u,p=cn.createCanvas(),y=Xv(p,{renderer:i?"svg":"canvas"});if(y.resize({width:d,height:g}),i){var m="";return A(c,function(_){var S=_.left-l,b=_.top-u;m+=''+_.dom+""}),y.painter.getSvgRoot().innerHTML=m,e.connectedBackgroundColor&&y.painter.setBackgroundColor(e.connectedBackgroundColor),y.refreshImmediately(),y.painter.toDataURL()}else return e.connectedBackgroundColor&&y.add(new Mt({shape:{x:0,y:0,width:d,height:g},style:{fill:e.connectedBackgroundColor}})),A(c,function(_){var S=new Fe({style:{x:_.left*v-l,y:_.top*v-u,image:_.dom}});y.add(S)}),y.refreshImmediately(),p.toDataURL("image/"+(e&&e.type||"png"))}else return this.getDataURL(e)},t.prototype.convertToPixel=function(e,i){return hu(this,"convertToPixel",e,i)},t.prototype.convertFromPixel=function(e,i){return hu(this,"convertFromPixel",e,i)},t.prototype.containPixel=function(e,i){if(this._disposed){this.id;return}var n=this._model,a,o=kl(n,e);return A(o,function(s,l){l.indexOf("Models")>=0&&A(s,function(u){var f=u.coordinateSystem;if(f&&f.containPoint)a=a||!!f.containPoint(i);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(i,u))}},this)},this),!!a},t.prototype.getVisual=function(e,i){var n=this._model,a=kl(n,e,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?Zm(s,l,i):qm(s,i)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;A(yC,function(i){var n=function(a){var o=e.getModel(),s=a.target,l,u=i==="globalout";if(u?l={}:s&&Ki(s,function(d){var g=rt(d);if(g&&g.dataIndex!=null){var p=g.dataModel||o.getSeriesByIndex(g.seriesIndex);return l=p&&p.getDataParams(g.dataIndex,g.dataType,s)||{},!0}else if(g.eventData)return l=O({},g.eventData),!0},!0),l){var f=l.componentType,h=l.componentIndex;(f==="markLine"||f==="markPoint"||f==="markArea")&&(f="series",h=l.seriesIndex);var c=f&&h!=null&&o.getComponent(f,h),v=c&&e[c.mainType==="series"?"_chartsMap":"_componentsMap"][c.__viewId];l.event=a,l.type=i,e._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:c,view:v},e.trigger(i,l)}};n.zrEventfulCallAtLast=!0,e._zr.on(i,n,e)}),A(aa,function(i,n){e._messageCenter.on(n,function(a){this.trigger(n,a)},e)}),A(["selectchanged"],function(i){e._messageCenter.on(i,function(n){this.trigger(i,n)},e)}),CM(this._messageCenter,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var e=this.getDom();e&&gy(this.getDom(),Kh,"");var i=this,n=i._api,a=i._model;A(i._componentsViews,function(o){o.dispose(a,n)}),A(i._chartsViews,function(o){o.dispose(a,n)}),i._zr.dispose(),i._dom=i._model=i._chartsMap=i._componentsMap=i._chartsViews=i._componentsViews=i._scheduler=i._api=i._zr=i._throttledZrFlush=i._theme=i._coordSysMgr=i._messageCenter=null,delete oa[i.id]},t.prototype.resize=function(e){if(!this[Ft]){if(this._disposed){this.id;return}this._zr.resize(e);var i=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!i){var n=i.resetOption("media"),a=e&&e.silent;this[Jt]&&(a==null&&(a=this[Jt].silent),n=!0,this[Jt]=null),this[Ft]=!0;try{n&&Vi(this),xr.update.call(this,{type:"resize",animation:O({duration:0},e&&e.animation)})}catch(o){throw this[Ft]=!1,o}this[Ft]=!1,Pn.call(this,a),Rn.call(this,a)}}},t.prototype.showLoading=function(e,i){if(this._disposed){this.id;return}if(W(e)&&(i=e,e=""),e=e||"default",this.hideLoading(),!!Of[e]){var n=Of[e](this._api,i),a=this._zr;this._loadingFX=n,a.add(n)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(e){var i=O({},e);return i.type=aa[e.type],i},t.prototype.dispatchAction=function(e,i){if(this._disposed){this.id;return}if(W(i)||(i={silent:!!i}),!!ws[e.type]&&this._model){if(this[Ft]){this._pendingActions.push(e);return}var n=i.silent;cu.call(this,e,n);var a=i.flush;a?this._zr.flush():a!==!1&&K.browser.weChat&&this._throttledZrFlush(),Pn.call(this,n),Rn.call(this,n)}},t.prototype.updateLabelLayout=function(){Le.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed){this.id;return}var i=e.seriesIndex,n=this.getModel(),a=n.getSeriesByIndex(i);a.appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){Vi=function(h){var c=h._scheduler;c.restorePipelines(h._model),c.prepareStageTasks(),fu(h,!0),fu(h,!1),c.plan()},fu=function(h,c){for(var v=h._model,d=h._scheduler,g=c?h._componentsViews:h._chartsViews,p=c?h._componentsMap:h._chartsMap,y=h._zr,m=h._api,_=0;_c.get("hoverLayerThreshold")&&!K.node&&!K.worker&&c.eachSeries(function(p){if(!p.preventUsingHoverLayer){var y=h._chartsMap[p.__viewId];y.__alive&&y.eachRendered(function(m){m.states.emphasis&&(m.states.emphasis.hoverLayer=!0)})}})}function o(h,c){var v=h.get("blendMode")||null;c.eachRendered(function(d){d.isGroup||(d.style.blend=v)})}function s(h,c){if(!h.preventAutoZ){var v=h.get("z")||0,d=h.get("zlevel")||0;c.eachRendered(function(g){return l(g,v,d,-1/0),!0})}}function l(h,c,v,d){var g=h.getTextContent(),p=h.getTextGuideLine(),y=h.isGroup;if(y)for(var m=h.childrenRef(),_=0;_0?{duration:g,delay:v.get("delay"),easing:v.get("easing")}:null;c.eachRendered(function(y){if(y.states&&y.states.emphasis){if(rn(y))return;if(y instanceof lt&&xb(y),y.__dirty){var m=y.prevStates;m&&y.useStates(m)}if(d){y.stateTransition=p;var _=y.getTextContent(),S=y.getTextGuideLine();_&&(_.stateTransition=p),S&&(S.stateTransition=p)}y.__dirty&&n(y)}})}Vd=function(h){return new(function(c){B(v,c);function v(){return c!==null&&c.apply(this,arguments)||this}return v.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},v.prototype.getComponentByElement=function(d){for(;d;){var g=d.__ecComponentInfo;if(g!=null)return h._model.getComponent(g.mainType,g.index);d=d.parent}},v.prototype.enterEmphasis=function(d,g){ls(d,g),se(h)},v.prototype.leaveEmphasis=function(d,g){us(d,g),se(h)},v.prototype.enterBlur=function(d){cb(d),se(h)},v.prototype.leaveBlur=function(d){Ey(d),se(h)},v.prototype.enterSelect=function(d){ky(d),se(h)},v.prototype.leaveSelect=function(d){Oy(d),se(h)},v.prototype.getModel=function(){return h.getModel()},v.prototype.getViewOfComponentModel=function(d){return h.getViewOfComponentModel(d)},v.prototype.getViewOfSeriesModel=function(d){return h.getViewOfSeriesModel(d)},v}(_m))(h)},v0=function(h){function c(v,d){for(var g=0;g=0)){Gd.push(e);var a=Wm.wrapStageHandler(e,n);a.__prio=t,a.__raw=e,r.push(a)}}function m0(r,t){Of[r]=t}function TC(r,t,e){var i=rC("registerMap");i&&i(r,t,e)}var MC=ET;Ci(Zh,sM);Ci(nl,lM);Ci(nl,uM);Ci(Zh,bM);Ci(nl,xM);Ci(o0,tC);g0(wm);y0(aC,pT);m0("default",fM);yn({type:Si,event:Si,update:Si},Ht);yn({type:Vo,event:Vo,update:Vo},Ht);yn({type:ta,event:ta,update:ta},Ht);yn({type:zo,event:zo,update:zo},Ht);yn({type:ea,event:ea,update:ea},Ht);p0("light",SM);p0("dark",$m);function En(r){return r==null?0:r.length||1}function Wd(r){return r}var CC=function(){function r(t,e,i,n,a,o){this._old=t,this._new=e,this._oldKeyGetter=i||Wd,this._newKeyGetter=n||Wd,this.context=a,this._diffModeMultiple=o==="multiple"}return r.prototype.add=function(t){return this._add=t,this},r.prototype.update=function(t){return this._update=t,this},r.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},r.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},r.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},r.prototype.remove=function(t){return this._remove=t,this},r.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},r.prototype._executeOneToOne=function(){var t=this._old,e=this._new,i={},n=new Array(t.length),a=new Array(e.length);this._initIndexMap(t,null,n,"_oldKeyGetter"),this._initIndexMap(e,i,a,"_newKeyGetter");for(var o=0;o1){var f=l.shift();l.length===1&&(i[s]=l[0]),this._update&&this._update(f,o)}else u===1?(i[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,i)},r.prototype._executeMultiple=function(){var t=this._old,e=this._new,i={},n={},a=[],o=[];this._initIndexMap(t,i,a,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var s=0;s1&&c===1)this._updateManyToOne&&this._updateManyToOne(f,u),n[l]=null;else if(h===1&&c>1)this._updateOneToMany&&this._updateOneToMany(f,u),n[l]=null;else if(h===1&&c===1)this._update&&this._update(f,u),n[l]=null;else if(h>1&&c>1)this._updateManyToMany&&this._updateManyToMany(f,u),n[l]=null;else if(h>1)for(var v=0;v1)for(var s=0;s30}var kn=W,Tr=G,EC=typeof Int32Array>"u"?Array:Int32Array,kC="e\0\0",Ud=-1,OC=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],NC=["_approximateExtent"],Yd,po,On,Nn,gu,go,yu,T0=function(){function r(t,e){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i,n=!1;S0(t)?(i=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(n=!0,i=t),i=i||["x","y"];for(var a={},o=[],s={},l=!1,u={},f=0;f=e)){var i=this._store,n=i.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=n.getSource().sourceFormat,l=s===be;if(l&&!n.pure)for(var u=[],f=t;f0},r.prototype.ensureUniqueItemVisual=function(t,e){var i=this._itemVisuals,n=i[t];n||(n=i[t]={});var a=n[e];return a==null&&(a=this.getVisual(e),F(a)?a=a.slice():kn(a)&&(a=O({},a)),n[e]=a),a},r.prototype.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{};this._itemVisuals[t]=n,kn(e)?O(n,e):n[e]=i},r.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},r.prototype.setLayout=function(t,e){kn(t)?O(this._layout,t):this._layout[t]=e},r.prototype.getLayout=function(t){return this._layout[t]},r.prototype.getItemLayout=function(t){return this._itemLayouts[t]},r.prototype.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?O(this._itemLayouts[t]||{},e):e},r.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},r.prototype.setItemGraphicEl=function(t,e){var i=this.hostModel&&this.hostModel.seriesIndex;ib(i,this.dataType,t,e),this._graphicEls[t]=e},r.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},r.prototype.eachItemGraphicEl=function(t,e){A(this._graphicEls,function(i,n){i&&t&&t.call(e,i,n)})},r.prototype.cloneShallow=function(t){return t||(t=new r(this._schema?this._schema:Tr(this.dimensions,this._getDimInfo,this),this.hostModel)),gu(t,this),t._store=this._store,t},r.prototype.wrapMethod=function(t,e){var i=this[t];Z(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var n=i.apply(this,arguments);return e.apply(this,[n].concat(oh(arguments)))})},r.internalField=function(){Yd=function(t){var e=t._invertedIndicesMap;A(e,function(i,n){var a=t._dimInfos[n],o=a.ordinalMeta,s=t._store;if(o){i=e[n]=new EC(o.categories.length);for(var l=0;l1&&(l+="__ec__"+f),n[e]=l}}}(),r}();function G2(r,t){return jh(r,t).dimensions}function jh(r,t){Gh(r)||(r=bm(r)),t=t||{};var e=t.coordDimensions||[],i=t.dimensionsDefine||r.dimensionsDefine||[],n=tt(),a=[],o=FC(r,e,i,t.dimensionsCount),s=t.canOmitUnusedDimensions&&x0(o),l=i===r.dimensionsDefine,u=l?b0(r):w0(i),f=t.encodeDefine;!f&&t.encodeDefaulter&&(f=t.encodeDefaulter(r,o));for(var h=tt(f),c=new Im(o),v=0;v0&&(i.name=n+(a-1)),a++,t.set(n,a)}}function FC(r,t,e,i){var n=Math.max(r.dimensionsDetectedCount||1,t.length,e.length,i||0);return A(t,function(a){var o;W(a)&&(o=a.dimsDef)&&(n=Math.max(n,o.length))}),n}function VC(r,t,e){if(e||t.hasKey(r)){for(var i=0;t.hasKey(r+i);)i++;r+=i}return t.set(r,!0),r}var zC=function(){function r(t){this.coordSysDims=[],this.axisMap=tt(),this.categoryAxisMap=tt(),this.coordSysName=t}return r}();function HC(r){var t=r.get("coordinateSystem"),e=new zC(t),i=GC[t];if(i)return i(r,e,e.axisMap,e.categoryAxisMap),e}var GC={cartesian2d:function(r,t,e,i){var n=r.getReferringComponents("xAxis",Pe).models[0],a=r.getReferringComponents("yAxis",Pe).models[0];t.coordSysDims=["x","y"],e.set("x",n),e.set("y",a),zi(n)&&(i.set("x",n),t.firstCategoryDimIndex=0),zi(a)&&(i.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(r,t,e,i){var n=r.getReferringComponents("singleAxis",Pe).models[0];t.coordSysDims=["single"],e.set("single",n),zi(n)&&(i.set("single",n),t.firstCategoryDimIndex=0)},polar:function(r,t,e,i){var n=r.getReferringComponents("polar",Pe).models[0],a=n.findAxisModel("radiusAxis"),o=n.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],e.set("radius",a),e.set("angle",o),zi(a)&&(i.set("radius",a),t.firstCategoryDimIndex=0),zi(o)&&(i.set("angle",o),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},geo:function(r,t,e,i){t.coordSysDims=["lng","lat"]},parallel:function(r,t,e,i){var n=r.ecModel,a=n.getComponent("parallel",r.get("parallelIndex")),o=t.coordSysDims=a.dimensions.slice();A(a.parallelAxisIndex,function(s,l){var u=n.getComponent("parallelAxis",s),f=o[l];e.set(f,u),zi(u)&&(i.set(f,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})}};function zi(r){return r.get("type")==="category"}function M0(r,t,e){e=e||{};var i=e.byIndex,n=e.stackedCoordDimension,a,o,s;WC(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(r&&r.get("stack")),u,f,h,c;if(A(a,function(m,_){H(m)&&(a[_]=m={name:m}),l&&!m.isExtraCoord&&(!i&&!u&&m.ordinalMeta&&(u=m),!f&&m.type!=="ordinal"&&m.type!=="time"&&(!n||n===m.coordDim)&&(f=m))}),f&&!i&&!u&&(i=!0),f){h="__\0ecstackresult_"+r.id,c="__\0ecstackedover_"+r.id,u&&(u.createInvertedIndices=!0);var v=f.coordDim,d=f.type,g=0;A(a,function(m){m.coordDim===v&&g++});var p={name:h,coordDim:v,coordDimIndex:g,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},y={name:c,coordDim:c,coordDimIndex:g+1,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(p.storeDimIndex=s.ensureCalculationDimension(c,d),y.storeDimIndex=s.ensureCalculationDimension(h,d)),o.appendCalculationDimension(p),o.appendCalculationDimension(y)):(a.push(p),a.push(y))}return{stackedDimension:f&&f.name,stackedByDimension:u&&u.name,isStackedByIndex:i,stackedOverDimension:c,stackResultDimension:h}}function WC(r){return!S0(r.schema)}function Mi(r,t){return!!t&&t===r.getCalculationInfo("stackedDimension")}function C0(r,t){return Mi(r,t)?r.getCalculationInfo("stackResultDimension"):t}function UC(r,t){var e=r.get("coordinateSystem"),i=el.get(e),n;return t&&t.coordSysDims&&(n=G(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=LC(l)}return o})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function YC(r,t,e){var i,n;return e&&A(r,function(a,o){var s=a.coordDim,l=e.categoryAxisMap.get(s);l&&(i==null&&(i=o),a.ordinalMeta=l.getOrdinalMeta(),t&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(n=!0)}),!n&&i!=null&&(r[i].otherDims.itemName=0),i}function tv(r,t,e){e=e||{};var i=t.getSourceManager(),n,a=!1;n=i.getSource(),a=n.sourceFormat===be;var o=HC(t),s=UC(t,o),l=e.useEncodeDefaulter,u=Z(l)?l:l?Tt(Ux,s,t):null,f={coordDimensions:s,generateCoord:e.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=jh(n,f),c=YC(h.dimensions,e.createInvertedIndices,o),v=a?null:i.getSharedDataStore(h),d=M0(t,{schema:h,store:v}),g=new T0(h,t);g.setCalculationInfo(d);var p=c!=null&&XC(n)?function(y,m,_,S){return S===c?_:this.defaultDimValueGetter(y,m,_,S)}:null;return g.hasItemOption=!1,g.initData(a?n:v,null,p),g}function XC(r){if(r.sourceFormat===be){var t=$C(r.data||[]);return!F(Pa(t))}}function $C(r){for(var t=0;te[1]&&(e[1]=t[1])},r.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},r.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},r.prototype.isBlank=function(){return this._isBlank},r.prototype.setBlank=function(t){this._isBlank=t},r}();Ns(or);var ZC=0,Nf=function(){function r(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++ZC}return r.createByAxisModel=function(t){var e=t.option,i=e.data,n=i&&G(i,qC);return new r({categories:n,needCollect:!n,deduplication:e.dedplication!==!1})},r.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},r.prototype.parseAndCollect=function(t){var e,i=this._needCollect;if(!H(t)&&!i)return t;if(i&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var n=this._getOrCreateMap();return e=n.get(t),e==null&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e},r.prototype._getOrCreateMap=function(){return this._map||(this._map=tt(this.categories))},r}();function qC(r){return W(r)&&r.value!=null?r.value:r+""}function Bf(r){return r.type==="interval"||r.type==="log"}function KC(r,t,e,i){var n={},a=r[1]-r[0],o=n.interval=hy(a/t);e!=null&&oi&&(o=n.interval=i);var s=n.intervalPrecision=D0(o),l=n.niceTickExtent=[Dt(Math.ceil(r[0]/o)*o,s),Dt(Math.floor(r[1]/o)*o,s)];return QC(l,r),n}function mu(r){var t=Math.pow(10,dh(r)),e=r/t;return e?e===2?e=3:e===3?e=5:e*=2:e=1,Dt(e*t)}function D0(r){return hr(r)+2}function Xd(r,t,e){r[t]=Math.max(Math.min(r[t],e[1]),e[0])}function QC(r,t){!isFinite(r[0])&&(r[0]=t[0]),!isFinite(r[1])&&(r[1]=t[1]),Xd(r,0,t),Xd(r,1,t),r[0]>r[1]&&(r[0]=r[1])}function al(r,t){return r>=t[0]&&r<=t[1]}function ol(r,t){return t[1]===t[0]?.5:(r-t[0])/(t[1]-t[0])}function sl(r,t){return r*(t[1]-t[0])+t[0]}var ev=function(r){B(t,r);function t(e){var i=r.call(this,e)||this;i.type="ordinal";var n=i.getSetting("ordinalMeta");return n||(n=new Nf({})),F(n)&&(n=new Nf({categories:G(n,function(a){return W(a)?a.value:a})})),i._ordinalMeta=n,i._extent=i.getSetting("extent")||[0,n.categories.length-1],i}return t.prototype.parse=function(e){return e==null?NaN:H(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return e=this.parse(e),al(e,this._extent)&&this._ordinalMeta.categories[e]!=null},t.prototype.normalize=function(e){return e=this._getTickNumber(this.parse(e)),ol(e,this._extent)},t.prototype.scale=function(e){return e=Math.round(sl(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],i=this._extent,n=i[0];n<=i[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(e==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var i=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,i.length);o=0&&e=0&&e=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(or);or.registerClass(ev);var si=Dt,mn=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return al(e,this._extent)},t.prototype.normalize=function(e){return ol(e,this._extent)},t.prototype.scale=function(e){return sl(e,this._extent)},t.prototype.setExtent=function(e,i){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(i)||(n[1]=parseFloat(i))},t.prototype.unionExtent=function(e){var i=this._extent;e[0]i[1]&&(i[1]=e[1]),this.setExtent(i[0],i[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=D0(e)},t.prototype.getTicks=function(e){var i=this._interval,n=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!i)return s;var l=1e4;n[0]l)return[];var f=s.length?s[s.length-1].value:a[1];return n[1]>f&&(e?s.push({value:si(f+i,o)}):s.push({value:n[1]})),s},t.prototype.getMinorTicks=function(e){for(var i=this.getTicks(!0),n=[],a=this.getExtent(),o=1;oa[0]&&v0&&(a=a===null?s:Math.min(a,s))}e[i]=a}}return e}function P0(r){var t=tD(r),e=[];return A(r,function(i){var n=i.coordinateSystem,a=n.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=t[l],f=Math.abs(o[1]-o[0]),h=a.scale.getExtent(),c=Math.abs(h[1]-h[0]);s=u?f/c*u:f}else{var v=i.getData();s=Math.abs(o[1]-o[0])/v.count()}var d=pt(i.get("barWidth"),s),g=pt(i.get("barMaxWidth"),s),p=pt(i.get("barMinWidth")||(E0(i)?.5:1),s),y=i.get("barGap"),m=i.get("barCategoryGap");e.push({bandWidth:s,barWidth:d,barMaxWidth:g,barMinWidth:p,barGap:y,barCategoryGap:m,axisKey:rv(a),stackId:L0(i)})}),eD(e)}function eD(r){var t={};A(r,function(i,n){var a=i.axisKey,o=i.bandWidth,s=t[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;t[a]=s;var u=i.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var f=i.barWidth;f&&!l[u].width&&(l[u].width=f,f=Math.min(s.remainedWidth,f),s.remainedWidth-=f);var h=i.barMaxWidth;h&&(l[u].maxWidth=h);var c=i.barMinWidth;c&&(l[u].minWidth=c);var v=i.barGap;v!=null&&(s.gap=v);var d=i.barCategoryGap;d!=null&&(s.categoryGap=d)});var e={};return A(t,function(i,n){e[n]={};var a=i.stacks,o=i.bandWidth,s=i.categoryGap;if(s==null){var l=it(a).length;s=Math.max(35-l*4,15)+"%"}var u=pt(s,o),f=pt(i.gap,1),h=i.remainedWidth,c=i.autoWidthCount,v=(h-u)/(c+(c-1)*f);v=Math.max(v,0),A(a,function(y){var m=y.maxWidth,_=y.minWidth;if(y.width){var S=y.width;m&&(S=Math.min(S,m)),_&&(S=Math.max(S,_)),y.width=S,h-=S+f*S,c--}else{var S=v;m&&mS&&(S=_),S!==v&&(y.width=S,h-=S+f*S,c--)}}),v=(h-u)/(c+(c-1)*f),v=Math.max(v,0);var d=0,g;A(a,function(y,m){y.width||(y.width=v),g=y,d+=y.width*(1+f)}),g&&(d-=g.width*f);var p=-d/2;A(a,function(y,m){e[n][m]=e[n][m]||{bandWidth:o,offset:p,width:y.width},p+=y.width*(1+f)})}),e}function rD(r,t,e){if(r&&t){var i=r[rv(t)];return i}}function iD(r,t){var e=I0(r,t),i=P0(e);A(e,function(n){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=L0(n),u=i[rv(s)][l],f=u.offset,h=u.width;a.setLayout({bandWidth:u.bandWidth,offset:f,size:h})})}function nD(r){return{seriesType:r,plan:Yh(),reset:function(t){if(R0(t)){var e=t.getData(),i=t.coordinateSystem,n=i.getBaseAxis(),a=i.getOtherAxis(n),o=e.getDimensionIndex(e.mapDimension(a.dim)),s=e.getDimensionIndex(e.mapDimension(n.dim)),l=t.get("showBackground",!0),u=e.mapDimension(a.dim),f=e.getCalculationInfo("stackResultDimension"),h=Mi(e,u)&&!!e.getCalculationInfo("stackedOnSeries"),c=a.isHorizontal(),v=aD(n,a),d=E0(t),g=t.get("barMinHeight")||0,p=f&&e.getDimensionIndex(f),y=e.getLayout("size"),m=e.getLayout("offset");return{progress:function(_,S){for(var b=_.count,w=d&&cr(b*3),x=d&&l&&cr(b*3),T=d&&cr(b),M=i.master.getRect(),C=c?M.width:M.height,D,L=S.getStore(),I=0;(D=_.next())!=null;){var P=L.get(h?p:o,D),R=L.get(s,D),E=v,z=void 0;h&&(z=+P-L.get(o,D));var k=void 0,N=void 0,V=void 0,U=void 0;if(c){var X=i.dataToPoint([P,R]);if(h){var J=i.dataToPoint([z,R]);E=J[0]}k=E,N=X[1]+m,V=X[0]-E,U=y,Math.abs(V)>>1;r[n][1]n&&(this._approxInterval=n);var s=yo.length,l=Math.min(oD(yo,this._approxInterval,0,s),s-1);this._interval=yo[l][1],this._minLevelUnit=yo[Math.max(l-1,0)][0]},t.prototype.parse=function(e){return dt(e)?e:+ir(e)},t.prototype.contain=function(e){return al(this.parse(e),this._extent)},t.prototype.normalize=function(e){return ol(this.parse(e),this._extent)},t.prototype.scale=function(e){return sl(e,this._extent)},t.type="time",t}(mn),yo=[["second",Oh],["minute",Nh],["hour",ia],["quarter-day",ia*6],["half-day",ia*12],["day",ge*1.2],["half-week",ge*3.5],["week",ge*7],["month",ge*31],["quarter",ge*95],["half-year",Nc/2],["year",Nc]];function sD(r,t,e,i){var n=ir(t),a=ir(e),o=function(d){return Fc(n,d,i)===Fc(a,d,i)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},f=function(){return u()&&o("hour")},h=function(){return f()&&o("minute")},c=function(){return h()&&o("second")},v=function(){return c()&&o("millisecond")};switch(r){case"year":return s();case"month":return l();case"day":return u();case"hour":return f();case"minute":return h();case"second":return c();case"millisecond":return v()}}function lD(r,t){return r/=ge,r>16?16:r>7.5?7:r>3.5?4:r>1.5?2:1}function uD(r){var t=30*ge;return r/=t,r>6?6:r>3?3:r>2?2:1}function fD(r){return r/=ia,r>12?12:r>6?6:r>3.5?4:r>2?2:1}function $d(r,t){return r/=t?Nh:Oh,r>30?30:r>20?20:r>15?15:r>10?10:r>5?5:r>2?2:1}function hD(r){return hy(r)}function vD(r,t,e){var i=new Date(r);switch(on(t)){case"year":case"month":i[nm(e)](0);case"day":i[am(e)](1);case"hour":i[om(e)](0);case"minute":i[sm(e)](0);case"second":i[lm(e)](0),i[um(e)](0)}return i.getTime()}function cD(r,t,e,i){var n=1e4,a=rm,o=0;function s(C,D,L,I,P,R,E){for(var z=new Date(D),k=D,N=z[I]();k1&&R===0&&L.unshift({value:L[0].value-k})}}for(var R=0;R=i[0]&&m<=i[1]&&h++)}var _=(i[1]-i[0])/t;if(h>_*1.5&&c>_/1.5||(u.push(p),h>_||r===a[v]))break}f=[]}}}for(var S=It(G(u,function(C){return It(C,function(D){return D.value>=i[0]&&D.value<=i[1]&&!D.notAdd})}),function(C){return C.length>0}),b=[],w=S.length-1,v=0;v0;)a*=10;var s=[Dt(gD(i[0]/a)*a),Dt(pD(i[1]/a)*a)];this._interval=a,this._niceExtent=s}},t.prototype.calcNiceExtent=function(e){sa.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return e=Ce(e)/Ce(this.base),al(e,this._extent)},t.prototype.normalize=function(e){return e=Ce(e)/Ce(this.base),ol(e,this._extent)},t.prototype.scale=function(e){return e=sl(e,this._extent),mo(this.base,e)},t.type="log",t}(or),O0=iv.prototype;O0.getMinorTicks=sa.getMinorTicks;O0.getLabel=sa.getLabel;function _o(r,t){return dD(r,hr(t))}or.registerClass(iv);var yD=function(){function r(t,e,i){this._prepareParams(t,e,i)}return r.prototype._prepareParams=function(t,e,i){i[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!f&&(l=0));var c=this._determinedMin,v=this._determinedMax;return c!=null&&(s=c,u=!0),v!=null&&(l=v,f=!0),{min:s,max:l,minFixed:u,maxFixed:f,isBlank:h}},r.prototype.modifyDataMinMax=function(t,e){this[_D[t]]=e},r.prototype.setDeterminedMinMax=function(t,e){var i=mD[t];this[i]=e},r.prototype.freeze=function(){this.frozen=!0},r}(),mD={min:"_determinedMin",max:"_determinedMax"},_D={min:"_dataMin",max:"_dataMax"};function SD(r,t,e){var i=r.rawExtentInfo;return i||(i=new yD(r,t,e),r.rawExtentInfo=i,i)}function So(r,t){return t==null?null:Zo(t)?NaN:r.parse(t)}function N0(r,t){var e=r.type,i=SD(r,t,r.getExtent()).calculate();r.setBlank(i.isBlank);var n=i.min,a=i.max,o=t.ecModel;if(o&&e==="time"){var s=I0("bar",o),l=!1;if(A(s,function(h){l=l||h.getBaseAxis()===t.axis}),l){var u=P0(s),f=wD(n,a,t,u);n=f.min,a=f.max}}return{extent:[n,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function wD(r,t,e,i){var n=e.axis.getExtent(),a=n[1]-n[0],o=rD(i,e.axis);if(o===void 0)return{min:r,max:t};var s=1/0;A(o,function(v){s=Math.min(v.offset,s)});var l=-1/0;A(o,function(v){l=Math.max(v.offset+v.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,f=t-r,h=1-(s+l)/a,c=f/h-f;return t+=c*(l/u),r-=c*(s/u),{min:r,max:t}}function Ff(r,t){var e=t,i=N0(r,e),n=i.extent,a=e.get("splitNumber");r instanceof iv&&(r.base=e.get("logBase"));var o=r.type,s=e.get("interval"),l=o==="interval"||o==="time";r.setExtent(n[0],n[1]),r.calcNiceExtent({splitNumber:a,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?e.get("minInterval"):null,maxInterval:l?e.get("maxInterval"):null}),s!=null&&r.setInterval&&r.setInterval(s)}function B0(r,t){if(t=t||r.get("type"),t)switch(t){case"category":return new ev({ordinalMeta:r.getOrdinalMeta?r.getOrdinalMeta():r.getCategories(),extent:[1/0,-1/0]});case"time":return new k0({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new(or.getClass(t)||mn)}}function bD(r){var t=r.scale.getExtent(),e=t[0],i=t[1];return!(e>0&&i>0||e<0&&i<0)}function Fa(r){var t=r.getLabelModel().get("formatter"),e=r.type==="category"?r.scale.getExtent()[0]:null;return r.scale.type==="time"?function(i){return function(n,a){return r.scale.getFormattedLabel(n,a,i)}}(t):H(t)?function(i){return function(n){var a=r.scale.getLabel(n),o=i.replace("{value}",a!=null?a:"");return o}}(t):Z(t)?function(i){return function(n,a){return e!=null&&(a=n.value-e),i(nv(r,n),a,n.level!=null?{level:n.level}:null)}}(t):function(i){return r.scale.getLabel(i)}}function nv(r,t){return r.type==="category"?r.scale.getLabel(t):t.value}function xD(r){var t=r.model,e=r.scale;if(!(!t.get(["axisLabel","show"])||e.isBlank())){var i,n,a=e.getExtent();e instanceof ev?n=e.count():(i=e.getTicks(),n=i.length);var o=r.getLabelModel(),s=Fa(r),l,u=1;n>40&&(u=Math.ceil(n/40));for(var f=0;f=0||(qd.push(r),Z(r)&&(r={install:r}),r.install(CD))}var Ta=mt();function DD(r){return r.type==="category"?LD(r):PD(r)}function AD(r,t){return r.type==="category"?ID(r,t):{ticks:G(r.scale.getTicks(),function(e){return e.value})}}function LD(r){var t=r.getLabelModel(),e=z0(r,t);return!t.get("show")||r.scale.isBlank()?{labels:[],labelCategoryInterval:e.labelCategoryInterval}:e}function z0(r,t){var e=H0(r,"labels"),i=av(t),n=G0(e,i);if(n)return n;var a,o;return Z(i)?a=Y0(r,i):(o=i==="auto"?RD(r):i,a=U0(r,o)),W0(e,i,{labels:a,labelCategoryInterval:o})}function ID(r,t){var e=H0(r,"ticks"),i=av(t),n=G0(e,i);if(n)return n;var a,o;if((!t.get("show")||r.scale.isBlank())&&(a=[]),Z(i))a=Y0(r,i,!0);else if(i==="auto"){var s=z0(r,r.getLabelModel());o=s.labelCategoryInterval,a=G(s.labels,function(l){return l.tickValue})}else o=i,a=U0(r,o,!0);return W0(e,i,{ticks:a,tickCategoryInterval:o})}function PD(r){var t=r.scale.getTicks(),e=Fa(r);return{labels:G(t,function(i,n){return{level:i.level,formattedLabel:e(i,n),rawLabel:r.scale.getLabel(i),tickValue:i.value}})}}function H0(r,t){return Ta(r)[t]||(Ta(r)[t]=[])}function G0(r,t){for(var e=0;e40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=r.dataToCoord(l+1)-r.dataToCoord(l),f=Math.abs(u*Math.cos(i)),h=Math.abs(u*Math.sin(i)),c=0,v=0;l<=a[1];l+=s){var d=0,g=0,p=ch(e({value:l}),t.font,"center","top");d=p.width*1.3,g=p.height*1.3,c=Math.max(c,d,7),v=Math.max(v,g,7)}var y=c/f,m=v/h;isNaN(y)&&(y=1/0),isNaN(m)&&(m=1/0);var _=Math.max(0,Math.floor(Math.min(y,m))),S=Ta(r.model),b=r.getExtent(),w=S.lastAutoInterval,x=S.lastTickCount;return w!=null&&x!=null&&Math.abs(w-_)<=1&&Math.abs(x-o)<=1&&w>_&&S.axisExtent0===b[0]&&S.axisExtent1===b[1]?_=w:(S.lastTickCount=o,S.lastAutoInterval=_,S.axisExtent0=b[0],S.axisExtent1=b[1]),_}function kD(r){var t=r.getLabelModel();return{axisRotate:r.getRotate?r.getRotate():r.isHorizontal&&!r.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}function U0(r,t,e){var i=Fa(r),n=r.scale,a=n.getExtent(),o=r.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=a[0],f=n.count();u!==0&&l>1&&f/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=F0(r),c=o.get("showMinLabel")||h,v=o.get("showMaxLabel")||h;c&&u!==a[0]&&g(a[0]);for(var d=u;d<=a[1];d+=l)g(d);v&&d-l!==a[1]&&g(a[1]);function g(p){var y={value:p};s.push(e?p:{formattedLabel:i(y),rawLabel:n.getLabel(y),tickValue:p})}return s}function Y0(r,t,e){var i=r.scale,n=Fa(r),a=[];return A(i.getTicks(),function(o){var s=i.getLabel(o),l=o.value;t(o.value,s)&&a.push(e?l:{formattedLabel:n(o),rawLabel:s,tickValue:l})}),a}var Kd=[0,1],OD=function(){function r(t,e,i){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=i||[0,0]}return r.prototype.contain=function(t){var e=this._extent,i=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return t>=i&&t<=n},r.prototype.containData=function(t){return this.scale.contain(t)},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.getPixelPrecision=function(t){return HS(t||this.scale.getExtent(),this._extent)},r.prototype.setExtent=function(t,e){var i=this._extent;i[0]=t,i[1]=e},r.prototype.dataToCoord=function(t,e){var i=this._extent,n=this.scale;return t=n.normalize(t),this.onBand&&n.type==="ordinal"&&(i=i.slice(),Qd(i,n.count())),rr(t,Kd,i,e)},r.prototype.coordToData=function(t,e){var i=this._extent,n=this.scale;this.onBand&&n.type==="ordinal"&&(i=i.slice(),Qd(i,n.count()));var a=rr(t,i,Kd,e);return this.scale.scale(a)},r.prototype.pointToData=function(t,e){},r.prototype.getTicksCoords=function(t){t=t||{};var e=t.tickModel||this.getTickModel(),i=AD(this,e),n=i.ticks,a=G(n,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=e.get("alignWithLabel");return ND(this,a,o,t.clamp),a},r.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var t=this.model.getModel("minorTick"),e=t.get("splitNumber");e>0&&e<100||(e=5);var i=this.scale.getMinorTicks(e),n=G(i,function(a){return G(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return n},r.prototype.getViewLabels=function(){return DD(this).labels},r.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},r.prototype.getTickModel=function(){return this.model.getModel("axisTick")},r.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),i=e[1]-e[0]+(this.onBand?1:0);i===0&&(i=1);var n=Math.abs(t[1]-t[0]);return Math.abs(n)/i},r.prototype.calculateCategoryInterval=function(){return ED(this)},r}();function Qd(r,t){var e=r[1]-r[0],i=t,n=e/i/2;r[0]+=n,r[1]-=n}function ND(r,t,e,i){var n=t.length;if(!r.onBand||e||!n)return;var a=r.getExtent(),o,s;if(n===1)t[0].coord=a[0],o=t[1]={coord:a[1]};else{var l=t[n-1].tickValue-t[0].tickValue,u=(t[n-1].coord-t[0].coord)/l;A(t,function(v){v.coord-=u/2});var f=r.scale.getExtent();s=1+f[1]-t[n-1].tickValue,o={coord:t[n-1].coord+u*s},t.push(o)}var h=a[0]>a[1];c(t[0].coord,a[0])&&(i?t[0].coord=a[0]:t.shift()),i&&c(a[0],t[0].coord)&&t.unshift({coord:a[0]}),c(a[1],o.coord)&&(i?o.coord=a[1]:t.pop()),i&&c(o.coord,a[1])&&t.push({coord:a[1]});function c(v,d){return v=Dt(v),d=Dt(d),h?v>d:vn&&(n+=Bn);var v=Math.atan2(s,o);if(v<0&&(v+=Bn),v>=i&&v<=n||v+Bn>=i&&v+Bn<=n)return l[0]=f,l[1]=h,u-e;var d=e*Math.cos(i)+r,g=e*Math.sin(i)+t,p=e*Math.cos(n)+r,y=e*Math.sin(n)+t,m=(d-o)*(d-o)+(g-s)*(g-s),_=(p-o)*(p-o)+(y-s)*(y-s);return m<_?(l[0]=d,l[1]=g,Math.sqrt(m)):(l[0]=p,l[1]=y,Math.sqrt(_))}function xs(r,t,e,i,n,a,o,s){var l=n-r,u=a-t,f=e-r,h=i-t,c=Math.sqrt(f*f+h*h);f/=c,h/=c;var v=l*f+u*h,d=v/c;s&&(d=Math.min(Math.max(d,0),1)),d*=c;var g=o[0]=r+d*f,p=o[1]=t+d*h;return Math.sqrt((g-n)*(g-n)+(p-a)*(p-a))}function X0(r,t,e,i,n,a,o){e<0&&(r=r+e,e=-e),i<0&&(t=t+i,i=-i);var s=r+e,l=t+i,u=o[0]=Math.min(Math.max(n,r),s),f=o[1]=Math.min(Math.max(a,t),l);return Math.sqrt((u-n)*(u-n)+(f-a)*(f-a))}var Ie=[];function zD(r,t,e){var i=X0(t.x,t.y,t.width,t.height,r.x,r.y,Ie);return e.set(Ie[0],Ie[1]),i}function HD(r,t,e){for(var i=0,n=0,a=0,o=0,s,l,u=1/0,f=t.data,h=r.x,c=r.y,v=0;v0){t=t/180*Math.PI,Re.fromArray(r[0]),vt.fromArray(r[1]),wt.fromArray(r[2]),q.sub(Qe,Re,vt),q.sub(Ze,wt,vt);var e=Qe.len(),i=Ze.len();if(!(e<.001||i<.001)){Qe.scale(1/e),Ze.scale(1/i);var n=Qe.dot(Ze),a=Math.cos(t);if(a1&&q.copy($t,wt),$t.toArray(r[1])}}}}function GD(r,t,e){if(e<=180&&e>0){e=e/180*Math.PI,Re.fromArray(r[0]),vt.fromArray(r[1]),wt.fromArray(r[2]),q.sub(Qe,vt,Re),q.sub(Ze,wt,vt);var i=Qe.len(),n=Ze.len();if(!(i<.001||n<.001)){Qe.scale(1/i),Ze.scale(1/n);var a=Qe.dot(t),o=Math.cos(e);if(a=l)q.copy($t,wt);else{$t.scaleAndAdd(Ze,s/Math.tan(Math.PI/2-f));var h=wt.x!==vt.x?($t.x-vt.x)/(wt.x-vt.x):($t.y-vt.y)/(wt.y-vt.y);if(isNaN(h))return;h<0?q.copy($t,vt):h>1&&q.copy($t,wt)}$t.toArray(r[1])}}}}function _u(r,t,e,i){var n=e==="normal",a=n?r:r.ensureState(e);a.ignore=t;var o=i.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();n?r.useStyle(s):a.style=s}function WD(r,t){var e=t.smooth,i=t.points;if(i)if(r.moveTo(i[0][0],i[0][1]),e>0&&i.length>=3){var n=Uu(i[0],i[1]),a=Uu(i[1],i[2]);if(!n||!a){r.lineTo(i[1][0],i[1][1]),r.lineTo(i[2][0],i[2][1]);return}var o=Math.min(n,a)*e,s=hl([],i[1],i[0],o/n),l=hl([],i[1],i[2],o/a),u=hl([],s,l,.5);r.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),r.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var f=1;f0){_(M*T,0,o);var C=M+w;C<0&&S(-C*T,1)}else S(-w*T,1)}}function _(w,x,T){w!==0&&(u=!0);for(var M=x;M0)for(var C=0;C0;C--){var P=T[C-1]*I;_(-P,C,o)}}}function b(w){var x=w<0?-1:1;w=Math.abs(w);for(var T=Math.ceil(w/(o-1)),M=0;M0?_(T,0,M+1):_(-T,o-M-1,o),w-=T,w<=0)return}return u}function UD(r,t,e,i){return Q0(r,"x","width",t,e)}function J0(r,t,e,i){return Q0(r,"y","height",t,e)}function j0(r){var t=[];r.sort(function(g,p){return p.priority-g.priority});var e=new ot(0,0,0,0);function i(g){if(!g.ignore){var p=g.ensureState("emphasis");p.ignore==null&&(p.ignore=!1)}g.ignore=!0}for(var n=0;n=0&&i.attr(a.oldLayoutSelect),ht(c,"emphasis")>=0&&i.attr(a.oldLayoutEmphasis)),Et(i,u,e,l)}else if(i.attr(u),!pn(i).valueAnimation){var h=$(i.style.opacity,1);i.style.opacity=0,Zt(i,{style:{opacity:h}},e,l)}if(a.oldLayout=u,i.states.select){var v=a.oldLayoutSelect={};wo(v,u,bo),wo(v,i.states.select,bo)}if(i.states.emphasis){var d=a.oldLayoutEmphasis={};wo(d,u,bo),wo(d,i.states.emphasis,bo)}gx(i,l,f,e,e)}if(n&&!n.ignore&&!n.invisible){var a=$D(n),o=a.oldLayout,g={points:n.shape.points};o?(n.attr({shape:o}),Et(n,{shape:g},e)):(n.setShape(g),n.style.strokePercent=0,Zt(n,{style:{strokePercent:1}},e)),a.oldLayout=g}},r}(),wu=mt();function qD(r){r.registerUpdateLifecycle("series:beforeupdate",function(t,e,i){var n=wu(e).labelManager;n||(n=wu(e).labelManager=new ZD),n.clearLabels()}),r.registerUpdateLifecycle("series:layoutlabels",function(t,e,i){var n=wu(e).labelManager;i.updatedSeries.forEach(function(a){n.addLabelsOfSeries(e.getViewOfSeriesModel(a))}),n.updateLayoutConfig(e),n.layout(e),n.processLabelsOverall()})}var bu=Math.sin,xu=Math.cos,t_=Math.PI,ui=Math.PI*2,KD=180/t_,e_=function(){function r(){}return r.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},r.prototype.moveTo=function(t,e){this._add("M",t,e)},r.prototype.lineTo=function(t,e){this._add("L",t,e)},r.prototype.bezierCurveTo=function(t,e,i,n,a,o){this._add("C",t,e,i,n,a,o)},r.prototype.quadraticCurveTo=function(t,e,i,n){this._add("Q",t,e,i,n)},r.prototype.arc=function(t,e,i,n,a,o){this.ellipse(t,e,i,i,0,n,a,o)},r.prototype.ellipse=function(t,e,i,n,a,o,s,l){var u=s-o,f=!l,h=Math.abs(u),c=Rr(h-ui)||(f?u>=ui:-u>=ui),v=u>0?u%ui:u%ui+ui,d=!1;c?d=!0:Rr(h)?d=!1:d=v>=t_==!!f;var g=t+i*xu(o),p=e+n*bu(o);this._start&&this._add("M",g,p);var y=Math.round(a*KD);if(c){var m=1/this._p,_=(f?1:-1)*(ui-m);this._add("A",i,n,y,1,+f,t+i*xu(o+_),e+n*bu(o+_)),m>.01&&this._add("A",i,n,y,0,+f,g,p)}else{var S=t+i*xu(s),b=e+n*bu(s);this._add("A",i,n,y,+d,+f,S,b)}},r.prototype.rect=function(t,e,i,n){this._add("M",t,e),this._add("l",i,0),this._add("l",0,n),this._add("l",-i,0),this._add("Z")},r.prototype.closePath=function(){this._d.length>0&&this._add("Z")},r.prototype._add=function(t,e,i,n,a,o,s,l,u){for(var f=[],h=this._p,c=1;c"}function aA(r){return""}function sv(r,t){t=t||{};var e=t.newline?"\n":"";function i(n){var a=n.children,o=n.tag,s=n.attrs,l=n.text;return nA(o,s)+(o!=="style"?ne(l):l||"")+(a?""+e+G(a,function(u){return i(u)}).join(e)+e:"")+aA(o)}return i(r)}function oA(r,t,e){e=e||{};var i=e.newline?"\n":"",n=" {"+i,a=i+"}",o=G(it(r),function(l){return l+n+G(it(r[l]),function(u){return u+":"+r[l][u]+";"}).join(i)+a}).join(i),s=G(it(t),function(l){return"@keyframes "+l+n+G(it(t[l]),function(u){return u+n+G(it(t[l][u]),function(f){var h=t[l][u][f];return f==="d"&&(h='path("'+h+'")'),f+":"+h+";"}).join(i)+a}).join(i)+a}).join(i);return!o&&!s?"":[""].join(i)}function zf(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function ep(r,t,e,i){return Pt("svg","root",{width:r,height:t,xmlns:r_,"xmlns:xlink":i_,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+r+" "+t:!1},e)}var sA=0;function a_(){return sA++}var rp={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},hi="transform-origin";function lA(r,t,e){var i=O({},r.shape);O(i,t),r.buildPath(e,i);var n=new e_;return n.reset(ty(r)),e.rebuildPath(n,1),n.generateStr(),n.getStr()}function uA(r,t){var e=t.originX,i=t.originY;(e||i)&&(r[hi]=e+"px "+i+"px")}var fA={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function o_(r,t){var e=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[e]=r,e}function hA(r,t,e){var i=r.shape.paths,n={},a,o;if(A(i,function(l){var u=zf(e.zrId);u.animation=!0,ll(l,{},u,!0);var f=u.cssAnims,h=u.cssNodes,c=it(f),v=c.length;if(v){o=c[v-1];var d=f[o];for(var g in d){var p=d[g];n[g]=n[g]||{d:""},n[g].d+=p.d||""}for(var y in h){var m=h[y].animation;m.indexOf(o)>=0&&(a=m)}}}),!!a){t.d=!1;var s=o_(n,e);return a.replace(o,s)}}function ip(r){return H(r)?rp[r]?"cubic-bezier("+rp[r]+")":fh(r)?r:"":""}function ll(r,t,e,i){var n=r.animators,a=n.length,o=[];if(r instanceof Wy){var s=hA(r,t,e);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Nt=o_(x,e);return Nt+" "+m[0]+" both"}}for(var p in l){var s=g(l[p]);s&&o.push(s)}if(o.length){var y=e.zrId+"-cls-"+a_();e.cssNodes["."+y]={animation:o.join(",")},t.class=y}}function vA(r,t,e){if(!r.ignore)if(r.isSilent()){var i={"pointer-events":"none"};np(i,t,e)}else{var n=r.states.emphasis&&r.states.emphasis.style?r.states.emphasis.style:{},a=n.fill;if(!a){var o=r.style&&r.style.fill,s=r.states.select&&r.states.select.style&&r.states.select.style.fill,l=r.currentStates.indexOf("select")>=0&&s||o;l&&(a=Qu(l))}var u=n.lineWidth;if(u){var f=!n.strokeNoScale&&r.transform?r.transform[0]:1;u=u/f}var i={cursor:"pointer"};a&&(i.fill=a),n.stroke&&(i.stroke=n.stroke),u&&(i["stroke-width"]=u),np(i,t,e)}}function np(r,t,e,i){var n=JSON.stringify(r),a=e.cssStyleCache[n];a||(a=e.zrId+"-cls-"+a_(),e.cssStyleCache[n]=a,e.cssNodes["."+a+":hover"]=r),t.class=t.class?t.class+" "+a:a}var Ma=Math.round;function s_(r){return r&&H(r.src)}function l_(r){return r&&Z(r.toDataURL)}function lv(r,t,e,i){eA(function(n,a){var o=n==="fill"||n==="stroke";o&&jg(a)?f_(t,r,n,i):o&&hh(a)?h_(e,r,n,i):o&&a==="none"?r[n]="transparent":r[n]=a},t,e,!1),_A(e,r,i)}function uv(r,t){var e=NS(t);e&&(e.each(function(i,n){i!=null&&(r[(tp+n).toLowerCase()]=i+"")}),t.isSilent()&&(r[tp+"silent"]="true"))}function ap(r){return Rr(r[0]-1)&&Rr(r[1])&&Rr(r[2])&&Rr(r[3]-1)}function cA(r){return Rr(r[4])&&Rr(r[5])}function fv(r,t,e){if(t&&!(cA(t)&&ap(t))){var i=1e4;r.transform=ap(t)?"translate("+Ma(t[4]*i)/i+" "+Ma(t[5]*i)/i+")":nS(t)}}function op(r,t,e){for(var i=r.points,n=[],a=0;a"u"){var p="Image width/height must been given explictly in svg-ssr renderer.";_e(c,p),_e(v,p)}else if(c==null||v==null){var y=function(C,D){if(C){var L=C.elm,I=c||D.width,P=v||D.height;C.tag==="pattern"&&(u?(P=1,I/=a.width):f&&(I=1,P/=a.height)),C.attrs.width=I,C.attrs.height=P,L&&(L.setAttribute("width",I),L.setAttribute("height",P))}},m=mh(d,null,r,function(C){l||y(w,C),y(h,C)});m&&m.width&&m.height&&(c=c||m.width,v=v||m.height)}h=Pt("image","img",{href:d,width:c,height:v}),o.width=c,o.height=v}else n.svgElement&&(h=Q(n.svgElement),o.width=n.svgWidth,o.height=n.svgHeight);if(h){var _,S;l?_=S=1:u?(S=1,_=o.width/a.width):f?(_=1,S=o.height/a.height):o.patternUnits="userSpaceOnUse",_!=null&&!isNaN(_)&&(o.width=_),S!=null&&!isNaN(S)&&(o.height=S);var b=ey(n);b&&(o.patternTransform=b);var w=Pt("pattern","",o,[h]),x=sv(w),T=i.patternCache,M=T[x];M||(M=i.zrId+"-p"+i.patternIdx++,T[x]=M,o.id=M,w=i.defs[M]=Pt("pattern",M,o,[h])),t[e]=Rs(M)}}function SA(r,t,e){var i=e.clipPathCache,n=e.defs,a=i[r.id];if(!a){a=e.zrId+"-c"+e.clipPathIdx++;var o={id:a};i[r.id]=a,n[a]=Pt("clipPath",a,o,[u_(r,e)])}t["clip-path"]=Rs(a)}function up(r){return document.createTextNode(r)}function ci(r,t,e){r.insertBefore(t,e)}function fp(r,t){r.removeChild(t)}function hp(r,t){r.appendChild(t)}function v_(r){return r.parentNode}function c_(r){return r.nextSibling}function Tu(r,t){r.textContent=t}var vp=58,wA=120,bA=Pt("","");function Hf(r){return r===void 0}function Xe(r){return r!==void 0}function xA(r,t,e){for(var i={},n=t;n<=e;++n){var a=r[n].key;a!==void 0&&(i[a]=n)}return i}function $n(r,t){var e=r.key===t.key,i=r.tag===t.tag;return i&&e}function Ca(r){var t,e=r.children,i=r.tag;if(Xe(i)){var n=r.elm=n_(i);if(hv(bA,r),F(e))for(t=0;ta?(d=e[l+1]==null?null:e[l+1].elm,d_(r,d,e,n,l)):Ms(r,t,i,a))}function Yi(r,t){var e=t.elm=r.elm,i=r.children,n=t.children;r!==t&&(hv(r,t),Hf(t.text)?Xe(i)&&Xe(n)?i!==n&&TA(e,i,n):Xe(n)?(Xe(r.text)&&Tu(e,""),d_(e,null,n,0,n.length-1)):Xe(i)?Ms(e,i,0,i.length-1):Xe(r.text)&&Tu(e,""):r.text!==t.text&&(Xe(i)&&Ms(e,i,0,i.length-1),Tu(e,t.text)))}function MA(r,t){if($n(r,t))Yi(r,t);else{var e=r.elm,i=v_(e);Ca(t),i!==null&&(ci(i,t.elm,c_(e)),Ms(i,[r],0,0))}return t}var CA=0,DA=function(){function r(t,e,i){if(this.type="svg",this.refreshHover=cp(),this.configLayer=cp(),this.storage=e,this._opts=i=O({},i),this.root=t,this._id="zr"+CA++,this._oldVNode=ep(i.width,i.height),t&&!i.ssr){var n=this._viewport=document.createElement("div");n.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=n_("svg");hv(null,this._oldVNode),n.appendChild(a),t.appendChild(n)}this.resize(i.width,i.height)}return r.prototype.getType=function(){return this.type},r.prototype.getViewportRoot=function(){return this._viewport},r.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},r.prototype.getSvgDom=function(){return this._svgDom},r.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",MA(this._oldVNode,t),this._oldVNode=t}},r.prototype.renderOneToVNode=function(t){return lp(t,zf(this._id))},r.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),i=this._width,n=this._height,a=zf(this._id);a.animation=t.animation,a.willUpdate=t.willUpdate,a.compress=t.compress,a.emphasis=t.emphasis;var o=[],s=this._bgVNode=AA(i,n,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=Pt("g","main",{},[]);this._paintList(e,a,l?l.children:o),l&&o.push(l);var u=G(it(a.defs),function(c){return a.defs[c]});if(u.length&&o.push(Pt("defs","defs",{},u)),t.animation){var f=oA(a.cssNodes,a.cssAnims,{newline:!0});if(f){var h=Pt("style","stl",{},[],f);o.push(h)}}return ep(i,n,o,t.useViewBox)},r.prototype.renderToString=function(t){return t=t||{},sv(this.renderToVNode({animation:$(t.cssAnimation,!0),emphasis:$(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:$(t.useViewBox,!0)}),{newline:!0})},r.prototype.setBackgroundColor=function(t){this._backgroundColor=t},r.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},r.prototype._paintList=function(t,e,i){for(var n=t.length,a=[],o=0,s,l,u=0,f=0;f=0&&!(c&&l&&c[g]===l[g]);g--);for(var p=d-1;p>g;p--)o--,s=a[o-1];for(var y=g+1;y=s)}}for(var h=this.__startIndex;h15)break}}P.prevElClipPaths&&y.restore()};if(m)if(m.length===0)T=p.__endIndex;else for(var C=v.dpr,D=0;D0&&t>n[0]){for(l=0;lt);l++);s=i[n[l]]}if(n.splice(l+1,0,t),i[t]=e,!e.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(e.dom,u.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.painter||(e.painter=this)}},r.prototype.eachLayer=function(t,e){for(var i=this._zlevelList,n=0;n0?xo:0),this._needsManuallyCompositing),f.__builtin__||ah("ZLevel "+u+" has been used by unkown layer "+f.id),f!==a&&(f.__used=!0,f.__startIndex!==l&&(f.__dirty=!0),f.__startIndex=l,f.incremental?f.__drawIndex=-1:f.__drawIndex=l,e(l),a=f),n.__dirty&Je&&!n.__inHover&&(f.__dirty=!0,f.incremental&&f.__drawIndex<0&&(f.__drawIndex=l))}e(l),this.eachBuiltinLayer(function(h,c){!h.__used&&h.getElementCount()>0&&(h.__dirty=!0,h.__startIndex=h.__endIndex=h.__drawIndex=0),h.__dirty&&h.__drawIndex<0&&(h.__drawIndex=h.__startIndex)})},r.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},r.prototype._clearLayer=function(t){t.clear()},r.prototype.setBackgroundColor=function(t){this._backgroundColor=t,A(this._layers,function(e){e.setUnpainted()})},r.prototype.configLayer=function(t,e){if(e){var i=this._layerConfig;i[t]?at(i[t],e,!0):i[t]=e;for(var n=0;n-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),i},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(Oe);function vv(r,t){var e=r.mapDimensionsAll("defaultedLabel"),i=e.length;if(i===1){var n=vn(r,t,e[0]);return n!=null?n+"":null}else if(i){for(var a=[],o=0;o=0&&i.push(t[a])}return i.join(" ")}var cv=function(r){B(t,r);function t(e,i,n,a){var o=r.call(this)||this;return o.updateData(e,i,n,a),o}return t.prototype._createSymbol=function(e,i,n,a,o){this.removeAll();var s=yr(e,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=OA,this._symbolType=e,this.add(s)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){ls(this.childAt(0))},t.prototype.downplay=function(){us(this.childAt(0))},t.prototype.setZ=function(e,i){var n=this.childAt(0);n.zlevel=e,n.z=i},t.prototype.setDraggable=function(e,i){var n=this.childAt(0);n.draggable=e,n.cursor=!i&&e?"move":n.cursor},t.prototype.updateData=function(e,i,n,a){this.silent=!1;var o=e.getItemVisual(i,"symbol")||"circle",s=e.hostModel,l=t.getSymbolSize(e,i),u=o!==this._symbolType,f=a&&a.disableAnimation;if(u){var h=e.getItemVisual(i,"symbolKeepAspect");this._createSymbol(o,e,i,l,h)}else{var c=this.childAt(0);c.silent=!1;var v={scaleX:l[0]/2,scaleY:l[1]/2};f?c.attr(v):Et(c,v,s,i),Lh(c)}if(this._updateCommon(e,i,l,n,a),u){var c=this.childAt(0);if(!f){var v={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:c.style.opacity}};c.scaleX=c.scaleY=0,c.style.opacity=0,Zt(c,v,s,i)}}f&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,i,n,a,o){var s=this.childAt(0),l=e.hostModel,u,f,h,c,v,d,g,p,y;if(a&&(u=a.emphasisItemStyle,f=a.blurItemStyle,h=a.selectItemStyle,c=a.focus,v=a.blurScope,g=a.labelStatesModels,p=a.hoverScale,y=a.cursorStyle,d=a.emphasisDisabled),!a||e.hasItemOption){var m=a&&a.itemModel?a.itemModel:e.getItemModel(i),_=m.getModel("emphasis");u=_.getModel("itemStyle").getItemStyle(),h=m.getModel(["select","itemStyle"]).getItemStyle(),f=m.getModel(["blur","itemStyle"]).getItemStyle(),c=_.get("focus"),v=_.get("blurScope"),d=_.get("disabled"),g=Na(m),p=_.getShallow("scale"),y=m.getShallow("cursor")}var S=e.getItemVisual(i,"symbolRotate");s.attr("rotation",(S||0)*Math.PI/180||0);var b=Km(e.getItemVisual(i,"symbolOffset"),n);b&&(s.x=b[0],s.y=b[1]),y&&s.attr("cursor",y);var w=e.getItemVisual(i,"style"),x=w.fill;if(s instanceof Fe){var T=s.style;s.useStyle(O({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},w))}else s.__isEmptyBrush?s.useStyle(O({},w)):s.useStyle(w),s.style.decal=null,s.setColor(x,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var M=e.getItemVisual(i,"liftZ"),C=this._z2;M!=null?C==null&&(this._z2=s.z2,s.z2+=M):C!=null&&(s.z2=C,this._z2=null);var D=o&&o.useNameLabel;Oa(s,g,{labelFetcher:l,labelDataIndex:i,defaultText:L,inheritColor:x,defaultOpacity:w.opacity});function L(R){return D?e.getName(R):vv(e,R)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var I=s.ensureState("emphasis");I.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=f;var P=p==null||p===!0?Math.max(1.1,3/this._sizeY):isFinite(p)&&p>0?+p:1;I.scaleX=this._sizeX*P,I.scaleY=this._sizeY*P,this.setSymbolScale(1),ga(this,c,v,d)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,i,n){var a=this.childAt(0),o=rt(this).dataIndex,s=n&&n.animation;if(this.silent=a.silent=!0,n&&n.fadeLabel){var l=a.getTextContent();l&&vs(l,{style:{opacity:0}},i,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();vs(a,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:o,cb:e,removeOpt:s})},t.getSymbolSize=function(e,i){return FM(e.getItemVisual(i,"symbolSize"))},t}(Ct);function OA(r,t){this.parent.drift(r,t)}function Cu(r,t,e,i){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(i.isIgnore&&i.isIgnore(e))&&!(i.clipShape&&!i.clipShape.contain(t[0],t[1]))&&r.getItemVisual(e,"symbol")!=="none"}function gp(r){return r!=null&&!W(r)&&(r={isIgnore:r}),r||{}}function yp(r){var t=r.hostModel,e=t.getModel("emphasis");return{emphasisItemStyle:e.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:e.get("focus"),blurScope:e.get("blurScope"),emphasisDisabled:e.get("disabled"),hoverScale:e.get("scale"),labelStatesModels:Na(t),cursorStyle:t.get("cursor")}}var NA=function(){function r(t){this.group=new Ct,this._SymbolCtor=t||cv}return r.prototype.updateData=function(t,e){this._progressiveEls=null,e=gp(e);var i=this.group,n=t.hostModel,a=this._data,o=this._SymbolCtor,s=e.disableAnimation,l=yp(t),u={disableAnimation:s},f=e.getSymbolPoint||function(h){return t.getItemLayout(h)};a||i.removeAll(),t.diff(a).add(function(h){var c=f(h);if(Cu(t,c,h,e)){var v=new o(t,h,l,u);v.setPosition(c),t.setItemGraphicEl(h,v),i.add(v)}}).update(function(h,c){var v=a.getItemGraphicEl(c),d=f(h);if(!Cu(t,d,h,e)){i.remove(v);return}var g=t.getItemVisual(h,"symbol")||"circle",p=v&&v.getSymbolType&&v.getSymbolType();if(!v||p&&p!==g)i.remove(v),v=new o(t,h,l,u),v.setPosition(d);else{v.updateData(t,h,l,u);var y={x:d[0],y:d[1]};s?v.attr(y):Et(v,y,n)}i.add(v),t.setItemGraphicEl(h,v)}).remove(function(h){var c=a.getItemGraphicEl(h);c&&c.fadeOut(function(){i.remove(c)},n)}).execute(),this._getSymbolPoint=f,this._data=t},r.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl(function(i,n){var a=t._getSymbolPoint(n);i.setPosition(a),i.markRedraw()})},r.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=yp(t),this._data=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(t,e,i){this._progressiveEls=[],i=gp(i);function n(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=t.start;a0?e=i[0]:i[1]<0&&(e=i[1]),e}function y_(r,t,e,i){var n=NaN;r.stacked&&(n=e.get(e.getCalculationInfo("stackedOverDimension"),i)),isNaN(n)&&(n=r.valueStart);var a=r.baseDataOffset,o=[];return o[a]=e.get(r.baseDim,i),o[1-a]=n,t.dataToPoint(o)}function FA(r,t){var e=[];return t.diff(r).add(function(i){e.push({cmd:"+",idx:i})}).update(function(i,n){e.push({cmd:"=",idx:n,idx1:i})}).remove(function(i){e.push({cmd:"-",idx:i})}).execute(),e}function VA(r,t,e,i,n,a,o,s){for(var l=FA(r,t),u=[],f=[],h=[],c=[],v=[],d=[],g=[],p=g_(n,t,o),y=r.getLayout("points")||[],m=t.getLayout("points")||[],_=0;_=n||g<0)break;if(wi(y,m)){if(l){g+=a;continue}break}if(g===e)r[a>0?"moveTo":"lineTo"](y,m),h=y,c=m;else{var _=y-u,S=m-f;if(_*_+S*S<.5){g+=a;continue}if(o>0){for(var b=g+a,w=t[b*2],x=t[b*2+1];w===y&&x===m&&p=i||wi(w,x))v=y,d=m;else{C=w-u,D=x-f;var P=y-u,R=w-y,E=m-f,z=x-m,k=void 0,N=void 0;if(s==="x"){k=Math.abs(P),N=Math.abs(R);var V=C>0?1:-1;v=y-V*k*o,d=m,L=y+V*N*o,I=m}else if(s==="y"){k=Math.abs(E),N=Math.abs(z);var U=D>0?1:-1;v=y,d=m-U*k*o,L=y,I=m+U*N*o}else k=Math.sqrt(P*P+E*E),N=Math.sqrt(R*R+z*z),M=N/(N+k),v=y-C*o*(1-M),d=m-D*o*(1-M),L=y+C*o*M,I=m+D*o*M,L=Mr(L,Cr(w,y)),I=Mr(I,Cr(x,m)),L=Cr(L,Mr(w,y)),I=Cr(I,Mr(x,m)),C=L-y,D=I-m,v=y-C*k/N,d=m-D*k/N,v=Mr(v,Cr(u,y)),d=Mr(d,Cr(f,m)),v=Cr(v,Mr(u,y)),d=Cr(d,Mr(f,m)),C=y-v,D=m-d,L=y+C*N/k,I=m+D*N/k}r.bezierCurveTo(h,c,v,d,y,m),h=L,c=I}else r.lineTo(y,m)}u=y,f=m,g+=a}return p}var m_=function(){function r(){this.smooth=0,this.smoothConstraint=!0}return r}(),zA=function(r){B(t,r);function t(e){var i=r.call(this,e)||this;return i.type="ec-polyline",i}return t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new m_},t.prototype.buildPath=function(e,i){var n=i.points,a=0,o=n.length/2;if(i.connectNulls){for(;o>0&&wi(n[o*2-2],n[o*2-1]);o--);for(;a=0){var S=u?(d-l)*_+l:(v-s)*_+s;return u?[e,S]:[S,e]}s=v,l=d;break;case o.C:v=a[h++],d=a[h++],g=a[h++],p=a[h++],y=a[h++],m=a[h++];var b=u?Qo(s,v,g,y,e,f):Qo(l,d,p,m,e,f);if(b>0)for(var w=0;w=0){var S=u?Lt(l,d,p,m,x):Lt(s,v,g,y,x);return u?[e,S]:[S,e]}}s=y,l=m;break}}},t}(lt),HA=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t}(m_),GA=function(r){B(t,r);function t(e){var i=r.call(this,e)||this;return i.type="ec-polygon",i}return t.prototype.getDefaultShape=function(){return new HA},t.prototype.buildPath=function(e,i){var n=i.points,a=i.stackedOnPoints,o=0,s=n.length/2,l=i.smoothMonotone;if(i.connectNulls){for(;s>0&&wi(n[s*2-2],n[s*2-1]);s--);for(;ot){a?e.push(o(a,l,t)):n&&e.push(o(n,l,0),o(n,l,t));break}else n&&(e.push(o(n,l,0)),n=null),e.push(l),a=l}return e}function XA(r,t,e){var i=r.getVisual("visualMeta");if(!(!i||!i.length||!r.count())&&t.type==="cartesian2d"){for(var n,a,o=i.length-1;o>=0;o--){var s=r.getDimensionInfo(i[o].dimension);if(n=s&&s.coordDim,n==="x"||n==="y"){a=i[o];break}}if(a){var l=t.getAxis(n),u=G(a.stops,function(_){return{coord:l.toGlobalCoord(l.dataToCoord(_.value)),color:_.color}}),f=u.length,h=a.outerColors.slice();f&&u[0].coord>u[f-1].coord&&(u.reverse(),h.reverse());var c=YA(u,n==="x"?e.getWidth():e.getHeight()),v=c.length;if(!v&&f)return u[0].coord<0?h[1]?h[1]:u[f-1].color:h[0]?h[0]:u[0].color;var d=10,g=c[0].coord-d,p=c[v-1].coord+d,y=p-g;if(y<.001)return"transparent";A(c,function(_){_.offset=(_.coord-g)/y}),c.push({offset:v?c[v-1].offset:.5,color:h[1]||"transparent"}),c.unshift({offset:v?c[0].offset:.5,color:h[0]||"transparent"});var m=new Dh(0,0,0,0,c,!0);return m[n]=g,m[n+"2"]=p,m}}}function $A(r,t,e){var i=r.get("showAllSymbol"),n=i==="auto";if(!(i&&!n)){var a=e.getAxesByScale("ordinal")[0];if(a&&!(n&&ZA(a,t))){var o=t.mapDimension(a.dim),s={};return A(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function ZA(r,t){var e=r.getExtent(),i=Math.abs(e[1]-e[0])/r.scale.count();isNaN(i)&&(i=0);for(var n=t.count(),a=Math.max(1,Math.round(n/5)),o=0;oi)return!1;return!0}function qA(r,t){return isNaN(r)||isNaN(t)}function KA(r){for(var t=r.length/2;t>0&&qA(r[t*2-2],r[t*2-1]);t--);return t-1}function bp(r,t){return[r[t*2],r[t*2+1]]}function QA(r,t,e){for(var i=r.length/2,n=e==="x"?0:1,a,o,s=0,l=-1,u=0;u=t||a>=t&&o<=t){l=u;break}s=u,a=o}return{range:[s,l],t:(t-a)/(o-a)}}function w_(r){if(r.get(["endLabel","show"]))return!0;for(var t=0;t0&&e.get(["emphasis","lineStyle","width"])==="bolder"){var V=g.getState("emphasis").style;V.lineWidth=+g.style.lineWidth+1}rt(g).seriesIndex=e.seriesIndex,ga(g,z,k,N);var U=wp(e.get("smooth")),X=e.get("smoothMonotone");if(g.setShape({smooth:U,smoothMonotone:X,connectNulls:T}),p){var J=l.getCalculationInfo("stackedOnSeries"),nt=0;p.useStyle(st(f.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:l.getVisual("style").decal})),J&&(nt=wp(J.get("smooth"))),p.setShape({smooth:U,stackedOnSmooth:nt,smoothMonotone:X,connectNulls:T}),fs(p,e,"areaStyle"),rt(p).seriesIndex=e.seriesIndex,ga(p,z,k,N)}var bt=function(ct){a._changePolyState(ct)};l.eachItemGraphicEl(function(ct){ct&&(ct.onHoverStateChange=bt)}),this._polyline.onHoverStateChange=bt,this._data=l,this._coordSys=o,this._stackedOnPoints=w,this._points=h,this._step=D,this._valueOrigin=S,e.get("triggerLineEvent")&&(this.packEventData(e,g),p&&this.packEventData(e,p))},t.prototype.packEventData=function(e,i){rt(i).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,i,n,a){var o=e.getData(),s=bi(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var f=l[s*2],h=l[s*2+1];if(isNaN(f)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(f,h))return;var c=e.get("zlevel")||0,v=e.get("z")||0;u=new cv(o,s),u.x=f,u.y=h,u.setZ(c,v);var d=u.getSymbolPath().getTextContent();d&&(d.zlevel=c,d.z=v,d.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else me.prototype.highlight.call(this,e,i,n,a)},t.prototype.downplay=function(e,i,n,a){var o=e.getData(),s=bi(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else me.prototype.downplay.call(this,e,i,n,a)},t.prototype._changePolyState=function(e){var i=this._polygon;gc(this._polyline,e),i&&gc(i,e)},t.prototype._newPolyline=function(e){var i=this._polyline;return i&&this._lineGroup.remove(i),i=new zA({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(i),this._polyline=i,i},t.prototype._newPolygon=function(e,i){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new GA({shape:{points:e,stackedOnPoints:i},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,i,n){var a,o,s=i.getBaseAxis(),l=s.inverse;i.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):i.type==="polar"&&(a=s.dim==="angle",o=!0);var u=e.hostModel,f=u.get("animationDuration");Z(f)&&(f=f(null));var h=u.get("animationDelay")||0,c=Z(h)?h(null):h;e.eachItemGraphicEl(function(v,d){var g=v;if(g){var p=[v.x,v.y],y=void 0,m=void 0,_=void 0;if(n)if(o){var S=n,b=i.pointToCoord(p);a?(y=S.startAngle,m=S.endAngle,_=-b[1]/180*Math.PI):(y=S.r0,m=S.r,_=b[0])}else{var w=n;a?(y=w.x,m=w.x+w.width,_=v.x):(y=w.y+w.height,m=w.y,_=v.y)}var x=m===y?0:(_-y)/(m-y);l&&(x=1-x);var T=Z(h)?h(d):f*x+c,M=g.getSymbolPath(),C=M.getTextContent();g.attr({scaleX:0,scaleY:0}),g.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),C&&C.animateFrom({style:{opacity:0}},{duration:300,delay:T}),M.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,i,n){var a=e.getModel("endLabel");if(w_(e)){var o=e.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new At({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var f=KA(l);f>=0&&(Oa(s,Na(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:f,defaultText:function(h,c,v){return v!=null?p_(o,v):vv(o,h)},enableTextSetter:!0},JA(a,i)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,i,n,a,o,s,l){var u=this._endLabel,f=this._polyline;if(u){e<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=n.getLayout("points"),c=n.hostModel,v=c.get("connectNulls"),d=s.get("precision"),g=s.get("distance")||0,p=l.getBaseAxis(),y=p.isHorizontal(),m=p.inverse,_=i.shape,S=m?y?_.x:_.y+_.height:y?_.x+_.width:_.y,b=(y?g:0)*(m?-1:1),w=(y?0:-g)*(m?-1:1),x=y?"x":"y",T=QA(h,S,x),M=T.range,C=M[1]-M[0],D=void 0;if(C>=1){if(C>1&&!v){var L=bp(h,M[0]);u.attr({x:L[0]+b,y:L[1]+w}),o&&(D=c.getRawValue(M[0]))}else{var L=f.getPointOn(S,x);L&&u.attr({x:L[0]+b,y:L[1]+w});var I=c.getRawValue(M[0]),P=c.getRawValue(M[1]);o&&(D=yy(n,d,I,P,T.t))}a.lastFrameIndex=M[0]}else{var R=e===1||a.lastFrameIndex>0?M[0]:0,L=bp(h,R);o&&(D=c.getRawValue(R)),u.attr({x:L[0]+b,y:L[1]+w})}if(o){var E=pn(u);typeof E.setLabelText=="function"&&E.setLabelText(D)}}},t.prototype._doUpdateAnimation=function(e,i,n,a,o,s,l){var u=this._polyline,f=this._polygon,h=e.hostModel,c=VA(this._data,e,this._stackedOnPoints,i,this._coordSys,n,this._valueOrigin),v=c.current,d=c.stackedOnCurrent,g=c.next,p=c.stackedOnNext;if(o&&(v=Dr(c.current,n,o,l),d=Dr(c.stackedOnCurrent,n,o,l),g=Dr(c.next,n,o,l),p=Dr(c.stackedOnNext,n,o,l)),Sp(v,g)>3e3||f&&Sp(d,p)>3e3){u.stopAnimation(),u.setShape({points:g}),f&&(f.stopAnimation(),f.setShape({points:g,stackedOnPoints:p}));return}u.shape.__points=c.current,u.shape.points=v;var y={shape:{points:g}};c.current!==v&&(y.shape.__points=c.next),u.stopAnimation(),Et(u,y,h),f&&(f.setShape({points:v,stackedOnPoints:d}),f.stopAnimation(),Et(f,{shape:{stackedOnPoints:p}},h),u.shape.points!==f.shape.points&&(f.shape.points=u.shape.points));for(var m=[],_=c.status,S=0;S<_.length;S++){var b=_[S].cmd;if(b==="="){var w=e.getItemGraphicEl(_[S].idx1);w&&m.push({el:w,ptIdx:S})}}u.animators&&u.animators.length&&u.animators[0].during(function(){f&&f.dirtyShape();for(var x=u.shape.__points,T=0;Tt&&(t=r[e]);return isFinite(t)?t:NaN},min:function(r){for(var t=1/0,e=0;et&&(t=a,e=n)}return isFinite(e)?e:NaN},nearest:function(r){return r[0]}},rL=function(r){return Math.round(r.length/2)};function b_(r){return{seriesType:r,reset:function(t,e,i){var n=t.getData(),a=t.get("sampling"),o=t.coordinateSystem,s=n.count();if(s>10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),f=l.getExtent(),h=i.getDevicePixelRatio(),c=Math.abs(f[1]-f[0])*(h||1),v=Math.round(s/c);if(isFinite(v)&&v>1){a==="lttb"&&t.setData(n.lttbDownSample(n.mapDimension(u.dim),1/v));var d=void 0;H(a)?d=eL[a]:Z(a)&&(d=a),d&&t.setData(n.downSample(n.mapDimension(u.dim),1/v,d,rL))}}}}}function $2(r){r.registerChartView(jA),r.registerSeriesModel(kA),r.registerLayout(tL("line")),r.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),i=t.getModel("lineStyle").getLineStyle();i&&!i.stroke&&(i.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",i)}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,b_("line"))}var Wf=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.getInitialData=function(e,i){return tv(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,i,n){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(e),s=a.dataToPoint(o);if(n)A(a.getAxes(),function(c,v){if(c.type==="category"&&i!=null){var d=c.getTicksCoords(),g=c.getTickModel().get("alignWithLabel"),p=o[v],y=i[v]==="x1"||i[v]==="y1";if(y&&!g&&(p+=1),d.length<2)return;if(d.length===2){s[v]=c.toGlobalCoord(c.getExtent()[y?1:0]);return}for(var m=void 0,_=void 0,S=1,b=0;bp){_=(w+m)/2;break}b===1&&(S=x-d[0].tickValue)}_==null&&(m?m&&(_=d[d.length-1].coord):_=d[0].coord),s[v]=c.toGlobalCoord(_)}});else{var l=this.getData(),u=l.getLayout("offset"),f=l.getLayout("size"),h=a.getBaseAxis().isHorizontal()?0:1;s[h]+=u+f/2}return s}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(Oe);Oe.registerClass(Wf);var iL=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.getInitialData=function(){return tv(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},t.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),i=this.get("largeThreshold");return i>e&&(e=i),e},t.prototype.brushSelector=function(e,i,n){return n.rect(i.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=Zs(Wf.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(Wf),nL=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return r}(),xp=function(r){B(t,r);function t(e){var i=r.call(this,e)||this;return i.type="sausage",i}return t.prototype.getDefaultShape=function(){return new nL},t.prototype.buildPath=function(e,i){var n=i.cx,a=i.cy,o=Math.max(i.r0||0,0),s=Math.max(i.r,0),l=(s-o)*.5,u=o+l,f=i.startAngle,h=i.endAngle,c=i.clockwise,v=Math.PI*2,d=c?h-fMath.PI/2&&fs)return!0;s=h}return!1},t.prototype._isOrderDifferentInView=function(e,i){for(var n=i.scale,a=n.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],n.getOrdinalMeta().categories.length-1);o<=s;++o)if(e.ordinalNumbers[o]!==n.getRawOrdinalNumber(o))return!0},t.prototype._updateSortWithinSameData=function(e,i,n,a){if(this._isOrderChangedWithinSameData(e,i,n)){var o=this._dataSort(e,n,i);this._isOrderDifferentInView(o,n)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:o}))}},t.prototype._dispatchInitSort=function(e,i,n){var a=i.baseAxis,o=this._dataSort(e,a,function(s){return e.get(e.mapDimension(i.otherAxis.dim),s)});n.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},t.prototype.remove=function(e,i){this._clear(this._model),this._removeOnRenderedListener(i)},t.prototype.dispose=function(e,i){this._removeOnRenderedListener(i)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(e){var i=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(a){cs(a,e,rt(a).dataIndex)})):i.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(me),Tp={cartesian2d:function(r,t){var e=t.width<0?-1:1,i=t.height<0?-1:1;e<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height);var n=r.x+r.width,a=r.y+r.height,o=Au(t.x,r.x),s=Lu(t.x+t.width,n),l=Au(t.y,r.y),u=Lu(t.y+t.height,a),f=sn?s:o,t.y=h&&l>a?u:l,t.width=f?0:s-o,t.height=h?0:u-l,e<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height),f||h},polar:function(r,t){var e=t.r0<=t.r?1:-1;if(e<0){var i=t.r;t.r=t.r0,t.r0=i}var n=Lu(t.r,r.r),a=Au(t.r0,r.r0);t.r=n,t.r0=a;var o=n-a<0;if(e<0){var i=t.r;t.r=t.r0,t.r0=i}return o}},Mp={cartesian2d:function(r,t,e,i,n,a,o,s,l){var u=new Mt({shape:O({},i),z2:1});if(u.__dataIndex=e,u.name="item",a){var f=u.shape,h=n?"height":"width";f[h]=0}return u},polar:function(r,t,e,i,n,a,o,s,l){var u=!n&&l?xp:zr,f=new u({shape:i,z2:1});f.name="item";var h=x_(n);if(f.calculateTextPosition=aL(h,{isRoundCap:u===xp}),a){var c=f.shape,v=n?"r":"endAngle",d={};c[v]=n?i.r0:i.startAngle,d[v]=i[v],(s?Et:Zt)(f,{shape:d},a)}return f}};function uL(r,t){var e=r.get("realtimeSort",!0),i=t.getBaseAxis();if(e&&i.type==="category"&&t.type==="cartesian2d")return{baseAxis:i,otherAxis:t.getOtherAxis(i)}}function Cp(r,t,e,i,n,a,o,s){var l,u;a?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(o?Et:Zt)(e,{shape:l},t,n,null);var f=t?r.baseAxis.model:null;(o?Et:Zt)(e,{shape:u},f,n)}function Dp(r,t){for(var e=0;e0?1:-1,o=i.height>0?1:-1;return{x:i.x+a*n/2,y:i.y+o*n/2,width:i.width-a*n,height:i.height-o*n}},polar:function(r,t,e){var i=r.getItemLayout(t);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function vL(r){return r.startAngle!=null&&r.endAngle!=null&&r.startAngle===r.endAngle}function x_(r){return function(t){var e=t?"Arc":"Angle";return function(i){switch(i){case"start":case"insideStart":case"end":case"insideEnd":return i+e;default:return i}}}(r)}function Lp(r,t,e,i,n,a,o,s){var l=t.getItemVisual(e,"style");if(s){if(!a.get("roundCap")){var f=r.shape,h=Zn(i.getModel("itemStyle"),f,!0);O(f,h),r.setShape(f)}}else{var u=i.get(["itemStyle","borderRadius"])||0;r.setShape("r",u)}r.useStyle(l);var c=i.getShallow("cursor");c&&r.attr("cursor",c);var v=s?o?n.r>=n.r0?"endArc":"startArc":n.endAngle>=n.startAngle?"endAngle":"startAngle":o?n.height>=0?"bottom":"top":n.width>=0?"right":"left",d=Na(i);Oa(r,d,{labelFetcher:a,labelDataIndex:e,defaultText:vv(a.getData(),e),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:v});var g=r.getTextContent();if(s&&g){var p=i.get(["label","position"]);r.textConfig.inside=p==="middle"?!0:null,oL(r,p==="outside"?v:p,x_(o),i.get(["label","rotate"]))}px(g,d,a.getRawValue(e),function(m){return p_(t,m)});var y=i.getModel(["emphasis"]);ga(r,y.get("focus"),y.get("blurScope"),y.get("disabled")),fs(r,i),vL(n)&&(r.style.fill="none",r.style.stroke="none",A(r.states,function(m){m.style&&(m.style.fill=m.style.stroke="none")}))}function cL(r,t){var e=r.get(["itemStyle","borderColor"]);if(!e||e==="none")return 0;var i=r.get(["itemStyle","borderWidth"])||0,n=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(i,n,a)}var dL=function(){function r(){}return r}(),Ip=function(r){B(t,r);function t(e){var i=r.call(this,e)||this;return i.type="largeBar",i}return t.prototype.getDefaultShape=function(){return new dL},t.prototype.buildPath=function(e,i){for(var n=i.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,f=0;f=0?e:null},30,!1);function pL(r,t,e){for(var i=r.baseDimIdx,n=1-i,a=r.shape.points,o=r.largeDataIndices,s=[],l=[],u=r.barWidth,f=0,h=a.length/3;f=s[0]&&t<=s[0]+l[0]&&e>=s[1]&&e<=s[1]+l[1])return o[f]}return-1}function T_(r,t,e){if(dv(e,"cartesian2d")){var i=t,n=e.getArea();return{x:r?i.x:n.x,y:r?n.y:i.y,width:r?i.width:n.width,height:r?n.height:i.height}}else{var n=e.getArea(),a=t;return{cx:n.cx,cy:n.cy,r0:r?n.r0:a.r0,r:r?n.r:a.r,startAngle:r?a.startAngle:0,endAngle:r?a.endAngle:Math.PI*2}}}function gL(r,t,e){var i=r.type==="polar"?zr:Mt;return new i({shape:T_(t,e,r),silent:!0,z2:0})}function Z2(r){r.registerChartView(lL),r.registerSeriesModel(iL),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,Tt(iD,"bar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,nD("bar")),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,b_("bar")),r.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(t,e){var i=t.componentType||"series";e.eachComponent({mainType:i,query:t},function(n){t.sortInfo&&n.axis.setCategorySortInfo(t.sortInfo)})})}var Ep=Math.PI*2,Do=Math.PI/180;function M_(r,t){return Ti(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function C_(r,t){var e=M_(r,t),i=r.get("center"),n=r.get("radius");F(n)||(n=[0,n]);var a=pt(e.width,t.getWidth()),o=pt(e.height,t.getHeight()),s=Math.min(a,o),l=pt(n[0],s/2),u=pt(n[1],s/2),f,h,c=r.coordinateSystem;if(c){var v=c.dataToPoint(i);f=v[0]||0,h=v[1]||0}else F(i)||(i=[i,i]),f=pt(i[0],a)+e.x,h=pt(i[1],o)+e.y;return{cx:f,cy:h,r0:l,r:u}}function yL(r,t,e){t.eachSeriesByType(r,function(i){var n=i.getData(),a=n.mapDimension("value"),o=M_(i,e),s=C_(i,e),l=s.cx,u=s.cy,f=s.r,h=s.r0,c=-i.get("startAngle")*Do,v=i.get("endAngle"),d=i.get("padAngle")*Do;v=v==="auto"?c-Ep:-v*Do;var g=i.get("minAngle")*Do,p=g+d,y=0;n.each(a,function(E){!isNaN(E)&&y++});var m=n.getSum(a),_=Math.PI/(m||y)*2,S=i.get("clockwise"),b=i.get("roseType"),w=i.get("stillShowZeroSum"),x=n.getDataExtent(a);x[0]=0;var T=S?1:-1,M=[c,v],C=T*d/2;xy(M,!S),c=M[0],v=M[1];var D=Math.abs(v-c),L=D,I=0,P=c;if(n.setLayout({viewRect:o,r:f}),n.each(a,function(E,z){var k;if(isNaN(E)){n.setItemLayout(z,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:S,cx:l,cy:u,r0:h,r:b?NaN:f});return}b!=="area"?k=m===0&&w?_:E*_:k=D/y,kk?(V=P+T*k/2,U=V):(V=P+C,U=N-C),n.setItemLayout(z,{angle:k,startAngle:V,endAngle:U,clockwise:S,cx:l,cy:u,r0:h,r:b?rr(E,x,[h,f]):f}),P=N}),Le?y:p,b=Math.abs(_.label.y-e);if(b>=S.maxY){var w=_.label.x-t-_.len2*n,x=i+_.len,T=Math.abs(w)r.unconstrainedWidth?null:v:null;i.setStyle("width",d)}var g=i.getBoundingRect();a.width=g.width;var p=(i.style.margin||0)+2.1;a.height=g.height+p,a.y-=(a.height-h)/2}}}function Iu(r){return r.position==="center"}function wL(r){var t=r.getData(),e=[],i,n,a=!1,o=(r.get("minShowLabelAngle")||0)*_L,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,f=s.x,h=s.y,c=s.height;function v(w){w.ignore=!0}function d(w){if(!w.ignore)return!0;for(var x in w.states)if(w.states[x].ignore===!1)return!0;return!1}t.each(function(w){var x=t.getItemGraphicEl(w),T=x.shape,M=x.getTextContent(),C=x.getTextGuideLine(),D=t.getItemModel(w),L=D.getModel("label"),I=L.get("position")||D.get(["emphasis","label","position"]),P=L.get("distanceToLabelLine"),R=L.get("alignTo"),E=pt(L.get("edgeDistance"),u),z=L.get("bleedMargin"),k=D.getModel("labelLine"),N=k.get("length");N=pt(N,u);var V=k.get("length2");if(V=pt(V,u),Math.abs(T.endAngle-T.startAngle)0?"right":"left":X>0?"left":"right"}var xe=Math.PI,Kt=0,sr=L.get("rotate");if(dt(sr))Kt=sr*(xe/180);else if(I==="center")Kt=0;else if(sr==="radial"||sr===!0){var Di=X<0?-U+xe:-U;Kt=Di}else if(sr==="tangential"&&I!=="outside"&&I!=="outer"){var Te=Math.atan2(X,J);Te<0&&(Te=xe*2+Te);var Va=J>0;Va&&(Te=xe+Te),Kt=Te-xe}if(a=!!Kt,M.x=nt,M.y=bt,M.rotation=Kt,M.setStyle({verticalAlign:"middle"}),Rt){M.setStyle({align:Nt});var ul=M.states.select;ul&&(ul.x+=M.x,ul.y+=M.y)}else{var _r=M.getBoundingRect().clone();_r.applyTransform(M.getComputedTransform());var mv=(M.style.margin||0)+2.1;_r.y-=mv/2,_r.height+=mv,e.push({label:M,labelLine:C,position:I,len:N,len2:V,minTurnAngle:k.get("minTurnAngle"),maxSurfaceAngle:k.get("maxSurfaceAngle"),surfaceNormal:new q(X,J),linePoints:ct,textAlign:Nt,labelDistance:P,labelAlignTo:R,edgeDistance:E,bleedMargin:z,rect:_r,unconstrainedWidth:_r.width,labelStyleWidth:M.style.width})}x.setTextConfig({inside:Rt})}}),!a&&r.get("avoidLabelOverlap")&&SL(e,i,n,l,u,c,f,h);for(var g=0;g0){for(var f=o.getItemLayout(0),h=1;isNaN(f&&f.startAngle)&&h=a.r0}},t.type="pie",t}(me);function TL(r,t,e){t=F(t)&&{coordDimensions:t}||O({encodeDefine:r.getEncode()},t);var i=r.getSource(),n=jh(i,t).dimensions,a=new T0(n,r);return a.initData(i,e),a}var ML=function(){function r(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return r.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},r.prototype.containName=function(t){var e=this._getRawData();return e.indexOfName(t)>=0},r.prototype.indexOfName=function(t){var e=this._getDataWithEncodedVisual();return e.indexOfName(t)},r.prototype.getItemVisual=function(t,e){var i=this._getDataWithEncodedVisual();return i.getItemVisual(t,e)},r}(),CL=mt(),DL=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.init=function(e){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new ML(et(this.getData,this),et(this.getRawData,this)),this._defaultLabelLine(e)},t.prototype.mergeOption=function(){r.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return TL(this,{coordDimensions:["value"],encodeDefaulter:Tt(Yx,this)})},t.prototype.getDataParams=function(e){var i=this.getData(),n=CL(i),a=n.seats;if(!a){var o=[];i.each(i.mapDimension("value"),function(l){o.push(l)}),a=n.seats=GS(o,i.hostModel.get("percentPrecision"))}var s=r.prototype.getDataParams.call(this,e);return s.percent=a[e]||0,s.$vars.push("percent"),s},t.prototype._defaultLabelLine=function(e){uf(e,"labelLine",["show"]);var i=e.labelLine,n=e.emphasis.labelLine;i.show=i.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(Oe);function AL(r){return{seriesType:r,reset:function(t,e){var i=t.getData();i.filterSelf(function(n){var a=i.mapDimension("value"),o=i.get(a,n);return!(dt(o)&&!isNaN(o)&&o<0)})}}}function q2(r){r.registerChartView(xL),r.registerSeriesModel(DL),MM("pie",r.registerAction),r.registerLayout(Tt(yL,"pie")),r.registerProcessor(mL("pie")),r.registerProcessor(AL("pie"))}var LL=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}(ft),Uf=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Pe).models[0]},t.type="cartesian2dAxis",t}(ft);Be(Uf,V0);var A_={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},IL=at({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},A_),pv=at({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},A_),PL=at({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},pv),RL=st({logBase:10},pv);const EL={category:IL,value:pv,time:PL,log:RL};var kL={value:1,category:1,time:1,log:1};function Op(r,t,e,i){A(kL,function(n,a){var o=at(at({},EL[a],!0),i,!0),s=function(l){B(u,l);function u(){var f=l!==null&&l.apply(this,arguments)||this;return f.type=t+"Axis."+a,f}return u.prototype.mergeDefaultAndTheme=function(f,h){var c=_a(this),v=c?tl(f):{},d=h.getTheme();at(f,d.get(a+"Axis")),at(f,this.getDefaultOption()),f.type=Np(f),c&&hn(f,v,c)},u.prototype.optionUpdated=function(){var f=this.option;f.type==="category"&&(this.__ordinalMeta=Nf.createByAxisModel(this))},u.prototype.getCategories=function(f){var h=this.option;if(h.type==="category")return f?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=t+"Axis."+a,u.defaultOption=o,u}(e);r.registerComponentModel(s)}),r.registerSubTypeDefaulter(t+"Axis",Np)}function Np(r){return r.type||(r.data?"category":"value")}var OL=function(){function r(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return r.prototype.getAxis=function(t){return this._axes[t]},r.prototype.getAxes=function(){return G(this._dimList,function(t){return this._axes[t]},this)},r.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),It(this.getAxes(),function(e){return e.scale.type===t})},r.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},r}(),Yf=["x","y"];function Bp(r){return r.type==="interval"||r.type==="time"}var NL=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=Yf,e}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!Bp(e)||!Bp(i))){var n=e.getExtent(),a=i.getExtent(),o=this.dataToPoint([n[0],a[0]]),s=this.dataToPoint([n[1],a[1]]),l=n[1]-n[0],u=a[1]-a[0];if(!(!l||!u)){var f=(s[0]-o[0])/l,h=(s[1]-o[1])/u,c=o[0]-n[0]*f,v=o[1]-a[0]*h,d=this._transform=[f,0,0,h,c,v];this._invTransform=Ps([],d)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var i=this.getAxis("x"),n=this.getAxis("y");return i.contain(i.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.containZone=function(e,i){var n=this.dataToPoint(e),a=this.dataToPoint(i),o=this.getArea(),s=new ot(n[0],n[1],a[0]-n[0],a[1]-n[1]);return o.intersect(s)},t.prototype.dataToPoint=function(e,i,n){n=n||[];var a=e[0],o=e[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return ye(n,e,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return n[0]=s.toGlobalCoord(s.dataToCoord(a,i)),n[1]=l.toGlobalCoord(l.dataToCoord(o,i)),n},t.prototype.clampData=function(e,i){var n=this.getAxis("x").scale,a=this.getAxis("y").scale,o=n.getExtent(),s=a.getExtent(),l=n.parse(e[0]),u=a.parse(e[1]);return i=i||[],i[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),i[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),i},t.prototype.pointToData=function(e,i){var n=[];if(this._invTransform)return ye(n,e,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.coordToData(a.toLocalCoord(e[0]),i),n[1]=o.coordToData(o.toLocalCoord(e[1]),i),n},t.prototype.getOtherAxis=function(e){return this.getAxis(e.dim==="x"?"y":"x")},t.prototype.getArea=function(e){e=e||0;var i=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),a=Math.min(i[0],i[1])-e,o=Math.min(n[0],n[1])-e,s=Math.max(i[0],i[1])-a+e,l=Math.max(n[0],n[1])-o+e;return new ot(a,o,s,l)},t}(OL),BL=function(r){B(t,r);function t(e,i,n,a,o){var s=r.call(this,e,i,n)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return t.prototype.isHorizontal=function(){var e=this.position;return e==="top"||e==="bottom"},t.prototype.getGlobalExtent=function(e){var i=this.getExtent();return i[0]=this.toGlobalCoord(i[0]),i[1]=this.toGlobalCoord(i[1]),e&&i[0]>i[1]&&i.reverse(),i},t.prototype.pointToData=function(e,i){return this.coordToData(this.toLocalCoord(e[this.dim==="x"?0:1]),i)},t.prototype.setCategorySortInfo=function(e){if(this.type!=="category")return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(OD);function Xf(r,t,e){e=e||{};var i=r.coordinateSystem,n=t.axis,a={},o=n.getAxesOnZeroOf()[0],s=n.position,l=o?"onZero":s,u=n.dim,f=i.getRect(),h=[f.x,f.x+f.width,f.y,f.y+f.height],c={left:0,right:1,top:0,bottom:1,onZero:2},v=t.get("offset")||0,d=u==="x"?[h[2]-v,h[3]+v]:[h[0]-v,h[1]+v];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));d[c.onZero]=Math.max(Math.min(g,d[1]),d[0])}a.position=[u==="y"?d[c[l]]:h[0],u==="x"?d[c[l]]:h[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var p={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=p[s],a.labelOffset=o?d[c[s]]-d[c.onZero]:0,t.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),un(e.labelInside,t.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var y=t.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-y:y,a.z2=1,a}function Fp(r){return r.get("coordinateSystem")==="cartesian2d"}function Vp(r){var t={xAxisModel:null,yAxisModel:null};return A(t,function(e,i){var n=i.replace(/Model$/,""),a=r.getReferringComponents(n,Pe).models[0];t[i]=a}),t}var Pu=Math.log;function FL(r,t,e){var i=mn.prototype,n=i.getTicks.call(e),a=i.getTicks.call(e,!0),o=n.length-1,s=i.getInterval.call(e),l=N0(r,t),u=l.extent,f=l.fixMin,h=l.fixMax;if(r.type==="log"){var c=Pu(r.base);u=[Pu(u[0])/c,Pu(u[1])/c]}r.setExtent(u[0],u[1]),r.calcNiceExtent({splitNumber:o,fixMin:f,fixMax:h});var v=i.getExtent.call(r);f&&(u[0]=v[0]),h&&(u[1]=v[1]);var d=i.getInterval.call(r),g=u[0],p=u[1];if(f&&h)d=(p-g)/o;else if(f)for(p=u[0]+d*o;pu[0]&&isFinite(g)&&isFinite(u[0]);)d=mu(d),g=u[1]-d*o;else{var y=r.getTicks().length-1;y>o&&(d=mu(d));var m=d*o;p=Math.ceil(u[1]/d)*d,g=Dt(p-m),g<0&&u[0]>=0?(g=0,p=Dt(m)):p>0&&u[1]<=0&&(p=0,g=-Dt(m))}var _=(n[0].value-a[0].value)/s,S=(n[o].value-a[o].value)/s;i.setExtent.call(r,g+d*_,p+d*S),i.setInterval.call(r,d),(_||S)&&i.setNiceExtent.call(r,g+d,p-d)}var VL=function(){function r(t,e,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Yf,this._initCartesian(t,e,i),this.model=t}return r.prototype.getRect=function(){return this._rect},r.prototype.update=function(t,e){var i=this._axesMap;this._updateScale(t,this.model);function n(o){var s,l=it(o),u=l.length;if(u){for(var f=[],h=u-1;h>=0;h--){var c=+l[h],v=o[c],d=v.model,g=v.scale;Bf(g)&&d.get("alignTicks")&&d.get("interval")==null?f.push(v):(Ff(g,d),Bf(g)&&(s=v))}f.length&&(s||(s=f.pop(),Ff(s.scale,s.model)),A(f,function(p){FL(p.scale,p.model,s.scale)}))}}n(i.x),n(i.y);var a={};A(i.x,function(o){zp(i,"y",o,a)}),A(i.y,function(o){zp(i,"x",o,a)}),this.resize(this.model,e)},r.prototype.resize=function(t,e,i){var n=t.getBoxLayoutParams(),a=!i&&t.get("containLabel"),o=Ti(n,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(A(s,function(u){if(!u.model.get(["axisLabel","inside"])){var f=xD(u);if(f){var h=u.isHorizontal()?"height":"width",c=u.model.get(["axisLabel","margin"]);o[h]-=f[h]+c,u.position==="top"?o.y+=f.height+c:u.position==="left"&&(o.x+=f.width+c)}}}),l()),A(this._coordsList,function(u){u.calcAffineTransform()});function l(){A(s,function(u){var f=u.isHorizontal(),h=f?[0,o.width]:[0,o.height],c=u.inverse?1:0;u.setExtent(h[c],h[1-c]),zL(u,f?o.x:o.y)})}},r.prototype.getAxis=function(t,e){var i=this._axesMap[t];if(i!=null)return i[e||0]},r.prototype.getAxes=function(){return this._axesList.slice()},r.prototype.getCartesian=function(t,e){if(t!=null&&e!=null){var i="x"+t+"y"+e;return this._coordsMap[i]}W(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var n=0,a=this._coordsList;n0?"top":"bottom",a="center"):ns(n-Er)?(o=i>0?"bottom":"top",a="center"):(o="middle",n>0&&n0?"right":"left":a=i>0?"left":"right"),{rotation:n,textAlign:a,textVerticalAlign:o}},r.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},r.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},r}(),Gp={axisLine:function(r,t,e,i){var n=t.get(["axisLine","show"]);if(n==="auto"&&r.handleAutoShown&&(n=r.handleAutoShown("axisLine")),!!n){var a=t.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(ye(s,s,o),ye(l,l,o));var f=O({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new Vr({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:f,strokeContainThreshold:r.strokeContainThreshold||5,silent:!0,z2:1});ya(h.shape,h.style.lineWidth),h.anid="line",e.add(h);var c=t.get(["axisLine","symbol"]);if(c!=null){var v=t.get(["axisLine","symbolSize"]);H(c)&&(c=[c,c]),(H(v)||dt(v))&&(v=[v,v]);var d=Km(t.get(["axisLine","symbolOffset"])||0,v),g=v[0],p=v[1];A([{rotate:r.rotation+Math.PI/2,offset:d[0],r:0},{rotate:r.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(y,m){if(c[m]!=="none"&&c[m]!=null){var _=yr(c[m],-g/2,-p/2,g,p,f.stroke,!0),S=y.r+y.offset,b=u?l:s;_.attr({rotation:y.rotate,x:b[0]+S*Math.cos(r.rotation),y:b[1]-S*Math.sin(r.rotation),silent:!0,z2:11}),e.add(_)}})}}},axisTickLabel:function(r,t,e,i){var n=WL(e,i,t,r),a=YL(e,i,t,r);if(GL(t,a,n),UL(e,i,t,r.tickDirection),t.get(["axisLabel","hideOverlap"])){var o=K0(G(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));j0(o)}},axisName:function(r,t,e,i){var n=un(r.axisName,t.get("name"));if(n){var a=t.get("nameLocation"),o=r.nameDirection,s=t.getModel("nameTextStyle"),l=t.get("nameGap")||0,u=t.axis.getExtent(),f=u[0]>u[1]?-1:1,h=[a==="start"?u[0]-f*l:a==="end"?u[1]+f*l:(u[0]+u[1])/2,Up(a)?r.labelOffset+o*l:0],c,v=t.get("nameRotate");v!=null&&(v=v*Er/180);var d;Up(a)?c=Nr.innerTextLayout(r.rotation,v!=null?v:r.rotation,o):(c=HL(r.rotation,a,v||0,u),d=r.axisNameAvailableWidth,d!=null&&(d=Math.abs(d/Math.sin(c.rotation)),!isFinite(d)&&(d=null)));var g=s.getFont(),p=t.get("nameTruncate",!0)||{},y=p.ellipsis,m=un(r.nameTruncateMaxWidth,p.maxWidth,d),_=new At({x:h[0],y:h[1],rotation:c.rotation,silent:Nr.isLabelSilent(t),style:je(s,{text:n,font:g,overflow:"truncate",width:m,ellipsis:y,fill:s.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:s.get("align")||c.textAlign,verticalAlign:s.get("verticalAlign")||c.textVerticalAlign}),z2:1});if(Rh({el:_,componentModel:t,itemName:n}),_.__fullText=n,_.anid="name",t.get("triggerEvent")){var S=Nr.makeAxisEventDataBase(t);S.targetType="axisName",S.name=n,rt(_).eventData=S}i.add(_),_.updateTransform(),e.add(_),_.decomposeTransform()}}};function HL(r,t,e,i){var n=fy(e-r),a,o,s=i[0]>i[1],l=t==="start"&&!s||t!=="start"&&s;return ns(n-Er/2)?(o=l?"bottom":"top",a="center"):ns(n-Er*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",nEr/2?a=l?"left":"right":a=l?"right":"left"),{rotation:n,textAlign:a,textVerticalAlign:o}}function GL(r,t,e){if(!F0(r.axis)){var i=r.get(["axisLabel","showMinLabel"]),n=r.get(["axisLabel","showMaxLabel"]);t=t||[],e=e||[];var a=t[0],o=t[1],s=t[t.length-1],l=t[t.length-2],u=e[0],f=e[1],h=e[e.length-1],c=e[e.length-2];i===!1?(le(a),le(u)):Wp(a,o)&&(i?(le(o),le(f)):(le(a),le(u))),n===!1?(le(s),le(h)):Wp(l,s)&&(n?(le(l),le(c)):(le(s),le(h)))}}function le(r){r&&(r.ignore=!0)}function Wp(r,t){var e=r&&r.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(!(!e||!i)){var n=lh([]);return uh(n,n,-r.rotation),e.applyTransform(tn([],n,r.getLocalTransform())),i.applyTransform(tn([],n,t.getLocalTransform())),e.intersect(i)}}function Up(r){return r==="middle"||r==="center"}function L_(r,t,e,i,n){for(var a=[],o=[],s=[],l=0;l=0||r===t}function QL(r){var t=gv(r);if(t){var e=t.axisPointerModel,i=t.axis.scale,n=e.option,a=e.get("status"),o=e.get("value");o!=null&&(o=i.parse(o));var s=$f(e);a==null&&(n.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o=0;a--)i[a]==null&&(delete e[t[a]],t.pop())}function ku(r,t){var e=r.visual,i=[];W(e)?Aa(e,function(a){i.push(a)}):e!=null&&i.push(e);var n={color:1,symbol:1};!t&&i.length===1&&!n.hasOwnProperty(r.type)&&(i[1]=i[0]),E_(r,i)}function Ao(r){return{applyVisual:function(t,e,i){var n=this.mapValueToVisual(t);i("color",r(e("color"),n))},_normalizedToVisual:qf([0,1])}}function $p(r){var t=this.option.visual;return t[Math.round(rr(r,[0,1],[0,t.length-1],!0))]||{}}function Fn(r){return function(t,e,i){i(r,this.mapValueToVisual(t))}}function qn(r){var t=this.option.visual;return t[this.option.loop&&r!==Cs?r%t.length:r]}function vi(){return this.option.visual[0]}function qf(r){return{linear:function(t){return rr(t,r,this.option.visual,!0)},category:qn,piecewise:function(t,e){var i=Kf.call(this,e);return i==null&&(i=rr(t,r,this.option.visual,!0)),i},fixed:vi}}function Kf(r){var t=this.option,e=t.pieceList;if(t.hasSpecialVisual){var i=Gt.findPieceIndex(r,e),n=e[i];if(n&&n.visual)return n.visual[this.type]}}function E_(r,t){return r.visual=t,r.type==="color"&&(r.parsedVisual=G(t,function(e){var i=ae(e);return i||[0,0,0,1]})),t}var fI={linear:function(r){return rr(r,this.option.dataExtent,[0,1],!0)},piecewise:function(r){var t=this.option.pieceList,e=Gt.findPieceIndex(r,t,!0);if(e!=null)return rr(e,[0,t.length-1],[0,1],!0)},category:function(r){var t=this.option.categories?this.option.categoryMap[r]:r;return t==null?Cs:t},fixed:Ht};function Lo(r,t,e){return r?t<=e:ta&&(t[1-i]=t[i]+h.sign*a),t}function Ou(r,t){var e=r[t]-r[1-t];return{span:Math.abs(e),sign:e>0?-1:e<0?1:t?-1:1}}function Hi(r,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,r))}var di=mt(),Zp=Q,Nu=et,vI=function(){function r(){this._dragging=!1,this.animationThreshold=15}return r.prototype.render=function(t,e,i,n){var a=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=i,!(!n&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,t,e,i);var f=u.graphicKey;f!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=f;var h=this._moveAnimation=this.determineAnimation(t,e);if(!s)s=this._group=new Ct,this.createPointerEl(s,u,t,e),this.createLabelEl(s,u,t,e),i.getZr().add(s);else{var c=Tt(qp,e,h);this.updatePointerEl(s,u,c),this.updateLabelEl(s,u,c,e)}Qp(s,e,!0),this._renderHandle(a)}},r.prototype.remove=function(t){this.clear(t)},r.prototype.dispose=function(t){this.clear(t)},r.prototype.determineAnimation=function(t,e){var i=e.get("animation"),n=t.axis,a=n.type==="category",o=e.get("snap");if(!o&&!a)return!1;if(i==="auto"||i==null){var s=this.animationThreshold;if(a&&n.getBandWidth()>s)return!0;if(o){var l=gv(t).seriesDataCount,u=n.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return i===!0},r.prototype.makeElOption=function(t,e,i,n,a){},r.prototype.createPointerEl=function(t,e,i,n){var a=e.pointer;if(a){var o=di(t).pointerEl=new hx[a.type](Zp(e.pointer));t.add(o)}},r.prototype.createLabelEl=function(t,e,i,n){if(e.label){var a=di(t).labelEl=new At(Zp(e.label));t.add(a),Kp(a,n)}},r.prototype.updatePointerEl=function(t,e,i){var n=di(t).pointerEl;n&&e.pointer&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},r.prototype.updateLabelEl=function(t,e,i,n){var a=di(t).labelEl;a&&(a.setStyle(e.label.style),i(a,{x:e.label.x,y:e.label.y}),Kp(a,n))},r.prototype._renderHandle=function(t){if(!(this._dragging||!this.updateHandleTransform)){var e=this._axisPointerModel,i=this._api.getZr(),n=this._handle,a=e.getModel("handle"),o=e.get("status");if(!a.get("show")||!o||o==="hide"){n&&i.remove(n),this._handle=null;return}var s;this._handle||(s=!0,n=this._handle=Ph(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){ua(u.event)},onmousedown:Nu(this._onHandleDragMove,this,0,0),drift:Nu(this._onHandleDragMove,this),ondragend:Nu(this._onHandleDragEnd,this)}),i.add(n)),Qp(n,e,!1),n.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");F(l)||(l=[l,l]),n.scaleX=l[0]/2,n.scaleY=l[1]/2,zm(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},r.prototype._moveHandleToValue=function(t,e){qp(this._axisPointerModel,!e&&this._moveAnimation,this._handle,Bu(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},r.prototype._onHandleDragMove=function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(Bu(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(Bu(n)),di(i).lastProp=null,this._doDispatchAxisPointer()}},r.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var e=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},r.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},r.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),Df(this,"_doDispatchAxisPointer")},r.prototype.doClear=function(){},r.prototype.buildLabel=function(t,e,i){return i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}},r}();function qp(r,t,e,i){k_(di(e).lastProp,i)||(di(e).lastProp=i,t?Et(e,i,r):(e.stopAnimation(),e.attr(i)))}function k_(r,t){if(W(r)&&W(t)){var e=!0;return A(t,function(i,n){e=e&&k_(r[n],i)}),!!e}else return r===t}function Kp(r,t){r[t.get(["label","show"])?"show":"hide"]()}function Bu(r){return{x:r.x||0,y:r.y||0,rotation:r.rotation||0}}function Qp(r,t,e){var i=t.get("z"),n=t.get("zlevel");r&&r.traverse(function(a){a.type!=="group"&&(i!=null&&(a.z=i),n!=null&&(a.zlevel=n),a.silent=e)})}function cI(r){var t=r.get("type"),e=r.getModel(t+"Style"),i;return t==="line"?(i=e.getLineStyle(),i.fill=null):t==="shadow"&&(i=e.getAreaStyle(),i.stroke=null),i}function dI(r,t,e,i,n){var a=e.get("value"),o=O_(a,t.axis,t.ecModel,e.get("seriesDataIndices"),{precision:e.get(["label","precision"]),formatter:e.get(["label","formatter"])}),s=e.getModel("label"),l=Ba(s.get("padding")||0),u=s.getFont(),f=ch(o,u),h=n.position,c=f.width+l[1]+l[3],v=f.height+l[0]+l[2],d=n.align;d==="right"&&(h[0]-=c),d==="center"&&(h[0]-=c/2);var g=n.verticalAlign;g==="bottom"&&(h[1]-=v),g==="middle"&&(h[1]-=v/2),pI(h,c,v,i);var p=s.get("backgroundColor");(!p||p==="auto")&&(p=t.get(["axisLine","lineStyle","color"])),r.label={x:h[0],y:h[1],style:je(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:p}),z2:10}}function pI(r,t,e,i){var n=i.getWidth(),a=i.getHeight();r[0]=Math.min(r[0]+t,n)-t,r[1]=Math.min(r[1]+e,a)-e,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0)}function O_(r,t,e,i,n){r=t.scale.parse(r);var a=t.scale.getLabel({value:r},{precision:n.precision}),o=n.formatter;if(o){var s={value:nv(t,{value:r}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};A(i,function(l){var u=e.getSeriesByIndex(l.seriesIndex),f=l.dataIndexInside,h=u&&u.getDataParams(f);h&&s.seriesData.push(h)}),H(o)?a=o.replace("{value}",a):Z(o)&&(a=o(s))}return a}function N_(r,t,e){var i=ji();return uh(i,i,e.rotation),Zu(i,i,e.position),nn([r.dataToCoord(t),(e.labelOffset||0)+(e.labelDirection||1)*(e.labelMargin||0)],i)}function gI(r,t,e,i,n,a){var o=Nr.innerTextLayout(e.rotation,0,e.labelDirection);e.labelMargin=n.get(["label","margin"]),dI(t,i,n,a,{position:N_(i.axis,r,e),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function yI(r,t,e){return e=e||0,{x1:r[e],y1:r[1-e],x2:t[e],y2:t[1-e]}}function mI(r,t,e){return e=e||0,{x:r[e],y:r[1-e],width:t[e],height:t[1-e]}}var _I=function(r){B(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,i,n,a,o){var s=n.axis,l=s.grid,u=a.get("type"),f=Jp(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var c=cI(a),v=SI[u](s,h,f);v.style=c,e.graphicKey=v.type,e.pointer=v}var d=Xf(l.model,n);gI(i,e,d,n,a,o)},t.prototype.getHandleTransform=function(e,i,n){var a=Xf(i.axis.grid.model,i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=N_(i.axis,e,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,i,n,a){var o=n.axis,s=o.grid,l=o.getGlobalExtent(!0),u=Jp(s,o).getOtherAxis(o).getGlobalExtent(),f=o.dim==="x"?0:1,h=[e.x,e.y];h[f]+=i[f],h[f]=Math.min(l[1],h[f]),h[f]=Math.max(l[0],h[f]);var c=(u[1]+u[0])/2,v=[c,c];v[f]=h[f];var d=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:e.rotation,cursorPoint:v,tooltipOption:d[f]}},t}(vI);function Jp(r,t){var e={};return e[t.dim+"AxisIndex"]=t.index,r.getCartesian(e)}var SI={line:function(r,t,e){var i=yI([t,e[0]],[t,e[1]],jp(r));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(r,t,e){var i=Math.max(1,r.getBandWidth()),n=e[1]-e[0];return{type:"Rect",shape:mI([t-i/2,e[0]],[i,n],jp(r))}}};function jp(r){return r.dim==="x"?0:1}var wI=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}(ft),dr=mt(),bI=A;function B_(r,t,e){if(!K.node){var i=t.getZr();dr(i).records||(dr(i).records={}),xI(i,t);var n=dr(i).records[r]||(dr(i).records[r]={});n.handler=e}}function xI(r,t){if(dr(r).initialized)return;dr(r).initialized=!0,e("click",Tt(tg,"click")),e("mousemove",Tt(tg,"mousemove")),e("globalout",MI);function e(i,n){r.on(i,function(a){var o=CI(t);bI(dr(r).records,function(s){s&&n(s,a,o.dispatchAction)}),TI(o.pendings,t)})}}function TI(r,t){var e=r.showTip.length,i=r.hideTip.length,n;e?n=r.showTip[e-1]:i&&(n=r.hideTip[i-1]),n&&(n.dispatchAction=null,t.dispatchAction(n))}function MI(r,t,e){r.handler("leave",null,e)}function tg(r,t,e,i){t.handler(r,e,i)}function CI(r){var t={showTip:[],hideTip:[]},e=function(i){var n=t[i.type];n?n.push(i):(i.dispatchAction=e,r.dispatchAction(i))};return{dispatchAction:e,pendings:t}}function Qf(r,t){if(!K.node){var e=t.getZr(),i=(dr(e).records||{})[r];i&&(dr(e).records[r]=null)}}var DI=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.render=function(e,i,n){var a=i.getComponent("tooltip"),o=e.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";B_("axisPointer",n,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},t.prototype.remove=function(e,i){Qf("axisPointer",i)},t.prototype.dispose=function(e,i){Qf("axisPointer",i)},t.type="axisPointer",t}(we);function F_(r,t){var e=[],i=r.seriesIndex,n;if(i==null||!(n=t.getSeriesByIndex(i)))return{point:[]};var a=n.getData(),o=bi(a,r);if(o==null||o<0||F(o))return{point:[]};var s=a.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)e=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(r.isStacked){var u=l.getBaseAxis(),f=l.getOtherAxis(u),h=f.dim,c=u.dim,v=h==="x"||h==="radius"?1:0,d=a.mapDimension(c),g=[];g[v]=a.get(d,o),g[1-v]=a.get(a.getCalculationInfo("stackResultDimension"),o),e=l.dataToPoint(g)||[]}else e=l.dataToPoint(a.getValues(G(l.dimensions,function(y){return a.mapDimension(y)}),o))||[];else if(s){var p=s.getBoundingRect().clone();p.applyTransform(s.transform),e=[p.x+p.width/2,p.y+p.height/2]}return{point:e,el:s}}var eg=mt();function AI(r,t,e){var i=r.currTrigger,n=[r.x,r.y],a=r,o=r.dispatchAction||et(e.dispatchAction,e),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){Xo(n)&&(n=F_({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=Xo(n),u=a.axesInfo,f=s.axesInfo,h=i==="leave"||Xo(n),c={},v={},d={list:[],map:{}},g={showPointer:Tt(II,v),showTooltip:Tt(PI,d)};A(s.coordSysMap,function(y,m){var _=l||y.containPoint(n);A(s.coordSysAxesInfo[m],function(S,b){var w=S.axis,x=OI(u,S);if(!h&&_&&(!u||x)){var T=x&&x.value;T==null&&!l&&(T=w.pointToData(n)),T!=null&&rg(S,T,g,!1,c)}})});var p={};return A(f,function(y,m){var _=y.linkGroup;_&&!v[m]&&A(_.axesInfo,function(S,b){var w=v[b];if(S!==y&&w){var x=w.value;_.mapper&&(x=y.axis.scale.parse(_.mapper(x,ig(S),ig(y)))),p[y.key]=x}})}),A(p,function(y,m){rg(f[m],y,g,!0,c)}),RI(v,f,c),EI(d,n,r,o),kI(f,o,e),c}}function rg(r,t,e,i,n){var a=r.axis;if(!(a.scale.isBlank()||!a.containData(t))){if(!r.involveSeries){e.showPointer(r,t);return}var o=LI(t,r),s=o.payloadBatch,l=o.snapToValue;s[0]&&n.seriesIndex==null&&O(n,s[0]),!i&&r.snap&&a.containData(l)&&l!=null&&(t=l),e.showPointer(r,t,s),e.showTooltip(r,o,l)}}function LI(r,t){var e=t.axis,i=e.dim,n=r,a=[],o=Number.MAX_VALUE,s=-1;return A(t.seriesModels,function(l,u){var f=l.getData().mapDimensionsAll(i),h,c;if(l.getAxisTooltipData){var v=l.getAxisTooltipData(f,r,e);c=v.dataIndices,h=v.nestestValue}else{if(c=l.getData().indicesOfNearest(f[0],r,e.type==="category"?.5:null),!c.length)return;h=l.getData().get(f[0],c[0])}if(!(h==null||!isFinite(h))){var d=r-h,g=Math.abs(d);g<=o&&((g=0&&s<0)&&(o=g,s=d,n=h,a.length=0),A(c,function(p){a.push({seriesIndex:l.seriesIndex,dataIndexInside:p,dataIndex:l.getData().getRawIndex(p)})}))}}),{payloadBatch:a,snapToValue:n}}function II(r,t,e,i){r[t.key]={value:e,payloadBatch:i}}function PI(r,t,e,i){var n=e.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(!(!t.triggerTooltip||!n.length)){var l=t.coordSys.model,u=Da(l),f=r.map[u];f||(f=r.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},r.list.push(f)),f.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:n.slice()})}}function RI(r,t,e){var i=e.axesInfo=[];A(t,function(n,a){var o=n.axisPointerModel.option,s=r[a];s?(!n.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!n.useHandle&&(o.status="hide"),o.status==="show"&&i.push({axisDim:n.axis.dim,axisIndex:n.axis.model.componentIndex,value:o.value})})}function EI(r,t,e,i){if(Xo(t)||!r.list.length){i({type:"hideTip"});return}var n=((r.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:e.tooltipOption,position:e.position,dataIndexInside:n.dataIndexInside,dataIndex:n.dataIndex,seriesIndex:n.seriesIndex,dataByCoordSys:r.list})}function kI(r,t,e){var i=e.getZr(),n="axisPointerLastHighlights",a=eg(i)[n]||{},o=eg(i)[n]={};A(r,function(u,f){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&A(h.seriesDataIndices,function(c){var v=c.seriesIndex+" | "+c.dataIndex;o[v]=c})});var s=[],l=[];A(a,function(u,f){!o[f]&&l.push(u)}),A(o,function(u,f){!a[f]&&s.push(u)}),l.length&&e.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&e.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function OI(r,t){for(var e=0;e<(r||[]).length;e++){var i=r[e];if(t.axis.dim===i.axisDim&&t.axis.model.componentIndex===i.axisIndex)return i}}function ig(r){var t=r.axis.model,e={},i=e.axisDim=r.axis.dim;return e.axisIndex=e[i+"AxisIndex"]=t.componentIndex,e.axisName=e[i+"AxisName"]=t.name,e.axisId=e[i+"AxisId"]=t.id,e}function Xo(r){return!r||r[0]==null||isNaN(r[0])||r[1]==null||isNaN(r[1])}function V_(r){I_.registerAxisPointerClass("CartesianAxisPointer",_I),r.registerComponentModel(wI),r.registerComponentView(DI),r.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!F(e)&&(t.axisPointer.link=[e])}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=XL(t,e)}),r.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},AI)}function K2(r){Ne(oI),Ne(V_)}function NI(r,t){var e=Ba(t.get("padding")),i=t.getItemStyle(["color","opacity"]);return i.fill=t.get("backgroundColor"),r=new Mt({shape:{x:r.x-e[3],y:r.y-e[0],width:r.width+e[1]+e[3],height:r.height+e[0]+e[2],r:t.get("borderRadius")},style:i,silent:!0,z2:-1}),r}var BI=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t}(ft);function z_(r){var t=r.get("confine");return t!=null?!!t:r.get("renderMode")==="richText"}function H_(r){if(K.domSupported){for(var t=document.documentElement.style,e=0,i=r.length;e-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var f=u*Math.PI/180,h=o+n,c=h*Math.abs(Math.cos(f))+h*Math.abs(Math.sin(f)),v=Math.round(((c-Math.SQRT2*n)/2+Math.SQRT2*n-(c-h)/2)*100)/100;s+=";"+a+":-"+v+"px";var d=t+" solid "+n+"px;",g=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+d,"border-right:"+d,"background-color:"+i+";"];return'
'}function UI(r,t){var e="cubic-bezier(0.23,1,0.32,1)",i=" "+r/2+"s "+e,n="opacity"+i+",visibility"+i;return t||(i=" "+r+"s "+e,n+=K.transformSupported?","+yv+i:",left"+i+",top"+i),zI+":"+n}function ng(r,t,e){var i=r.toFixed(0)+"px",n=t.toFixed(0)+"px";if(!K.transformSupported)return e?"top:"+n+";left:"+i+";":[["top",n],["left",i]];var a=K.transform3dSupported,o="translate"+(a?"3d":"")+"("+i+","+n+(a?",0":"")+")";return e?"top:0;left:0;"+yv+":"+o+";":[["top",0],["left",0],[G_,o]]}function YI(r){var t=[],e=r.get("fontSize"),i=r.getTextColor();i&&t.push("color:"+i),t.push("font:"+r.getFont()),e&&t.push("line-height:"+Math.round(e*3/2)+"px");var n=r.get("textShadowColor"),a=r.get("textShadowBlur")||0,o=r.get("textShadowOffsetX")||0,s=r.get("textShadowOffsetY")||0;return n&&a&&t.push("text-shadow:"+o+"px "+s+"px "+a+"px "+n),A(["decoration","align"],function(l){var u=r.get(l);u&&t.push("text-"+l+":"+u)}),t.join(";")}function XI(r,t,e){var i=[],n=r.get("transitionDuration"),a=r.get("backgroundColor"),o=r.get("shadowBlur"),s=r.get("shadowColor"),l=r.get("shadowOffsetX"),u=r.get("shadowOffsetY"),f=r.getModel("textStyle"),h=Fm(r,"html"),c=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+c),t&&n&&i.push(UI(n,e)),a&&i.push("background-color:"+a),A(["width","color","radius"],function(v){var d="border-"+v,g=hm(d),p=r.get(g);p!=null&&i.push(d+":"+p+(v==="color"?"":"px"))}),i.push(YI(f)),h!=null&&i.push("padding:"+Ba(h).join("px ")+"px"),i.join(";")+";"}function ag(r,t,e,i,n){var a=t&&t.painter;if(e){var o=a&&a.getViewportRoot();o&&T1(r,o,e,i,n)}else{r[0]=i,r[1]=n;var s=a&&a.getViewportRootOffset();s&&(r[0]+=s.offsetLeft,r[1]+=s.offsetTop)}r[2]=r[0]/t.getWidth(),r[3]=r[1]/t.getHeight()}var $I=function(){function r(t,e){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,K.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var n=this._zr=t.getZr(),a=e.appendTo,o=a&&(H(a)?document.querySelector(a):la(a)?a:Z(a)&&a(t.getDom()));ag(this._styleCoord,n,o,t.getWidth()/2,t.getHeight()/2),(o||t.getDom()).appendChild(i),this._api=t,this._container=o;var s=this;i.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},i.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=n.handler,f=n.painter.getViewportRoot();fe(f,l,!0),u.dispatch("mousemove",l)}},i.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return r.prototype.update=function(t){if(!this._container){var e=this._api.getDom(),i=VI(e,"position"),n=e.style;n.position!=="absolute"&&i!=="absolute"&&(n.position="relative")}var a=t.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=t.get("className")||""},r.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,a=this._styleCoord;i.innerHTML?n.cssText=HI+XI(t,!this._firstShow,this._longHide)+ng(a[0],a[1],!0)+("border-color:"+xi(e)+";")+(t.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},r.prototype.setContent=function(t,e,i,n,a){var o=this.el;if(t==null){o.innerHTML="";return}var s="";if(H(a)&&i.get("trigger")==="item"&&!z_(i)&&(s=WI(i,n,a)),H(t))o.innerHTML=t+s;else if(t){o.innerHTML="",F(t)||(t=[t]);for(var l=0;l=0?this._tryShow(a,o):n==="leave"&&this._hide(o))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,i=this._ecModel,n=this._api,a=e.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(e,i,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,i,n,a){if(!(a.from===this.uid||K.node||!n.getDom())){var o=lg(a,n);this._ticket="";var s=a.dataByCoordSys,l=t2(a,i,n);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var f=qI;f.x=a.x,f.y=a.y,f.update(),rt(f).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:f},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(e,i,n,a))return;var h=F_(a,i),c=h.point[0],v=h.point[1];c!=null&&v!=null&&this._tryShow({offsetX:c,offsetY:v,target:h.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(n.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:n.getZr().findHover(a.x,a.y).target},o))}},t.prototype.manuallyHideTip=function(e,i,n,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(lg(a,n))},t.prototype._manuallyAxisShowTip=function(e,i,n,a){var o=a.seriesIndex,s=a.dataIndex,l=i.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=i.getSeriesByIndex(o);if(u){var f=u.getData(),h=Vn([f.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},t.prototype._tryShow=function(e,i){var n=e.target,a=this._tooltipModel;if(a){this._lastX=e.offsetX,this._lastY=e.offsetY;var o=e.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,e);else if(n){var s=rt(n);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;Ki(n,function(f){if(rt(f).dataIndex!=null)return l=f,!0;if(rt(f).tooltipConfig!=null)return u=f,!0},!0),l?this._showSeriesItemTooltip(e,l,i):u?this._showComponentItemTooltip(e,u,i):this._hide(i)}else this._lastDataByCoordSys=null,this._hide(i)}},t.prototype._showOrMove=function(e,i){var n=e.get("showDelay");i=et(i,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(i,n):i()},t.prototype._showAxisTooltip=function(e,i){var n=this._ecModel,a=this._tooltipModel,o=[i.offsetX,i.offsetY],s=Vn([i.tooltipOption],a),l=this._renderMode,u=[],f=wa("section",{blocks:[],noHeader:!0}),h=[],c=new ou;A(e,function(m){A(m.dataByAxis,function(_){var S=n.getComponent(_.axisDim+"Axis",_.axisIndex),b=_.value;if(!(!S||b==null)){var w=O_(b,S.axis,n,_.seriesDataIndices,_.valueLabelOpt),x=wa("section",{header:w,noHeader:!qe(w),sortBlocks:!0,blocks:[]});f.blocks.push(x),A(_.seriesDataIndices,function(T){var M=n.getSeriesByIndex(T.seriesIndex),C=T.dataIndexInside,D=M.getDataParams(C);if(!(D.dataIndex<0)){D.axisDim=_.axisDim,D.axisIndex=_.axisIndex,D.axisType=_.axisType,D.axisId=_.axisId,D.axisValue=nv(S.axis,{value:b}),D.axisValueLabel=w,D.marker=c.makeTooltipMarker("item",xi(D.color),l);var L=id(M.formatTooltip(C,!0,null)),I=L.frag;if(I){var P=Vn([M],a).get("valueFormatter");x.blocks.push(P?O({valueFormatter:P},I):I)}L.text&&h.push(L.text),u.push(D)}})}})}),f.blocks.reverse(),h.reverse();var v=i.position,d=s.get("order"),g=ud(f,c,l,d,n.get("useUTC"),s.get("textStyle"));g&&h.unshift(g);var p=l==="richText"?"\n\n":"
",y=h.join(p);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(e,u)?this._updatePosition(s,v,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,y,u,Math.random()+"",o[0],o[1],v,null,c)})},t.prototype._showSeriesItemTooltip=function(e,i,n){var a=this._ecModel,o=rt(i),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,f=o.dataIndex,h=o.dataType,c=u.getData(h),v=this._renderMode,d=e.positionDefault,g=Vn([c.getItemModel(f),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),p=g.get("trigger");if(!(p!=null&&p!=="item")){var y=u.getDataParams(f,h),m=new ou;y.marker=m.makeTooltipMarker("item",xi(y.color),v);var _=id(u.formatTooltip(f,!1,h)),S=g.get("order"),b=g.get("valueFormatter"),w=_.frag,x=w?ud(b?O({valueFormatter:b},w):w,m,v,S,a.get("useUTC"),g.get("textStyle")):_.text,T="item_"+u.name+"_"+f;this._showOrMove(g,function(){this._showTooltipContent(g,x,y,T,e.offsetX,e.offsetY,e.position,e.target,m)}),n({type:"showTip",dataIndexInside:f,dataIndex:c.getRawIndex(f),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,i,n){var a=rt(i),o=a.tooltipConfig,s=o.option||{};if(H(s)){var l=s;s={content:l,formatter:l}}var u=[s],f=this._ecModel.getComponent(a.componentMainType,a.componentIndex);f&&u.push(f),u.push({formatter:s.content});var h=e.positionDefault,c=Vn(u,this._tooltipModel,h?{position:h}:null),v=c.get("content"),d=Math.random()+"",g=new ou;this._showOrMove(c,function(){var p=Q(c.get("formatterParams")||{});this._showTooltipContent(c,v,p,d,e.offsetX,e.offsetY,e.position,i,g)}),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,i,n,a,o,s,l,u,f){if(this._ticket="",!(!e.get("showContent")||!e.get("show"))){var h=this._tooltipContent;h.setEnterable(e.get("enterable"));var c=e.get("formatter");l=l||e.get("position");var v=i,d=this._getNearestPoint([o,s],n,e.get("trigger"),e.get("borderColor")),g=d.color;if(c)if(H(c)){var p=e.ecModel.get("useUTC"),y=F(n)?n[0]:n,m=y&&y.axisType&&y.axisType.indexOf("time")>=0;v=c,m&&(v=qs(y.axisValue,v,p)),v=vm(v,n,!0)}else if(Z(c)){var _=et(function(S,b){S===this._ticket&&(h.setContent(b,f,e,g,l),this._updatePosition(e,l,o,s,h,n,u))},this);this._ticket=a,v=c(n,a,_)}else v=c;h.setContent(v,f,e,g,l),h.show(e,g),this._updatePosition(e,l,o,s,h,n,u)}},t.prototype._getNearestPoint=function(e,i,n,a){if(n==="axis"||F(i))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!F(i))return{color:a||i.color||i.borderColor}},t.prototype._updatePosition=function(e,i,n,a,o,s,l){var u=this._api.getWidth(),f=this._api.getHeight();i=i||e.get("position");var h=o.getSize(),c=e.get("align"),v=e.get("verticalAlign"),d=l&&l.getBoundingRect().clone();if(l&&d.applyTransform(l.transform),Z(i)&&(i=i([n,a],s,o.el,d,{viewSize:[u,f],contentSize:h.slice()})),F(i))n=pt(i[0],u),a=pt(i[1],f);else if(W(i)){var g=i;g.width=h[0],g.height=h[1];var p=Ti(g,{width:u,height:f});n=p.x,a=p.y,c=null,v=null}else if(H(i)&&l){var y=jI(i,d,h,e.get("borderWidth"));n=y[0],a=y[1]}else{var y=QI(n,a,o,u,f,c?null:20,v?null:20);n=y[0],a=y[1]}if(c&&(n-=ug(c)?h[0]/2:c==="right"?h[0]:0),v&&(a-=ug(v)?h[1]/2:v==="bottom"?h[1]:0),z_(e)){var y=JI(n,a,o,u,f);n=y[0],a=y[1]}o.moveTo(n,a)},t.prototype._updateContentNotChangedOnAxis=function(e,i){var n=this._lastDataByCoordSys,a=this._cbParamsList,o=!!n&&n.length===e.length;return o&&A(n,function(s,l){var u=s.dataByAxis||[],f=e[l]||{},h=f.dataByAxis||[];o=o&&u.length===h.length,o&&A(u,function(c,v){var d=h[v]||{},g=c.seriesDataIndices||[],p=d.seriesDataIndices||[];o=o&&c.value===d.value&&c.axisType===d.axisType&&c.axisId===d.axisId&&g.length===p.length,o&&A(g,function(y,m){var _=p[m];o=o&&y.seriesIndex===_.seriesIndex&&y.dataIndex===_.dataIndex}),a&&A(c.seriesDataIndices,function(y){var m=y.seriesIndex,_=i[m],S=a[m];_&&S&&S.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=i,!!o},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,i){K.node||!i.getDom()||(Df(this,"_updatePosition"),this._tooltipContent.dispose(),Qf("itemTooltip",i))},t.type="tooltip",t}(we);function Vn(r,t,e){var i=t.ecModel,n;e?(n=new yt(e,i,i),n=new yt(t.option,n,i)):n=t;for(var a=r.length-1;a>=0;a--){var o=r[a];o&&(o instanceof yt&&(o=o.get("tooltip",!0)),H(o)&&(o={formatter:o}),o&&(n=new yt(o,n,i)))}return n}function lg(r,t){return r.dispatchAction||et(t.dispatchAction,t)}function QI(r,t,e,i,n,a,o){var s=e.getSize(),l=s[0],u=s[1];return a!=null&&(r+l+a+2>i?r-=l+a:r+=a),o!=null&&(t+u+o>n?t-=u+o:t+=o),[r,t]}function JI(r,t,e,i,n){var a=e.getSize(),o=a[0],s=a[1];return r=Math.min(r+o,i)-o,t=Math.min(t+s,n)-s,r=Math.max(r,0),t=Math.max(t,0),[r,t]}function jI(r,t,e,i){var n=e[0],a=e[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=t.width,f=t.height;switch(r){case"inside":s=t.x+u/2-n/2,l=t.y+f/2-a/2;break;case"top":s=t.x+u/2-n/2,l=t.y-a-o;break;case"bottom":s=t.x+u/2-n/2,l=t.y+f+o;break;case"left":s=t.x-n-o,l=t.y+f/2-a/2;break;case"right":s=t.x+u+o,l=t.y+f/2-a/2}return[s,l]}function ug(r){return r==="center"||r==="middle"}function t2(r,t,e){var i=gh(r).queryOptionMap,n=i.keys()[0];if(!(!n||n==="series")){var a=Ra(t,n,i.get(n),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=e.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var f=rt(u).tooltipConfig;if(f&&f.name===r.name)return l=u,!0}),l)return{componentMainType:n,componentIndex:o.componentIndex,el:l}}}}function Q2(r){Ne(V_),r.registerComponentModel(BI),r.registerComponentView(KI),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Ht),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Ht)}var fg=A;function hg(r){if(r){for(var t in r)if(r.hasOwnProperty(t))return!0}}function vg(r,t,e){var i={};return fg(t,function(a){var o=i[a]=n();fg(r[a],function(s,l){if(Gt.isValidType(l)){var u={type:l,visual:s};e&&e(u,a),o[l]=new Gt(u),l==="opacity"&&(u=Q(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new Gt(u))}})}),i;function n(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function e2(r,t,e){var i;A(e,function(n){t.hasOwnProperty(n)&&hg(t[n])&&(i=!0)}),i&&A(e,function(n){t.hasOwnProperty(n)&&hg(t[n])?r[n]=Q(t[n]):delete r[n]})}function r2(r,t,e,i){var n={};return A(r,function(a){var o=Gt.prepareVisualTypes(t[a]);n[a]=o}),{progress:function(o,s){var l;i!=null&&(l=s.getDimensionIndex(i));function u(b){return Zm(s,h,b)}function f(b,w){TM(s,h,b,w)}for(var h,c=s.getStore();(h=o.next())!=null;){var v=s.getRawDataItem(h);if(!(v&&v.visualMap===!1))for(var d=i!=null?c.get(l,h):h,g=e(d),p=t[g],y=n[g],m=0,_=y.length;m<_;m++){var S=y[m];p[S]&&p[S].applyVisual(d,u,f)}}}}}var i2=function(r,t){if(t==="all")return{type:"all",title:r.getLocaleModel().get(["legend","selector","all"])};if(t==="inverse")return{type:"inverse",title:r.getLocaleModel().get(["legend","selector","inverse"])}},Jf=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.layoutMode={type:"box",ignoreSize:!0},e}return t.prototype.init=function(e,i,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(e,i){r.prototype.mergeOption.call(this,e,i),this._updateSelector(e)},t.prototype._updateSelector=function(e){var i=e.selector,n=this.ecModel;i===!0&&(i=e.selector=["all","inverse"]),F(i)&&A(i,function(a,o){H(a)&&(a={type:a}),i[o]=at(a,i2(n,a.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&this.get("selectedMode")==="single"){for(var i=!1,n=0;n=0},t.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(ft),Gi=Tt,jf=A,Io=Ct,U_=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.newlineDisabled=!1,e}return t.prototype.init=function(){this.group.add(this._contentGroup=new Io),this.group.add(this._selectorGroup=new Io),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,i,n){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!e.get("show",!0)){var o=e.get("align"),s=e.get("orient");(!o||o==="auto")&&(o=e.get("left")==="right"&&s==="vertical"?"right":"left");var l=e.get("selector",!0),u=e.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,e,i,n,l,s,u);var f=e.getBoxLayoutParams(),h={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),v=Ti(f,h,c),d=this.layoutInner(e,o,v,a,l,u),g=Ti(st({width:d.width,height:d.height},f),h,c);this.group.x=g.x-d.x,this.group.y=g.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=NI(d,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,i,n,a,o,s,l){var u=this.getContentGroup(),f=tt(),h=i.get("selectedMode"),c=[];n.eachRawSeries(function(v){!v.get("legendHoverLink")&&c.push(v.id)}),jf(i.getData(),function(v,d){var g=v.get("name");if(!this.newlineDisabled&&(g===""||g==="\n")){var p=new Io;p.newline=!0,u.add(p);return}var y=n.getSeriesByName(g)[0];if(!f.get(g))if(y){var m=y.getData(),_=m.getVisual("legendLineStyle")||{},S=m.getVisual("legendIcon"),b=m.getVisual("style"),w=this._createItem(y,g,d,v,i,e,_,b,S,h,a);w.on("click",Gi(cg,g,null,a,c)).on("mouseover",Gi(th,y.name,null,a,c)).on("mouseout",Gi(eh,y.name,null,a,c)),n.ssr&&w.eachChild(function(x){var T=rt(x);T.seriesIndex=y.seriesIndex,T.dataIndex=d,T.ssrType="legend"}),f.set(g,!0)}else n.eachRawSeries(function(x){if(!f.get(g)&&x.legendVisualProvider){var T=x.legendVisualProvider;if(!T.containName(g))return;var M=T.indexOfName(g),C=T.getItemVisual(M,"style"),D=T.getItemVisual(M,"legendIcon"),L=ae(C.fill);L&&L[3]===0&&(L[3]=.2,C=O(O({},C),{fill:pr(L,"rgba")}));var I=this._createItem(x,g,d,v,i,e,{},C,D,h,a);I.on("click",Gi(cg,null,g,a,c)).on("mouseover",Gi(th,null,g,a,c)).on("mouseout",Gi(eh,null,g,a,c)),n.ssr&&I.eachChild(function(P){var R=rt(P);R.seriesIndex=x.seriesIndex,R.dataIndex=d,R.ssrType="legend"}),f.set(g,!0)}},this)},this),o&&this._createSelector(o,i,a,s,l)},t.prototype._createSelector=function(e,i,n,a,o){var s=this.getSelectorGroup();jf(e,function(u){var f=u.type,h=new At({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:f==="all"?"legendAllSelect":"legendInverseSelect"})}});s.add(h);var c=i.getModel("selectorLabel"),v=i.getModel(["emphasis","selectorLabel"]);Oa(h,{normal:c,emphasis:v},{defaultText:u.title}),pf(h)})},t.prototype._createItem=function(e,i,n,a,o,s,l,u,f,h,c){var v=e.visualDrawType,d=o.get("itemWidth"),g=o.get("itemHeight"),p=o.isSelected(i),y=a.get("symbolRotate"),m=a.get("symbolKeepAspect"),_=a.get("icon");f=_||f||"roundRect";var S=n2(f,a,l,u,v,p,c),b=new Io,w=a.getModel("textStyle");if(Z(e.getLegendIcon)&&(!_||_==="inherit"))b.add(e.getLegendIcon({itemWidth:d,itemHeight:g,icon:f,iconRotate:y,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:m}));else{var x=_==="inherit"&&e.getData().getVisual("symbol")?y==="inherit"?e.getData().getVisual("symbolRotate"):y:0;b.add(a2({itemWidth:d,itemHeight:g,icon:f,iconRotate:x,itemStyle:S.itemStyle,symbolKeepAspect:m}))}var T=s==="left"?d+5:-5,M=s,C=o.get("formatter"),D=i;H(C)&&C?D=C.replace("{name}",i!=null?i:""):Z(C)&&(D=C(i));var L=p?w.getTextColor():a.get("inactiveColor");b.add(new At({style:je(w,{text:D,x:T,y:g/2,fill:L,align:M,verticalAlign:"middle"},{inheritColor:L})}));var I=new Mt({shape:b.getBoundingRect(),style:{fill:"transparent"}}),P=a.getModel("tooltip");return P.get("show")&&Rh({el:I,componentModel:o,itemName:i,itemTooltipOption:P.option}),b.add(I),b.eachChild(function(R){R.silent=!0}),I.silent=!h,this.getContentGroup().add(b),pf(b),b.__legendDataIndex=n,b},t.prototype.layoutInner=function(e,i,n,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();ln(e.get("orient"),l,e.get("itemGap"),n.width,n.height);var f=l.getBoundingRect(),h=[-f.x,-f.y];if(u.markRedraw(),l.markRedraw(),o){ln("horizontal",u,e.get("selectorItemGap",!0));var c=u.getBoundingRect(),v=[-c.x,-c.y],d=e.get("selectorButtonGap",!0),g=e.getOrient().index,p=g===0?"width":"height",y=g===0?"height":"width",m=g===0?"y":"x";s==="end"?v[g]+=f[p]+d:h[g]+=c[p]+d,v[1-g]+=f[y]/2-c[y]/2,u.x=v[0],u.y=v[1],l.x=h[0],l.y=h[1];var _={x:0,y:0};return _[p]=f[p]+d+c[p],_[y]=Math.max(f[y],c[y]),_[m]=Math.min(0,c[m]+v[1-g]),_}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(we);function n2(r,t,e,i,n,a,o){function s(p,y){p.lineWidth==="auto"&&(p.lineWidth=y.lineWidth>0?2:0),jf(p,function(m,_){p[_]==="inherit"&&(p[_]=y[_])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),f=r.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?i.decal:Rf(h,o),u.fill==="inherit"&&(u.fill=i[n]),u.stroke==="inherit"&&(u.stroke=i[f]),u.opacity==="inherit"&&(u.opacity=(n==="fill"?i:e).opacity),s(u,i);var c=t.getModel("lineStyle"),v=c.getLineStyle();if(s(v,e),u.fill==="auto"&&(u.fill=i.fill),u.stroke==="auto"&&(u.stroke=i.fill),v.stroke==="auto"&&(v.stroke=i.fill),!a){var d=t.get("inactiveBorderWidth"),g=u[f];u.lineWidth=d==="auto"?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),v.stroke=c.get("inactiveColor"),v.lineWidth=c.get("inactiveWidth")}return{itemStyle:u,lineStyle:v}}function a2(r){var t=r.icon||"roundRect",e=yr(t,0,0,r.itemWidth,r.itemHeight,r.itemStyle.fill,r.symbolKeepAspect);return e.setStyle(r.itemStyle),e.rotation=(r.iconRotate||0)*Math.PI/180,e.setOrigin([r.itemWidth/2,r.itemHeight/2]),t.indexOf("empty")>-1&&(e.style.stroke=e.style.fill,e.style.fill="#fff",e.style.lineWidth=2),e}function cg(r,t,e,i){eh(r,t,e,i),e.dispatchAction({type:"legendToggleSelect",name:r!=null?r:t}),th(r,t,e,i)}function Y_(r){for(var t=r.getZr().storage.getDisplayList(),e,i=0,n=t.length;in[o],p=[-v.x,-v.y];i||(p[a]=f[u]);var y=[0,0],m=[-d.x,-d.y],_=$(e.get("pageButtonGap",!0),e.get("itemGap",!0));if(g){var S=e.get("pageButtonPosition",!0);S==="end"?m[a]+=n[o]-d[o]:y[a]+=d[o]+_}m[1-a]+=v[s]/2-d[s]/2,f.setPosition(p),h.setPosition(y),c.setPosition(m);var b={x:0,y:0};if(b[o]=g?n[o]:v[o],b[s]=Math.max(v[s],d[s]),b[l]=Math.min(0,d[l]+m[1-a]),h.__rectSize=n[o],g){var w={x:0,y:0};w[o]=Math.max(n[o]-d[o]-_,0),w[s]=b[s],h.setClipPath(new Mt({shape:w})),h.__rectSize=w[o]}else c.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(e);return x.pageIndex!=null&&Et(f,{x:x.contentPosition[0],y:x.contentPosition[1]},g?e:null),this._updatePageInfoView(e,x),b},t.prototype._pageGo=function(e,i,n){var a=this._getPageInfo(i)[e];a!=null&&n.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:i.id})},t.prototype._updatePageInfoView=function(e,i){var n=this._controllerGroup;A(["pagePrev","pageNext"],function(f){var h=f+"DataIndex",c=i[h]!=null,v=n.childOfName(f);v&&(v.setStyle("fill",c?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),v.cursor=c?"pointer":"default")});var a=n.childOfName("pageText"),o=e.get("pageFormatter"),s=i.pageIndex,l=s!=null?s+1:0,u=i.pageCount;a&&o&&a.setStyle("text",H(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},t.prototype._getPageInfo=function(e){var i=e.get("scrollDataIndex",!0),n=this.getContentGroup(),a=this._containerGroup.__rectSize,o=e.getOrient().index,s=Fu[o],l=Vu[o],u=this._findTargetItemIndex(i),f=n.children(),h=f[u],c=f.length,v=c?1:0,d={contentPosition:[n.x,n.y],pageCount:v,pageIndex:v-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return d;var g=S(h);d.contentPosition[o]=-g.s;for(var p=u+1,y=g,m=g,_=null;p<=c;++p)_=S(f[p]),(!_&&m.e>y.s+a||_&&!b(_,y.s))&&(m.i>y.i?y=m:y=_,y&&(d.pageNextDataIndex==null&&(d.pageNextDataIndex=y.i),++d.pageCount)),m=_;for(var p=u-1,y=g,m=g,_=null;p>=-1;--p)_=S(f[p]),(!_||!b(m,_.s))&&y.i=x&&w.s<=x+a}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var i,n=this.getContentGroup(),a;return n.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===e&&(i=s)}),i!=null?i:a},t.type="legend.scroll",t}(U_);function f2(r){r.registerAction("legendScroll","legendscroll",function(t,e){var i=t.scrollDataIndex;i!=null&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(n){n.setScrollDataIndex(i)})})}function h2(r){Ne(X_),r.registerComponentModel(l2),r.registerComponentView(u2),f2(r)}function J2(r){Ne(X_),Ne(h2)}var $_={get:function(r,t,e){var i=Q((v2[r]||{})[t]);return e&&F(i)?i[i.length-1]:i}},v2={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},gg=Gt.mapVisual,c2=Gt.eachVisual,d2=F,yg=A,p2=uy,g2=rr,Ds=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e.stateList=["inRange","outOfRange"],e.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],e.layoutMode={type:"box",ignoreSize:!0},e.dataBound=[-1/0,1/0],e.targetVisuals={},e.controllerVisuals={},e}return t.prototype.init=function(e,i,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,i){var n=this.option;!i&&e2(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var i=this.stateList;e=et(e,this),this.controllerVisuals=vg(this.option.controller,i,e),this.targetVisuals=vg(this.option.target,i,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,i=[];return e==null||e==="all"?this.ecModel.eachSeries(function(n,a){i.push(a)}):i=Ot(e),i},t.prototype.eachTargetSeries=function(e,i){A(this.getTargetSeriesIndices(),function(n){var a=this.ecModel.getSeriesByIndex(n);a&&e.call(i,a)},this)},t.prototype.isTargetSeries=function(e){var i=!1;return this.eachTargetSeries(function(n){n===e&&(i=!0)}),i},t.prototype.formatValueText=function(e,i,n){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;n=n||["<",">"],F(e)&&(e=e.slice(),u=!0);var f=i?e:u?[h(e[0]),h(e[1])]:h(e);if(H(l))return l.replace("{value}",u?f[0]:f).replace("{value2}",u?f[1]:f);if(Z(l))return u?l(e[0],e[1]):l(e);if(u)return e[0]===s[0]?n[0]+" "+f[1]:e[1]===s[1]?n[1]+" "+f[0]:f[0]+" - "+f[1];return f;function h(c){return c===s[0]?"min":c===s[1]?"max":(+c).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var e=this.option,i=p2([e.min,e.max]);this._dataExtent=i},t.prototype.getDataDimensionIndex=function(e){var i=this.option.dimension;if(i!=null)return e.getDimensionIndex(i);for(var n=e.dimensions,a=n.length-1;a>=0;a--){var o=n[a],s=e.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,i=this.option,n={inRange:i.inRange,outOfRange:i.outOfRange},a=i.target||(i.target={}),o=i.controller||(i.controller={});at(a,n),at(o,n);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),f.call(this,o);function l(h){d2(i.color)&&!h.inRange&&(h.inRange={color:i.color.slice().reverse()}),h.inRange=h.inRange||{color:e.get("gradientColor")}}function u(h,c,v){var d=h[c],g=h[v];d&&!g&&(g=h[v]={},yg(d,function(p,y){if(Gt.isValidType(y)){var m=$_.get(y,"inactive",s);m!=null&&(g[y]=m,y==="color"&&!g.hasOwnProperty("opacity")&&!g.hasOwnProperty("colorAlpha")&&(g.opacity=[0,0]))}}))}function f(h){var c=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,v=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,d=this.get("inactiveColor"),g=this.getItemSymbol(),p=g||"roundRect";yg(this.stateList,function(y){var m=this.itemSize,_=h[y];_||(_=h[y]={color:s?d:[d]}),_.symbol==null&&(_.symbol=c&&Q(c)||(s?p:[p])),_.symbolSize==null&&(_.symbolSize=v&&Q(v)||(s?m[0]:[m[0],m[0]])),_.symbol=gg(_.symbol,function(w){return w==="none"?p:w});var S=_.symbolSize;if(S!=null){var b=-1/0;c2(S,function(w){w>b&&(b=w)}),_.symbolSize=gg(S,function(w){return g2(w,[0,b],[0,m[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(ft),mg=[20,140],y2=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.optionUpdated=function(e,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(n){n.mappingMethod="linear",n.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){r.prototype.resetItemSize.apply(this,arguments);var e=this.itemSize;(e[0]==null||isNaN(e[0]))&&(e[0]=mg[0]),(e[1]==null||isNaN(e[1]))&&(e[1]=mg[1])},t.prototype._resetRange=function(){var e=this.getExtent(),i=this.option.range;!i||i.auto?(e.auto=1,this.option.range=e):F(i)&&(i[0]>i[1]&&i.reverse(),i[0]=Math.max(i[0],e[0]),i[1]=Math.min(i[1],e[1]))},t.prototype.completeVisualOption=function(){r.prototype.completeVisualOption.apply(this,arguments),A(this.stateList,function(e){var i=this.option.controller[e].symbolSize;i&&i[0]!==i[1]&&(i[0]=i[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),i=uy((this.get("range")||[]).slice());return i[0]>e[1]&&(i[0]=e[1]),i[1]>e[1]&&(i[1]=e[1]),i[0]=n[1]||e<=i[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var i=[];return this.eachTargetSeries(function(n){var a=[],o=n.getData();o.each(this.getDataDimensionIndex(o),function(s,l){e[0]<=s&&s<=e[1]&&a.push(l)},this),i.push({seriesId:n.id,dataIndex:a})},this),i},t.prototype.getVisualMeta=function(e){var i=_g(this,"outOfRange",this.getExtent()),n=_g(this,"inRange",this.option.range.slice()),a=[];function o(v,d){a.push({value:v,color:e(v,d)})}for(var s=0,l=0,u=n.length,f=i.length;le[1])break;a.push({color:this.getControllerVisual(l,"color",i),offset:s/n})}return a.push({color:this.getControllerVisual(e[1],"color",i),offset:1}),a},t.prototype._createBarPoints=function(e,i){var n=this.visualMapModel.itemSize;return[[n[0]-i[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-i[1],e[1]]]},t.prototype._createBarGroup=function(e){var i=this._orient,n=this.visualMapModel.get("inverse");return new Ct(i==="horizontal"&&!n?{scaleX:e==="bottom"?1:-1,rotation:Math.PI/2}:i==="horizontal"&&n?{scaleX:e==="bottom"?-1:1,rotation:-Math.PI/2}:i==="vertical"&&!n?{scaleX:e==="left"?1:-1,scaleY:-1}:{scaleX:e==="left"?1:-1})},t.prototype._updateHandle=function(e,i){if(this._useHandle){var n=this._shapes,a=this.visualMapModel,o=n.handleThumbs,s=n.handleLabels,l=a.itemSize,u=a.getExtent();m2([0,1],function(f){var h=o[f];h.setStyle("fill",i.handlesColor[f]),h.y=e[f];var c=Ye(e[f],[0,l[1]],u,!0),v=this.getControllerVisual(c,"symbolSize");h.scaleX=h.scaleY=v/l[0],h.x=l[0]-v/2;var d=nn(n.handleLabelPoints[f],Ho(h,this.group));s[f].setStyle({x:d[0],y:d[1],text:a.formatValueText(this._dataInterval[f]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",n.mainGroup):"center"})},this)}},t.prototype._showIndicator=function(e,i,n,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],f=this._shapes,h=f.indicator;if(h){h.attr("invisible",!1);var c={convertOpacityToAlpha:!0},v=this.getControllerVisual(e,"color",c),d=this.getControllerVisual(e,"symbolSize"),g=Ye(e,s,u,!0),p=l[0]-d/2,y={x:h.x,y:h.y};h.y=g,h.x=p;var m=nn(f.indicatorLabelPoint,Ho(h,this.group)),_=f.indicatorLabel;_.attr("invisible",!1);var S=this._applyTransform("left",f.mainGroup),b=this._orient,w=b==="horizontal";_.setStyle({text:(n||"")+o.formatValueText(i),verticalAlign:w?S:"middle",align:w?"center":S});var x={x:p,y:g,style:{fill:v}},T={style:{x:m[0],y:m[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var M={duration:100,easing:"cubicInOut",additive:!0};h.x=y.x,h.y=y.y,h.animateTo(x,M),_.animateTo(T,M)}else h.attr(x),_.attr(T);this._firstShowIndicator=!1;var C=this._shapes.handleLabels;if(C)for(var D=0;Do[1]&&(h[1]=1/0),i&&(h[0]===-1/0?this._showIndicator(f,h[1],"< ",l):h[1]===1/0?this._showIndicator(f,h[0],"> ",l):this._showIndicator(f,f,"≈ ",l));var c=this._hoverLinkDataIndices,v=[];(i||xg(n))&&(v=this._hoverLinkDataIndices=n.findTargetDataIndices(h));var d=nw(c,v);this._dispatchHighDown("downplay",$o(d[0],n)),this._dispatchHighDown("highlight",$o(d[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var i;if(Ki(e.target,function(l){var u=rt(l);if(u.dataIndex!=null)return i=u,!0},!0),!!i){var n=this.ecModel.getSeriesByIndex(i.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(n)){var o=n.getData(i.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),i.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0);var i=this._shapes.handleLabels;if(i)for(var n=0;n=0&&(a.dimension=o,i.push(a))}}),r.getData().setVisual("visualMeta",i)}}];function C2(r,t,e,i){for(var n=t.targetVisuals[i],a=Gt.prepareVisualTypes(n),o={color:qm(r.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),r.registerAction(x2,T2),A(M2,function(t){r.registerVisual(r.PRIORITY.VISUAL.COMPONENT,t)}),r.registerPreprocessor(D2))}function A2(r){r.registerComponentModel(y2),r.registerComponentView(w2),K_(r)}var L2=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e._pieceList=[],e}return t.prototype.optionUpdated=function(e,i){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var n=this._mode=this._determineMode();this._pieceList=[],I2[this._mode].call(this,this._pieceList),this._resetSelected(e,i);var a=this.option.categories;this.resetVisual(function(o,s){n==="categories"?(o.mappingMethod="category",o.categories=Q(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=G(this._pieceList,function(l){return l=Q(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var e=this.option,i={},n=Gt.listVisualTypes(),a=this.isCategory();A(e.pieces,function(s){A(n,function(l){s.hasOwnProperty(l)&&(i[l]=1)})}),A(i,function(s,l){var u=!1;A(this.stateList,function(f){u=u||o(e,f,l)||o(e.target,f,l)},this),!u&&A(this.stateList,function(f){(e[f]||(e[f]={}))[l]=$_.get(l,f==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}r.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,i){var n=this.option,a=this._pieceList,o=(i?n:e).selected||{};if(n.selected=o,A(a,function(l,u){var f=this.getSelectedMapKey(l);o.hasOwnProperty(f)||(o[f]=!0)},this),n.selectedMode==="single"){var s=!1;A(a,function(l,u){var f=this.getSelectedMapKey(l);o[f]&&(s?o[f]=!1:s=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(e){return this._mode==="categories"?e.value+"":e.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=Q(e)},t.prototype.getValueState=function(e){var i=Gt.findPieceIndex(e,this._pieceList);return i!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[i])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var i=[],n=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var f=Gt.findPieceIndex(l,n);f===e&&o.push(u)},this),i.push({seriesId:a.id,dataIndex:o})},this),i},t.prototype.getRepresentValue=function(e){var i;if(this.isCategory())i=e.value;else if(e.value!=null)i=e.value;else{var n=e.interval||[];i=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return i},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var i=[],n=["",""],a=this;function o(f,h){var c=a.getRepresentValue({interval:f});h||(h=a.getValueState(c));var v=e(c,h);f[0]===-1/0?n[0]=v:f[1]===1/0?n[1]=v:i.push({value:f[0],color:v},{value:f[1],color:v})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return A(s,function(f){var h=f.interval;h&&(h[0]>u&&o([u,h[0]],"outOfRange"),o(h.slice()),u=h[1])},this),{stops:i,outerColors:n}},t.type="visualMap.piecewise",t.defaultOption=Zs(Ds.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(Ds),I2={splitNumber:function(r){var t=this.option,e=Math.min(t.precision,20),i=this.getExtent(),n=t.splitNumber;n=Math.max(parseInt(n,10),1),t.splitNumber=n;for(var a=(i[1]-i[0])/n;+a.toFixed(e)!==a&&e<5;)e++;t.precision=e,a=+a.toFixed(e),t.minOpen&&r.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o","≥"][i[0]]];e.text=e.text||this.formatValueText(e.value!=null?e.value:e.interval,!1,n)},this)}};function Dg(r,t){var e=r.inverse;(r.orient==="vertical"?!e:e)&&t.reverse()}var P2=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type=t.type,e}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var i=this.visualMapModel,n=i.get("textGap"),a=i.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=i.itemSize,f=this._getViewData(),h=f.endsText,c=un(i.get("showLabel",!0),!h);h&&this._renderEndsText(e,h[0],u,c,l),A(f.viewPieceList,function(v){var d=v.piece,g=new Ct;g.onclick=et(this._onItemClick,this,d),this._enableHoverLink(g,v.indexInModelPieceList);var p=i.getRepresentValue(d);if(this._createItemSymbol(g,p,[0,0,u[0],u[1]]),c){var y=this.visualMapModel.getValueState(p);g.add(new At({style:{x:l==="right"?-n:u[0]+n,y:u[1]/2,text:d.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:y==="outOfRange"?.5:1}}))}e.add(g)},this),h&&this._renderEndsText(e,h[1],u,c,l),ln(i.get("orient"),e,i.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,i){var n=this;e.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=n.visualMapModel;s.option.hoverLink&&n.api.dispatchAction({type:o,batch:$o(s.findTargetDataIndices(i),s)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,i=e.option;if(i.orient==="vertical")return q_(e,this.api,e.itemSize);var n=i.align;return(!n||n==="auto")&&(n="left"),n},t.prototype._renderEndsText=function(e,i,n,a,o){if(i){var s=new Ct,l=this.visualMapModel.textStyleModel;s.add(new At({style:je(l,{x:a?o==="right"?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:a?o:"center",text:i})})),e.add(s)}},t.prototype._getViewData=function(){var e=this.visualMapModel,i=G(e.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),n=e.get("text"),a=e.get("orient"),o=e.get("inverse");return(a==="horizontal"?o:!o)?i.reverse():n&&(n=n.slice().reverse()),{viewPieceList:i,endsText:n}},t.prototype._createItemSymbol=function(e,i,n){e.add(yr(this.getControllerVisual(i,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(i,"color")))},t.prototype._onItemClick=function(e){var i=this.visualMapModel,n=i.option,a=n.selectedMode;if(a){var o=Q(n.selected),s=i.getSelectedMapKey(e);a==="single"||a===!0?(o[s]=!0,A(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},t.type="visualMap.piecewise",t}(Z_);function R2(r){r.registerComponentModel(L2),r.registerComponentView(P2),K_(r)}function j2(r){Ne(A2),Ne(R2)}var E2=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="dataset",e}return t.prototype.init=function(e,i,n){r.prototype.init.call(this,e,i,n),this._sourceManager=new Rm(this),sd(this)},t.prototype.mergeOption=function(e,i){r.prototype.mergeOption.call(this,e,i),sd(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:tr},t}(ft),k2=function(r){B(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.type="dataset",e}return t.type="dataset",t}(we);function O2(r){r.registerComponentModel(E2),r.registerComponentView(k2)}Ne([EA,O2]);Ne(qD);export{Oe as $,vh as A,je as B,ft as C,we as D,zS as E,OL as F,u1 as G,OD as H,Ti as I,U2 as J,Y2 as K,Ia as L,yt as M,Q as N,Nf as O,Tt as P,ne as Q,Mt as R,fm as S,W as T,Nx as U,V2 as V,H2 as W,G2 as X,W2 as Y,Fe as Z,T0 as _,X2 as a,Dt as a0,me as a1,EA as a2,j2 as a3,N2 as a4,F2 as a5,B2 as a6,B as a7,$2 as b,Z2 as c,J2 as d,q2 as e,O2 as f,K2 as g,Q2 as h,z2 as i,F as j,rt as k,A as l,G as m,ht as n,SC as o,ae as p,wC as q,Ko as r,g0 as s,Xh as t,Ne as u,at as v,st as w,Xv as x,jm as y,At as z}; diff --git a/assets/en-o7vnTKjO.js b/assets/en-o7vnTKjO.js new file mode 100644 index 0000000..f5208d8 --- /dev/null +++ b/assets/en-o7vnTKjO.js @@ -0,0 +1 @@ +const e={Notifications:{BrowserWarnings:{Description:"{name} is outdated and not fully supported. The current version is {version}, but Mainsail requires version {minVersion} or higher.",Headline:"Outdated Browser"},DependencyDescription:"The current {name} version does not support all features of Mainsail. Update {name} to at least {neededVersion}.",DependencyName:"Dependency: {name}",DismissAll:"Dismiss all",KlipperWarnings:{DeprecatedOption:"Option '{option}' in section '{section}' is deprecated and will be removed in a future release.",DeprecatedOptionHeadline:"Deprecated Klipper Option",DeprecatedValue:"Value '{value}' in option '{option}' in section '{section}' is deprecated and will be removed in a future release.",DeprecatedValueHeadline:"Deprecated Klipper Value",KlipperRuntimeWarning:"Klipper runtime warning",KlipperWarning:"Klipper warning"},MaintenanceReminder:"Maintenance Reminder",MaintenanceReminderText:'Maintenance "{name}" is due.',MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"An error was detected while loading the moonraker component '{component}'. Please check the log file and fix the issue.",MoonrakerFailedInitComponentDescription:"An error was detected during initialization the moonraker component '{component}'. Please check the log file and fix the issue.",MoonrakerInitComponent:"Init. Moonraker: {component}",MoonrakerWarning:"Moonraker warning",UnparsedConfigOption:"Unparsed config option '{option}: {value}' detected in section [{section}]. This may be an option no longer available or could be the result of a module that failed to load. In the future this will result in a startup error.",UnparsedConfigSection:"Unparsed config section [{section}] detected. This may be the result of a component that failed to load. In the future this will result in a startup error."},Never:"never",NextReboot:"next reboot",NoNotification:"No Notification available",Notifications:"Notifications",OneDayShort:"1D",OneHourShort:"1H",OneWeekShort:"1W",Remind:"Remind:",ShowDetails:"show details",TmcOtFlag:"Stepper driver error: OT flag set",TmcOtFlagText:"The stepper driver '{name}' has triggered the OT flag and stopped working. This can be caused by a too high current. Please check the stepper driver settings and cooling.",TmcOtpwFlag:"Stepper driver warning: OTPW flag set",TmcOtpwFlagText:"The stepper driver '{name}' has triggered the OTPW flag and may stop working if it gets any hotter. This is an indication of an over temperature condition. This can be caused by a too high current. Please check the stepper driver settings and cooling."},NumberInput:{GreaterOrEqualError:"Must be greater or equal than {min}!",MustBeBetweenError:"Must be between {min} and {max}!",NoEmptyAllowedError:"Input must not be empty!"},Printers:"Printers",TextfieldWithCopy:{Copied:"Copied"},TheServiceWorker:{DescriptionNeedUpdate:"The local cache is outdated and needs to be updated. Please click on the button below to update the cache.",TitleNeedUpdate:"PWA needs update",Update:"update"},ThrottledStates:{DescriptionCurrentlyThrottled:"rPi ARM core(s) are currently throttled down.",DescriptionFrequencyCapped:"rPi ARM max frequency is currently limited to 1.2 GHz.",DescriptionPreviouslyFrequencyCapped:"rPi ARM max frequency was at least once limited to 1.2 GHz since last power-on.",DescriptionPreviouslyTemperatureLimited:"rPi uC (3A+/3B+ only) temperature was at least once above the soft limit (default 60C) since last power-on.",DescriptionPreviouslyThrottled:"rPI ARM core(s) were throttled down at least once since last power-on.",DescriptionPreviouslyUnderVolted:"rPI supply voltage dropped below 4.65V at least once since the last power-on.",DescriptionTemperatureLimitActive:"rPi uC (3A+/3B+ only) temperature is currently above the soft limit (default 60C).",DescriptionUnderVoltageDetected:"rPI supply voltage currently below 4.65V",TitleCurrentlyThrottled:"Currently Throttled",TitleFrequencyCapped:"Frequency Capped",TitlePreviouslyFrequencyCapped:"Previously Frequency Capped",TitlePreviouslyTemperatureLimited:"Previously Temperature Limited",TitlePreviouslyThrottled:"Previously Throttled",TitlePreviouslyUnderVolted:"Previously Under-Volted",TitleTemperatureLimitActive:"Temperature Limit Active",TitleUnderVoltageDetected:"Under-Voltage Detected"},Titles:{Complete:"Complete - {filename}",Error:"ERROR",Pause:"Pause Print",PrinterOff:"Printer OFF",Printing:"{percent}% Printing - {filename}",PrintingETA:"{percent}% Printing - ETA: {eta} - {filename}"},TopBar:{CannotUploadTheFile:"Cannot upload the file!",EmergencyStop:"Emergency Stop",SAVE_CONFIG:"SAVE CONFIG",Uploading:"Uploading",UploadOfFileSuccessful:"Upload of {file} successful!",UploadPrint:"Upload & Print"},TopCornerMenu:{Cancel:"Cancel",ConfirmationDialog:{Description:{HostReboot:"Rebooting the Host will cause the current print to fail!",HostShutdown:"Shutting down the Host will cause the current print to fail!",KlipperFirmwareRestart:"Restarting the Klipper Firmware will cause the current print to fail!",KlipperRestart:"Restarting Klipper will cause the current print to fail!",KlipperStop:"Stopping Klipper will cause the current print to fail!",ServiceRestart:"Restarting this service may cause the current print to fail!",ServiceStart:"Starting this service may cause the current print to fail!",ServiceStop:"Stopping this service may cause the current print to fail!"},Title:{HostReboot:"Host Reboot",HostShutdown:"Host Shutdown",KlipperFirmwareRestart:"Klipper Firmware Restart",KlipperRestart:"Klipper Restart",ServiceRestart:"Service Restart",ServiceStart:"Service Start",ServiceStop:"Service Stop"}},HostControl:"Host Control",KlipperControl:"Klipper Control",KlipperFirmwareRestart:"Firmware Restart",KlipperRestart:"Restart",PowerDevices:"Power Devices",Reboot:"Reboot",Restart:"Restart",ServiceControl:"Service Control",Shutdown:"Shutdown",Start:"Start",Stop:"Stop"},UpdateDialog:{Close:"Close",Empty:"Empty",Recovering:"Recovering {software}...",RecoveringDone:"Recovering {software} done!",Updating:"Updating {software}...",UpdatingDone:"Updating {software} done!"}},t={Abort:"abort",Accept:"accept",Adjusted:"adjusted",Description:"Click on ADJUSTED if the current screw was adjusted. Click on ACCEPT to continue without adjustment.",Headline:"Bed Screws",ScrewAccepted:"Screws accepted",ScrewIndex:"Screw Index",ScrewName:"Screw Name",ScrewOutput:"{current} of {max}"},a={AreYouSure:"Are you sure?",CancelJob:"Cancel Job",No:"No",Yes:"Yes"},o={CannotConnectTo:"Cannot connect to Moonraker ({host}).",CheckMoonrakerLog:"If this message appears repeatedly, please have a look in the log file located at:",Connecting:"Connecting to {host}",ErrorMessage:"Error message: {message}",Failed:"Connection failed",Help:"Help",Initializing:"Initializing",TryAgain:"try again"},i={CommandList:"Command list",Empty:"Empty",HideTemperatures:"Hide temperatures",HideTimelapse:"Hide Timelapse",Search:"Search",SetupConsole:"Setup Console"},r={AreYouSure:"Are you sure?",CoolDown:"CoolDown",No:"No",Yes:"Yes"},n={CanBusInfo:"Only unassigned nodes can be detected. It’s recommended to have only one unassigned device connected to the can bus to avoid communication issues. For more details, please click on the link:",ClickRefresh:"Click on the refresh button to search for devices.",DevicePath:"Device path",Formats:"Formats",Headline:"Devices",HideSystemEntries:"Hide system entries",LibcameraId:"Libcamera ID",NoDeviceFound:"No device found. Please check the connection and click on the refresh button.",PathByHardware:"Path by hardware",PathById:"Path by ID",Refresh:"refresh",Resolutions:"Resolutions"},s={StartPrint:{Cancel:"Cancel",DoYouWantToStartFilename:"Do you want to start {filename}?",DoYouWantToStartFilenameFilament:"Do you want to start {filename} with the following filament?",Headline:"Start Job",Print:"print",Timelapse:"Timelapse"}},l={ConfigReference:"Config Reference",DeviceDialog:"Devices",DontSave:"Don't save",Downloading:"Downloading",FailedSave:"{filename} could not be uploaded!",FileReadOnly:"read-only",FileStructure:"File Structure",SaveClose:"Save & close",SaveRestart:"Save & Restart",SuccessfullySaved:"{filename} successfully saved.",UnsavedChanges:"Unsaved Changes",UnsavedChangesMessage:"Do you want to save your changes made to {filename}?",UnsavedChangesSubMessage:"Your changes will be lost if you don't save them. You can disable this message in the editor settings.",Uploading:"Uploading"},d={AreYouSure:"Are you sure?",EmergencyStop:"Emergency Stop",No:"No",Yes:"Yes"},c={AddBatchToQueue:"Add batch to Queue",AddToQueue:"Add to Queue",AllFiles:"All",BedTemp:"Bed Temp.",Cancel:"Cancel",ChamberTemp:"Chamber Temp.",Count:"Count",Create:"Create",CreateNewDirectory:"Create new Directory",CurrentPath:"Current path",Delete:"Delete",DeleteDirectory:"Delete Directory",DeleteDirectoryQuestion:'Do you really want to delete the "{name}" directory with all its contents?',DeleteSelectedQuestion:"Do you really want to delete {count} selected files?",DeleteSingleFileQuestion:'Do you really want to delete the file "{name}"?',Download:"Download",Duplicate:"Duplicate",DuplicateFile:"Duplicate File",EditFile:"Edit File",Empty:"Empty",ExtruderTemp:"Extruder Temp.",FilamentName:"Filament Name",FilamentType:"Filament Type",FilamentUsage:"Filament Usage",FilamentWeight:"Filament Weight",Files:"Files",Filesize:"File size",Free:"Free",FreeDisk:"Free disk",GCodeFiles:"G-Code Files",GcodesRootDirectoryDoesntExists:'No G-Code directory found. Please check option "path" in the [virtual_sdcard] section of the Klipper configuration.',HiddenFiles:"Hidden files",InvalidNameAlreadyExists:"Name already exists, please choose another name.",InvalidNameEmpty:"Input must not be empty!",LastEndTime:"Last End Time",LastFilamentUsed:"Last Filament Used",LastModified:"Last modified",LastPrintDuration:"Last Print Duration",LastStartTime:"Last Start Time",LastTotalDuration:"Last Total Duration",LayerHeight:"Layer Height",Name:"Name",NewDirectory:"New Directory",NozzleDiameter:"Nozzle Diameter",ObjectHeight:"Object Height",Preheat:"Preheat",PrintedFiles:"Printed files",PrintStart:"Print start",PrintTime:"Print Time",RefreshCurrentDirectory:"Refresh current Directory",Rename:"Rename",RenameDirectory:"Rename Directory",RenameFile:"Rename File",ScanMeta:"Scan Metadata",ScanMetaSuccess:"Successfully scanned metadata from: {filename}.",Search:"Search",SetupCurrentList:"Setup current list",Slicer:"Slicer",SuccessfullyCreated:"Successfully created {filename}.",SuccessfullyDeleted:"Successfully deleted {filename}.",SuccessfullyMoved:"Successfully moved {filename}.",SuccessfullyRenamed:"Successfully renamed {filename}.",SuccessfullyUploaded:"Upload of {filename} successful!",Total:"Total",UploadNewGcode:"Upload new G-Code",Used:"Used",View3D:"View 3D"},m={CannotUploadFile:"Cannot upload file!",DropFilesToUploadFiles:"Drop files to upload"},p={ClearLoadedFile:"Clear",CNCMode:"CNC Mode",ColorMode:"Color Mode",Downloading:"Downloading",ForceLineRendering:"Force Line Rendering",HDRendering:"HD Rendering (Round Extrusions)",High:"High",LoadCurrentFile:"Current file",LoadLocal:"Local File",Low:"Low",Max:"Max",Medium:"Medium",ReloadRequired:"Reload required",Rendering:"Rendering",RenderQuality:"Render Quality",ShowGCode:"Show G-Code",ShowObjectSelection:"Show Object Selection",ShowToolhead:"Show Toolhead",ShowTravelMoves:"Show Travel Moves",SpecularLighting:"Specular Lighting",Title:"G-Code Viewer",Tracking:"Tracking",Transparency:"Transparency",Ultra:"Ultra",VoxelMode:"Voxel Mode (ASMBL)"},u={Abort:"abort",BedMeshCalibrate:"Bed Mesh Calibrate",BedMeshRemove:"Bed Mesh Remove",Calibrate:"calibrate",Clear:"clear",CurrentMesh:{Headline:"Current Mesh",Max:"Max",Min:"Min",Name:"Name",Range:"Range",Size:"Size"},DeleteBedMeshProfile:"Delete Bed Mesh Profile",DoYouReallyWantToDelete:'Do you really want to delete the profile "{name}"?',ErrorKlipperNotReady:"Klipper not ready. Heightmap disabled.",Flat:"Flat",Heightmap:"Heightmap",InvalidNameAlreadyExists:"Profile name already exists, please choose another profile name.",InvalidNameAscii:"Name is invalid. Only ascii character are allowed.",InvalidNameEmpty:"Input must not be empty!",InvalidNameReserved:"Profile 'default' is reserved, please choose another profile name.",Mesh:"Mesh",Name:"Name",NoBedMeshHasBeenLoadedYet:"No bed mesh has been loaded yet.",NoProfile:"No profile available",Probed:"Probed",Profiles:"Profiles",Remove:"delete",Rename:"rename",RenameBedMeshProfile:"Rename Bed Mesh Profile",ScaleGradient:"Scale gradient",ScaleZMax:"Scale z-max.",TitleCalibrate:"Calibrate new bed mesh",TitleClear:"Clear bed mesh",TitleHomeAll:"Home all",Wireframe:"Wireframe"},h={AddANote:"Add a note",AddMaintenance:"Add Maintenance",AddNote:"Add note",AddToQueueSuccessful:"File {filename} added to Queue.",AllJobs:"All",AvgPrinttime:"Print Time - Ø",Cancel:"Cancel",Chart:"Chart",CreateNote:"Create Note",DateBasedReminder:"Date",DateBasedReminderDescription:"This reminder is based on the date.",Days:"days",Delete:"Delete",DeleteSelectedQuestion:"Do you really want to delete {count} selected jobs?",DeleteSingleJobQuestion:"Do you really want to delete the job?",Details:"Details",EditMaintenance:"Edit Maintenance",EditNote:"Edit Note",Empty:"empty",EndTime:"End Time",EntryCreatedAt:"Created at {date}.",EntryNextPerform:"Next perform:",EntryPerformedAt:"Performed at {date}.",EntrySince:"Used since:",EstimatedFilament:"Estimated Filament",EstimatedFilamentWeight:"Estimated Filament Weight",EstimatedTime:"Estimated Time",Filament:"Filament",FilamentBasedReminder:"Filament",FilamentBasedReminderDescription:"This reminder is based on the filament usage.",FilamentCalc:"Filament Calc",FilamentUsage:"Filament usage",FilamentUsed:"Filament Used",Filename:"Filename",Filesize:"Filesize",FirstLayerBedTemp:"First Layer Bed Temp.",FirstLayerExtTemp:"First Layer Ext. Temp.",FirstLayerHeight:"First Layer Height",HistoryFilamentUsage:"Filament",HistoryPrinttimeAVG:"Prints",Hours:"hours",InvalidNameEmpty:"Invalid name. Name must not be empty!",JobDetails:"Job Details",Jobs:"Jobs",LastModified:"Last Modified",LayerHeight:"Layer Height",LoadCompleteHistory:"Load complete history",LongestPrinttime:"Longest Print Time",Maintenance:"Maintenance",MaintenanceEntries:"Maintenance Entries",Meter:"meter",Name:"Name",NoReminder:"No reminder",Note:"Note",ObjectHeight:"Object Height",OneTime:"One-Time",Perform:"perform",Performed:"performed",PerformedAndReschedule:"performed and reschedule",PerformMaintenance:"Perform Maintenance",PrintDuration:"Print Time",PrintHistory:"Print History",PrintJobs:"Print Jobs",PrintTime:"Print Time",PrinttimeAvg:"Print Time - Ø",PrinttimeBasedReminder:"Print Time",PrinttimeBasedReminderDescription:"This reminder is based on the print time.",Reminder:"Reminder",Repeat:"Repeat",Reprint:"Reprint",Save:"save",Search:"search",SelectedFilamentUsed:"Selected Filament Used",SelectedJobs:"Selected Jobs",SelectedPrinttime:"Selected Print Time",Settings:"Settings",Slicer:"Slicer",SlicerVersion:"Slicer Version",StartTime:"Start Time",Statistics:"Statistics",Status:"Status",StatusValues:{cancelled:"Cancelled",completed:"Completed",error:"Error",in_progress:"In progress",interrupted:"Interrupted",klippy_disconnect:"Klippy disconnect",klippy_shutdown:"Klippy shutdown",Others:"Others",server_exit:"Server exit"},Table:"Table",Time:"Time",TitleExportHistory:"Export History",TotalDuration:"Total Time",TotalFilamentUsed:"Total Filament Used",TotalJobs:"Total Jobs",TotalPrinttime:"Total Print Time",TotalTime:"Total Time"},g={Cancel:"Cancel",ChangeCount:"Change count",Count:"Count",Empty:"Empty",InvalidCountEmpty:"Input must not be empty!",InvalidCountGreaterZero:"Input must be greater than 0!",JobQueue:"Job Queue",Pause:"Pause",RemoveFromQueue:"Remove from Queue",Start:"Start",StartPrint:"Start Job"},f={ConfigFilesPanel:{AllFiles:"All",Cancel:"Cancel",ConfigFiles:"Config Files",ConfigRootDirectoryDoesntExists:'No configuration directory found. Please check option "config_path" in the [file_manager] section of the Moonraker configuration.',Create:"Create",CreateDirectory:"Create Directory",CreateFile:"Create File",CurrentPath:"Current path",Delete:"Delete",DeleteDirectory:"Delete Directory",DeleteDirectoryQuestion:'Delete directory "{name}" and all its contents?',DeleteSelectedQuestion:"Delete {count} selected elements?",DeleteSingleFileQuestion:'Do you really want to delete the file "{name}"?',Download:"Download",Duplicate:"Duplicate",DuplicateFile:"Duplicate File",EditFile:"Edit file",Empty:"Empty",Files:"Files",Filesize:"Filesize",Free:"Free",FreeDisk:"Free disk",HiddenFiles:"Hidden files",HideBackupFiles:"Hide backup files",LastModified:"Last modified",Name:"Name",RefreshDirectory:"Refresh Directory",Rename:"Rename",RenameDirectory:"Rename Directory",RenameFile:"Rename File",Root:"Root",SetupCurrentList:"Setup current list",ShowFile:"Show file",Total:"Total",UploadFile:"Upload File",Uploading:"Uploading",Used:"Used"},EndstopPanel:{Endstop:"Endstop",EndstopInfo:"Press the sync-button on the right-bottom to load the current endstop status.",Endstops:"Endstops",open:"OPEN",TRIGGERED:"TRIGGERED"},LogfilesPanel:{Accept:"accept",Cancel:"cancel",Logfiles:"Log Files",Rollover:"Rollover Logs",RolloverDescription:"Please select which logs should be reset:",RolloverToastFailed:'Rollover log for "{name}": {message}',RolloverToastSuccessful:'Log for "{name}" was successfully reset.'},SystemPanel:{Constants:"Constants",Cpu:"CPU",HostDetails:"Host details",LastStats:"Last stats",Load:"Load",Memory:"MEM",NoMoreInfos:"No more Infos",SystemLoad:"System Loads",Values:{Awake:"Awake: {awake}",Bandwidth:"Bandwidth: {bandwidth}/s",Distro:"Distro: {name} {version_id}",Frequency:"Freq: {frequency}",Load:"Load: {load}",Memory:"Mem: {memory}",Os:"OS: {os}",Received:"Received: {received}",Temp:"Temp: {temp}°C",TempMax:"max: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Transmitted: {transmitted}",Version:"Version: {version}"}},UpdatePanel:{Abort:"Abort",AreYouSure:"Are you sure?",CheckForUpdates:"Check for updates",Close:"Close",CommitHistory:"Commit History",Commits:"Commits",CommitsAvailable:"no commits available | {count} commit available | {count} commits available",CommitsOnDate:"Commits on {date}",CommittedDaysAgo:"committed {days} days ago",CommittedHoursAgo:"committed {hours} hours ago",CommittedOnDate:"committed on {date}",CommittedYesterday:"committed yesterday",ConfigChanges:"Config Changes",Corrupt:"corrupt",CountPackagesCanBeUpgraded:"{count} packages can be upgraded",Detached:"detached",Dirty:"dirty",GenericUpdateQuestion:"Check the commit history (if available) and the GitHub page for this project to see if any manual adjustments are necessary for this update.",GitHubPage:"GitHub Page",HardRecovery:"Hard Recovery",InitUpdateManager:"The Update Manager has not been initialized yet. This is normal when you start the system for the first time. Please click on the refresh button to initialize all components.",Invalid:"invalid",IUnderstandTheRisks:"I understand the risks",KlipperUpdateQuestionConfig:"This update may also contain changes to config parameters that would need to be modified in the printer.cfg file, see the change log for details.",KlipperUpdateQuestionFirmware:"This will update the Klipper host software. Control boards running the Klipper firmware may need to be flashed with recompiled firmware before the machine can be put back into service.",LinkToGithub:"Link to GitHub",MoonrakerUpdateQuestion:"This will update the Moonraker API. Changes to the moonraker.conf file may be required to continue using the machine.",MoreCommitsInfo:"A maximum of 30 commits can be displayed here. To see all commits, please click on the following link:",OSPackages:"OS-Packages",SoftRecovery:"Soft Recovery",StartUpdate:"Start Update",System:"System",ThesePackagesCanBeUpgrade:"These system packages can be upgraded:",Unknown:"unknown",Update:"update",UpdateAll:"Update all components",UpdateManager:"Update Manager",UpdateWarning:"Update warning: {name}",Upgrade:"upgrade",UpgradeableSystemPackages:"Upgradeable System Packages",UpToDate:"up-to-date",WebClientUpdateQuestion:"In some cases updating the web client could have changes that may cause incompatibility. See the release notes for more information."}},S={Abort:"abort",Accept:"accept",Advanced:"Advanced",Headline:"Manual Probe"},C={ExtruderControlPanel:{Allowed:"Allowed",CleanNozzle:"Clean Nozzle",EstimatedExtrusion:"Extrusion:",Extrude:"Extrude",ExtruderControl:"Extruder Control",ExtruderTempTooLow:"Extruder temp. <",ExtrusionFactor:"Extrusion factor",ExtrusionFeedrate:"Extrusion Feedrate",FilamentLength:"Filament Length",FirmwareRetraction:"Firmware Retraction",FirmwareRetractionSettings:{RetractLength:"Retract Length",RetractSpeed:"Retract Speed",UnretractExtraLength:"Unretract Extra Length",UnretractSpeed:"Unretract Speed"},Headline:"Extruder",LoadFilament:"Load Filament",PressureAdvance:"Pressure Advance",PressureAdvanceSettings:{Advance:"Pressure Advance",Extruder:"Extruder",SmoothTime:"Smooth Time"},PurgeFilament:"Purge Filament",Requested:"Requested",Retract:"Retract",TooLargeExtrusion:"Extrusion too large!",Tools:"Tools",UnloadFilament:"Unload Filament"},FarmPrinterPanel:{ReconnectToPrinter:"Reconnect",SwitchToPrinter:"Switch to Printer",WebcamOff:"Off"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Please check if the Klipper service is running and klippy_uds_address is correctly configured in the moonraker.conf.",FirmwareRestart:"Firmware Restart",KlipperLog:"Klipper Log",MoonrakerCannotConnect:"Moonraker can't connect to Klipper!",MoonrakerLog:"Moonraker Log",PowerOn:"Power on",PrinterSwitchedOff:"Printer is powered off",PrinterSwitchedOffDescription:"The printer is currently powered off and Klipper cannot connect. To power on the printer, click the button below:",Restart:"Restart",ServiceReports:"{service} reports"},MachineSettingsPanel:{Headline:"Machine",MotionSettings:{Acceleration:"Acceleration",MaxAccelToDecel:"Max Accel. to Decel.",MinimumCruiseRatio:"Min. Cruise Ratio",SquareCornerVelocity:"Square Corner Velocity",Velocity:"Velocity"}},MacrosPanel:{Headline:"Macros",Send:"send"},MiniconsolePanel:{Autoscroll:"Autoscroll",Headline:"Console",HideTemperatures:"Hide temperatures",HideTimelapse:"Hide Timelapse",RawOutput:"RAW-Output (for debugging)",SendCode:"Send code...",SetupConsole:"Setup Console"},MinSettingsPanel:{IncludeMainsailCfg:"Make sure you include the mainsail.cfg in your printer.cfg file.",IsNotDefinedInConfig:"is not defined in config.",MissingConfiguration:"Missing configuration",MoreInformation:"more information"},MiscellaneousPanel:{Headline:"Miscellaneous",Light:{Blue:"blue",Green:"green",Red:"red",White:"white"},RunoutSensor:{Detected:"detected",Empty:"empty"}},PowerControlPanel:{Error:"Error",Off:"Off",On:"On",PowerControl:"Power Control"},SpoolmanPanel:{ActiveSpool:"Active Spool",Cancel:"Cancel",ChangeSpool:"Change Spool",DaysAgo:"{days} days ago",EjectSpool:"Eject spool",EjectSpoolQuestion:"Are you sure to eject the filament spool?",Filament:"Filament",FilamentTypeMismatch:"The material of the active spool ({spoolType}) does not match the material of the G-Code ({fileType}).",Headline:"Spoolman",LastUsed:"Last Used",Location:"Location",Material:"Material",Never:"Never",NoActiveSpool:"Filament tracking is inactive. To get started, please select a spool.",NoResults:"No spool found with the current search criteria.",NoSpool:"No spool",NoSpools:"No spools available",NoSpoolSelected:"No spool selected. Please select a spool or this print will not be tracked.",OpenSpoolManager:"open Spool Manager",Refresh:"refresh",Search:"Search",SelectSpool:"Select Spool",Today:"Today",TooLessFilament:"The current spool may not have enough filament for this print. ({spoolWeight}g of {fileWeight}g)",Weight:"Weight",Yesterday:"Yesterday"},StatusPanel:{CancelPrint:"Cancel print",ClearPrintStats:"Clear print stats",Difference:"Difference",EmptyGcodes:"No G-Code available.",EmptyHistory:"There is no job in the history.",EmptyJobqueue:"There is currently no file in the job queue.",Estimate:"Estimate",ETA:"ETA",ExcludeObject:{Cancel:"cancel",Excluded:"Excluded",ExcludeObject:"Exclude Object",ExcludeObjectHeadline:"Exclude Object",ExcludeObjectText:'Do you really want to exclude "{name}"?'},Filament:"Filament",File:"File",Flow:"Flow",Headline:"Status",JobqueueMoreFiles:"no more jobs | one more job | {count} more jobs",Layer:"Layer",Max:"max",ObjectHeight:"Object Height",PauseAtLayer:{Abort:"abort",Accept:"accept",AtLayer:"at Layer",Call:"Call",DescriptionPauseAtLayerActive:'This function is already active and will call "{call}" at layer {layer}. If you call the command again, these settings will be overwritten.',DescriptionPauseNextLayerActive:'This function is already active and will call "{call}" at the next layer.',Layer:"Layer",NextLayer:"next Layer",PauseAtLayer:"Pause at Layer",Type:"Type"},PausePrint:"Pause print",Print:"Print",PrintTime:"Print Time",ReprintJob:"Reprint job",Requested:"Requested",ResumePrint:"Resume print",Slicer:"Slicer",Speed:"Speed",Total:"Total",TotalTime:"Total Time",Unknown:"Unknown"},TemperaturePanel:{AutoscaleChart:"Autoscale Chart",Avg:"Avg",Cooldown:"Cooldown",Current:"Current",Dataset:{Power:"PWM-power",Speed:"PWM-speed",Target:"target temperature",Temperature:"current temperature"},Headline:"Temperatures",HideMcuHostSensors:"Hide Host/MCU Sensors",HideMonitors:"Hide Monitors",Max:"max",Min:"min",Name:"Name",Presets:"Presets",Settings:"Settings",SetupTemperatures:"Setup Temperatures",ShowChart:"Show Chart",ShowNameInChart:"Show {name} in chart",ShowNameInList:"Show {name} in list",State:"State",Target:"Target",TemperaturesInChart:"Temperature [°C]",TempTooHigh:"Temperature too high for {name}! (max: {max})",TempTooLow:"Temperature too low for {name}! (min: {min})",TurnHeaterOff:"Turn Heater Off"},ToolheadControlPanel:{Absolute:"absolute",ALL:"ALL",ControlButtons:"Control buttons",CoordinateFields:"Coordinate fields",Headline:"Toolhead",PleaseConfigureSteps:"Please configure steps",Position:"Position",PositionOutput:"Position output",QGL:"QGL",Relative:"relative",SettingsInterfaceControl:"Settings > Interface > Control",SpeedFactor:"Speed factor",ZOffset:"Z-Offset",ZTilt:"Z-Tilt"},WebcamPanel:{All:"All",ConnectingTo:"Connecting to {url}",Disconnected:"Disconnected",ErrorWhileConnecting:"Error while connecting to {url}",FPS:"FPS",Headline:"Webcam",NoWebcam:'No webcam available. Add a webcam under "Interface Settings" -> "Webcams".',UnknownWebcamService:"Unknown Webcam Service"},ZoffsetPanel:{Clear:"Clear",Headline:"Z-Offset",Later:"Later",Ok:"OK",Save:"Save",SaveConfig:"SAVE CONFIG",SaveInfoDescription:'The new Z-Offset has been calculated and registered. Click on "SAVE CONFIG" to save it to the printer.cfg and restart Klipper.',SaveInfoDescriptionPrint:'The new Z-Offset has been calculated and registered. After printing, click on "SAVE CONFIG" in the top bar to save it to the printer.cfg and restart Klipper.',SaveInfoHeadline:"Information"}},y={AreYouSure:"Are you sure?",No:"No",TurnDeviceOff:"Turn {device} off",TurnDeviceOn:"Turn {device} on",Yes:"Yes"},D={Console:"Console",Dashboard:"Dashboard","G-Code Files":"G-Code Files","G-Code Viewer":"G-Code Viewer",Heightmap:"Heightmap",History:"History",Machine:"Machine",Printers:"Printers",Timelapse:"Timelapse",Webcam:"Webcam"},b={Accept:"accept",Base:"Base",ErrorText:"Something went wrong during the probing process.",Headline:"Screws tilt adjust",Retry:"retry"},T={AddPrinter:"Add Printer",AddPrintersToJson:"Please add the Printers to the config.json.",CannotConnectTo:"Cannot connect to {host}.",ChangePrinter:"Change Printer",Connecting:"Connecting to {host}",ConnectionFailed:"Connection failed",EditPrinter:"Edit Printer",Hello:"Hello and welcome to the remote mode of Mainsail!",HostnameInvalid:"invalid Hostname/IP",HostnameIp:"Hostname/IP",HostnameRequired:"Hostname is required",Name:"Name",Path:"Path",Port:"Port",PortRequired:"Port is required",RememberToAdd:"Please remember to add '{cors}' in moonraker.conf within 'cors_domains'.",SelectPrinter:"Select Printer",TryAgain:"try again",UpdatePrinter:"Update Printer",YouCanFindMore:"You can find more details at"},P={Cancel:"Cancel",Close:"Close",ConsoleTab:{AddFilter:"add filter",Console:"Console",CreateHeadline:"Create filter",Direction:"Direction",DirectionShell:"Last entry at the bottom",DirectionTable:"Last entry on the top",EditHeadline:"Edit filter",EntryStyle:"Entry-Design",EntryStyleCompact:"compact",EntryStyleDefault:"default",Filters:"Filters",Height:"Height",HideTemperatures:"Hide temperatures",HideTimelapse:"Hide Timelapse",Name:"Name",Regex:"Regex",StoreButton:"Store filter",UpdateButton:"Update filter"},ControlTab:{Bars:"Bars",Circle:"Circle",Control:"Control",Cross:"Cross",EnableXYHoming:"Enable combined X & Y axes homing",EstimatedExtrusionInfo:"Show estimated extrusion info",EstimatedExtrusionInfoDescription:"Show / Hide info for estimated extrusions based on extrusion amount and feedrate",HideDuringPrint:"Hide axis controls during print",InvertXMovement:"Invert X axis movement direction",InvertYMovement:"Invert Y axis movement direction",InvertZMovement:"Invert Z axis movement direction",IsDefault:" (default)",MaximumValues:"Maximum values: {maximum}",MaximumValuesVisibility:"Maximum of {maximum} values is recommended for best visibility",MinimumValues:"Minimum values: {minimum}",MotorsOff:"Motors off{isDefault}",MoveDistancesEInMm:"Extrusion amount presets (in mm)",MoveDistancesInMm:"Move distance increments (in mm)",MoveDistancesXYInMm:"Move distance increments X & Y axes (in mm)",MoveDistancesZInMm:"Move distance increments Z axis (in mm)",OverwriteActionButton:"Overwrite action button",QuadGantryLevel:"Quad Gantry Level{isDefault}",SpeedEInMms:"Extrusion speed presets (in mm/s)",SpeedXY:"Movement speed X & Y axes",SpeedZ:"Movement speed Z axis",Style:"Style",ValueGreaterThan:"Value has to be greater than {value}",ZOffsetIncrements:"Z-Offset increments (in mm)",ZOffsetSaveOption:"Z-Offset save option",ZOffsetSaveOptionDescription:"Change the option to save the Z-Offset",ZTiltAdjust:"Z-Tilt Adjust{isDefault}"},DashboardTab:{Dashboard:"Dashboard",Desktop:"Desktop",Mobile:"Mobile",ResetLayout:"Reset Layout",Tablet:"Tablet",Widescreen:"Widescreen"},Edit:"Edit",EditorTab:{ConfirmUnsavedChanges:"Prompt to save or discard unsaved changes",ConfirmUnsavedChangesDescription:"If enabled, the editor requires a confirmation to either save or discard the changes made. If disabled, changes are silently discarded.",Editor:"Editor",KlipperRestartMethod:"Klipper restart method",KlipperRestartMethodDescription:"Select which restart method will be used on 'Save & Restart' when editing Klipper config files.",Spaces:"Spaces: {count}",TabSize:"TAB Size",TabSizeDescription:"Adjusts how many spaces should be indented for TAB",UseEscToClose:"Use ESC to close editor",UseEscToCloseDescription:"Allows the ESC key to close the editor"},GCodeViewerTab:{BackgroundColor:"Background Color",ExtruderColor:"Extruder Colors",GCodeViewer:"G-Code Viewer",GridColor:"Grid Color",MaxFeed:"Max Feed Rate",MinFeed:"Min Feed Rate",ProgressColor:"Progress Color",ShowAxes:"Show Axes"},GeneralTab:{"12hours":"12-hours ({time})","24hours":"24-hours ({time})",Backup:"Backup",BackupDialog:"Please select all the sections you want to create a backup:",CalcEstimateTime:"Estimate time calculation",CalcEstimateTimeDescription:"If multiple are selected, an average will be calculated",CalcEtaTime:"ETA calculation",CalcEtaTimeDescription:"If multiple are selected, an average will be calculated",CalcPrintProgress:"Print progress calculation",CalcPrintProgressDescription:"Method for calculating the print progress.",CalcPrintProgressItems:{Filament:"Filament",FileAbsolute:"File position (absolute)",FileRelative:"File position (relative)",Slicer:"Slicer (M73)"},CannotReadJson:"Cannot read/parse backup file.",DateFormat:"Date Format",DbConsoleHistory:"Console History",DbHistoryJobs:"History Jobs",DbHistoryTotals:"History Totals",DbMaintenance:"Maintenance",DbNavigation:"Navigation",DbTimelapseSettings:"Timelapse Settings",DbView:"View Settings",EstimateValues:{Filament:"Filament",File:"File",Slicer:"Slicer"},Everything:"Everything",FactoryDialog:"Please select all the sections you want to reset:",FactoryReset:"Factory reset",General:"General",Language:"Language",MainsailSettingsMoonrakerDb:"Mainsail Settings in Moonraker DB",PrinterName:"Printer Name",Reset:"reset",Restore:"Restore",RestoreDialog:"Please select all the sections you want to restore:",TimeFormat:"Time Format"},HeightmapTab:{ColorSchemes:"Color Schemes",DefaultOrientation:"Default Orientation",DefaultOrientationDescription:"Select the default orientation for the bed mesh visualization.",Heightmap:"Heightmap",IsDefault:"(Default)",Orientations:{Front:"Front",LeftFront:"Left Front",RightFront:"Right Front",Top:"Top"},Schemes:{GrayScale:"Grayscale",Hot:"Hot",Hsv:"Hsv",Portland:"Portland",Spring:"Spring"}},InterfaceSettings:"Interface Settings",MacrosTab:{Add:"add",AddGroup:"add Group",AvailableMacros:"Available Macros",ChangeMacroColor:"Change the color of the button.",Color:"Color",CountMacros:"no Macros added | {count} Macro | {count} Macros",Custom:"custom",CustomColor:"Custom Color",DeletedMacro:"Deleted macro",DeleteMacroFromGroup:"Delete macro from group.",EditGroup:"Edit Group",Error:"error",Expert:"Expert",General:"General",Group:"Group",GroupMacros:"Group Macros",Macrogroups:"Groups",Macros:"Macros",Management:"Management",Name:"Name",NoAvailableMacros:"No available macros.",NoGroups:"No group found...",NOMacros:"No macros found...",NoMacrosInGroup:"No macros in this group.",Primary:"primary",Search:"Search",Secondary:"secondary",ShowInStatePaused:"Show/hide if printer is paused.",ShowInStatePrinting:"Show/hide if printer is printing.",ShowInStateStandby:"Show/hide if printer is standby.",Simple:"Simple",Status:"Status",Success:"success",UnknownGroup:"Unknown Group",Warning:"warning"},MiscellaneousTab:{AddGroup:"add group",AddPreset:"add preset",Color:"Color",CreateGroup:"Create group",CreatePreset:"Create preset",End:"End",EndDescription:"Last LED of this group.",Groups:"Groups",GroupSubTitle:"Start: {start}, End: {end}",LightGroups:"{name} - Groups",LightPresets:"{name} - Presets",Miscellaneous:"Miscellaneous",Name:"Name",NoDevicesFound:"No devices found",NoGroupFound:"No group found",NoPresetFound:"No preset found",Presets:"Presets",Start:"Start",StartDescription:"First LED of this group.",UnableToLoadLight:"Unable to load light",UnableToLoadPreset:"Unable to load preset"},NavigationTab:{Navigation:"Navigation"},PresetsTab:{AddPreset:"add preset",Cooldown:"Cooldown",CreateHeadline:"Create Preset",CustomGCode:"Custom G-Code",EditCooldown:"Edit Cooldown",EditHeadline:"Edit Preset",ErrorInvalidValue:"Invalid value",ErrorNameNotUnique:"Name already exists",ErrorNameRequired:"Name required",Name:"Name",PreheatPresets:"Presets",PresetInfo:"Please set at least a target temperature or a custom G-Code.",PresetNamePlaceholder:"Preset name (required)",StoreButton:"Store preset",UpdateButton:"Update preset",UpdateCooldown:"Update Cooldown"},RemotePrintersTab:{AddPrinter:"Add Printer",EditPrinter:"Edit Printer",Hostname:"Hostname",Name:"Name",NameDescription:"This name will not be displayed in the GUI and will only used for redirects.",Path:"Path",Port:"Port",RemotePrinters:"Printers",UpdatePrinter:"Update Printer",UseConfigJson:"InstanceDB = JSON detected. Please use the config.json to modify the printers list."},Store:"store",TimelapseTab:{Autorender:"Autorender",AutorenderDescription:"If enabled, the timelapse video will automatically render at the end of the print",Camera:"Camera",CameraDescriptionWithSnapshotUrl:"Select which camera (with snapshot URL) should be used",CameraWarningAlreadySet:"This value is already set in the Moonraker configuration file.",CameraWarningAlreadySetSmall:"snapshoturl in the [timelapse] section",ConstantRateFactor:"Constant Rate Factor",ConstantRateFactorDescription:"This configure quality vs file size of the rendered video. The range of the CRF scale is 0–51, where 0 is lossless, 23 is the default and 51 is worst quality possible. A lower value generally leads to higher quality and a subjectively sane range is 17–28. Consider 17 or 18 to be visually lossless.",duplicatelastframe:"Duplicate Last Frame",duplicatelastframeDescription:"Duplicates the last frame on the end of the video",Enabled:"Enabled",EnabledDescription:"If disabled, G-Code macros are ignored and auto-render is skipped.",Extraoutputparams:"Extra Output Params",ExtraoutputparamsDescription:"Defines extra output parameters to FFMPEG. Note: Specifying anything here will disable the rotation setting",FwRetract:"FW Retract",FwRetractDescription:"Use firmware retraction in the timelapse macro",GcodeVerbose:"Verbose G-Code",GcodeVerboseDescription:"If enabled, G-Code macros will write information to the console",General:"General",HyperlapseCycle:"Hyperlapse Cycle Time",HyperlapseCycleDescription:"A snapshot will be taken any X seconds",Mode:"Mode",ModeDescription:"Select between Layer macro and Hyperlapse (time-based) mode",NoWebcamFound:"No Webcam available",OutputFramerate:"Output Framerate",OutputFramerateDescription:"Defines the framerate of the video. Note: this will be ignored if variable_fps is enabled",Parkhead:"Park Toolhead",ParkheadDescription:"If enabled, the toolhead will be parked before taking a frame.",Parkpos:"Park position",ParkposDescription:"Select the parking position",ParkTime:"Park Time",ParkTimeDescription:"Add additional idle time when parking.",Pixelformat:"Pixel format",PixelformatDescription:"Defines the pixel format of the output video",PosDZ:"Position Z",PosDZDescription:"Park position Z (relative)",PosX:"Position X",PosXDescription:"Park position X (absolute)",PosY:"Position Y",PosYDescription:"Park position Y (absolute)",PreviewImage:"Preview Image",PreviewImageDescription:"Save a preview image with the same name as the video",RenderingOptions:"Rendering Options",RetractDistance:"Retract Distance",RetractDistanceDescription:"The length of filament that the extruder retracts.",RetractSpeed:"Retract Speed",RetractSpeedDescription:"Speed at which the extruder retracts the filament.",RulesBetweenMinMax:"Value must be between {min} and {max}!",RulesMin:"Value must be minimum {min}!",RulesPositive:"Value must be positive!",RulesRequired:"Value is required!",RulesZeroAndPositive:"Value must be 0 or greater!",SaveFrames:"Save Frames",SaveFramesDescription:"Save the frames to a zip-file for external rendering",SelectWebcam:"Select webcam...",StreamDelayCompensation:"Stream Delay Compensation",StreamDelayCompensationDescription:"Delay frame capture",Targetlength:"Target Length",TargetlengthDescription:"The target length when Variable FPS is enabled",TimeFormatCode:"Time Format Code",TimeFormatCodeDescription:"This defines how the timestamp in the output file should be encoded",Timelapse:"Timelapse",TravelSpeed:"Travel Speed",TravelSpeedDescription:"Travel speed while moving to the parking position and resuming",UnretractDistance:"Unretract Distance",UnretractDistanceDescription:"The length of filament that the extruder unretracts after a retraction.",UnretractSpeed:"Unretract Speed",UnretractSpeedDescription:"Speed at which the extruder unretracts the filament after a retraction.",VariableFps:"Variable FPS",VariableFpsDescription:"If enabled, the framerate of the output video will be calculated based on target length",VariableFpsMax:"Variable FPS max",VariableFpsMaxDescription:"Maximum variable FPS value",VariableFpsMin:"Variable FPS min",VariableFpsMinDescription:"Minimum variable FPS value"},UiSettingsTab:{BedScrewsDialog:"Bed Screws Dialog",BedScrewsDialogDescription:"Display helper dialog for BED_SCREWS_ADJUST.",BigThumbnailBackground:"Large thumbnail background color",BoolBigThumbnail:"Large thumbnail",BoolBigThumbnailDescription:"Display a large thumbnail in the status panel during a print.",BoolHideUploadAndPrintButton:"Hide Upload and Print Button",BoolHideUploadAndPrintButtonDescription:'Show or hide the "Upload and Print" button in the top bar.',ConfirmOnCancelJob:"Require confirm on Cancel Job",ConfirmOnCancelJobDescription:"Show a confirmation dialog on Cancel Job",ConfirmOnCoolDown:"Require confirm on CoolDown",ConfirmOnCoolDownDescription:"Show a confirmation dialog on CoolDown",ConfirmOnEmergencyStop:"Require confirm on Emergency Stop",ConfirmOnEmergencyStopDescription:"Show a confirmation dialog on Emergency Stop",ConfirmOnPowerDeviceChange:"Require confirm on Device Power changes",ConfirmOnPowerDeviceChangeDescription:"Show a confirmation dialog on Device Power changes",DashboardFilesFilter:"Dashboard Files Filter",DashboardFilesFilterCompleted:"Completed",DashboardFilesFilterDescription:"Filter the files in the Dashbord Status Panel by their last status.",DashboardFilesFilterFailed:"Failed",DashboardFilesFilterNew:"New",DashboardFilesLimit:"Dashboard Files Limit",DashboardFilesLimitDescription:"Select the maximum number of files to display on the dashboard Status Panel. (0 hides the files tab)",DashboardFilesLimitLabel:"{count} files",DashboardHistoryLimit:"Dashboard History Limit",DashboardHistoryLimitDescription:"Select the maximum number of jobs to display on the dashboard in the Status Panel. (0 hides the history tab)",DashboardHistoryLimitLabel:"{count} jobs",DefaultNavigationState:"Navigation default state",DefaultNavigationStateAlwaysClosed:"always closed",DefaultNavigationStateAlwaysOpen:"always open",DefaultNavigationStateDescription:"Which state should have the navigation per default.",DefaultNavigationStateLastState:"last state",DisableFanAnimation:"Disable fan animation",DisableFanAnimationDescription:"This can reduce some load in your Browser.",DisplayCANCEL_PRINT:"Display CANCEL_PRINT",DisplayCANCEL_PRINTDescription:"Shows the CANCEL_PRINT button permanently - no second layer confirmation needed.",GcodeThumbnails:"G-Code thumbnails",GcodeThumbnailsDescription:"Click on the button to get to the instructions.",Guide:"Guide",HideOtherInstances:"Hide other instances",HideOtherInstancesDescription:"Hide other instances of Klipper & Moonraker in the Service Menu.",HideSaveConfigButtonForBedMesh:"Hide SAVE_CONFIG button for bed_mesh changes",HideSaveConfigButtonForBedMeshDescription:"Hide SAVE_CONFIG, if only bed_mesh changes are pending to be saved in Klipper.",HideUpdateWarnings:"Hide Update Warnings",HideUpdateWarningsDescription:"This option will hide all update warnings in the update manager.",LockSliders:"Lock sliders on touchscreen devices",LockSlidersDelay:"Slider lock delay",LockSlidersDelayDescription:"Sliders will lock after a given delay. If set to 0 or left blank, sliders will only lock on page change/reload.",LockSlidersDescription:"Sliders on touchscreens need to be unlocked before changes are allowed.",Logo:"Logo",ManualProbeDialog:"Manual Probe Helper Dialog",ManualProbeDialogDescription:"Display helper dialog for PROBE_CALIBRATE or Z_ENDSTOP_CALIBRATE.",Mode:"Mode",ModeDescription:"Change the overall look and feel of the application.",NavigationStyle:"Navigation style",NavigationStyleDescription:"Change navigation appearance",NavigationStyleIconsAndText:"Icons + Text",NavigationStyleIconsOnly:"Icons only",PowerDeviceName:"Printer power device",PowerDeviceNameDescription:"Select which Moonraker power device should be used to power on the printer.",Primary:"Primary",PrintstatusThumbnailZoom:"Large thumbnail zoom",PrintstatusThumbnailZoomDescription:"This will deactivate the zoom effect of the thumbnail in the status panel.",ProgressAsFavicon:"Show progress as favicon",ProgressAsFaviconDescription:"Change the Mainsail logo favicon to a progress circle.",ScrewsTiltAdjustDialog:"Screws Tilt Adjust Dialog",ScrewsTiltAdjustDialogDescription:"Display helper dialog for SCREWS_TILT_CALCULATE.",TempchartHeight:"Height Temperature Chart",TempchartHeightDescription:"Modify the height of the temperature chart on the Dashboard.",Theme:"Theme",ThemeDark:"Dark",ThemeDescription:"Customizes the branding of the interface.",ThemeLight:"Light",UiSettings:"UI-Settings"},Update:"update",WebcamsTab:{AddWebcam:"add webcam",Color:"Color",CreateWebcam:"Create Webcam",EditCrowsnestConf:"Edit crowsnest.conf",EditWebcam:"Edit Webcam",Enable:"Enable",EnableAudio:"Enable audio",FlipWebcam:"Flip webcam image:",HideFps:"Hide FPS counter",Hlsstream:"HLS Stream",Horizontally:"horizontally",IconBed:"Bed",IconCam:"Cam",IconDoor:"Door",IconFilament:"Filament",IconHot:"Hot",IconMcu:"MCU",IconNozzle:"Nozzle",IconPrinter:"Printer",Ipstream:"IP Camera",JMuxerStream:"Raw h264 stream (jmuxer)",Mjpegstreamer:"MJPEG-Streamer",MjpegstreamerAdaptive:"Adaptive MJPEG-Streamer (experimental)",Name:"Name",NameAlreadyExists:"Name already exists",NozzleCrosshair:"Nozzle Crosshair",Required:"required",Rotate:"Rotate",SaveWebcam:"Save Webcam",Service:"Service",Size:"Size",TargetFPS:"Target FPS",UpdateWebcam:"Update Webcam",UrlSnapshot:"URL Snapshot",UrlStream:"URL Stream",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"vertically",Webcams:"Webcams",WebrtcCameraStreamer:"WebRTC (camera-streamer)",WebrtcGo2rtc:"WebRTC (go2rtc)",WebrtcJanus:"WebRTC (janus-gateway)",WebrtcMediaMTX:"WebRTC (MediaMTX)"}},v={AllFiles:"All",Autorender:"Auto-render",Cancel:"Cancel",Create:"Create",CreateNewDirectory:"create directory",CurrentPath:"Current Path",Delete:"Delete",DeleteDirectory:"Delete Directory",DeleteDirectoryQuestion:'Do you really want to delete the "{name}" directory with all its contents?',DeleteSelectedQuestion:"Do you really want to delete {count} selected files?",DeleteSingleFileQuestion:'Do you really want to delete the file "{name}"?',Download:"Download",DuplicateLastframe:"Duplicate last frame",Empty:"No finished timelapse found.",Enabled:"Enabled",EstimatedLength:"Estimated length",Files:"Files",Filesize:"Filesize",Fixed:"fixed",Framerate:"Framerate",Frames:"Frames",Free:"Free",FreeDisk:"Free disk",LastModified:"Last modified",MaxFramerate:"Max. framerate",MinFramerate:"Min. framerate",Name:"Name",NewDirectory:"New Directory",NoActiveTimelapse:"No records available.",Preview:"Preview",RefreshCurrentDirectory:"refresh directory",Rename:"Rename",RenameDirectory:"Rename Directory",RenameFile:"Rename File",Render:"render",RenderSettings:"Render Settings",SaveFrames:"Save frames",Search:"search",StartRender:"start render",Status:"Status",TargetFps:"Target FPS",Targetlength:"Target length",TimelapseFiles:"Timelapse Files",TimelapseRendering:"Timelapse rendering",TimelapseRenderingSuccessful:"Timelapse rendering successful",Total:"Total",Type:"Type",Used:"Used",Variable:"Variable",Video:"Video"},w="English",F={App:e,BedScrews:t,CancelJobDialog:a,ConnectionDialog:o,Console:i,CoolDownDialog:r,DevicesDialog:n,Dialogs:s,Editor:l,EmergencyStopDialog:d,Files:c,FullscreenUpload:m,GCodeViewer:p,Heightmap:u,History:h,JobQueue:g,Machine:f,ManualProbe:S,Panels:C,PowerDeviceChangeDialog:y,Router:D,ScrewsTiltAdjust:b,SelectPrinterDialog:T,Settings:P,Timelapse:v,title:w};export{e as App,t as BedScrews,a as CancelJobDialog,o as ConnectionDialog,i as Console,r as CoolDownDialog,n as DevicesDialog,s as Dialogs,l as Editor,d as EmergencyStopDialog,c as Files,m as FullscreenUpload,p as GCodeViewer,u as Heightmap,h as History,g as JobQueue,f as Machine,S as ManualProbe,C as Panels,y as PowerDeviceChangeDialog,D as Router,b as ScrewsTiltAdjust,T as SelectPrinterDialog,P as Settings,v as Timelapse,F as default,w as title}; diff --git a/assets/envTextureLoader-0a1UyQXk.js b/assets/envTextureLoader-0a1UyQXk.js new file mode 100644 index 0000000..4f04ac3 --- /dev/null +++ b/assets/envTextureLoader-0a1UyQXk.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/rgbdDecode.fragment-BKWiTJSM.js","assets/Viewer-DVCEMRp5.js","assets/vuetify-Ce4WN_Dg.js","assets/overlayscrollbars-CiKU261J.js","assets/overlayscrollbars-BJn_P54_.css","assets/vuetify-BSwS9o2d.css","assets/index-Bku7SJna.js","assets/echarts-DzoUeqWp.js","assets/index-DdkGOISd.css","assets/codemirror-ZSHHXwGs.js","assets/Viewer-oTo4b16s.css","assets/rgbdDecode.fragment-DQaMBCWE.js","assets/helperFunctions-CmftqOHQ.js"])))=>i.map(i=>d[i]); +import{o as C}from"./index-Bku7SJna.js";import{B as P,a as S,d as D,V as m,f as B,h as U,P as z,I as G}from"./Viewer-DVCEMRp5.js";import{C as V}from"./cubemapToSphericalPolynomial-DI79UW0r.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./echarts-DzoUeqWp.js";import"./codemirror-ZSHHXwGs.js";P.prototype.forceSphericalPolynomialsRecompute=function(){this._texture&&(this._texture._sphericalPolynomial=null,this._texture._sphericalPolynomialPromise=null,this._texture._sphericalPolynomialComputed=!1)};Object.defineProperty(P.prototype,"sphericalPolynomial",{get:function(){if(this._texture){if(this._texture._sphericalPolynomial||this._texture._sphericalPolynomialComputed)return this._texture._sphericalPolynomial;if(this._texture.isReady)return this._texture._sphericalPolynomialPromise||(this._texture._sphericalPolynomialPromise=V.ConvertCubeMapTextureToSphericalPolynomial(this),this._texture._sphericalPolynomialPromise===null?this._texture._sphericalPolynomialComputed=!0:this._texture._sphericalPolynomialPromise.then(e=>{this._texture._sphericalPolynomial=e,this._texture._sphericalPolynomialComputed=!0})),null}return null},set:function(e){this._texture&&(this._texture._sphericalPolynomial=e)},enumerable:!0,configurable:!0});const O="image/png",I=2,M=[134,22,135,150,246,214,150,54];function k(e){const a=new DataView(e.buffer,e.byteOffset,e.byteLength);let t=0;for(let l=0;lI)throw new Error('Unsupported babylon environment map version "'.concat(e.version,'". Latest supported version is "').concat(I,'".'));return e.version===2||(e={...e,version:2,imageType:O}),e}function E(e,a){a=A(a);const t=a.specular;let r=Math.log2(a.width);if(r=Math.round(r)+1,t.mipmaps.length!==6*r)throw new Error('Unsupported specular mipmaps number "'.concat(t.mipmaps.length,'"'));const n=new Array(r);for(let o=0;o{if(t){const i=a.createTexture(null,!0,!0,null,1,null,u=>{v(u)},e);r==null||r.onEffectCreatedObservable.addOnce(u=>{u.executeWhenCompiled(()=>{r.externalTextureSamplerBinding=!0,r.onApply=p=>{p._bindTexture("textureSampler",i),p.setFloat2("scale",1,a._features.needsInvertingBitmap&&e instanceof ImageBitmap?-1:1)},a.scenes.length&&(a.scenes[0].postProcessManager.directRender([r],_,!0,o,l),a.restoreDefaultFramebuffer(),i.dispose(),URL.revokeObjectURL(n),x())})})}else{if(a._uploadImageToTexture(y,e,o,l),s){const i=h[l];i&&a._uploadImageToTexture(i._texture,e,o,0)}x()}})}async function N(e,a,t=O){if(!B.IsExponentOfTwo(e.width))throw new Error("Texture size must be a power of two");const r=U(e.width)+1,n=e.getEngine();let o=!1,l=!1,s=null,h=null,_=null;const y=n.getCaps();e.format=5,e.type=0,e.generateMipMaps=!0,e._cachedAnisotropicFilteringLevel=null,n.updateTextureSamplingMode(3,e),y.textureLOD?n._features.supportRenderAndCopyToLodForFloatTextures?y.textureHalfFloatRender&&y.textureHalfFloatLinearFiltering?(o=!0,e.type=2):y.textureFloatRender&&y.textureFloatLinearFiltering&&(o=!0,e.type=1):o=!1:(o=!1,l=!0,_={});let x=0;if(o)n.isWebGPU?(x=1,await C(()=>import("./rgbdDecode.fragment-BKWiTJSM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))):await C(()=>import("./rgbdDecode.fragment-DQaMBCWE.js"),__vite__mapDeps([11,1,2,3,4,5,6,7,8,9,10,12])),s=new z("rgbdDecode","rgbdDecode",null,null,1,null,3,n,!1,void 0,e.type,void 0,null,!1,void 0,x),e._isRGBD=!1,e.invertY=!1,h=n.createRenderTargetCubeTexture(e.width,{generateDepthBuffer:!1,generateMipMaps:!0,generateStencilBuffer:!1,samplingMode:3,type:e.type,format:5});else if(e._isRGBD=!0,e.invertY=!0,l){const u=e._lodGenerationScale,p=e._lodGenerationOffset;for(let c=0;c<3;c++){const g=1-c/2,f=p,L=(r-1)*u+p,R=f+(L-f)*g,w=Math.round(Math.min(Math.max(R,0),L)),b=new G(n,2);b.isCube=!0,b.invertY=!0,b.generateMipMaps=!1,n.updateTextureSamplingMode(2,b);const T=new P(null);switch(T._isCube=!0,T._texture=b,_[w]=T,c){case 0:e._lodTextureLow=T;break;case 1:e._lodTextureMid=T;break;case 2:e._lodTextureHigh=T;break}}}const v=[];for(let i=0;iF(f,n,o,s,d,u,i,l,_,h,e));else{const f=new Image;f.src=d,g=new Promise((L,R)=>{f.onload=()=>{F(f,n,o,s,d,u,i,l,_,h,e).then(()=>L()).catch(w=>{R(w)})},f.onerror=w=>{R(w)}})}v.push(g)}if(a.length{h&&(n._releaseTexture(e),h._swapAndDie(e)),s&&s.dispose(),l&&(e._lodTextureHigh&&e._lodTextureHigh._texture&&(e._lodTextureHigh._texture.isReady=!0),e._lodTextureMid&&e._lodTextureMid._texture&&(e._lodTextureMid._texture.isReady=!0),e._lodTextureLow&&e._lodTextureLow._texture&&(e._lodTextureLow._texture.isReady=!0))})}function Y(e,a){a=A(a);const t=a.irradiance;if(!t)return;const r=new D;m.FromArrayToRef(t.x,0,r.x),m.FromArrayToRef(t.y,0,r.y),m.FromArrayToRef(t.z,0,r.z),m.FromArrayToRef(t.xx,0,r.xx),m.FromArrayToRef(t.yy,0,r.yy),m.FromArrayToRef(t.zz,0,r.zz),m.FromArrayToRef(t.yz,0,r.yz),m.FromArrayToRef(t.zx,0,r.zx),m.FromArrayToRef(t.xy,0,r.xy),e._sphericalPolynomial=r}class X{constructor(){this.supportCascades=!1}loadCubeData(a,t,r,n,o){if(Array.isArray(a))return;const l=k(a);if(l){t.width=l.width,t.height=l.width;try{Y(t,l),H(t,a,l).then(()=>{t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),n&&n()},s=>{o==null||o("Can not upload environment levels",s)})}catch(s){o==null||o("Can not upload environment file",s)}}else o&&o("Can not parse the environment file",null)}loadData(){throw".env not supported in 2d."}}export{X as _ENVTextureLoader}; diff --git a/assets/es-DJtSPj3U.js b/assets/es-DJtSPj3U.js new file mode 100644 index 0000000..58e49d3 --- /dev/null +++ b/assets/es-DJtSPj3U.js @@ -0,0 +1 @@ +const e={Notifications:{BrowserWarnings:{Description:"{name} está desactualizado y no es totalmente compatible. La versión actual es {version}, pero Mainsail requiere la versión {minVersion} o superior.",Headline:"Navegador obsoleto"},DependencyDescription:"La versión actual de {name} no es compatible con todas las funciones de Mainsail. Actualice {name} a al menos {neededVersion}.",DependencyName:"Dependencia: {name}",DismissAll:"Descartar todo",KlipperWarnings:{DeprecatedOption:"La opción '{option}' en la sección '{section}' está discontinuada y será removida en la próxima versión.",DeprecatedOptionHeadline:"Opción de Klipper en desuso",DeprecatedValue:"El valor '{value}' en la opción '{option}' en la sección '{section}' está discontinuado y será removido en la próxima versión.",DeprecatedValueHeadline:"Valor de Klipper en desuso",KlipperRuntimeWarning:"Elimina la advertencia de tiempo de ejecución",KlipperWarning:"Advertencia de Klipper"},MaintenanceReminder:"Recordatorio de mantenimiento",MaintenanceReminderText:'Se debe realizar el mantenimiento a "{name}".',MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"Se detectó un error al cargar el componente moonraker '{componente}'. Verifique el archivo de registro y solucione el problema.",MoonrakerFailedInitComponentDescription:"Se detectó un error durante la inicialización del componente moonraker '{component}'. Verifique el archivo de registro y solucione el problema.",MoonrakerInitComponent:"Inicializar Moonraker: {component}",MoonrakerWarning:"Advertencia de Moonraker",UnparsedConfigOption:"Opción de configuración no analizada '{option}: {value}' detectada en la sección [{section}]. Esta puede ser una opción que ya no está disponible o puede ser el resultado de un módulo que no se pudo cargar. En el futuro, esto dará un error de inicio.",UnparsedConfigSection:"Sección de configuración no analizada [{section}] detectada. Esto puede ser por un componente que no se pudo cargar. En el futuro, esto dará un error de inicio."},Never:"nunca",NextReboot:"próximo reinicio",NoNotification:"No hay notificación disponible",Notifications:"Notificaciones",OneDayShort:"1D",OneHourShort:"1H",OneWeekShort:"1Sem.",Remind:"Recordar:",ShowDetails:"Mostrar detalles",TmcOtFlag:"Error de controlador de paso: indicador OT fijado",TmcOtFlagText:"El controlador del motor de paso '{name}' ha disparado la bandera OT y dejó de funcionar. Esto puede ser causado por una corriente demasiado alta. Por favor, compruebe la configuración de controlador y enfriamiento.",TmcOtpwFlag:"Advertencia de controlador de paso: indicador OTPW fijado",TmcOtpwFlagText:"El controlador del motor de paso '{name}' ha activado la bandera OTPW y puede dejar de funcionar si se pone más caliente. Esto es una indicación de una condición de temperatura superior. Esto puede ser causado por una corriente demasiado alta. Por favor, compruebe la configuración de controlador y enfriamiento."},NumberInput:{GreaterOrEqualError:"¡Debe ser mayor o igual a {min}!",MustBeBetweenError:"¡Debe estar entre {min} y {max}!",NoEmptyAllowedError:"¡No puede estar vacío!"},Printers:"Impresoras",TextfieldWithCopy:{Copied:"Copiado"},TheServiceWorker:{DescriptionNeedUpdate:"El caché local necesita ser actualizado. Por favor, haga click en el botón de abajo para actualizar el caché.",TitleNeedUpdate:"PWA necesita actualizarse",Update:"actualizar"},ThrottledStates:{DescriptionCurrentlyThrottled:"Los núcleos rPi ARM tienen la frecuencia reducida.",DescriptionFrequencyCapped:"La frecuencia máxima de los núcleos rPi ARM está actualmente limitada a 1.2 GHz.",DescriptionPreviouslyFrequencyCapped:"La frecuencia máxima de los núcleos rPi ARM fue limitada al menos una vez a 1.2 GHz desde el último encendido.",DescriptionPreviouslyTemperatureLimited:"rPi uC (3A+/3B+ only). La temperatura estuvo por lo menos una vez por encima del límite (default 60C) desde el último encendido.",DescriptionPreviouslyThrottled:"La frecuencia de los núcleos rPI ARM se redujo al menos una vez desde el último encendido.",DescriptionPreviouslyUnderVolted:"El voltaje de entrada de rPi se redujo a menos de 4.65V por lo menos una vez desde el último encendido.",DescriptionTemperatureLimitActive:"rPi uC (3A+/3B+ solamente). La temperatura está actualmente por encima del límite (default 60C).",DescriptionUnderVoltageDetected:"El voltaje de alimentación del rPi está actualmente por debajo de los 4.65V",TitleCurrentlyThrottled:"Actualmente limitado",TitleFrequencyCapped:"Limitado por frecuencia",TitlePreviouslyFrequencyCapped:"Limitado anteriormente por frecuencia",TitlePreviouslyTemperatureLimited:"Limitado anteriormente por temperatura",TitlePreviouslyThrottled:"Anteriormente limitado",TitlePreviouslyUnderVolted:"Anteriormente bajo voltaje",TitleTemperatureLimitActive:"Límite de temperatura activo",TitleUnderVoltageDetected:"Bajo voltaje detectado"},Titles:{Complete:"Completado - {filename}",Error:"ERROR",Pause:"Pausar impresión",PrinterOff:"Impresora Apagada",Printing:"{percent}% impreso - {filename}",PrintingETA:"{percent}% impreso - ETA: {eta} - {filename}"},TopBar:{CannotUploadTheFile:"¡No se pudo subir el Archivo!",EmergencyStop:"Parada de emergencia",SAVE_CONFIG:"GUARDAR CONFIG.",Uploading:"Cargando",UploadOfFileSuccessful:"¡{file} cargado con éxito!",UploadPrint:"Cargar e imprimir"},TopCornerMenu:{Cancel:"Cancelar",ConfirmationDialog:{Description:{HostReboot:"¡Reiniciar el Host causará que la impresión en curso falle!",HostShutdown:"¡Apagar el Host causará que la impresión en curso falle!",KlipperFirmwareRestart:"¡Reiniciar el firmware de Klipper causará que la impresión en curso falle!",KlipperRestart:"¡Reiniciar Klipper causará que la impresión en curso falle!",KlipperStop:"¡Detener Klipper causará que la impresión en curso falle!",ServiceRestart:"¡Reiniciar este servicio puede causar que la impresión en curso falle!",ServiceStart:"¡Iniciar este servicio puede causar que la impresión en curso falle!",ServiceStop:"¡Detener este servicio puede causar que la impresión en curso falle!"},Title:{HostReboot:"Reiniciar Host",HostShutdown:"Apagar Host",KlipperFirmwareRestart:"Reiniciar firmware de Klipper",KlipperRestart:"Reiniciar Klipper",ServiceRestart:"Reiniciar servicio",ServiceStart:"Iniciar servicio",ServiceStop:"Detener servicio"}},HostControl:"Control del Host",KlipperControl:"Control de Klipper",KlipperFirmwareRestart:"Reiniciar firmware",KlipperRestart:"Reiniciar",PowerDevices:"Encender dispositivos",Reboot:"Reiniciar",Restart:"Reiniciar",ServiceControl:"Control de servicios",Shutdown:"Apagar",Start:"Iniciar",Stop:"Parar"},UpdateDialog:{Close:"Cerrar",Empty:"Vacío",Recovering:"Recuperando {software}...",RecoveringDone:"¡Recuperación de {software} realizada!",Updating:"Actualizando {software}...",UpdatingDone:"¡Actualización de {software} realizada!"}},a={Abort:"abortar",Accept:"aceptar",Adjusted:"ajustar",Description:"Haz click en AJUSTADO si el tornillo actual ha sido ajustado. Haz click en ACEPTAR para continuar sin ajustar.",Headline:"Tornillos de la Cama",ScrewAccepted:"Tornillos aceptados",ScrewIndex:"Índice de Tornillos",ScrewName:"Nombre de Tornillo",ScrewOutput:"{current} de {max}"},r={AreYouSure:"¿Estás seguro?",CancelJob:"Cancelar trabajo",No:"No",Yes:"Sí"},o={CannotConnectTo:"No se pudo conectar a ({host}) Moonraker.",CheckMoonrakerLog:"Si este mensaje aparece repetidamente, por favor dé un vistazo al archivo de registro ubicado en:",Connecting:"Conectando a {host}",ErrorMessage:"Mensaje de error: {message}",Failed:"Conexión Fallida",Help:"Ayuda",Initializing:"Inicializando",TryAgain:"Intentar nuevamente"},i={CommandList:"Lista de comandos",Empty:"Vacío",HideTemperatures:"Ocultar temperaturas",HideTimelapse:"Ocultar timelapse",Search:"Buscar",SendCode:"Enviar código...",SetupConsole:"Configurar consola"},t={AreYouSure:"¿Estás seguro?",CoolDown:"Enfriarse",No:"No",Yes:"Sí"},n={CanBusInfo:"Solo se pueden detectar los nodos no asignados. Se recomienda tener solo un dispositivo no asignado conectado al bus CAN para evitar problemas de comunicación. Para obtener más detalles, haga clic en el enlace:",ClickRefresh:"Haz clic en el botón actualizar para buscar dispositivos.",DevicePath:"Ruta del dispositivo",Formats:"Formatos",Headline:"Dispositivos",HideSystemEntries:"Ocultar entradas del sistema",LibcameraId:"Id de Libcamera",NoDeviceFound:"No se encontró ningún dispositivo. Verifique la conexión y haga clic en el botón Actualizar.",PathByHardware:"Ruta por hardware",PathById:"Ruta por ID",Refresh:"Refrescar",Resolutions:"Resoluciones"},s={StartPrint:{Cancel:"Cancelar",DoYouWantToStartFilename:"¿Desea iniciar {filename}?",DoYouWantToStartFilenameFilament:"¿Quieres iniciar {filename} con el siguiente filamento?",Headline:"Iniciar trabajo",Print:"imprimir",Timelapse:"Lapso de tiempo"}},l={ConfigReference:"Configuración de referencia",DeviceDialog:"Dispositivos",DontSave:"No guardar",Downloading:"Descargando",FailedSave:"¡{filename} no pudo cargarse!",FileReadOnly:"Sólo lectura",FileStructure:"Estructura del archivo",SaveClose:"Guardar y cerrar",SaveRestart:"Guardar y reiniciar",SuccessfullySaved:"{filename} guardado con éxito.",UnsavedChanges:"Cambios sin guardar",UnsavedChangesMessage:"¿Quiere guardar los cambios realizados al archivo {filename}?",UnsavedChangesSubMessage:"Sus cambios se perderán si no los guarda. Puede desactivar este mensaje en la configuración del editor.",Uploading:"Cargando"},c={AreYouSure:"¿Está seguro?",EmergencyStop:"Parada de emergencia",No:"No",Yes:"Sí"},d={AddBatchToQueue:"Añadir lote a la fila",AddToQueue:"Añadir a la fila",AllFiles:"Todos",BedTemp:"Temp. Cama",Cancel:"Cancelar",ChamberTemp:"Temp. Cámara",Count:"Contador",Create:"Crear",CreateNewDirectory:"Crear nuevo directorio",CurrentPath:"Ruta actual",Delete:"Borrar",DeleteDirectory:"Borrar directorio",DeleteDirectoryQuestion:'¿Realmente quiere borrar la carpeta "{name}" con todo su contenido?',DeleteSelectedQuestion:"¿Realmente desea eliminar {count} archivos seleccionados?",DeleteSingleFileQuestion:'¿Realmente quiere eliminar el archivo "{name}"?',Download:"Descargar",Duplicate:"Duplicar",DuplicateFile:"Duplicar Archivo",EditFile:"Editar archivo",Empty:"Vacío",ExtruderTemp:"Temp. Extructor",Filament:"Filamento",FilamentName:"Nombre del filamento",FilamentType:"Tipo de filamento",FilamentUsage:"Uso de filamento",FilamentWeight:"Peso del filamento",Files:"Archivos",Filesize:"Tamaño del archivo",Free:"Libre",FreeDisk:"Espacio libre en disco",GCodeFiles:"Archivos G-Code",GcodesRootDirectoryDoesntExists:'No existe un directorio de archivos G-Code. Por favor, habilita la opción "path" en la sección [virtual_sdcard] de la configuración de Klipper.',HiddenFiles:"Archivos ocultos",InvalidNameAlreadyExists:"El nombre ya existe, por favor escoge otro nombre.",InvalidNameEmpty:"¡La entrada no puede estar vacía!",LastEndTime:"Ultima hora de finalización",LastFilamentUsed:"Ultimo filamento usado",LastModified:"Ultima modificación",LastPrintDuration:"Duración de la ultima impresión",LastStartTime:"Ultima hora de inicio",LastTotalDuration:"Ultima duración total",LayerHeight:"Altura de capa",Name:"Nombre",NewDirectory:"Nuevo directorio",NozzleDiameter:"Diámetro de la boquilla",ObjectHeight:"Altura del objeto",Preheat:"Precalentar",PrintedFiles:"Archivos impresos",PrintStart:"Iniciar impresión",PrintTime:"Tiempo de impresión",RefreshCurrentDirectory:"Actualizar directorio actual",Rename:"Renombrar",RenameDirectory:"Renombrar directorio",RenameFile:"Renombrar archivo",ScanMeta:"Escanear Metadatos",ScanMetaSuccess:"Los metadatos de {filename} han sido escaneados de forma exitosa.",Search:"Buscar",SetupCurrentList:"Configurar lista actual",Slicer:"Laminador",SuccessfullyCreated:"{filename} creado con éxito.",SuccessfullyDeleted:"{filename} eliminado con éxito.",SuccessfullyMoved:"{filename} movido con éxito.",SuccessfullyRenamed:"{filename} renombrado con éxito.",SuccessfullyUploaded:"{filename} subido con éxito!",Total:"Total",UploadNewGcode:"Cargar nuevo G-Code",Used:"Usado",View3D:"Vista 3D"},m={CannotUploadFile:"No se pudo cargar el erchivo!",DropFilesToUploadFiles:"Borrar archivos para subir"},u={ClearLoadedFile:"Borrar",CNCMode:"Modo CNC",ColorMode:"Modo de color",Downloading:"Descargando",ForceLineRendering:"Forzar renderizado de líneas ",HDRendering:"Renderizado HD (extrusiones redondas)",High:"Alto",LoadCurrentFile:"Archivo actual",LoadLocal:"Archivo local",Low:"Bajo",Max:"Máximo",Medium:"Medio",ReloadRequired:"Recarga requerida",Rendering:"Renderizando",RenderQuality:"Calidad de render",ShowGCode:"Mostrar G-Code",ShowObjectSelection:"Mostrar selección de objeto",ShowToolhead:"Mostrar cabezal",ShowTravelMoves:"Mostrar desplazamientos",SpecularLighting:"Iluminación especular",Title:"Visor de G-Code",Tracking:"Seguimiento",Transparency:"Transparencia",Ultra:"Ultra",VoxelMode:"Modo Voxel (ASMBL)"},p={Abort:"Abortar",BedMeshCalibrate:"Calibrar malla de la cama",BedMeshRemove:"Borrar malla de cama",Calibrate:"Calibrar",Clear:"Limpiar",CurrentMesh:{Headline:"Malla actual",Max:"Max",Min:"Min",Name:"Nombre",Range:"Rango",Size:"Tamaño",Variance:"Variación"},DeleteBedMeshProfile:"Borrar perfil de la malla de cama",DoYouReallyWantToDelete:'¿Realmente quiere eliminar el perfil "{name}"?',ErrorKlipperNotReady:"Klipper no disponible. Mapa de altura deshabilitado.",Flat:"Plana",Heightmap:"Mapa de altura",InvalidNameAlreadyExists:"El nombre del perfil ya existe, por favor escoge otro nombre de perfil.",InvalidNameAscii:"El nombre es inválido. Solo caracteres ascii son permitidos.",InvalidNameEmpty:"¡La entrada no puede estar vacía!",InvalidNameReserved:"El perfil 'default' está reservado, por favor escoge otro nombre de perfil.",Later:"Más tarde",Mesh:"Malla",Name:"Nombre",NoBedMeshHasBeenLoadedYet:"bed_mesh no ha sido cargado aún.",NoProfile:"No hay perfil disponible",Ok:"OK",Probed:"Sondeada",Profiles:"Perfil",Remove:"remover",RemoveSaveDescription:"El perfil bed_mesh se ha registrado como eliminado. Haga click en SAVE_CONFIG para removerlo del archivo printer.cfg y reinicie Klipper.",Rename:"renombrar",RenameBedMeshProfile:"Renombrar perfil de BED_MESH",SAVE_CONFIG:"SAVE_CONFIG",ScaleGradient:"Gradiente de escala",ScaleZMax:"Escalar Z-Max",TitleCalibrate:"Calibrar nueva malla de cama",TitleClear:"Limpiar la malla de cama",TitleHomeAll:"Llevar al origen",Wireframe:"Estructura de hilos"},g={AddANote:"Añadir una nota",AddMaintenance:"Agregar mantenimiento",AddNote:"Agregar Nota",AddToQueueSuccessful:"El archivo {filename} está añadido a la cola.",AllJobs:"Todos",AvgPrinttime:"Tiempo promedio de imp.",Cancel:"Cancelar",Chart:"Gráfico",CreateNote:"Crear Nota",DateBasedReminder:"Fecha",DateBasedReminderDescription:"Este recordatorio se basa en la fecha.",Days:"días",Delete:"Eliminar",DeleteSelectedQuestion:"¿Está seguro de que desea eliminar los {count} trabajos seleccionados?",DeleteSingleJobQuestion:"¿Está seguro de que desea eliminar este trabajo?",Details:"Detalles",EditMaintenance:"Editar mantenimiento",EditNote:"Editar Nota",Empty:"Vacío",EndTime:"Hora de finalización",EntryCreatedAt:"Creado en {date}.",EntryNextPerform:"Próxima actuación:",EntryPerformedAt:"Realizado en {date}.",EntrySince:"Utilizado desde:",EstimatedFilament:"Filamento estimado",EstimatedFilamentWeight:"Peso de filamento estimado",EstimatedTime:"Tiempo estimado",FilamentBasedReminder:"Filamento",FilamentBasedReminderDescription:"Este recordatorio se basa en el uso del filamento.",FilamentCalc:"Filamento calculado",FilamentUsage:"Uso de filamento",FilamentUsed:"Filamento utilizado",Filename:"Nombre de archivo",Filesize:"Tamaño de archivo",FirstLayerBedTemp:"Temp. cama primer capa",FirstLayerExtTemp:"Temp. Primera capa",FirstLayerHeight:"Altura primera capa",HistoryFilamentUsage:"Filamento",HistoryPrinttimeAVG:"Impresiones",Hours:"horas",InvalidNameEmpty:"Nombre inválido. ¡El nombre no debe estar vacío!",JobDetails:"Detalles del trabajo",Jobs:"Trabajos",LastModified:"Última modificación",LayerHeight:"Altura de capa",LoadCompleteHistory:"Cargar historial completo",LongestPrinttime:"Impresión más larga",Maintenance:"Mantenimiento",MaintenanceEntries:"Entradas de mantenimiento",Meter:"metro",Name:"Nombre",NoReminder:"Sin recordatorio",Note:"Nota",ObjectHeight:"Altura del objeto",OneTime:"Una vez",Perform:"Realizar",Performed:"Realizado",PerformedAndReschedule:"Realizado y reprogramado",PerformMaintenance:"Realizar mantenimiento",PrintDuration:"Duración de la impresión",PrintHistory:"Historial de impresiones",PrintJobs:"Trabajos de impresión",PrintTime:"Tiempo de impresión",PrinttimeAvg:"Tiempo promedio de imp.",PrinttimeBasedReminder:"Tiempo de impresión",PrinttimeBasedReminderDescription:"Este recordatorio se basa en el tiempo de impresión.",Reminder:"Recordatorio",Repeat:"Repetir",Reprint:"Reimprimir",Save:"guardar",Search:"Buscar",SelectedFilamentUsed:"Elija el filamento usado",SelectedJobs:"Tareas elegidas",SelectedPrinttime:"Tiempo de impresion elegido",Settings:"Ajustes",Slicer:"Laminador",SlicerVersion:"Versión del laminador",StartTime:"Hora de inicio",Statistics:"Estadísticas",Status:"Estado",StatusValues:{cancelled:"Cancelado",completed:"Completado",error:"Error",in_progress:"En progreso",interrupted:"Interrumpido",klippy_disconnect:"Klippy desconectado",klippy_shutdown:"Klippy apagado",Others:"Otros",server_exit:"salida del servidor"},Table:"Tabla",TitleExportHistory:"Exportar historial",TitleRefreshHistory:"Actualizar historial",TitleSettings:"Configuración",TotalDuration:"Duración total",TotalFilamentUsed:"Filamento utilizado en total",TotalJobs:"Trabajos totales",TotalPrinttime:"Tiempo total de impresión",TotalTime:"Tiempo total"},b={AllJobs:"Todas las tareas",Cancel:"Cancelar",ChangeCount:"Cambiar contador",Count:"Contador",Empty:"Vacía",InvalidCountEmpty:"¡La entrada no puede estar vacía!",InvalidCountGreaterZero:"¡La entrada debe ser mayor que 0!",JobQueue:"Cola de tareas",Jobs:"Tareas",Pause:"Pausar",RemoveFromQueue:"Remover de la cola",Start:"Iniciar",StartPrint:"Iniciar tarea"},C={ConfigFilesPanel:{AllFiles:"Todos",Cancel:"Cancelar",ConfigFiles:"Archivos de configuración",ConfigRootDirectoryDoesntExists:'Ningún directorio encontrado. Por favor habilita la opción "config_path" en la sección [file_manager] de la configuración de Moonraker.',Create:"Crear",CreateDirectory:"Crear directorio",CreateFile:"Crear archivo",CurrentPath:"Ruta actual",Delete:"Eliminar",DeleteDirectory:"Eliminar carpeta",DeleteDirectoryQuestion:'¿Realmente quiere eliminar "{name}" con todo su contenido?',DeleteSelectedQuestion:"¿Eliminar {count} elementos seleccionados?",DeleteSingleFileQuestion:'¿Realmente quieres borrar el archivo "{name}"?',Download:"Descargar",Duplicate:"Duplicar",DuplicateFile:"Duplicar Archivo",EditFile:"Editar archivo",Empty:"Vacío",Files:"Archivos",Filesize:"Tamaño",Free:"Libre",FreeDisk:"Espacio libre en el disco",HiddenFiles:"Archivos ocultos",HideBackupFiles:"Ocultar archivos de backup",LastModified:"Última modificación",Name:"Nombre",RefreshDirectory:"Actualizar directorio",Rename:"Renombrar",RenameDirectory:"Renombrar directorio",RenameFile:"Renombrar archivo",Root:"Raiz",SetupCurrentList:"Configurar lista actual",ShowFile:"Mostrar archivo",Total:"Total",UploadFile:"Cargar archivo",Uploading:"Cargando",Used:"Usado"},EndstopPanel:{Endstop:"Fin de carrera",EndstopInfo:"Presione el botón Sincronizar en la parte inferior derecha para cargar el estado actual de los fines de carrera.",Endstops:"Fines de carrera",open:"ABIERTO",TRIGGERED:"ACTIVADO"},LogfilesPanel:{Accept:"Aceptar",Cancel:"Cancelar",Logfiles:"Archivos de registro",Rollover:"Registros de Rotación",RolloverDescription:"Por favor seleciona los registros que deben ser reseteados:",RolloverToastFailed:'Registros de rotación de "{name}": {message}',RolloverToastSuccessful:'El registro de "{name}" ha sido reseteado exitosamente'},SystemPanel:{Constants:"Constantes",Cpu:"Cpu",HostDetails:"Detalles del host",LastStats:"Últimas estadísticas",Load:"Carga",Memory:"Mem.",NoMoreInfos:"No hay mas Info",SystemLoad:"Cargas del sistema",Values:{Awake:"Despierto: {awake}",Bandwidth:"Ancho de banda: {bandwidth}/s",Distro:"Distribucion: {name} {version_id}",Frequency:"Frec: {frequency}",Load:"Carga: {load}",Memory:"Mem: {memory}",Os:"OS: {os}",Received:"Recibidos: {received}",Temp:"Temp: {temp}°C",TempMax:"max: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Transmitidos: {transmitted}",Version:"Version: {version}"}},UpdatePanel:{Abort:"Abortar",AreYouSure:"¿Estás seguro?",CheckForUpdates:"Comprobar actualizaciones",Close:"Cerrar",CommitHistory:"Historial de Commits",Commits:"Commits",CommitsAvailable:"no hay commits disponibles | {count} commit disponible | {count} commits disponibles",CommitsOnDate:"Commits en {date}",CommittedDaysAgo:"Hizo commits hace {days} días",CommittedHoursAgo:"Hizo commits hace {hours} horas",CommittedOnDate:"Hizo commits el día {date}",CommittedYesterday:"Hizo commits ayer",ConfigChanges:"Configurar Cambios",Corrupt:"corrupto",CountPackagesCanBeUpgraded:"{count} paquetes pueden ser actualizados",Detached:"separado",Dirty:"sucio",GenericUpdateQuestion:"Comprueba el historial de commits (si está disponible) y la página de GitHub de este proyecto para ver si es necesario hacer algún ajuste manual con el fin de poder implementar la actualización",GitHubPage:"Página de GitHub",HardRecovery:"Hard Recovery",InitUpdateManager:"El Mánager de Actualizaciones no ha sido iniciado. Esto suele pasar cuando inicias el sistema por primera vez. Por favor haz click en el botón de refrescar para iniciar todos los componentes.",Invalid:"inválido",IUnderstandTheRisks:"Entiendo los riesgos",KlipperUpdateQuestionConfig:"This update may also contain changes to config parameters that would need to be modified in the printer.cfg file, see the change log for details.",KlipperUpdateQuestionFirmware:"Esto va a actualizar el software cliente de Klipper. Tal vez se necesite resetear las placas de control que ejecuten Klipper con el firmware compilado antes de que la máquina pueda volver a funcionar.",LinkToGithub:"Link a GitHub",MoonrakerUpdateQuestion:"This will update the Moonraker API. Changes to the moonraker.conf file may be required to continue using the machine.",MoreCommitsInfo:"A maximum of 30 commits can be displayed here. To see all commits, please click on the following link:",OSPackages:"Paquetes del sistema",SoftRecovery:"Recuperación Suave",StartUpdate:"Empezar Actualización",System:"Sistema",ThesePackagesCanBeUpgrade:"Estos paquetes del sistema puede ser actualizados:",Unknown:"desconocido",Update:"actualizar",UpdateAll:"actualizar todos los componentes",UpdateManager:"Mánager de actualizaciones",UpdateWarning:"Aviso de actualización: {name}",Upgrade:"mejorar",UpgradeableSystemPackages:"Paquetes del Sistema Mejorables",UpToDate:"al día",WebClientUpdateQuestion:"En algunos casos la actualización del cliente web podría tener cambios que podrían causar incompatibilidad. Consulte las notas de la versión para obtener más información."}},v={Abort:"abortar",Accept:"aceptar",Advanced:"Avanzado",Headline:"Sondeada Manual"},f={ExtruderControlPanel:{Allowed:"Permitida",CleanNozzle:"Limpiar la boquilla",EstimatedExtrusion:"Extrusion estimada",Extrude:"Extruir",ExtruderControl:"Control del extrusor",ExtruderTempTooLow:"Temp del extrusor. <",ExtrusionFactor:"Factor de extrusión",ExtrusionFeedrate:"Velocidad de avance de extrusión",FilamentLength:"Largo del filamento",FirmwareRetraction:"Reversión del firmware",FirmwareRetractionSettings:{RetractLength:"Distancia de retracción",RetractSpeed:"Velocidad de retracción",UnretractExtraLength:"Distancia adicional post-retracción",UnretractSpeed:"Velocidad de post-retracción"},Headline:"Extrusor",LoadFilament:"Cargar filamento",PressureAdvance:"Avance de presión de extrusión",PressureAdvanceSettings:{Advance:"Avance",Extruder:"Extrusor",SmoothTime:"Tiempo de suavizado"},PurgeFilament:"Purgar filamento",Requested:"Solicitada",Retract:"Retraer",TooLargeExtrusion:"¡Extrusión muy grande!",Tools:"Herramientas",UnloadFilament:"Descargar Filamento"},FarmPrinterPanel:{ReconnectToPrinter:"Reconectar",SwitchToPrinter:"Cambiar a impresora",WebcamOff:"Apagar"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Por favor comprueba si el servicio de Klipper se está ejecutando y klippy_uds_address está correctamente configurado en moonraker.conf.",FirmwareRestart:"Reiniciar Firmware",KlipperCheck:"Verifique que el servicio Klipper está corriendo y que un UDS (Unix Domain Socket) esta configurado.",KlipperLog:"Registro de Klipper",MoonrakerCannotConnect:"¡Moonraker no se pudo conectar a Klipper!",MoonrakerLog:"Registro de Moonraker",PowerOn:"Encender",PrinterSwitchedOff:"La impresora está apagada",PrinterSwitchedOffDescription:"La impresora está actualmente apagada y Klipper no se puede conectar. Para encender la impresora, haz click en el botón de abajo:",Restart:"Reiniciar",ServiceReports:"reporta {service}"},MachineSettingsPanel:{Headline:"Configuración de impresora",MotionSettings:{Acceleration:"Aceleración",MaxAccelToDecel:"Max. Acel. a Decel.",MinimumCruiseRatio:"Relación mínima de crucero",SquareCornerVelocity:"Velocidad esquinas rectas",Velocity:"Velocidad"}},MacrosPanel:{Headline:"Macros",Send:"Enviar"},MiniconsolePanel:{Autoscroll:"Desplazamiento automático",Headline:"Consola",HideTemperatures:"Ocultar temperaturas",HideTimelapse:"Ocultar timelapse",RawOutput:"Salida RAW (para depuración)",SendCode:"Enviar código...",SetupConsole:"Configurar consola"},MinSettingsPanel:{IncludeMainsailCfg:"Asegúrese de incluir mainsail.cfg en su archivo printer.cfg.",IsNotDefinedInConfig:"no está definida en la configuración.",MissingConfiguration:"Configuración no encontrada",MoreInformation:"más información"},MiscellaneousPanel:{Headline:"Varios",Light:{Blue:"azul",Green:"verde",Red:"rojo",White:"blanco"},RunoutSensor:{Detected:"detectado",Disabled:"deshabilitado",Empty:"Vacío"}},PowerControlPanel:{Error:"Error",Off:"Apagado",On:"Encendido",PowerControl:"Control de energía"},SpoolmanPanel:{Cancel:"Cancelar",ChangeSpool:"Cambiar carrete",DaysAgo:"Hace {days} días",EjectSpool:"Expulsar el carrete",EjectSpoolQuestion:"¿Está seguro de expulsar la bobina del filamento?",Filament:"Filamento",FilamentTypeMismatch:"El material del carrecte en uso ({spoolType}) no coincide con el material del G-Code ({fileType}).",Headline:"Carrete de bobina",LastUsed:"Utilizado por última vez",Location:"Ubicación",Material:"Material",Never:"Nunca",NoActiveSpool:"El seguimiento del filamento está inactivo. Para empezar, seleccione una bobina.",NoResults:"No se ha encontrado ninguna bobina con los criterios de búsqueda actuales.",NoSpools:"No hay bobinas disponibles",NoSpoolSelected:"No hay bobina seleccionada. Selecciona una bobina o no se realizará el seguimiento de esta impresión.",OpenSpoolManager:"Abrir el Administrador de carretes",Refresh:"recargar",Search:"Buscar",SelectSpool:"Seleccionar carrete",Today:"Hoy",TooLessFilament:"Es posible que la bobina actual no tenga suficiente filamento para esta impresión. ({spoolWeight}g de {fileWeight}g)",Weight:"Peso",Yesterday:"Ayer"},StatusPanel:{CancelPrint:"Cancelar impresión",ClearPrintStats:"Limpiar estadísticas de impresión",Difference:"Diferencia",EmptyGcodes:"No hay código G disponible.",EmptyJobqueue:"No hay ningún archivo en la cola de trabajos.",Estimate:"Estimación",ETA:"ETA",ExcludeObject:{Cancel:"Cancelar",Excluded:"Excluido",ExcludeObject:"Excluir objeto",ExcludeObjectHeadline:"Excluir objeto",ExcludeObjectText:'¿Realmente quiere excluir a "{name}"?'},Filament:"Filamento",File:"Archivo",Files:"Archivos",Flow:"Flujo",Headline:"Estado",Jobqueue:"Cola de trabajo",JobqueueMoreFiles:"no mas trabajos | un trabajo mas | {count} trabajos mas",Layer:"Capa",Max:"max",ObjectHeight:"Altura del objeto",PauseAtLayer:{Abort:"Abortar",Accept:"Aceptar",AtLayer:"a La Capa",Call:"Llamar",DescriptionPauseAtLayerActive:'Esta función ya está activa y va a llamar "{call}" a la capa {layer}. Si vuelves a ejecutar el comando, estas opciones se sobrescribirán.',DescriptionPauseNextLayerActive:'Esta función ya está activa y llamará "{call}" en la siguiente capa.',Layer:"Capa",NextLayer:"siguiente Capa",PauseAtLayer:"Para en la Capa",Type:"Tipo"},PausePrint:"Pausar impresión",Print:"Imprimir",PrintTime:"Tiempo de impresion",ReprintJob:"Reimprimir trabajo",Requested:"Solicitada",ResumePrint:"Reanudar impresión",Slicer:"Laminador",Speed:"Velocidad",Status:"Estado",Total:"Total",Unknown:"Desconocido"},TemperaturePanel:{AutoscaleChart:"Autoescalar gráfico",Avg:"Promedio",Cooldown:"Enfriar",Current:"Actual",Dataset:{Power:"Potencia PWM",Speed:"Velocidad PWM",Target:"temperatura objetivo",Temperature:"temperatura actual"},Headline:"Temperaturas",HideMcuHostSensors:"Ocultar Sensores Host/MCU",HideMonitors:"Ocultar monitores",Max:"max",Min:"min",Name:"Nombre",Presets:"Preestab.",SetupTemperatures:"Configurar temperaturas",ShowChart:"Mostrar gráfico",ShowNameInChart:"Mostrar {name} en el gráfico",ShowNameInList:"Mostrar {name} en el listado",State:"Estado",Target:"Objetivo",TemperaturesInChart:"Temperatura [°C]",TempTooHigh:"¡Temperatura muy alta para {name}! (max: {max})",TempTooLow:"¡Temperatura muy baja para {name}! (min: {min})"},ToolheadControlPanel:{Absolute:"absoluta",ALL:"TODO",ControlButtons:"Botones de control",CoordinateFields:"Campos de coordenadas",Headline:"Toolhead",PleaseConfigureSteps:"Por favor configure los pasos",Position:"Posición",PositionOutput:"Posición de salida",QGL:"QGL",Relative:"relativa",SettingsInterfaceControl:"Configuración > Interfaz > Control",SpeedFactor:"Factor de velocidad",ZOffset:"Desplazamiento del eje Z",ZTilt:"Z Tilt"},WebcamPanel:{All:"Todos",ConnectingTo:"Conectando a {url}",Disconnected:"Desconectado",ErrorWhileConnecting:"Error al conectar a {url}",FPS:"FPS",Headline:"Cámara web",NoWebcam:'No hay cámara web disponible. Agregue una cámara web en "Configuración" -> "Cámaras web".',UnknownWebcamService:"Servicio de cámara web desconocido"},ZoffsetPanel:{Clear:"Limpiar",Headline:"Z-Offset",Later:"Más tarde",Ok:"OK",Save:"Guardar",SaveConfig:"SAVEE CONFIG",SaveInfoDescription:'El nuervo Z-Offset fue calculado y registrado. Haga click en "SAVE CONFIG" para guardar el nuevo Z-Offset en su archivo printer.cfg y reiniciar Klipper.',SaveInfoDescriptionPrint:'El nuevo Z-Offset fue calculado y registrado. Después de imprimir, haga click en "SAVE CONFIG" en la barra superior para guardarlo en printer.cfg y reiniciar Klipper.',SaveInfoHeadline:"Información",ToEndstop:"al fin de carrera",ToProbe:"a la sonda"}},D={AreYouSure:"¿Está seguro?",No:"No",TurnDeviceOff:"Apagar {device}",TurnDeviceOn:"Encender {device}",Yes:"Si"},S={Console:"Consola",Dashboard:"Panel de control","G-Code Files":"Archivos G-Code","G-Code Viewer":"Visor de G-Code",Heightmap:"Mapa de altura",History:"Historial",Machine:"Máquina",Printers:"Impresoras",Timelapse:"Timelapse",Webcam:"Cámara web"},h={Accept:"aceptar",Base:"Base",ErrorText:"Algo salió mal durante el proceso de sondeo.",Headline:"Ajuste de inclinación de tornillos",Retry:"reintentar"},T={AddPrinter:"Agregar impresora",AddPrintersToJson:"Por favor, añade Impresoras al config.json.",CannotConnectTo:"No es posible conectarse a {host}.",ChangePrinter:"Cambiar impresora",Connecting:"Conectando a {host}",ConnectionFailed:"Conexión fallida",EditPrinter:"Editar impresora",Hello:"¡Hola y bienvenido al modo remoto de Mainsail!",HostnameInvalid:"Nombre de host o IP inválida",HostnameIp:"Nombre del host/IP",HostnameRequired:"El nombre del host es obligatorio",Name:"Nombre",Path:"Ruta",Port:"Puerto",PortRequired:"El puerto es obligatorio",RememberToAdd:"Por favor recuerde agregar {cors} en moonraker.conf dentro de 'cors_domains'.",SelectPrinter:"Elegir impresora",TryAgain:"Intentar nuevamente",UpdatePrinter:"Actualizar impresora",YouCanFindMore:"Puede encontrar más detalles en"},E={Cancel:"Cancelar",Close:"Cerrar",ConsoleTab:{AddFilter:"Agregar filtro",Console:"Consola",CreateHeadline:"Crear filtro",Direction:"Dirección",DirectionShell:"Última entrada abajo",DirectionTable:"Última entrada arriba",EditHeadline:"Editar filtro",EntryStyle:"Estilo",EntryStyleCompact:"Compacto",EntryStyleDefault:"Predeterminado",Filters:"Filtros",Height:"Altura",HideTemperatures:"Ocultar temperaturas",HideTimelapse:"Ocultar Timelapse",Name:"Nombre",Regex:"Regex",StoreButton:"Guardar filtro",UpdateButton:"Actualizar filtro"},ControlTab:{Bars:"Barras",Circle:"Círculo",Control:"Control",Cross:"Cruz",EnableXYHoming:"Habilitar homing X Y combinado ",EstimatedExtrusionInfo:"Mostrar info de extrusion estimada",EstimatedExtrusionInfoDescription:"Mostrar / Ocultar informacion de extrusion estimada basado en la candidad de extrusion y el avance",HideDuringPrint:"Ocultar los controles de los ejes durante la impresión",InvertXMovement:"Invertir movimiento X",InvertYMovement:"Invertir movimiento Y",InvertZMovement:"Invertir movimiento Z",IsDefault:" (default)",MaximumValues:"Valores máximos: {maximum}",MaximumValuesVisibility:"Máximo valor de {maximum} se recomienda para mejor visibilidad",MinimumValues:"Valores mínimos: {minimum}",MotorsOff:"Motores apagados{isDefault}",MoveDistancesEInMm:"Distancia recorrido E en mm",MoveDistancesInMm:"Distancia recorrido en mm",MoveDistancesXYInMm:"Distancia recorrido XY en mm",MoveDistancesZInMm:"Distancia recorrido Z en mm",QuadGantryLevel:"Quad Gantry Level{isDefault}",SpeedEInMms:"Velocidad E en mm/s",SpeedXY:"Velocidad XY",SpeedZ:"Velocidad Z",Style:"Estilo",ValueGreaterThan:"El valor debe ser mayor a {value}",ZOffsetIncrements:"Incrementos de Z-Offset (en mm)",ZOffsetSaveOption:"Opciones para guardar el desplazamiento en el eje Z",ZOffsetSaveOptionDescription:"Cambiar opciones para guardar el desplazamiento en el eje Z",ZTiltAdjust:"Ajuste de Z-Tilt{isDefault}"},DashboardTab:{Dashboard:"Tablero de control",Desktop:"Escritorio",Mobile:"Celular",ResetLayout:"Restablecer diseño",Tablet:"Tableta",Widescreen:"Pantalla ancha"},Edit:"Editar",EditorTab:{ConfirmUnsavedChanges:"Preguntar si guardar o descartar cambios",ConfirmUnsavedChangesDescription:"Si está activa, el editor requerirá una confirmación para guardar o descartar los cambio realizados. Si está desactivada, los cambios serán descartados.",Editor:"Editor",KlipperRestartMethod:"Metodo de reinicio de klipper",KlipperRestartMethodDescription:'Elija metodo de reinicio que sera usado cuando editamos configuracion de klipper y presionamos "Guardar y Reiniciar"',Spaces:"Espacios: {count}",TabSize:"Tamaño TAB",TabSizeDescription:"Ajusta cuántos espacios deben sangrarse para TAB",UseEscToClose:"Use ESC para cerrar",UseEscToCloseDescription:"Permite que la tecla ESC cierre el editor"},GCodeViewerTab:{BackgroundColor:"Color de fondo",ExtruderColor:"Color extrusor",GCodeViewer:"Visor de G-Code",GridColor:"Color grilla",MaxFeed:"Alimentación máxima",MinFeed:"Alimentación mínima",ProgressColor:"Color de Progreso",ShowAxes:"Mostrar ejes"},GeneralTab:{"12hours":"12-horas ({time})","24hours":"24-horas ({time})",Backup:"Backup",BackupDialog:"Elija todas las secciones a las que quiere hacer backup:",CalcEstimateTime:"Cálculo de tiempo estimado",CalcEstimateTimeDescription:"Si se selecciona muchos, un promedio será calculado",CalcEtaTime:"Cálculo de ETA",CalcEtaTimeDescription:"Si se seleccionan varios, se calculará una media",CalcPrintProgress:"Cálculo del progreso de impresión",CalcPrintProgressDescription:"Método para calcular el progreso de impresión",CalcPrintProgressItems:{Filament:"Filamento",FileAbsolute:"Posición del archivo (absoluta)",FileRelative:"Posición del archivo (relativa)",Slicer:"Slicer (M73)"},CannotReadJson:"No se puede leer el archivo de backup.",DateFormat:"Formato de Fecha",DbConsoleHistory:"Historial de la Consola",DbHistoryJobs:"Historial de Trabajos",DbHistoryTotals:"Historial Totales",DbMaintenance:"Mantenimiento",DbNavigation:"Navegación",DbTimelapseSettings:"Ajustes de Timelapse",DbView:"Ajustes de Vista",DbWebcams:"Cámaras web",EstimateValues:{Filament:"Filamento",File:"Archivo",Slicer:"Slicer"},Everything:"Todo",FactoryDialog:"Elija las secciones que quiere reiniciar:",FactoryReset:"Restablecimiento de fábrica",General:"General",Language:"Idioma",MainsailSettingsMoonrakerDb:"Ajustes de Mainsail en Moonraker DB",MoonrakerDb:"Moonraker DB",PrinterName:"Nombre de la impresora",Reset:"Reiniciar",Restore:"Restaurar",RestoreDialog:"Elija las secciones que quiere restaurar:",TimeFormat:"Formato de Tiempo"},HeightmapTab:{ColorSchemes:"Esquemas de colores",DefaultOrientation:"Orientación por defecto",DefaultOrientationDescription:"Seleccione la orientación por defecto para la visualización de la malla.",Heightmap:"Mapa de altura",IsDefault:"(Por defecto)",Orientations:{Front:"Delante",LeftFront:"Frontal izquierdo",RightFront:"Frontal derecho",Top:"Arriba"},Schemes:{GrayScale:"Escala de grises",Hot:"Caliente",Hsv:"Espacio de color HSV",Portland:"Portland",Spring:"Primavera"}},InterfaceSettings:"Configuración de la interfaz",MacrosTab:{Add:"Agregar",AddGroup:"Agregar grupo",AvailableMacros:"Macros disponibles",ChangeMacroColor:"Cambiar el color del botón.",Color:"Color",CountMacros:"No se agregaron macros | {count} Macro | {count} Macros",Custom:"Personalizado",CustomColor:"Color personalizado",DeletedMacro:"Macro eliminada",DeleteMacroFromGroup:"Eliminar macro del grupo",EditGroup:"Editar grupo",Error:"Error",Expert:"Experto",General:"General",Group:"Grupo",GroupMacros:"Grupos de macros",Macrogroups:"Grupos",Macros:"Macros",Management:"Gestión",Name:"Nombre",NoAvailableMacros:"No hay macros disponibles.",NoGroups:"No se encontraron grupos...",NOMacros:"No se encontraron macros...",NoMacrosInGroup:"No hay Macros en este grupo.",Primary:"Primario",Search:"Buscar",Secondary:"Secundario",ShowInStatePaused:"Mostrar/Ocultar si la impresora está pausada.",ShowInStatePrinting:"Mostrar/Ocultar si la impresora está imprimiendo.",ShowInStateStandby:"Mostrar/Ocultar si la impresora está en espera.",Simple:"Simple",Status:"Estado",Success:"Éxito",UnknownGroup:"Grupo desconocido",Warning:"Alerta"},MiscellaneousTab:{AddGroup:"añadir grupo",AddPreset:"añadir preset",Color:"Color",CreateGroup:"Crear grupo",CreatePreset:"Crear preset",End:"Fin",EndDescription:"Último LED de este grupo.",Groups:"Grupos",GroupSubTitle:"Comienzo: {start}, Final: {end}",LightGroups:"{name} - Grupos",LightPresets:"{name} - Presets",Miscellaneous:"Varios",Name:"Nombre",NoDevicesFound:"Ningún dispositivo encontrado",NoGroupFound:"Ningún grupo encontrado",NoPresetFound:"Ningún preset encontrado",Presets:"Presets",Start:"Comenzar",StartDescription:"Primer LED de este grupo.",UnableToLoadLight:"No se puede cargar la luz",UnableToLoadPreset:"No se puede cargar el preset"},NavigationTab:{Navigation:"Navegación"},PresetsTab:{AddPreset:"Agregar config. preestablecida",Cooldown:"Enfriamiento",CreateHeadline:"Crear config. preestablecida",CustomGCode:"G-Code personalizado",EditCooldown:"Editar enfriamiento",EditHeadline:"Editar config. preestablecida",ErrorInvalidValue:"Valor invalido",ErrorNameNotUnique:"Nombre ya existente",ErrorNameRequired:"nombre requerido",Name:"Nombre",PreheatPresets:"Precalentamiento",PresetInfo:"Debe configurar como mínimo una temperatura objetivo o un G-code personalizado.",PresetNamePlaceholder:"Nombre preestablecido (requerido)",StoreButton:"Guardar config. preestablecida",UpdateButton:"Actualizar config. preestablecida",UpdateCooldown:"Actualizar enfriamiento"},RemotePrintersTab:{AddPrinter:"Agregar impresora",EditPrinter:"Editar impresora",Hostname:"Nombre del Host",Name:"Nombre",NameDescription:"Este nombre no se mostrará en la GUI y solo se usará para redirecciones.",Path:"Ruta",Port:"Puerto",RemotePrinters:"Impresoras remotas",UpdatePrinter:"Actualizar impresora",UseConfigJson:"InstanceDB = JSON detectado. Por favor, utilice el config.json para modificar la lista de impresoras."},Store:"tienda",TimelapseTab:{Autorender:"Autorrenderizado",AutorenderDescription:"Si está activa, el video del timelapse será renderizado automáticamente al finalizar la impresión.",Camera:"Cámara",CameraDescription:"Elija qué cámara será utilizada.",CameraDescriptionWithSnapshotUrl:"Selecciona qué cámara (con URL de instantánea) debe utilizarse",CameraWarningAlreadySet:"Este valor ya está establecido en el archivo de configuración del Moonraker.",CameraWarningAlreadySetSmall:"snapshoturl en la sección [timelapse]",ConstantRateFactor:"Factor de tasa constante",ConstantRateFactorDescription:"Configura la calidad vs. el tamaño del archivo del video renderizado. El rango de la escala de FTC es de 0-51, donde 0 es sin pérdidas, 23 es predeterminado y 51 es la peor calidad posible. Un valor más bajo generalmente conduce a una mayor calidad y un rango subjetivamente sensato es 17-28. Considere que 17 o 18 no tienen pérdida visual. ",duplicatelastframe:"Duplicar último cuadro",duplicatelastframeDescription:"Duplica el ultimo cuadro al final de video.",Enabled:"Activado",EnabledDescription:"Si está desactivado, las macros de G-code son ignoradas y el autorrender es salteado.",Extraoutputparams:"Parámetros adicionales",ExtraoutputparamsDescription:"Defina parámetros adicionales para FFMPEG. Nota: Especificar cualquier dato aquí deshabilita la configuración de rotación.",FwRetract:"Retracción de firmware",FwRetractDescription:"Usar la retracción de firmware en la macro de Timelapse.",GcodeVerbose:"G-code verboso",GcodeVerboseDescription:"Si está activo, las macros de G-Code escribirán información en la consola.",General:"General",HyperlapseCycle:"Tiempo de ciclo Hyperlapse",HyperlapseCycleDescription:"Se tomará una foto cada X segundos.",Mode:"Modo",ModeDescription:"Elija en modo entre LayerMacro e Hyperlape (basado en tiempo).",NoWebcamFound:"No hay webcam disponible",OutputFramerate:"Framerate",OutputFramerateDescription:"Define los cuadros por segundo del video. Nota: Puede ser ignorado si variable_fps está activado.",Parkhead:"Apartar cabezal",ParkheadDescription:"Si está activado, el cabezal será apartado antes de tomar la foto para el Timelapse.",Parkpos:"Posición donde apartar",ParkposDescription:"Seleccione la posición donde apartar el cabezal.",ParkTime:"Park time",ParkTimeDescription:"Agregue tiempo de inactividad adicional al apartar el cabezal.",Pixelformat:"Formato de pixel",PixelformatDescription:"Define el formato de pixeles del video.",PosDZ:"Posición Z",PosDZDescription:"Posición donde apartar Z (relativa)",PosX:"Posición X",PosXDescription:"Posición donde apartar X (absoluta)",PosY:"Posición Y",PosYDescription:"Posición donde apartar Y (absoluta)",PreviewImage:"Imagen previsualización",PreviewImageDescription:"Guarda una imagen de previsualización con el mismo nombre que el video.",RenderingOptions:"Opciones de renderizado",RetractDistance:"Distancia de retracción",RetractDistanceDescription:"El largo del filamento que el extrusor retrae.",RetractSpeed:"Velocidad de retracción",RetractSpeedDescription:"Velocidad con que el extrusor retrae el filamento.",RulesBetweenMinMax:"¡El valor debe estar entre {min} y {max}!",RulesMin:"¡El valor debe ser como mínimo de {min}!",RulesPositive:"¡El valor debe ser positivo!",RulesRequired:"¡El valor es obligatorio!",RulesZeroAndPositive:"¡El valor debe ser 0 o superior!",SaveFrames:"Guardar cuadros",SaveFramesDescription:"Guardar los cuadros como archivo .zip para render externo.",SelectWebcam:"Selecciona una webcam...",StreamDelayCompensation:"Compensación de retraso de stream",StreamDelayCompensationDescription:"Retraso de captura de cuadros.",Targetlength:"Duración del video",TargetlengthDescription:"Indica la duración del video cuando FPS variable está activado.",TimeFormatCode:"Formato de fecha",TimeFormatCodeDescription:"Define el formato de la fecha en el archivo de salida.",Timelapse:"Timelapse",TravelSpeed:"Velocidad de movimiento",TravelSpeedDescription:"Velocidad del movimiento con que se aparta y retorna el cabezal.",UnretractDistance:"Distancia de post-retracción",UnretractDistanceDescription:"Largo del filamento que el extrusor devuelve al cabezal después de la retracción.",UnretractSpeed:"Velocidad de post-retracción",UnretractSpeedDescription:"Velocidad con la que el extrusor devuelve el filamento después de la retracción.",VariableFps:"FPS Variable",VariableFpsDescription:'Si está activo, los cuadros por segundo del video serán calculado según el "Largo del video".',VariableFpsMax:"FPS Variable máximo",VariableFpsMaxDescription:"Valor máximo de FPS variables",VariableFpsMin:"FPS Variable mínimo",VariableFpsMinDescription:"Valor mínimo de FPS variables"},UiSettingsTab:{BedScrewsDialog:"Diálogo de tornillos de cama",BedScrewsDialogDescription:"Mostrar diálogo de ayuda para BED_SCREWS_ADJUST.",BigThumbnailBackground:"Color de fondo para una vista previa grande",BoolBigThumbnail:"Miniatura grande",BoolBigThumbnailDescription:"Mostrar una miniatura grande en el panel de estado durante una impresión.",BoolHideUploadAndPrintButton:"Ocultar botón de Subir e Imprimir",BoolHideUploadAndPrintButtonDescription:'Mostrar u ocultar el botón de "Upload and Print" en la barra de arriba',ConfirmOnCancelJob:"Se requiere confirmación para cancelar el trabajo",ConfirmOnCancelJobDescription:"Mostrar un cuadro de diálogo de confirmación para cancelar el trabajo",ConfirmOnCoolDown:"Confirmar el enfriamiento",ConfirmOnCoolDownDescription:"Mostrar un diálogo de confirmación para el enfriamiento",ConfirmOnEmergencyStop:"Requerir confirmación en Parada de Emergencia",ConfirmOnEmergencyStopDescription:"Mostrar un diálogo de confirmación en Parada de Emergencia",ConfirmOnPowerDeviceChange:"Solicitar confirmación para cambios en Alimentación del Dispositivo",ConfirmOnPowerDeviceChangeDescription:"Mostrar un diálogo de confirmación en Alimentación del Dispositivo",DefaultNavigationState:"Estado por defecto de la navegación",DefaultNavigationStateAlwaysClosed:"siempre cerrado",DefaultNavigationStateAlwaysOpen:"siempre abierto",DefaultNavigationStateDescription:"Qué estado debe tener la navegación por defecto.",DefaultNavigationStateLastState:"último estado",DisableFanAnimation:"Desactivar la animación del ventilador",DisableFanAnimationDescription:"Esto puede reducir la carga de su navegador.",DisplayCANCEL_PRINT:"Mostrar CANCEL_PRINT",DisplayCANCEL_PRINTDescription:"Muestra el botón CANCEL_PRINT permanentemente - no necesita confirmación de segunda capa.",GcodeThumbnails:"Miniaturas de G-Code",GcodeThumbnailsDescription:"Haga clic en el botón para acceder a las instrucciones.",Guide:"Guía",HideSaveConfigButtonForBedMesh:"Ocultar el botón SAVE_CONFIG para los cambios en bed_mesh",HideSaveConfigButtonForBedMeshDescription:"Ocultar SAVE_CONFIG, si sólo están pendientes de guardar en Klipper los cambios en bed_mesh.",HideUpdateWarnings:"Ocultar avisos de actualización",HideUpdateWarningsDescription:"Esta opción ocultará todos los avisos de actualización en el gestor de actualizaciones.",LockSliders:"Bloquear deslizadores en dispositivos con pantalla táctil",LockSlidersDelay:"Retraso de bloqueo de deslizadores",LockSlidersDelayDescription:"Los deslizadores se bloquearán después de un retardo determinado. Si se establece en 0 o se deja en blanco, los deslizadores sólo se bloquearán al cambiar/recargar la página.",LockSlidersDescription:"Los controles deslizantes de las pantallas táctiles deben desbloquearse antes de permitir cambios.",Logo:"Logo",ManualProbeDialog:"Diálogo Manual del Ayudante de Sonda",ManualProbeDialogDescription:"Mostrar diálogo de ayuda para PROBE_CALIBRATE o Z_ENDSTOP_CALIBRATE.",Mode:"Modo",ModeDescription:"Cambia el aspecto general de la aplicación.",NavigationStyle:"Estilo de Navegación",NavigationStyleDescription:"Modificar el aspecto de la navegación",NavigationStyleIconsAndText:"Iconos + Texto",NavigationStyleIconsOnly:"Solo Iconos",PowerDeviceName:"Dispositivo de alimentación de la impresora",PowerDeviceNameDescription:"Seleccione qué dispositivo de alimentación Moonraker debe utilizarse para encender la impresora.",Primary:"Primario",PrintstatusThumbnailZoom:"Zoom para miniaturas grandes",PrintstatusThumbnailZoomDescription:"Esto desactivará el efecto zoom de la miniatura en el panel de estado.",ProgressAsFavicon:"Mostrar el progreso como un favicon",ProgressAsFaviconDescription:"Cambiar el favicon del logotipo de Mainsail por un círculo de progreso.",ScrewsTiltAdjustDialog:"Diálogo de Ajuste de Inclinación de los Tornillos",ScrewsTiltAdjustDialogDescription:"Mostrar diálogo de ayuda para SCREWS_TILT_CALCULATE.",TempchartHeight:"Gráfico de Temperaturas de Altura",TempchartHeightDescription:"Modifica la altura del gráfico de temperatura en el Cuadro De Mandos.",Theme:"Tema",ThemeDark:"Oscuro",ThemeDescription:"Personaliza la marca de la interfaz.",ThemeLight:"Claro",UiSettings:"Ajustes de UI"},Update:"actualizar",WebcamsTab:{AddWebcam:"Agregar cámara web",CreateWebcam:"Crear cámara web",EditCrowsnestConf:"Editar crowsnest.conf",EditWebcam:"Editar cámara web",EnableAudio:"Activar los sonidos",FlipWebcam:"Voltear la imagen de la cámara web:",HideFps:"Ocultar contador de FPS",Hlsstream:"Stream HLS",Horizontally:"horizontalmente",IconBed:"Cama",IconCam:"Cámara",IconDoor:"Puerta",IconFilament:"Filamento",IconHot:"Caliente",IconMcu:"MCU",IconNozzle:"Boquilla",IconPrinter:"Impresora",Ipstream:"Cámara IP",JMuxerStream:"stream h264 crudo (jmuxer)",Mjpegstreamer:"MJPEG-Streamer",MjpegstreamerAdaptive:"MJPEG-Streamer Adaptativo (experimental)",Name:"Nombre",NameAlreadyExists:"El nombre ya existe",Required:"Requerido",Rotate:"rotar",SaveWebcam:"Guardar cámara web",Service:"Servicio",TargetFPS:"FPS Objetivo",UpdateWebcam:"Actualizar cámara web",UrlSnapshot:"URL Snapshot",UrlStream:"URL Stream",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"verticalmente",Webcams:"Cámaras web",WebrtcCameraStreamer:"WebRTC (camera-streamer)",WebrtcGo2rtc:"WebRTC (go2rtc)",WebrtcJanus:"WebRTC (janus-gateway)",WebrtcMediaMTX:"WebRTC (MediaMTX / rtsp-simple-server)"}},P={AllFiles:"Todos",Autorender:"Autorrenderizado",Cancel:"Cancelar",Create:"Crear",CreateNewDirectory:"Crear directorio",CurrentPath:"Ruta actual",Delete:"Eliminar",DeleteDirectory:"Eliminar directorio",DeleteDirectoryQuestion:'¿Está seguro de que desea eliminar la carpeta "{name}" con todo su contenido?',DeleteSelectedQuestion:"¿Realmente quieres borrar {count} archivos selecionados?",DeleteSingleFileQuestion:'¿Realmente quieres borrar el archivo "{name}"?',Download:"Descargar",DuplicateLastframe:"Duplicar último cuadro",Empty:"No se encontró Timelapse finalizado.",Enabled:"Activada",EstimatedLength:"Longitud estimada",Files:"Archivos",Filesize:"Tamaño del archivo",Fixed:"Fijo",Framerate:"Cuadros por segundo",Frames:"Cuadros",Free:"Libre",FreeDisk:"Espacio libre en el disco",LastModified:"Ultima modificación",MaxFramerate:"Máx. Cuadros por segundo",MinFramerate:"Mín. Cuadros por segundo",Name:"Nombre",NewDirectory:"Nuevo directorio",NoActiveTimelapse:"Sin registros disponibles.",Preview:"Previsualizar",RefreshCurrentDirectory:"Actualizar directorio",Rename:"Renombrar",RenameDirectory:"Renombrar directorio",RenameFile:"Renombrar archivo",Render:"Renderizar",RenderSettings:"Configuración Render",SaveFrames:"Guardar cuadros",Search:"Buscar",StartRender:"Iniciar render",Status:"Estado",TargetFps:"Objetivo FPS",Targetlength:"Longitud objetivo",TimelapseFiles:"Archivo Timelapse",TimelapseRendering:"Renderizando Timelapse",TimelapseRenderingSuccessful:"Timelapse renderizado con éxito",Total:"Total",Type:"Tipo",Used:"Usado",Variable:"Variable",Video:"Video"},A="Español",y={App:e,BedScrews:a,CancelJobDialog:r,ConnectionDialog:o,Console:i,CoolDownDialog:t,DevicesDialog:n,Dialogs:s,Editor:l,EmergencyStopDialog:c,Files:d,FullscreenUpload:m,GCodeViewer:u,Heightmap:p,History:g,JobQueue:b,Machine:C,ManualProbe:v,Panels:f,PowerDeviceChangeDialog:D,Router:S,ScrewsTiltAdjust:h,SelectPrinterDialog:T,Settings:E,Timelapse:P,title:A};export{e as App,a as BedScrews,r as CancelJobDialog,o as ConnectionDialog,i as Console,t as CoolDownDialog,n as DevicesDialog,s as Dialogs,l as Editor,c as EmergencyStopDialog,d as Files,m as FullscreenUpload,u as GCodeViewer,p as Heightmap,g as History,b as JobQueue,C as Machine,v as ManualProbe,f as Panels,D as PowerDeviceChangeDialog,S as Router,h as ScrewsTiltAdjust,T as SelectPrinterDialog,E as Settings,P as Timelapse,y as default,A as title}; diff --git a/assets/exrTextureLoader-CpwykM8r.js b/assets/exrTextureLoader-CpwykM8r.js new file mode 100644 index 0000000..49652a8 --- /dev/null +++ b/assets/exrTextureLoader-CpwykM8r.js @@ -0,0 +1 @@ +import{C as yn,a as Sn,f as G}from"./Viewer-DVCEMRp5.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./index-Bku7SJna.js";import"./echarts-DzoUeqWp.js";import"./codemirror-ZSHHXwGs.js";const ln=4,X=4,an=1,R=2,En=8,H=65536,j=H>>3,xn=16,T=14,F=(1<>-a-14,l[i|256]=1024>>-a-14|32768,r[i]=-a-1,r[i|256]=-a-1):a<=15?(l[i]=a+15<<10,l[i|256]=a+15<<10|32768,r[i]=13,r[i|256]=13):a<128?(l[i]=31744,l[i|256]=64512,r[i]=24,r[i|256]=24):(l[i]=31744,l[i|256]=64512,r[i]=13,r[i|256]=13)}const c=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let i=1;i<1024;++i){let a=i<<13,u=0;for(;!(a&8388608);)a<<=1,u-=8388608;a&=-8388609,u+=947912704,c[i]=a|u}for(let i=1024;i<2048;++i)c[i]=939524096+(i-1024<<13);for(let i=1;i<31;++i)s[i]=i<<23;s[31]=1199570944,s[32]=2147483648;for(let i=33;i<63;++i)s[i]=2147483648+(i-32<<23);s[63]=3347054592;for(let i=1;i<64;++i)i!==32&&(o[i]=1024);return{floatView:t,uint32View:e,baseTable:l,shiftTable:r,mantissaTable:c,exponentTable:s,offsetTable:o}}function $(n,t){const e=new Uint8Array(n);let l=0;for(;e[t.value+l]!=0;)l+=1;const r=new TextDecoder().decode(e.slice(t.value,t.value+l));return t.value=t.value+l+1,r}function P(n,t){const e=n.getInt32(t.value,!0);return t.value+=ln,e}function _(n,t){const e=n.getUint32(t.value,!0);return t.value+=ln,e}function Z(n,t){const e=n.getUint8(t.value);return t.value+=an,e}function B(n,t){const e=n.getUint16(t.value,!0);return t.value+=R,e}function cn(n,t){const e=n[t.value];return t.value+=an,e}function gn(n,t){let e;return"getBigInt64"in DataView.prototype?e=Number(n.getBigInt64(t.value,!0)):e=n.getUint32(t.value+4,!0)+Number(n.getUint32(t.value,!0)<<32),t.value+=En,e}function b(n,t){const e=n.getFloat32(t.value,!0);return t.value+=X,e}function In(n,t){return On(B(n,t))}function On(n){const t=(n&31744)>>10,e=n&1023;return(n>>15?-1:1)*(t?t===31?e?NaN:1/0:Math.pow(2,t-15)*(1+e/1024):6103515625e-14*(e/1024))}function An(n){if(Math.abs(n)>65504)throw new Error("Value out of range.Consider using float instead of half-float.");n=yn(n,-65504,65504),z.floatView[0]=n;const t=z.uint32View[0],e=t>>23&511;return z.baseTable[e]+((t&8388607)>>z.shiftTable[e])}function Pn(n,t){return An(b(n,t))}function Un(n,t,e){const l=new TextDecoder().decode(new Uint8Array(n).slice(t.value,t.value+e));return t.value=t.value+e,l}function mn(n,t){const e=P(n,t),l=_(n,t);return[e,l]}function _n(n,t){const e=_(n,t),l=_(n,t);return[e,l]}function Tn(n,t){const e=b(n,t),l=b(n,t);return[e,l]}function Nn(n,t){const e=b(n,t),l=b(n,t),r=b(n,t);return[e,l,r]}function Cn(n,t,e){const l=t.value,r=[];for(;t.valuec||(t[r++]=n[e++],r>c));)t[r++]=n[l++]}const kn=20000630;function zn(n,t){if(n.getUint32(0,!0)!=kn)throw new Error("Incorrect OpenEXR format");const e=n.getUint8(4),l=n.getUint8(5),r={singleTile:!!(l&2),longName:!!(l&4),deepFormat:!!(l&8),multiPart:!!(l&16)};t.value=8;const c={};let s=!0;for(;s;){const o=$(n.buffer,t);if(!o)s=!1;else{const i=$(n.buffer,t),a=_(n,t),u=Ln(n,t,i,a);u===void 0?Sn.Warn("Unknown header attribute type ".concat(i,"'.")):c[o]=u}}if(l&-5)throw new Error("Unsupported file format");return{version:e,spec:r,...c}}const pn=16,Hn=1<>3]&1<<(r&7))&&(t[e++]=r);const l=e-1;for(;e>e&(1<>l;if(a=new Uint8Array([a])[0],o.value+a>i)return null;const u=s[o.value-1];for(;a-- >0;)s[o.value++]=u}else if(o.value0;--e){const l=t+D[e]>>1;D[e]=t,t=l}for(let e=0;e0&&(n[e]=l|D[l]++<<6)}}function Gn(n,t,e,l,r,c){const s=t;let o=0,i=0;for(;l<=r;l++){if(s.value-t.value>e)return;let a=tn(6,o,i,n,s);const u=a.l;if(o=a.c,i=a.lc,c[l]=u,u==sn){if(s.value-t.value>e)throw new Error("Error in HufUnpackEncTable");a=tn(8,o,i,n,s);let f=a.l+vn;if(o=a.c,i=a.lc,l+f>r+1)throw new Error("Error in HufUnpackEncTable");for(;f--;)c[l++]=0;l--}else if(u>=K){let f=u-K+2;if(l+f>r+1)throw new Error("Error in HufUnpackEncTable");for(;f--;)c[l++]=0;l--}}Wn(c)}function fn(n){return n&63}function hn(n){return n>>6}function Yn(n,t,e,l){for(;t<=e;t++){const r=hn(n[t]),c=fn(n[t]);if(r>>c)throw new Error("Invalid table entry");if(c>T){const s=l[r>>c-T];if(s.len)throw new Error("Invalid table entry");if(s.lit++,s.p){const o=s.p;s.p=new Array(s.lit);for(let i=0;i0;o--){const i=l[(r<=T;){const w=a>>u-T&d,y=t[w];if(y.len){u-=y.len;const h=Y(y.lit,c,a,u,e,l,o,i,f);h&&(a=h.c,u=h.lc)}else{if(!y.p)throw new Error("hufDecode issues");let h;for(h=0;h=v&&hn(n[y.p[h]])==(a>>u-v&(1<>=I,u-=I;u>0;){const p=t[a<=F||a<0||a>=F)throw new Error("Wrong HUF_ENCSIZE");const f=new Array(F),x=new Array(V);Zn(x);const I=l-(e.value-o);if(Gn(n,e,I,i,a,f),u>8*(l-(e.value-o)))throw new Error("Wrong hufUncompress");Yn(f,i,a,x),Xn(f,x,n,e,u,a,c,r,s)}function Q(n){return n&65535}function en(n){const t=Q(n);return t>32767?t-65536:t}function N(n,t){const e=en(n),r=en(t),c=e+(r&1)+(r>>1),s=c,o=c-r;return{a:s,b:o}}function C(n,t){const e=Q(n),l=Q(t),r=e-(l>>1)&nn;return{a:l+r-Hn&nn,b:r}}function qn(n,t,e,l,r,c,s){const o=s<16384,i=e>r?r:e;let a=1,u,f;for(;a<=i;)a<<=1;for(a>>=1,u=a,a>>=1;a>=1;){f=0;const x=f+c*(r-u),I=c*a,p=c*u,w=l*a,y=l*u;let h,v,A,L;for(;f<=x;f+=p){let E=f;const W=f+l*(e-u);for(;E<=W;E+=y){const O=E+w,g=E+I,k=g+w;if(o){let S=N(n[E+t],n[g+t]);h=S.a,A=S.b,S=N(n[O+t],n[k+t]),v=S.a,L=S.b,S=N(h,v),n[E+t]=S.a,n[O+t]=S.b,S=N(A,L),n[g+t]=S.a,n[k+t]=S.b}else{let S=C(n[E+t],n[g+t]);h=S.a,A=S.b,S=C(n[O+t],n[k+t]),v=S.a,L=S.b,S=C(h,v),n[E+t]=S.a,n[O+t]=S.b,S=C(A,L),n[g+t]=S.a,n[k+t]=S.b}}if(e&a){const O=E+I;let g;o?g=N(n[E+t],n[O+t]):g=C(n[E+t],n[O+t]),h=g.a,n[O+t]=g.b,n[E+t]=h}}if(r&a){let E=f;const W=f+l*(e-u);for(;E<=W;E+=y){const O=E+w;let g;o?g=N(n[E+t],n[O+t]):g=C(n[E+t],n[O+t]),h=g.a,n[O+t]=g.b,n[E+t]=h}}u=a,a>>=1}return f}function $n(n,t,e){for(let l=0;l0;){const c=r.getInt8(l++);if(c<0){const s=-c;t-=s+1;for(let o=0;o=j)throw new Error("Wrong PIZ_COMPRESSION BITMAP_SIZE");if(o<=i)for(let p=0;p0,bytesPerLine:0,outLineWidth:0,lines:0,scanlineBlockSize:0,inputSize:null,type:0,uncompress:null,getter:()=>0,format:5,outputChannels:0,decodeChannels:{},blockCount:null,byteArray:null,linearSpace:!1,textureType:0};switch(n.compression){case U.NO_COMPRESSION:r.lines=1,r.uncompress=wn;break;case U.RLE_COMPRESSION:r.lines=1,r.uncompress=Qn;break;case U.ZIPS_COMPRESSION:r.lines=1,r.uncompress=rn,await G.LoadScriptAsync(M.FFLATEUrl);break;case U.ZIP_COMPRESSION:r.lines=16,r.uncompress=rn,await G.LoadScriptAsync(M.FFLATEUrl);break;case U.PIZ_COMPRESSION:r.lines=32,r.uncompress=jn;break;case U.PXR24_COMPRESSION:r.lines=16,r.uncompress=Vn,await G.LoadScriptAsync(M.FFLATEUrl);break;default:throw new Error(U[n.compression]+" is unsupported")}r.scanlineBlockSize=r.lines;const c={};for(const a of n.channels)switch(a.name){case"Y":case"R":case"G":case"B":case"A":c[a.name]=!0,r.type=a.pixelType}let s=!1;if(c.R&&c.G&&c.B)s=!c.A,r.outputChannels=4,r.decodeChannels={R:0,G:1,B:2,A:3};else if(c.Y)r.outputChannels=1,r.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(r.type===1)switch(l){case m.Float:r.getter=In,r.inputSize=R;break;case m.HalfFloat:r.getter=B,r.inputSize=R;break}else if(r.type===2)switch(l){case m.Float:r.getter=b,r.inputSize=X;break;case m.HalfFloat:r.getter=Pn,r.inputSize=X}else throw new Error("Unsupported pixelType "+r.type+" for "+n.compression);r.blockCount=r.height/r.scanlineBlockSize;for(let a=0;aa:r.scanOrder=a=>r.height-1-a,r.outputChannels==4?(r.format=5,r.linearSpace=!0):(r.format=6,r.linearSpace=!1),r}function nt(n,t,e,l){const r={value:0};for(let c=0;cn.height?n.height-s:n.scanlineBlockSize;const i=n.size=n.height)continue;const x=a*n.bytesPerLine,I=(n.height-1-f)*n.outLineWidth;for(let p=0;p{const u=e.getEngine();e.format=s.format,e.type=o.textureType,e.invertY=!1,e._gammaSpace=!s.linearSpace,o.byteArray&&u._uploadDataToTextureDirectly(e,o.byteArray,0,0,void 0,!0)})}}export{st as _ExrTextureLoader}; diff --git a/assets/fogFragment-BYUe2MTZ.js b/assets/fogFragment-BYUe2MTZ.js new file mode 100644 index 0000000..7e98743 --- /dev/null +++ b/assets/fogFragment-BYUe2MTZ.js @@ -0,0 +1 @@ +import{S as o}from"./Viewer-DVCEMRp5.js";const f="fogFragmentDeclaration",e="#ifdef FOG\n#define FOGMODE_NONE 0.\n#define FOGMODE_EXP 1.\n#define FOGMODE_EXP2 2.\n#define FOGMODE_LINEAR 3.\nconst E=2.71828;uniform vFogInfos: vec4f;uniform vFogColor: vec3f;varying vFogDistance: vec3f;fn CalcFogFactor()->f32\n{var fogCoeff: f32=1.0;var fogStart: f32=uniforms.vFogInfos.y;var fogEnd: f32=uniforms.vFogInfos.z;var fogDensity: f32=uniforms.vFogInfos.w;var fogDistance: f32=length(fragmentInputs.vFogDistance);if (FOGMODE_LINEAR==uniforms.vFogInfos.x)\n{fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);}\nelse if (FOGMODE_EXP==uniforms.vFogInfos.x)\n{fogCoeff=1.0/pow(E,fogDistance*fogDensity);}\nelse if (FOGMODE_EXP2==uniforms.vFogInfos.x)\n{fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);}\nreturn clamp(fogCoeff,0.0,1.0);}\n#endif\n";o.IncludesShadersStoreWGSL[f]=e;const n="fogFragment",g="#ifdef FOG\nvar fog: f32=CalcFogFactor();\n#ifdef PBR\nfog=toLinearSpace(fog);\n#endif\ncolor= vec4f(mix(uniforms.vFogColor,color.rgb,fog),color.a);\n#endif\n";o.IncludesShadersStoreWGSL[n]=g; diff --git a/assets/fr-BgUf3CTX.js b/assets/fr-BgUf3CTX.js new file mode 100644 index 0000000..1cd9d3a --- /dev/null +++ b/assets/fr-BgUf3CTX.js @@ -0,0 +1 @@ +const e={Notifications:{BrowserWarnings:{Description:"{name} est obsolète et n'est pas entièrement pris en charge. La version actuelle est {version}, mais Mainsail requiert la version {minVersion} ou une version supérieure.",Headline:"Navigateur obsolète"},DependencyDescription:"La version actuelle de {name} ne supporte pas toutes les fonctionnalités de Mainsail. Mettez {name} à jour vers la version {neededVersion}.",DependencyName:"Dépendance: {name}",DismissAll:"Annuler tout",KlipperWarnings:{DeprecatedOption:"L'option '{option}' dans la section '{section}' est obsolète et sera supprimée dans une prochaine version.",DeprecatedOptionHeadline:"Option Klipper obsolète",DeprecatedValue:"La valeur '{value}' dans l'option '{option}' de la section '{section}' est obsolète et sera supprimée dans une prochaine version.",DeprecatedValueHeadline:"Valeur d'une option Klipper obsolète",KlipperWarning:"Avertissement Klipper"},MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"Une erreur a été détectée lors du chargement du composant moonraker '{component}'. Veuillez vérifier le fichier log et corriger le problème.",MoonrakerWarning:"Avertissement Moonraker",UnparsedConfigOption:"Option de configuration non analysée '{option} : {value}' détectée dans la section [{section}]. Il peut s'agir d'une option qui n'est plus disponible ou d'un module dont le chargement a échoué. À l'avenir, cela se traduira par une erreur de démarrage.",UnparsedConfigSection:"Section de configuration non analysée [{section}] détectée. Cela peut être le résultat d'un composant qui n'a pas réussi à se charger. À l'avenir, cela se traduira par une erreur de démarrage."},Never:"jamais",NextReboot:"prochain redémarrage",NoNotification:"Pas de notification disponible",Notifications:"Notifications",Remind:"Rappel:",ShowDetails:"afficher les détails"},NumberInput:{GreaterOrEqualError:"Doit être supérieur ou égal à {min}!",MustBeBetweenError:"Doit être compris entre {min} et {max}!",NoEmptyAllowedError:"L'entrée ne doit pas être vide !"},Printers:"Imprimantes",TextfieldWithCopy:{Copied:"Copié"},TheServiceWorker:{DescriptionNeedUpdate:"Le cache local est obsolète et doit être mis à jour. Veuillez cliquer sur le bouton ci-dessous pour mettre à jour le cache.",TitleNeedUpdate:"PWA a besoin d'une mise à jour",Update:"mise à jour"},ThrottledStates:{DescriptionCurrentlyThrottled:"Le(s) coeur(s) du rPi ARM est (sont) actuellement bridé(s).",DescriptionFrequencyCapped:"La fréquence maximale du rPi ARM est actuellement limitée à 1,2 GHz.",DescriptionPreviouslyFrequencyCapped:"La fréquence maximale du rPi ARM a été limitée au moins une fois à 1,2 GHz depuis la dernière mise sous tension.",DescriptionPreviouslyTemperatureLimited:"La température du rPi uC (3A+/3B+ uniquement) a dépassé au moins une fois la limite souple (par défaut 60C) depuis la dernière mise sous tension.",DescriptionPreviouslyThrottled:"Le(s) coeur(s) du rPi ARM a(ont) été ralenti(s) au moins une fois depuis la dernière mise sous tension.",DescriptionPreviouslyUnderVolted:"La tension d'alimentation du rPi a chuté en dessous de 4,65 V au moins une fois depuis la dernière mise sous tension.",DescriptionTemperatureLimitActive:"La température du rPi uC (3A+/3B+ uniquement) est actuellement supérieure à la limite souple (60C par défaut).",DescriptionUnderVoltageDetected:"Tension d'alimentation du rPi actuellement inférieure à 4,65V",TitleCurrentlyThrottled:"actuellement en mode réduit",TitleFrequencyCapped:"fréquence réduite",TitlePreviouslyFrequencyCapped:"a été limité en fréquence",TitlePreviouslyTemperatureLimited:"a été limité par la température",TitlePreviouslyThrottled:"Précédemment fréquence réduite",TitlePreviouslyUnderVolted:"précédemment alimentation faible",TitleTemperatureLimitActive:"Limite de température active",TitleUnderVoltageDetected:"Alimentation faible détectée"},Titles:{Complete:"Terminé - {filename}",Error:"ERREUR",Pause:"Pause impression",PrinterOff:"Imprimante OFF",Printing:"{percent}% imprimé - {filename}",PrintingETA:"{percent}% imprimé - TEA: {eta} - {filename}"},TopBar:{CannotUploadTheFile:"Chargement du fichier impossible!",EmergencyStop:"Arrêt d'urgence",SAVE_CONFIG:"Sauvegarde de la configuration",Uploading:"Chargement",UploadOfFileSuccessful:"le fichier {file} a été chargé!",UploadPrint:"Charger et imprimer"},TopCornerMenu:{Cancel:"Annuler",ConfirmationDialog:{Description:{HostReboot:"Le redémarrage de l'hôte entraînera l'échec de l'impression en cours!",HostShutdown:"L'arrêt de l'hôte entraînera l'échec de l'impression en cours!",KlipperFirmwareRestart:"Le redémarrage du micrologiciel Klipper entraînera l'échec de l'impression en cours!",KlipperRestart:"Le redémarrage de Klipper entraînera l'échec de l'impression en cours!",KlipperStop:"L'arrêt de Klipper entraînera l'échec de l'impression en cours!",ServiceRestart:"Le redémarrage de ce service peut entraîner l'échec de l'impression en cours!",ServiceStart:"Le démarrage de ce service peut entraîner l'échec de l'impression en cours!",ServiceStop:"L'arrêt de ce service peut entraîner l'échec de l'impression en cours!"},Title:{HostReboot:"Redémarrage de l'hôte",HostShutdown:"Fermeture de l'hôte",KlipperFirmwareRestart:"Redémarrage du firmware Klipper",KlipperRestart:"Redémarrage de Klipper",ServiceRestart:"Redémarrage du Service",ServiceStart:"Démarrage du Service",ServiceStop:"Arrêt du Service"}},HostControl:"Contrôle de l'hôte",KlipperControl:"Contrôle de klipper",KlipperFirmwareRestart:"Redémarrage du firmware",KlipperRestart:"Redémarrage",PowerDevices:"Modules d'alimentation",Reboot:"Redémarrer",Restart:"Redémarrage",ServiceControl:"Contrôle des services",Shutdown:"Arrêt",Start:"Démarrage",Stop:"Arrêter"},UpdateDialog:{Close:"Fermer",Empty:"Vide",Recovering:"Récupération {software}...",RecoveringDone:"Récupération {software} effectuée!",Updating:"Mise à jour {software}...",UpdatingDone:"Mise à jour {software} effectuée!"}},r={Abort:"annuler",Accept:"accepter",Adjusted:"ajusté",Description:"Cliquez sur Ajusté si la vis courante a été ajustée. Cliquez sur Accepter pour continuer sans ajustement.",Headline:"Vis du plateau",ScrewAccepted:"Vis acceptées",ScrewIndex:"Index des vis",ScrewName:"Nom de la vis",ScrewOutput:"{current} de {max}"},i={CannotConnectTo:"Impossible de se connecter à Moonraker ({host}).",CheckMoonrakerLog:"Si ce message apparaît de manière répétée, veuillez consulter le fichier log situé à l'adresse suivante:",Connecting:"Se connecter à {host}",Failed:"Échec de la connexion",Initializing:"Initialisation",TryAgain:"Réessayez"},t={CommandList:"Liste des commandes",Empty:"Vide",HideTemperatures:"Cacher les températures",HideTimelapse:"Cacher le timelapse",SendCode:"Envoyer le code...",SetupConsole:"Configuration console"},a={AreYouSure:"Êtes-vous sûr·e?",No:"Non",Yes:"Oui"},n={Formats:"Formats",Headline:"Appareils",HideSystemEntries:"Masquer les entrées système",Resolutions:"Résolutions"},o={StartPrint:{Cancel:"Annuler",DoYouWantToStartFilename:"Voulez-vous commencer {filename}?",DoYouWantToStartFilenameFilament:"Voulez-vous démarrer {filename} avec le filament suivant?",Headline:"Démarrage Impression",Print:"imprimer",Timelapse:"Timelapse"}},s={ConfigReference:"Référence de la configuration",DontSave:"Ne pas sauvegarder",Downloading:"Téléchargement",FailedSave:"{filename} n'a pas pu être téléchargé!",FileReadOnly:"lecture seule",SaveClose:"Enregistrer et fermer",SaveRestart:"Sauvegarder et Redémarrer",SuccessfullySaved:"{filename} sauvegardé avec succès.",UnsavedChanges:"Modifications non sauvegardées",UnsavedChangesMessage:"Souhaitez-vous enregistrer les modifications apportées à {filename}?",UnsavedChangesSubMessage:"Vos modifications seront perdues si vous ne les enregistrez pas. Vous pouvez désactiver ce message dans les paramètres de l'éditeur.",Uploading:"Chargement"},l={AreYouSure:"Êtes-vous sûr?",EmergencyStop:"Arrêt d'urgence",No:"Non",Yes:"Oui"},u={AddBatchToQueue:"Ajouter un lot à la file d'attente",AddToQueue:"Ajouter à la file d'attente",AllFiles:"Tous",BedTemp:"Température plateau",Cancel:"Annuler",ChamberTemp:"Température chambre",Count:"Nombre",Create:"Créer",CreateNewDirectory:"Créer un nouveau répertoire",CurrentPath:"Répertoire actuel",Delete:"Supprimer",DeleteDirectory:"Supprimer le répertoire",DeleteDirectoryQuestion:'Voulez-vous vraiment supprimer "{name}" avec tout son contenu?',DeleteSelectedQuestion:"Voulez-vous vraiment supprimer les {count} fichiers sélectionnés ?",DeleteSingleFileQuestion:'Voulez-vous vraiment supprimer le fichier "{name}"?',Download:"Télécharger",Duplicate:"Dupliquer",DuplicateFile:"Fichiers en double",EditFile:"Editer le fichier",Empty:"Vide",ExtruderTemp:"Température Extrudeur",Filament:"Filament",FilamentName:"Nom du filament",FilamentType:"Type de filament",FilamentUsage:"Utilisation du filament",FilamentWeight:"Poids du filament",Files:"Fichiers",Filesize:"Taille du fichier",Free:"Gratuit",FreeDisk:"Disque libre",GCodeFiles:"Fichiers G-Code",GcodesRootDirectoryDoesntExists:"Aucun répertoire G-Code n'a été trouvé. Veuillez vérifier l'option \"path\" dans la section [virtual_sdcard] de la configuration de Klipper.",HiddenFiles:"Fichiers cachés",InvalidNameAlreadyExists:"Le nom existe déjà, veuillez choisir un autre nom.",InvalidNameEmpty:"L'entrée ne doit pas être vide!",LastEndTime:"Dernière heure de fin",LastFilamentUsed:"Dernier filament utilisé",LastModified:"Dernière modification",LastPrintDuration:"Durée de la dernière impression",LastStartTime:"Dernière heure de début",LastTotalDuration:"Dernière Durée totale",LayerHeight:"Hauteur de la couche",Name:"Nom",NewDirectory:"Nouveau répertoire",NozzleDiameter:"Diamètre de la buse",ObjectHeight:"Hauteur de l'objet",Preheat:"Préchauffage",PrintedFiles:"Fichiers imprimés",PrintStart:"Début de l'impression",PrintTime:"Temps d'impression",RefreshCurrentDirectory:"Actualiser le répertoire actuel",Rename:"Renommer",RenameDirectory:"Renommer le répertoire",RenameFile:"Renommer un fichier",ScanMeta:"Scanner les métadonnées",ScanMetaSuccess:"L'analyse des métadonnées a été effectuée avec succès à partir de: {filename}.",Search:"Recherche",SetupCurrentList:"Configuration de la liste actuelle",Slicer:"Trancheur",SuccessfullyCreated:"{filename} créé avec succès.",SuccessfullyDeleted:"Suppression de {filename} réussie.",SuccessfullyMoved:"Déplacement réussi de {filename}.",SuccessfullyRenamed:"{filename} renommé avec succès.",SuccessfullyUploaded:"Chargement de {filename} réussi!",Total:"Total",UploadNewGcode:"Charger un nouveau G-Code",Used:"Utilisé",View3D:"Vue 3D"},d={CannotUploadFile:"Impossible de télécharger le fichier!",DropFilesToUploadFiles:"Déposer des fichiers à télécharger"},c={ClearLoadedFile:"Effacer",CNCMode:"Mode CNC",ColorMode:"Mode couleur",Downloading:"Téléchargement",ForceLineRendering:"Rendu de la ligne de force",HDRendering:"Rendu HD (Extrusions rondes)",High:"Haut",LoadCurrentFile:"Charge le fichier courant",LoadLocal:"Fichier local",Low:"Faible",Max:"Max",Medium:"Moyen",ReloadRequired:"Recharge nécessaire",Rendering:"Rendu",RenderQuality:"Qualité du rendu",ShowGCode:"Afficher le G-Code",ShowObjectSelection:"Afficher la sélection d'objets",ShowToolhead:"Afficher la tête d'outil",ShowTravelMoves:"Montrer les déplacements",SpecularLighting:"Éclairage spéculaire",Title:"Visionneuse G-Code",Tracking:"Suivi",Transparency:"Transparence",Ultra:"Ultra",VoxelMode:"Mode Voxel (ASMBL)"},m={Abort:"annuler",BedMeshCalibrate:"Calibrage du maillage",BedMeshRemove:"Supprimer le maillage",Calibrate:"calibrer",Clear:"Effacer",CurrentMesh:{Headline:"Maillage actuel",Max:"Max",Min:"Min",Name:"Nom",Range:"Gamme",Size:"Taille"},DeleteBedMeshProfile:"Supprimer le profil du maillage",DoYouReallyWantToDelete:'Voulez-vous vraiment supprimer le profil "{name}"?',ErrorKlipperNotReady:"Klipper n'est pas prêt. Maillage désactivé.",Flat:"Plat",Heightmap:"Maillage",InvalidNameAlreadyExists:"Le nom du profil existe déjà, veuillez choisir un autre nom de profil.",InvalidNameAscii:"Le nom n'est pas valide. Seuls les caractères ascii sont autorisés.",InvalidNameEmpty:"L'entrée ne doit pas être vide!",InvalidNameReserved:"Le profil 'par défaut' est réservé, veuillez choisir un autre nom de profil.",Later:"Plus tard",Mesh:"Calculé",Name:"Nom",NoBedMeshHasBeenLoadedYet:"Aucun maillage chargé",NoProfile:"Pas de profil disponible",Ok:"OK",Probed:"Mesuré",Profiles:"Profils",Remove:"supprimer",RemoveSaveDescription:"Le maillage a été enregistré comme supprimé. Cliquez sur SAVE_CONFIG pour le retirer du fichier printer.cfg et redémarrez Klipper.",Rename:"renommer",RenameBedMeshProfile:"Renommer le maillage",SAVE_CONFIG:"SAVE_CONFIG",ScaleGradient:"Facteur d'échelle",ScaleZMax:"Maximum axe Z.",TitleCalibrate:"Calibrage du nouveau maillage",TitleClear:"Effacer maillage",TitleHomeAll:"Réf. tous",Wireframe:"Maillage"},p={AddNote:"Ajouter une note",AllJobs:"Tous",AvgPrinttime:"Temps d'impression - Ø",Cancel:"Annuler",Chart:"Graphique",CreateNote:"Créer une note",Delete:"Supprimer",DeleteSelectedQuestion:"Voulez-vous vraiment effacer {count} travaux?",DeleteSingleJobQuestion:"Voulez vous vraimetn supprimer le travail?",Details:"Détails",EditNote:"Editer la Note",Empty:"vide",EndTime:"Heure de fin",EstimatedFilament:"Estimation de la longueur du filament",EstimatedFilamentWeight:"Estimation du poids du filament",EstimatedTime:"Estimation de la durée d'impression",FilamentCalc:"Filament Calculé",FilamentUsage:"Filament Consommé",FilamentUsed:"Filament Utilisé",Filename:"Fichier",Filesize:"Taille",FirstLayerBedTemp:"Temp. plateau 1ère couche",FirstLayerExtTemp:"Temp. extrudeur 1ère couche",FirstLayerHeight:"Hauteur 1ère couche",HistoryFilamentUsage:"Filament",HistoryPrinttimeAVG:"Impressions",JobDetails:"Détails impression",Jobs:"Travaux",LastModified:"Dernière modification",LayerHeight:"Hauteur de la couche",LongestPrinttime:"Temps d'impression le plus long",Note:"Note",ObjectHeight:"Hauteur de l'objet",PrintDuration:"Temps d'impression",PrintHistory:"Historique d'impression",PrintTime:"Durée d'impression",PrinttimeAvg:"Temps moyen d'impression",Reprint:"Réimpression",Save:"sauvegarder",Search:"recherche",SelectedFilamentUsed:"Filament sélectionné utilisé",SelectedJobs:"Travaux sélectionnés",SelectedPrinttime:"Temps d'impression sélectionné",Slicer:"Trancheur",SlicerVersion:"Version slicer",StartTime:"Heure de début",Statistics:"Statistiques",Status:"Statut",StatusValues:{cancelled:"Annulé",completed:"Terminé",error:"Erreur",in_progress:"En cours",klippy_disconnect:"Déconnexion de Klippy",klippy_shutdown:"Arrêt Klippy",Others:"Autres",server_exit:"Sortie du serveur"},Table:"Table",TitleExportHistory:"Exporter l'historique",TitleRefreshHistory:"Rafraîchir l'historique",TitleSettings:"Paramètres",TotalDuration:"Durée totale",TotalFilamentUsed:"Total du filament utilisé",TotalJobs:"Nombre travaux",TotalPrinttime:"Total temps d'impression",TotalTime:"Durée totale"},g={AllJobs:"Tous",Cancel:"Annuler",ChangeCount:"Nombre de changements",Count:"Nombre",Empty:"Vide",InvalidCountEmpty:"L'entrée ne doit pas être vide!",InvalidCountGreaterZero:"L'entrée doit être supérieure à 0!",JobQueue:"File d'attente",Jobs:"Jobs",Pause:"Pause",RemoveFromQueue:"Retirer de la file d'attente",Start:"Démarrage"},f={ConfigFilesPanel:{AllFiles:"Tous",Cancel:"Annuler",ConfigFiles:"Fichiers de configuration",ConfigRootDirectoryDoesntExists:"Aucun répertoire de configuration n'a été trouvé. Veuillez vérifier l'option \"config_path\" dans la section [file_manager] de la configuration de Moonraker.",Create:"Créer",CreateDirectory:"Créer un répertoire",CreateFile:"Créer un fichier",CurrentPath:"Chemin actuel",Delete:"Supprimer",DeleteDirectory:"Supprimer le répertoire",DeleteDirectoryQuestion:'Supprimer le répertoire "{name}" et tout son contenu?',DeleteSelectedQuestion:"Supprimer les {count} élements sélectionnés?",DeleteSingleFileQuestion:'Voulez-vous vraiment supprimer le fichier "{name}"?',Download:"Télécharger",Duplicate:"Dupliquer",DuplicateFile:"Fichiers en double",EditFile:"Editer le fichier",Empty:"Vide",Files:"Fichiers",Filesize:"Taille des fichiers",Free:"Libre",FreeDisk:"Disque libre",HiddenFiles:"Fichiers cachés",HideBackupFiles:"Cacher les fichiers de sauvegarde",LastModified:"Dernière modification",Name:"Nom",RefreshDirectory:"Actualiser le répertoire",Rename:"Renommer",RenameDirectory:"Renommer le répertoire",RenameFile:"Renommer un fichier",Root:"Racine",SetupCurrentList:"Configuration de la liste actuelle",ShowFile:"Afficher le fichier",Total:"Total",UploadFile:"Charger le fichier",Uploading:"Chargement",Used:"Utilisé"},EndstopPanel:{Endstop:"Fin de course",EndstopInfo:"Appuyez sur le bouton de synchronisation en bas à droite pour charger l'état actuel des fins de course.",Endstops:"Fins de course",open:"inactif",TRIGGERED:"actif"},LogfilesPanel:{Accept:"accepter",Cancel:"annuler",Logfiles:"Fichiers logs",Rollover:"Logs glissants",RolloverDescription:"Veuillez sélectionner les logs à réinitialiser:",RolloverToastFailed:'Message du log "{name}": {message}',RolloverToastSuccessful:'Le log "{name}" a été réinitialisé avec succès.'},SystemPanel:{Constants:"Constantes",Cpu:"CPU",HostDetails:"Détails hôte",LastStats:"Dernières statistiques",Load:"Chargement",Memory:"Mémoire",NoMoreInfos:"Pas d'infos supplémentaires",SystemLoad:"Charge Système",Values:{Awake:"Eveillé: {awake}",Bandwidth:"Bande passante: {bandwidth}/s",Distro:"Distribution: {name} {version_id}",Frequency:"Fréquence: {frequency}",Load:"Chargement: {load}",Memory:"Mémoire: {memory}",Os:"OS: {os}",Received:"Reçu: {received}",Temp:"Température: {temp}°C",TempMax:"max: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Transmis: {transmitted}",Version:"Version: {version}"}},UpdatePanel:{Abort:"Abandonner",AreYouSure:"Êtes-vous sûr?",CheckForUpdates:"Vérifier les mises à jour",Close:"Fermer",CommitHistory:"Historique des publications",Commits:"Publications",CommitsAvailable:"pas de publications disponibles | {count} publication disponible | {count} publications disponibles",CommitsOnDate:"Publications le {date}",CommittedDaysAgo:"publié {days} jours avant",CommittedHoursAgo:"publié {hours} heures avant",CommittedOnDate:"publié le {date}",CommittedYesterday:"publié hier",ConfigChanges:"Changements de configuration",Corrupt:"corrompu",CountPackagesCanBeUpgraded:"{count} paquets peuvent être mis à jour",Detached:"détaché",Dirty:"différent",GenericUpdateQuestion:"Vérifiez l'historique des publications (s'il est disponible) et la page GitHub de ce projet pour voir si des ajustements manuels sont nécessaires pour cette mise à jour.",GitHubPage:"Page GitHub",HardRecovery:"Récupération difficile",InitUpdateManager:"Le gestionnaire de mise à jour n'a pas encore été initialisé. C'est normal lorsque vous démarrez le système pour la première fois. Veuillez cliquer sur le bouton d'actualisation pour initialiser tous les composants.",Invalid:"invalide",IUnderstandTheRisks:"Je comprends les risques",KlipperUpdateQuestionConfig:"Cette mise à jour peut également contenir des changements dans les paramètres de configuration qui devront être modifiés dans le fichier printer.cfg, voir le journal des changements pour plus de détails.",KlipperUpdateQuestionFirmware:"Cette opération met à jour le logiciel hôte de Klipper. Les cartes de contrôle fonctionnant avec le micrologiciel Klipper peuvent avoir besoin d'être flashées avec un micrologiciel recompilé avant que la machine ne puisse être remise en service.",LinkToGithub:"Lien vers GitHub",MoonrakerUpdateQuestion:"Cette opération met à jour l'API Moonraker. Des modifications du fichier moonraker.conf peuvent être nécessaires pour continuer à utiliser la machine.",MoreCommitsInfo:"Un maximum de 30 publications peuvent être affichées ici. Pour voir toutes les publications, veuillez cliquer sur le lien suivant:",OSPackages:"Paquets OS",SoftRecovery:"Récupération douce",StartUpdate:"Démarrer la mise à jour",System:"Système",ThesePackagesCanBeUpgrade:"Ces paquets système peuvent être mis à jour:",Unknown:"inconnue",Update:"mise à jour",UpdateAll:"Mise à jour de tous les composants",UpdateManager:"Gestionnaire de mise à jour",UpdateWarning:"Avertissement de mise à jour: {name}",Upgrade:"mise à niveau",UpgradeableSystemPackages:"Packs de systèmes évolutifs",UpToDate:"à jour",WebClientUpdateQuestion:"Dans certains cas, la mise à jour du client web peut entraîner des modifications susceptibles de provoquer une incompatibilité. Voir les notes de version pour plus d'informations."}},h={Abort:"annuler",Accept:"accepter",Advanced:"Avancé",Headline:"Sonde manuelle"},v={ExtruderControlPanel:{Allowed:"Autorisé",CleanNozzle:"Nettoyage de la buse",EstimatedExtrusion:"Extrusion:",Extrude:"Extrusion",ExtruderTempTooLow:"Température d'extrusion trop basse",ExtrusionFactor:"Facteur d'extrusion",ExtrusionFeedrate:"Vitesse d'extrusion",FilamentLength:"Longueur du filament",FirmwareRetractionSettings:{RetractLength:"Longueur de rétraction",RetractSpeed:"Vitesse de rétraction",UnretractExtraLength:"Distance de dérétraction supplémentaire",UnretractSpeed:"Vitesse de dérétraction"},Headline:"Contrôles d'Extrudeur",LoadFilament:"Chargement du filament",PressureAdvanceSettings:{Advance:"Avance de la pression",Extruder:"Extrudeur",SmoothTime:"Temps de lissage"},PurgeFilament:"Purge du filament",Requested:"Demandé",Retract:"Rétraction",TooLargeExtrusion:"Extrusion trop importante!",UnloadFilament:"Décharger le filament"},FarmPrinterPanel:{ReconnectToPrinter:"Se reconnecter",SwitchToPrinter:"Changer d'imprimante",WebcamOff:"Arrêt"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Veuillez vérifier que le service Klipper fonctionne et que l'adresse klippy_uds_address est correctement configurée dans le fichier moonraker.conf..",FirmwareRestart:"Redémarrage du firmware",MoonrakerCannotConnect:"Moonraker ne peut pas se connecter à Klipper!",PowerOn:"Mise sous tension",PrinterSwitchedOff:"L'imprimante est hors tension",PrinterSwitchedOffDescription:"L'imprimante est actuellement hors tension et Klipper ne peut pas se connecter. Pour mettre l'imprimante sous tension, cliquez sur le bouton ci-dessous:",Restart:"Redémarrage",ServiceReports:"rapports de {service}"},MachineSettingsPanel:{Headline:"Réglages machine",MotionSettings:{Acceleration:"Accélération",MaxAccelToDecel:"Décélération maximale",SquareCornerVelocity:"Vitesse des angles droits",Velocity:"Vitesse"}},MacrosPanel:{Headline:"Macros",Send:"envoyer"},MiniconsolePanel:{Autoscroll:"Défilement automatique",Headline:"Console",HideTemperatures:"Cacher les températures",HideTimelapse:"Cacher le timelapse",SendCode:"Envoyer le code...",SetupConsole:"Réglage Console"},MinSettingsPanel:{IncludeMainsailCfg:"Veillez à inclure le fichier mainsail.cfg dans votre fichier printer.cfg.",IsNotDefinedInConfig:"n'est pas défini dans la configuration.",MissingConfiguration:"Configuration manquante",MoreInformation:"Plus d'informations"},MiscellaneousPanel:{Headline:"Divers",Light:{Blue:"bleu",Green:"vert",Red:"rouge",White:"blanc"},RunoutSensor:{Detected:"détecté",Disabled:"inactif",Empty:"Vide"}},PowerControlPanel:{Error:"Erreur",Off:"Arrêt",On:"Marche",PowerControl:"Alimentation"},SpoolmanPanel:{Cancel:"Annuler",ChangeSpool:"Changer de bobine",DaysAgo:"{days} jours avant",EjectSpool:"Ejecter la bobine",EjectSpoolQuestion:"Êtes-vous sûr de vouloir éjecter la bobine de filament?",Filament:"Filament",FilamentTypeMismatch:"Le matériau de la bobine active ({spoolType}) ne correspond pas au matériau du G-Code ({fileType}).",Headline:"Spoolman",LastUsed:"Dernière utilisation",Location:"Localisation",Material:"Matériau",Never:"Jamais",NoActiveSpool:"Le suivi du filament est inactif. Pour commencer, veuillez sélectionner une bobine.",NoResults:"Aucune bobine n'a été trouvée avec les critères de recherche actuels.",NoSpools:"Pas de bobines disponibles",NoSpoolSelected:"Aucune bobine sélectionnée. Veuillez sélectionner une bobine ou cette impression ne sera pas suivie.",OpenSpoolManager:"ouvrir le gestionnaire de bobines",Refresh:"rafraîchir",Search:"Recherche",SelectSpool:"Sélectionner une bobine",Today:"Aujourd'hui",TooLessFilament:"Il se peut que la bobine actuelle ne contienne pas assez de filament pour cette impression. ({spoolWeight}g pour {fileWeight}g)",Weight:"Poids",Yesterday:"Hier"},StatusPanel:{CancelPrint:"Annuler l'impression",ClearPrintStats:"Effacer les statistiques d'impression",Difference:"Différence",EmptyGcodes:"Pas de G-Codes disponibles.",EmptyJobqueue:"Il n'y a actuellement aucun fichier dans la file d'attente.",Estimate:"Estimation",ETA:"TEA",ExcludeObject:{Cancel:"annuler",Excluded:"Exclus",ExcludeObject:"Exclure un objet",ExcludeObjectHeadline:"Exclure un objet",ExcludeObjectText:'Voulez-vous vraiment exclure "{name}"?'},Filament:"Filament",File:"Fichier",Files:"Fichiers",Flow:"Débit",Headline:"Statut",Jobqueue:"File d'attente",JobqueueMoreFiles:"pas de travaux | un travail | {count} travaux",Layer:"Couche",Max:"max",ObjectHeight:"Hauteur de l'objet",PauseAtLayer:{Abort:"annuler",Accept:"accepter",AtLayer:"à la couche",Call:"Appeler",DescriptionPauseAtLayerActive:"Cette fonction est déjà active et appellera '{call}' à la couche {layer}. Si vous appelez à nouveau la commande, ces paramètres seront écrasés.",DescriptionPauseNextLayerActive:"Cette fonction est déjà active et appellera '{call}' à la couche suivante.",Layer:"Couche",NextLayer:"Couche suivante",PauseAtLayer:"Pause à la couche",Type:"Type"},PausePrint:"Pause de l'impression",Print:"Imprimer",PrintTime:"Temps d'impression",ReprintJob:"Réimpression",Requested:"Requis",ResumePrint:"Reprendre l'impression",Slicer:"Trancheur",Speed:"Vitesse",Status:"Statut",Total:"Total",Unknown:"Inconnu"},TemperaturePanel:{AutoscaleChart:"Echelle automatique",Avg:"Moyenne",Cooldown:"Refroidissement",Current:"Actuel",Dataset:{Power:"Puissance-PWM",Speed:"Vitesse-PWM",Target:"température cible",Temperature:"température actuelle"},Headline:"Températures",HideMcuHostSensors:"Cacher les capteurs hôte/MCU",HideMonitors:"Cacher les moniteurs",Max:"max",Min:"min",Name:"Nom",Presets:"Préréglages",SetupTemperatures:"Réglages Températures",ShowChart:"Afficher graphique",ShowNameInChart:"Afficher {name} dans le graphique",ShowNameInList:"Afficher {name} dans la liste",State:"État",Target:"Cible",TemperaturesInChart:"Température [°C]",TempTooHigh:"Température trop élevée pour {name}! (max: {max})",TempTooLow:"Température trop basse pour {name}! (min: {min})"},ToolheadControlPanel:{Absolute:"absolue",ALL:"Tous",ControlButtons:"Boutons de commande",CoordinateFields:"Champs de coordonnées",Headline:"Tête d'impression",PleaseConfigureSteps:"Veuillez configurer les Pas",Position:"Position",PositionOutput:"Position de sortie",QGL:"QGL",Relative:"relative",SettingsInterfaceControl:"Réglages > Interface > Contrôle",SpeedFactor:"Facteur de vitesse",ZOffset:"Offset Z",ZTilt:"Z-Tilt"},WebcamPanel:{All:"Tous",FPS:"IPS",Headline:"Caméra",NoWebcam:'Aucune webcam n\'est disponible. Ajouter une webcam sous "Réglages interface" -> "Caméras".',UnknownWebcamService:"Service Caméra inconnu"},ZoffsetPanel:{Clear:"Effacer",Headline:"Offset Z",Later:"Plus tard",Ok:"OK",Save:"Sauvegarder",SaveConfig:"SAVE CONFIG",SaveInfoDescription:'Le nouveau décalage Z a été calculé et enregistré. Cliquez sur "SAVE CONFIG" pour l\'enregistrer dans le fichier printer.cfg et redémarrer Klipper.',SaveInfoDescriptionPrint:"Le nouveau décalage Z a été calculé et enregistré. Après l'impression, cliquez sur \"SAVE CONFIG\" dans la barre supérieure pour l'enregistrer dans le fichier printer.cfg et redémarrer Klipper.",SaveInfoHeadline:"Information"}},C={AreYouSure:"Êtes-vous sûr?",No:"Non",TurnDeviceOff:"Arrêter {device}",TurnDeviceOn:"Mettre en marche {device}",Yes:"Oui"},S={Console:"Console",Dashboard:"Tableau de bord","G-Code Files":"Fichiers G-Code","G-Code Viewer":"Visionneuse G-Code",Heightmap:"Maillage",History:"Historique",Machine:"Machine",Printers:"Imprimantes",Timelapse:"Timelapse",Webcam:"Caméra"},D={Accept:"accepter",Base:"Base",ErrorText:"Un problème s'est produit au cours du processus de sondage.",Headline:"Ajustement de niveau par vis",Retry:"réessayer"},b={AddPrinter:"Ajouter une imprimante",AddPrintersToJson:"Veuillez ajouter les imprimantes au fichier config.json.",CannotConnectTo:"Impossible de se connecter à {host}.",ChangePrinter:"Changer d'imprimante",Connecting:"Se connecter à {host}",ConnectionFailed:"Échec de la connexion",EditPrinter:"Editer l'imprimante",Hello:"Bonjour et bienvenue dans le mode à distance de Mainsail!",HostnameInvalid:"nom d'hôte/IP non valide",HostnameIp:"Nom d'hôte/IP",HostnameRequired:"Le nom d'hôte est requis",Port:"Port",PortRequired:"Le port est nécessaire",RememberToAdd:"N'oubliez pas d'ajouter '{cors}' dans moonraker.conf à l'intérieur de 'cors_domains'.",SelectPrinter:"Sélectionner l'imprimante",TryAgain:"Réessayez",UpdatePrinter:"Mise à jour de l'imprimante",YouCanFindMore:"Vous trouverez plus d'informations à l'adresse suivante"},T={Cancel:"Annuler",Close:"Fermer",ConsoleTab:{AddFilter:"ajouter un filtre",Console:"Console",CreateHeadline:"Créer un filtre",Direction:"Direction",DirectionShell:"Défilement de bas en haut",DirectionTable:"Défilement de haut en bas",EditHeadline:"Editer le filtre",EntryStyle:"Style de dialogue d'entrée",EntryStyleCompact:"compact",EntryStyleDefault:"par défaut",Filters:"Filtres",Height:"Hauteur",HideTemperatures:"Cacher les températures",HideTimelapse:"Cacher le timelapse",Name:"Nom",Regex:"Regex",StoreButton:"Ajouter un filtre",UpdateButton:"Mise à jour du filtre"},ControlTab:{Bars:"Barres",Circle:"Cercle",Control:"Contrôle",Cross:"Croix",EnableXYHoming:"Activer les m.a.z. simultanées des axes X & Y",EstimatedExtrusionInfo:"Afficher les estimations d'extrusion",EstimatedExtrusionInfoDescription:"Afficher / Cacher les estimations d'extrusions basées sur la quantité et le débit.",HideDuringPrint:"Masquer les commandes d'axe pendant l'impression",InvertXMovement:"Inverser le sens de déplacement de l'axe X",InvertYMovement:"Inverser le sens de déplacement de l'axe Y",InvertZMovement:"Inverser le sens de déplacement de l'axe Z",IsDefault:" (défaut)",MaximumValues:"Valeurs maximales: {maximum}",MaximumValuesVisibility:"Maximum de {maximum} est recommandée pour une meilleure visibilité",MinimumValues:"Valeurs minimales: {minimum}",MotorsOff:"Moteurs éteints{isDefault}",MoveDistancesEInMm:"Déplacement E (en mm)",MoveDistancesInMm:"Déplacement (en mm)",MoveDistancesXYInMm:"Déplacement X & Y (en mm)",MoveDistancesZInMm:"Déplacement Z (in mm)",QuadGantryLevel:"Portique à quatre niveaux{isDefault}",SpeedEInMms:"Vitesse E (en mm/s)",SpeedXY:"Vitesse X & Y",SpeedZ:"Vitesse Z",Style:"Style",ValueGreaterThan:"La valeur doit être supérieure à {value}",ZOffsetIncrements:"Increments Offset Z (en mm)",ZOffsetSaveOption:"Option de sauvegarde de l'Offset Z",ZOffsetSaveOptionDescription:"Modifier l'option d'enregistrement de l'Offset Z",ZTiltAdjust:"Réglage du Z-Tilt{isDefault}"},DashboardTab:{Dashboard:"Tableau de bord",Desktop:"Ecran standard",Mobile:"Mobile",ResetLayout:"Réinitialisation de la mise en page",Tablet:"Tablette",Widescreen:"Écran large"},Edit:"Edition",EditorTab:{ConfirmUnsavedChanges:"Confirmation pour sauvegarder ou annuler des changements",ConfirmUnsavedChangesDescription:"Si cette option est activée, l'éditeur demande une confirmation pour enregistrer ou rejeter les modifications apportées. S'il est désactivé, les modifications sont ignorées en silence.",Editor:"Éditeur",KlipperRestartMethod:"Méthode de redémarrage de klipper",KlipperRestartMethodDescription:"Sélectionnez la méthode de redémarrage qui sera utilisée lors de l'opération 'Enregistrer et redémarrer' lorsque vous modifiez les fichiers de configuration de Klipper.",Spaces:"Espaces: {count}",TabSize:"Taille de la fonction TAB",TabSizeDescription:"Règle le nombre d'espaces qui doivent être indentés pour les TAB",UseEscToClose:"Utiliser ESC pour fermer l'éditeur",UseEscToCloseDescription:"Permet de fermer l'éditeur à l'aide de la touche ESC"},GCodeViewerTab:{BackgroundColor:"Couleur de l'arrière-plan",ExtruderColor:"Couleur de l'extrudeur",GCodeViewer:"Visionneuse G-Code",GridColor:"Couleur de la grille",MaxFeed:"Débit maximum",MinFeed:"Débit minimum",ProgressColor:"Couleur d'avancement",ShowAxes:"Afficher les axes"},GeneralTab:{"12hours":"12 heures ({time})","24hours":"24 heures ({time})",Backup:"Sauvegarde",BackupDialog:"Choisissez les sections que vous désirez sauvegarder:",CalcEstimateTime:"Calcul du temps estimé",CalcEstimateTimeDescription:"Si plusieurs sont sélectionnés, une moyenne sera calculée.",CalcEtaTime:"Calcul du TEA",CalcEtaTimeDescription:"Si plusieurs sont sélectionnés, une moyenne sera calculée.",CalcPrintProgress:"Calcul de la progression de l'impression",CalcPrintProgressDescription:"Méthode de calcul de l'avancement de l'impression.",CalcPrintProgressItems:{Filament:"Filament",FileAbsolute:"Position absolue dans le fichier",FileRelative:"Position relative dans le fichier",Slicer:"Trancheur (M73)"},CannotReadJson:"Lecture/interprétation du fichier de sauvegarde impossible.",DateFormat:"Format de la date",DbConsoleHistory:"Historique de la console",DbHistoryJobs:"Historique des travaux",DbHistoryTotals:"Historique Totaux",DbNavigation:"Navigation",DbTimelapseSettings:"Réglages Timelapse",DbView:"Voir les paramètres",EstimateValues:{Filament:"Filament",File:"Fichier",Slicer:"Trancheur"},Everything:"Tout",FactoryDialog:"Veuillez sélectionner toutes les sections que vous souhaitez réinitialiser:",FactoryReset:"Réinitialisation d'usine",General:"Général",Language:"Langue",MainsailSettingsMoonrakerDb:"Réglages de Mainsail dans Moonraker DB",PrinterName:"Nom de l'imprimante",Reset:"réinitialiser",Restore:"Restaurer",RestoreDialog:"Veuillez sélectionner toutes les sections que vous souhaitez restaurer:",TimeFormat:"Format de l'heure"},HeightmapTab:{ColorSchemes:"Schémas de couleurs",Heightmap:"Maillage",IsDefault:"(Défaut)",Schemes:{GrayScale:"Niveaux de gris",Hot:"Chaud",Hsv:"Hsv",Portland:"Portland",Spring:"Printemps"}},InterfaceSettings:"Réglages interface",MacrosTab:{Add:"ajouter",AddGroup:"ajouter un groupe",AvailableMacros:"Macros disponibles",ChangeMacroColor:"Modifier la couleur du bouton.",Color:"Couleur",CountMacros:"pas de macro ajoutée | {count} Macro | {count} Macros",Custom:"personnalisé",CustomColor:"Couleur personnalisée",DeletedMacro:"Macro supprimée",DeleteMacroFromGroup:"Supprimer une macro du groupe.",EditGroup:"Edition du groupe",Error:"erreur",Expert:"Expert",General:"Général",Group:"Groupe",GroupMacros:"Macros du groupe",Macrogroups:"Groupes",Macros:"Macros",Management:"Gestion",Name:"Nom",NoAvailableMacros:"Pas de macros disponibles.",NoGroups:"Pas de groupe trouvé...",NOMacros:"Pas de macros trouvées...",NoMacrosInGroup:"Pas de macros dans ce groupe.",Primary:"primaire",Search:"Recherche",Secondary:"secondaire",ShowInStatePaused:"Afficher/masquer si l'imprimante est en pause.",ShowInStatePrinting:"Afficher/masquer si l'imprimante est en cours d'impression.",ShowInStateStandby:"Afficher/masquer si l'imprimante est en veille.",Simple:"Simple",Status:"Statut",Success:"succès",UnknownGroup:"Groupe inconnu",Warning:"avertissement"},MiscellaneousTab:{AddGroup:"ajouter un groupe",AddPreset:"ajouter un préréglage",Color:"Couleur",CreateGroup:"Créer un groupe",CreatePreset:"Créer un préréglage",End:"Fin",EndDescription:"Dernière DEL de ce groupe.",Groups:"Groupes",GroupSubTitle:"Début: {start}, Fin: {end}",LightGroups:"{name} - Groupes",LightPresets:"{name} - Préréglages",Miscellaneous:"Divers",Name:"Nom",NoDevicesFound:"Aucun dispositif trouvé",NoGroupFound:"Pas de groupe trouvé",NoPresetFound:"Pas de préréglage trouvé",Presets:"Préréglages",Start:"Démarrage",StartDescription:"Première DEL de ce groupe.",UnableToLoadLight:"Impossible de charger la lumière",UnableToLoadPreset:"Impossible de charger la présélection"},NavigationTab:{Navigation:"Navigation"},PresetsTab:{AddPreset:"ajouter un préréglage",Cooldown:"Refroidissement",CreateHeadline:"Créer un préréglage",CustomGCode:"G-Code personnalisé",EditCooldown:"Editer refroidissement",EditHeadline:"Editer préréglage",ErrorInvalidValue:"Valeur non valide",ErrorNameNotUnique:"Le nom existe déjà",ErrorNameRequired:"Nom requis",Name:"Nom",PreheatPresets:"Préréglages",PresetInfo:"Vous devez définir une température cible ou un G-Code utilisateur.",PresetNamePlaceholder:"Nom de la présélection (requis)",StoreButton:"Mémoriser les préréglages",UpdateButton:"Mise à jour de la présélection",UpdateCooldown:"Mise à jour refroidissement"},RemotePrintersTab:{AddPrinter:"Ajouter une imprimante",EditPrinter:"Editer l'imprimante",Hostname:"Nom d'hôte",Port:"Port",RemotePrinters:"Imprimantes",UpdatePrinter:"Mise à jour de l'imprimante",UseConfigJson:"InstanceDB = JSON détectée. Veuillez utiliser le fichier config.json pour modifier la liste des imprimantes."},Store:"magasin",TimelapseTab:{Autorender:"Rendu automatique",AutorenderDescription:"Si cette option est activée, la vidéo du timelapse sera automatiquement calculée à la fin de l'impression.",Camera:"Caméra",CameraDescription:"Sélectionner la caméra à utiliser",ConstantRateFactor:"Facteur d'échantillonnage",ConstantRateFactorDescription:"Il configure la qualité par rapport à la taille du fichier de la vidéo rendue. L'échelle CRF va de 0 à 51, où 0 correspond à une qualité sans perte, 23 est la valeur par défaut et 51 est la pire qualité possible.. Une valeur plus faible est généralement synonyme de meilleure qualité et une fourchette subjectivement saine se situe entre 17 et 28. Les valeurs 17 et 18 sont considérées comme étant visuellement sans perte.",duplicatelastframe:"Dupliquer la dernière image",duplicatelastframeDescription:"Duplique la dernière image à la fin de la vidéo",Enabled:"Activé",EnabledDescription:"Si cette option est désactivée, les macros G-Code sont ignorées et le rendu automatique est ignoré.",Extraoutputparams:"Paramètres de sortie supplémentaires",ExtraoutputparamsDescription:"Définit des paramètres de sortie supplémentaires pour FFMPEG. Note : Si vous spécifiez quelque chose ici, le paramètre de rotation sera désactivé.",FwRetract:"Rétraction Firmware",FwRetractDescription:"Utiliser la rétraction du firmware dans la macro timelapse",GcodeVerbose:"Verbose G-Code",GcodeVerboseDescription:"Si cette option est activée, les macros G-Code écriront des informations sur la console.",General:"Général",HyperlapseCycle:"Temps de cycle Hyperlapse",HyperlapseCycleDescription:"Un instantané sera pris toutes les X secondes.",Mode:"Mode",ModeDescription:"Choix entre le mode macro-couche et le mode hyperlapse (basé sur le temps)",OutputFramerate:"Images par seconde",OutputFramerateDescription:"Définit le taux de rafraîchissement de la vidéo. Remarque : ce paramètre sera ignoré si l'option variable_fps est activée.",Parkhead:"Parking de la tête",ParkheadDescription:"Si cette option est activée, la tête de l'outil sera garée avant de prendre une image.",Parkpos:"Position de parking",ParkposDescription:"Sélectionner la position de parking",ParkTime:"Temps de parking",ParkTimeDescription:"Ajoutez un temps d'inactivité supplémentaire lors du stationnement.",Pixelformat:"Format des pixel",PixelformatDescription:"Définit le format des pixels de la sortie vidéo (yuv420p)",PosDZ:"Position Z",PosDZDescription:"Position de parking Z (relative)",PosX:"Position X",PosXDescription:"Position de parking X (absolute)",PosY:"Position Y",PosYDescription:"Position de parking Y (absolute)",PreviewImage:"Image de prévisualisation",PreviewImageDescription:"Enregistrer une image de prévisualisation portant le même nom que la vidéo",RenderingOptions:"Options de rendu",RetractDistance:"Distance de rétraction",RetractDistanceDescription:"Distance de rétraction du filament avant parking.",RetractSpeed:"Vitesse de rétraction",RetractSpeedDescription:"Vitesse de rétraction du filament avant parking.",SaveFrames:"Sauvegarde des images",SaveFramesDescription:"Sauvegarder les images dans un fichier zip pour un traitement externe",StreamDelayCompensation:"Délai de compensation du flux",StreamDelayCompensationDescription:"Délai avant capture d'une image du flux",Targetlength:"Durée de la vidéo",TargetlengthDescription:"La longueur de la vidéo lorsque l'option Variable IPS est activée",TimeFormatCode:"Format du code horaire",TimeFormatCodeDescription:"Ceci définit comment l'horodatage dans le fichier de sortie doit être encodé",Timelapse:"Timelapse",TravelSpeed:"Vitesse de déplacement",TravelSpeedDescription:"Vitesse de déplacement pour se rendre à la position de parking et pour reprendre l'impression.",UnretractDistance:"Distance de dérétraction",UnretractDistanceDescription:"Distance de dérétraction du filament après parking et avant reprise d'impression.",UnretractSpeed:"Vitesse de dérétraction",UnretractSpeedDescription:"Vitesse de dérétraction du filament après parking et avant reprise d'impression.",VariableFps:"IPS variable",VariableFpsDescription:"Si activé, le nombre d'images par seconde (IPS) sera calculé tenant compte de la taille du fichier de sortie.",VariableFpsMax:"IPS variable max",VariableFpsMaxDescription:"",VariableFpsMin:"IPS variable min",VariableFpsMinDescription:""},UiSettingsTab:{BedScrewsDialog:"Bed Screws",BedScrewsDialogDescription:"Affiche la boîte de dialogue d'aide pour BED_SCREWS_ADJUST.",BigThumbnailBackground:"Couleur d'arrière-plan de la grande miniature",BoolBigThumbnail:"Grande miniature",BoolBigThumbnailDescription:"Affichage d'une grande miniature dans le panneau d'état lors d'une impression.",BoolHideUploadAndPrintButton:"Masquer le bouton de Chargement et d'impression",BoolHideUploadAndPrintButtonDescription:"Afficher ou masquer le bouton 'Charger et imprimer' dans la barre supérieure.",ConfirmOnEmergencyStop:"Confirmation obligatoire de l'arrêt d'urgence",ConfirmOnEmergencyStopDescription:"Affiche un dialogue de confirmation sur l'arrêt d'urgence",ConfirmOnPowerDeviceChange:"Requiert une confirmation pour changement de mode de modules de puissance",ConfirmOnPowerDeviceChangeDescription:"Affiche une boîte de dialogue de confirmation en cas de modification de l'alimentation de l'appareil",DefaultNavigationState:"État par défaut de la navigation",DefaultNavigationStateAlwaysClosed:"toujours fermé",DefaultNavigationStateAlwaysOpen:"toujours ouvert",DefaultNavigationStateDescription:"Quel état devrait avoir la navigation par défaut.",DefaultNavigationStateLastState:"dernier état",DisableFanAnimation:"Désactiver l'animation du ventilateur",DisableFanAnimationDescription:"Cela peut réduire la charge de votre navigateur.",DisplayCANCEL_PRINT:"Affichage de CANCEL_PRINT",DisplayCANCEL_PRINTDescription:"Affiche le bouton CANCEL_PRINT de manière permanente. Pas de confirmation demandée.",GcodeThumbnails:"Miniature G-Code",GcodeThumbnailsDescription:"Cliquez sur le bouton pour accéder aux instructions.",Guide:"Guide",HideSaveConfigButtonForBedMesh:"Cacher le bouton SAVE_CONFIG lors de changements de maillage",HideSaveConfigButtonForBedMeshDescription:"Cache le bouton SAVE_CONFIG si seulement des changements de maillages sont en attente de sauvegarde vers Klipper",HideUpdateWarnings:"Masquer les avertissements de mise à jour",HideUpdateWarningsDescription:"Cette option permet de masquer tous les avertissements de mise à jour dans le gestionnaire de mise à jour.",LockSliders:"Verrouiller les curseurs sur les appareils à écran tactile",LockSlidersDelay:"Délai de verrouillage du curseur",LockSlidersDelayDescription:"Les curseurs se verrouillent après un délai donné. S'ils sont réglés sur 0 ou laissés vides, les curseurs ne se verrouilleront que lors du changement ou du chargement de la page.",LockSlidersDescription:"Les curseurs des écrans tactiles doivent être déverrouillés avant que les modifications ne soient autorisées.",Logo:"Logo",ManualProbeDialog:"Aide à la sonde manuelle",ManualProbeDialogDescription:"Affiche une boîte de dialogue d'aide pour PROBE_CALIBRATE ou Z_ENDSTOP_CALIBRATE.",NavigationStyle:"Style de navigation",NavigationStyleDescription:"Modifie l'apparence de la navigation",NavigationStyleIconsAndText:"Icônes + Textes",NavigationStyleIconsOnly:"Icônes uniquement",PowerDeviceName:"Dispositif d'alimentation de l'imprimante",PowerDeviceNameDescription:"Choisissez quel appareil de puissance Moonraker doit utiliser pour l'alimentation de l'imprimante.",Primary:"Primaire",ScrewsTiltAdjustDialog:"Screws Tilt Adjust",ScrewsTiltAdjustDialogDescription:"Affiche une boîte de dialogue d'aide pour SCREWS_TILT_CALCULATE.",TempchartHeight:"Hauteur dans le tableau des températures",TempchartHeightDescription:"Modifie la hauteur du graphique de température sur le tableau de bord.",UiSettings:"Interface"},Update:"mise à jour",WebcamsTab:{AddWebcam:"ajouter une caméra",CreateWebcam:"Créer une caméra",EditCrowsnestConf:"Editer crowsnest.conf",EditWebcam:"Editer caméra",FlipWebcam:"Retourner l'image de la caméra:",HideFps:"Hide FPS counter",Hlsstream:"Flux HLS",Horizontally:"horizontalement",IconBed:"Plateau",IconCam:"Caméra",IconDoor:"Porte",IconFilament:"Filament",IconHot:"Chaud",IconMcu:"MCU",IconNozzle:"Buse",IconPrinter:"Imprimante",Ipstream:"Caméra IP",JMuxerStream:"Flux de données brutes h264 (jmuxer)",Mjpegstreamer:"MJPEG-Streamer",MjpegstreamerAdaptive:"Streamer MJPEG adaptatif (experimental)",Name:"Nom",NameAlreadyExists:"Le nom existe déjà",Required:"requis",Rotate:"Rotation",SaveWebcam:"Sauvegarde caméra",Service:"Service",TargetFPS:"IPS cible",UpdateWebcam:"Mise à jour de la caméra",UrlSnapshot:"Aperçu de l'URL",UrlStream:"Flux d'URL",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"verticalement",Webcams:"Caméras",WebrtcCameraStreamer:"WebRTC (camera-streamer)",WebrtcJanus:"WebRTC (janus-gateway)",WebrtcMediaMTX:"WebRTC (MediaMTX)"}},P={AllFiles:"Tous",Autorender:"Rendu automatique",Cancel:"Annuler",Create:"Créer",CreateNewDirectory:"créer un répertoire",CurrentPath:"Chemin actuel",Delete:"Supprimer",DeleteDirectory:"Supprimer le répertoire",DeleteDirectoryQuestion:'Voulez-vous vraiment supprimer le répertoire "{name}" avec tout son contenu?',DeleteSelectedQuestion:"Voulez-vous vraiment supprimer les {count} fichiers sélectionnés ?",DeleteSingleFileQuestion:'Voulez-vous vraiment supprimer le fichier "{name}"?',Download:"Télécharger",DuplicateLastframe:"Dupliquer la dernière image",Empty:"Aucun timelapse terminé n'a été trouvé.",Enabled:"Activé",EstimatedLength:"Taille estimée",Files:"Fichiers",Filesize:"Taille des fichiers",Fixed:"constant",Framerate:"IPS",Frames:"images",Free:"Libre",FreeDisk:"Disque libre",LastModified:"Dernière modification",MaxFramerate:"IPS max",MinFramerate:"IPS min",Name:"Nom",NewDirectory:"Nouveau répertoire",NoActiveTimelapse:"Pas d'enregistrement disponible.",Preview:"Prévisualisation",RefreshCurrentDirectory:"rafraîchir le répertoire",Rename:"Renommer",RenameDirectory:"Renommer le répertoire",RenameFile:"Renommer le fichier",Render:"calculer",RenderSettings:"Paramètres de calcul de la vidéo",SaveFrames:"Sauvegarder les images",Search:"recherche",StartRender:"commencer le rendu",Status:"Statut",TargetFps:"IPS cible",Targetlength:"Longueur cible",TimelapseFiles:"Fichiers Timelapse",TimelapseRendering:"Rendu Timelapse",TimelapseRenderingSuccessful:"Rendu en timelapse réussi",Total:"Total",Type:"Type",Used:"Utilisé",Variable:"Variable",Video:"Vidéo"},F="Français",A={App:e,BedScrews:r,ConnectionDialog:i,Console:t,CoolDownDialog:a,DevicesDialog:n,Dialogs:o,Editor:s,EmergencyStopDialog:l,Files:u,FullscreenUpload:d,GCodeViewer:c,Heightmap:m,History:p,JobQueue:g,Machine:f,ManualProbe:h,Panels:v,PowerDeviceChangeDialog:C,Router:S,ScrewsTiltAdjust:D,SelectPrinterDialog:b,Settings:T,Timelapse:P,title:F};export{e as App,r as BedScrews,i as ConnectionDialog,t as Console,a as CoolDownDialog,n as DevicesDialog,o as Dialogs,s as Editor,l as EmergencyStopDialog,u as Files,d as FullscreenUpload,c as GCodeViewer,m as Heightmap,p as History,g as JobQueue,f as Machine,h as ManualProbe,v as Panels,C as PowerDeviceChangeDialog,S as Router,D as ScrewsTiltAdjust,b as SelectPrinterDialog,T as Settings,P as Timelapse,A as default,F as title}; diff --git a/assets/fxaa.fragment-CKBSH8ak.js b/assets/fxaa.fragment-CKBSH8ak.js new file mode 100644 index 0000000..6049e9f --- /dev/null +++ b/assets/fxaa.fragment-CKBSH8ak.js @@ -0,0 +1 @@ +import{S as r}from"./Viewer-DVCEMRp5.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./index-Bku7SJna.js";import"./echarts-DzoUeqWp.js";import"./codemirror-ZSHHXwGs.js";const a="fxaaPixelShader",e="varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d;uniform texelSize: vec2f;varying sampleCoordS: vec2f;varying sampleCoordE: vec2f;varying sampleCoordN: vec2f;varying sampleCoordW: vec2f;varying sampleCoordNW: vec2f;varying sampleCoordSE: vec2f;varying sampleCoordNE: vec2f;varying sampleCoordSW: vec2f;const fxaaQualitySubpix: f32=1.0;const fxaaQualityEdgeThreshold: f32=0.166;const fxaaQualityEdgeThresholdMin: f32=0.0833;const kLumaCoefficients: vec3f= vec3f(0.2126,0.7152,0.0722);fn FxaaLuma(rgba: vec4f)->f32 {return dot(rgba.rgb,kLumaCoefficients);} \n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var posM: vec2f;posM.x=input.vUV.x;posM.y=input.vUV.y;var rgbyM: vec4f=textureSampleLevel(textureSampler,textureSamplerSampler,input.vUV,0.0);var lumaM: f32=FxaaLuma(rgbyM);var lumaS: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordS,0.0));var lumaE: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordE,0.0));var lumaN: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordN,0.0));var lumaW: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,input.sampleCoordW,0.0));var maxSM: f32=max(lumaS,lumaM);var minSM: f32=min(lumaS,lumaM);var maxESM: f32=max(lumaE,maxSM);var minESM: f32=min(lumaE,minSM);var maxWN: f32=max(lumaN,lumaW);var minWN: f32=min(lumaN,lumaW);var rangeMax: f32=max(maxWN,maxESM);var rangeMin: f32=min(minWN,minESM);var rangeMaxScaled: f32=rangeMax*fxaaQualityEdgeThreshold;var range: f32=rangeMax-rangeMin;var rangeMaxClamped: f32=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);\n#ifndef MALI\nif(range=edgeVert;var subpixA: f32=subpixNSWE*2.0+subpixNWSWNESE;if (!horzSpan)\n{lumaN=lumaW;}\nif (!horzSpan) \n{lumaS=lumaE;}\nif (horzSpan) \n{lengthSign=uniforms.texelSize.y;}\nvar subpixB: f32=(subpixA*(1.0/12.0))-lumaM;var gradientN: f32=lumaN-lumaM;var gradientS: f32=lumaS-lumaM;var lumaNN: f32=lumaN+lumaM;var lumaSS: f32=lumaS+lumaM;var pairN: bool=abs(gradientN)>=abs(gradientS);var gradient: f32=max(abs(gradientN),abs(gradientS));if (pairN)\n{lengthSign=-lengthSign;}\nvar subpixC: f32=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);var posB: vec2f;posB.x=posM.x;posB.y=posM.y;var offNP: vec2f;offNP.x=select(uniforms.texelSize.x,0.0,(!horzSpan));offNP.y=select(uniforms.texelSize.y,0.0,(horzSpan));if (!horzSpan) \n{posB.x+=lengthSign*0.5;}\nif (horzSpan)\n{posB.y+=lengthSign*0.5;}\nvar posN: vec2f;posN.x=posB.x-offNP.x*1.5;posN.y=posB.y-offNP.y*1.5;var posP: vec2f;posP.x=posB.x+offNP.x*1.5;posP.y=posB.y+offNP.y*1.5;var subpixD: f32=((-2.0)*subpixC)+3.0;var lumaEndN: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,posN,0.0));var subpixE: f32=subpixC*subpixC;var lumaEndP: f32=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,posP,0.0));if (!pairN) \n{lumaNN=lumaSS;}\nvar gradientScaled: f32=gradient*1.0/4.0;var lumaMM: f32=lumaM-lumaNN*0.5;var subpixF: f32=subpixD*subpixE;var lumaMLTZero: bool=lumaMM<0.0;lumaEndN-=lumaNN*0.5;lumaEndP-=lumaNN*0.5;var doneN: bool=abs(lumaEndN)>=gradientScaled;var doneP: bool=abs(lumaEndP)>=gradientScaled;if (!doneN) \n{posN.x-=offNP.x*3.0;}\nif (!doneN) \n{posN.y-=offNP.y*3.0;}\nvar doneNP: bool=(!doneN) || (!doneP);if (!doneP) \n{posP.x+=offNP.x*3.0;}\nif (!doneP)\n{posP.y+=offNP.y*3.0;}\nif (doneNP)\n{if (!doneN) {lumaEndN=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,posN.xy,0.0));}\nif (!doneP) {lumaEndP=FxaaLuma(textureSampleLevel(textureSampler,textureSamplerSampler,posP.xy,0.0));}\nif (!doneN) {lumaEndN=lumaEndN-lumaNN*0.5;}\nif (!doneP) {lumaEndP=lumaEndP-lumaNN*0.5;}\ndoneN=abs(lumaEndN)>=gradientScaled;doneP=abs(lumaEndP)>=gradientScaled;if (!doneN) {posN.x-=offNP.x*12.0;}\nif (!doneN) {posN.y-=offNP.y*12.0;}\ndoneNP=(!doneN) || (!doneP);if (!doneP) {posP.x+=offNP.x*12.0;}\nif (!doneP) {posP.y+=offNP.y*12.0;}}\nvar dstN: f32=posM.x-posN.x;var dstP: f32=posP.x-posM.x;if (!horzSpan)\n{dstN=posM.y-posN.y;}\nif (!horzSpan) \n{dstP=posP.y-posM.y;}\nvar goodSpanN: bool=(lumaEndN<0.0) != lumaMLTZero;var spanLength: f32=(dstP+dstN);var goodSpanP: bool=(lumaEndP<0.0) != lumaMLTZero;var spanLengthRcp: f32=1.0/spanLength;var directionN: bool=dstN1023?t*Math.pow(2,1023)*Math.pow(2,e-1023):e<-1074?t*Math.pow(2,-1074)*Math.pow(2,e+1074):t*Math.pow(2,e)}function R(t,e,a,i,r,l){r>0?(r=A(1,r-136),t[l+0]=e*r,t[l+1]=a*r,t[l+2]=i*r):(t[l+0]=0,t[l+1]=0,t[l+2]=0)}function g(t,e){let a="",i="";for(let r=e;r32767)throw"HDR Bad header format, unsupported size";return s+=i.length+1,{height:e,width:a,dataPosition:s}}function b(t,e){return _(t,e)}function _(t,e){let a=e.height;const i=e.width;let r,l,s,c,n,o=e.dataPosition,f=0,d=0,h=0;const m=new ArrayBuffer(i*4),w=new Uint8Array(m),B=new ArrayBuffer(e.width*e.height*4*3),u=new Float32Array(B);for(;a>0;){if(r=t[o++],l=t[o++],s=t[o++],c=t[o++],r!=2||l!=2||s&128||e.width<8||e.width>32767)return H(t,e);if((s<<8|c)!=i)throw"HDR Bad header format, wrong scan line width";for(f=0,h=0;h<4;h++)for(d=(h+1)*i;f128){if(n=r-128,n==0||n>d-f)throw"HDR Bad Format, bad scanline data (run)";for(;n-- >0;)w[f++]=l}else{if(n=r,n==0||n>d-f)throw"HDR Bad Format, bad scanline data (non-run)";if(w[f++]=l,--n>0)for(let p=0;p0;){for(n=0;n{const o=a.getEngine();a.type=1,a.format=5,a._gammaSpace=!1,o._uploadDataToTextureDirectly(a,n)})}}export{C as _HDRTextureLoader}; diff --git a/assets/helperFunctions-CmftqOHQ.js b/assets/helperFunctions-CmftqOHQ.js new file mode 100644 index 0000000..3f9bd09 --- /dev/null +++ b/assets/helperFunctions-CmftqOHQ.js @@ -0,0 +1 @@ +import{S as e}from"./Viewer-DVCEMRp5.js";const a="helperFunctions",o="const float PI=3.1415926535897932384626433832795;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float HALF_MIN=5.96046448e-08; \nconst float LinearEncodePowerApprox=2.2;const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);const float Epsilon=0.0000001;\n#define saturate(x) clamp(x,0.0,1.0)\n#define absEps(x) abs(x)+Epsilon\n#define maxEps(x) max(x,Epsilon)\n#define saturateEps(x) clamp(x,Epsilon,1.0)\nmat3 transposeMat3(mat3 inMatrix) {vec3 i0=inMatrix[0];vec3 i1=inMatrix[1];vec3 i2=inMatrix[2];mat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);return outMatrix;}\nmat3 inverseMat3(mat3 inMatrix) {float a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];float a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];float a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];float b01=a22*a11-a12*a21;float b11=-a22*a10+a12*a20;float b21=a21*a10-a11*a20;float det=a00*b01+a01*b11+a02*b21;return mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),\nb11,(a22*a00-a02*a20),(-a12*a00+a02*a10),\nb21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;}\n#if USE_EXACT_SRGB_CONVERSIONS\nvec3 toLinearSpaceExact(vec3 color)\n{vec3 nearZeroSection=0.0773993808*color;vec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nreturn mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));\n#else\nreturn\nvec3(\ncolor.r<=0.04045 ? nearZeroSection.r : remainingSection.r,\ncolor.g<=0.04045 ? nearZeroSection.g : remainingSection.g,\ncolor.b<=0.04045 ? nearZeroSection.b : remainingSection.b);\n#endif\n}\nvec3 toGammaSpaceExact(vec3 color)\n{vec3 nearZeroSection=12.92*color;vec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055);\n#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\nreturn mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));\n#else\nreturn\nvec3(\ncolor.r<=0.0031308 ? nearZeroSection.r : remainingSection.r,\ncolor.g<=0.0031308 ? nearZeroSection.g : remainingSection.g,\ncolor.b<=0.0031308 ? nearZeroSection.b : remainingSection.b);\n#endif\n}\n#endif\nfloat toLinearSpace(float color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nfloat nearZeroSection=0.0773993808*color;float remainingSection=pow(0.947867299*(color+0.055),2.4);return color<=0.04045 ? nearZeroSection : remainingSection;\n#else\nreturn pow(color,LinearEncodePowerApprox);\n#endif\n}\nvec3 toLinearSpace(vec3 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toLinearSpaceExact(color);\n#else\nreturn pow(color,vec3(LinearEncodePowerApprox));\n#endif\n}\nvec4 toLinearSpace(vec4 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4(toLinearSpaceExact(color.rgb),color.a);\n#else\nreturn vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);\n#endif\n}\nfloat toGammaSpace(float color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nfloat nearZeroSection=12.92*color;float remainingSection=1.055*pow(color,0.41666)-0.055;return color<=0.0031308 ? nearZeroSection : remainingSection;\n#else\nreturn pow(color,GammaEncodePowerApprox);\n#endif\n}\nvec3 toGammaSpace(vec3 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn toGammaSpaceExact(color);\n#else\nreturn pow(color,vec3(GammaEncodePowerApprox));\n#endif\n}\nvec4 toGammaSpace(vec4 color)\n{\n#if USE_EXACT_SRGB_CONVERSIONS\nreturn vec4(toGammaSpaceExact(color.rgb),color.a);\n#else\nreturn vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);\n#endif\n}\nfloat square(float value)\n{return value*value;}\nvec3 square(vec3 value)\n{return value*value;}\nfloat pow5(float value) {float sq=value*value;return sq*sq*value;}\nfloat getLuminance(vec3 color)\n{return clamp(dot(color,LuminanceEncodeApprox),0.,1.);}\nfloat getRand(vec2 seed) {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);}\nfloat dither(vec2 seed,float varianceAmount) {float rand=getRand(seed);float normVariance=varianceAmount/255.0;float dither=mix(-normVariance,normVariance,rand);return dither;}\nconst float rgbdMaxRange=255.0;vec4 toRGBD(vec3 color) {float maxRGB=maxEps(max(color.r,max(color.g,color.b)));float D =max(rgbdMaxRange/maxRGB,1.);D =clamp(floor(D)/255.0,0.,1.);vec3 rgb=color.rgb*D;rgb=toGammaSpace(rgb);return vec4(clamp(rgb,0.,1.),D); }\nvec3 fromRGBD(vec4 rgbd) {rgbd.rgb=toLinearSpace(rgbd.rgb);return rgbd.rgb/rgbd.a;}\nvec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {vec3 invOrigVec=vec3(1.0,1.0,1.0)/origVec;vec3 halfSize=cubeSize*0.5;vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);vec3 intersectPositionWS=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}\n";e.IncludesShadersStore[a]=o; diff --git a/assets/hu-B1cvWa_J.js b/assets/hu-B1cvWa_J.js new file mode 100644 index 0000000..13b4738 --- /dev/null +++ b/assets/hu-B1cvWa_J.js @@ -0,0 +1 @@ +const e={Notifications:{BrowserWarnings:{Description:"{name} elavult és nem teljesen támogatott. A jelenlegi verzió {version}, de a Mainsail-hez {minVersion} vagy újabb verzió szükséges.",Headline:"Elavult böngésző"},DependencyDescription:"Ez a verzió {name} nem támogat minden Mainsail funkciót. Frissítsd az újra {neededVersion} a jelenlegit {name}.",DependencyName:"Függőség: {name}",DismissAll:"Mind elvetése",KlipperWarnings:{DeprecatedOption:"'{section}' / '{option}' opcióját leírtuk, és a következő verzióban már nem lesz benne.",DeprecatedOptionHeadline:"Elavult Klipper Opció",DeprecatedValue:"A '{value}' érték az '{option}' opcióban a '{section}' szakaszban elavult, és egy későbbi kiadásban eltávolításra kerül.",DeprecatedValueHeadline:"Elavult Klipper Érték",KlipperRuntimeWarning:"Klipper futásidejű figyelmeztetés",KlipperWarning:"Klipper figyelmeztetés"},MaintenanceReminder:"Karbantartási emlékeztető",MaintenanceReminderText:'"{name}" karbantartás esedékes.',MoonrakerWarnings:{MoonrakerComponent:"Moonraker: {component}",MoonrakerFailedComponentDescription:"Hiba a betöltés során, Moonraker '{component}'. Kérlek ellenőrizd a logokat, és javítsd a hibát.",MoonrakerFailedInitComponentDescription:"Hiba történt a moonraker komponens inicializálása során '{component}'. Kérjük, ellenőrizd a naplófájlt, és javítsd ki a problémát.",MoonrakerInitComponent:"Itt. Moonraker: {component}",MoonrakerWarning:"Moonraker figyelmeztetés",UnparsedConfigOption:"A [{section}] szekcióban helytelen konfig opciót '{option}: {value}' detektáltam. Ez lehet egy már nem elérhető opció, vagy egy hibásan betöltődő modul is okozhatja. A jövőben ez egy indítási hibaként fog jelentkezni.",UnparsedConfigSection:"Helytelen konfig szekciót [{section}] detektáltam. Ezt egy hibásan betöltődő komponens okozhatja. A jövőben ez egy indítási hibaként fog jelentkezni."},Never:"soha",NextReboot:"Következő újraindítás",NoNotification:"Nincsenek értesítések",Notifications:"Értesítések",OneDayShort:"1N",OneHourShort:"1Ó",OneWeekShort:"1H",Remind:"Emlékeztető:",ShowDetails:"részletek mutatása",TmcOtFlag:"Motorvezérlő hiba: OT jelző beállítva",TmcOtFlagText:"A '{name}' motorvezérlő aktiválta az OT-jelzőt és leállt. Ezt a túl nagy áram okozhatja. Kérjük, ellenőrizd a motorvezérlő beállításait és a hűtését.",TmcOtpwFlag:"Motorvezérlő figyelmeztetés: OTPW jelző beállítva",TmcOtpwFlagText:"A '{name}' motorvezérlő aktiválta az OTPW jelzőt, és ha tovább melegszik, leállhat a működése. Ez egy túlmelegedési állapotot jelez. Melyet okozhat a túl nagy áram. Kérjük, ellenőrizd a motorvezérlő beállításait és a hűtését."},NumberInput:{GreaterOrEqualError:"Nagyobbnak vagy egyenlőnek kell lennie mint {min}!",MustBeBetweenError:"A {min} és {max} között kell lennie!",NoEmptyAllowedError:"Nem lehet üres a bemenet!"},Printers:"Nyomtatók",TextfieldWithCopy:{Copied:"Másolva"},TheServiceWorker:{DescriptionNeedUpdate:"A helyi gyorsítótár elavult, és frissítésre szorul. Kérjük, kattints az alábbi gombra a gyorsítótár frissítéséhez.",TitleNeedUpdate:"A PWA frissítést igényel",Update:"frissítés"},ThrottledStates:{DescriptionCurrentlyThrottled:"Az rPi ARM mag(ok) jelenleg túlterheltek.",DescriptionFrequencyCapped:"Az rPi ARM max frekvenciája jelenleg 1,2 GHz -re korlátozódik.",DescriptionPreviouslyFrequencyCapped:"Az rPi ARM maximális frekvenciája legalább egyszer 1,2 GHz-re korlátozódott az utolsó bekapcsolás óta.",DescriptionPreviouslyTemperatureLimited:"rPi uC(csak 3A+/3B+) hőmérséklete legalább egyszer meghaladta az első korlátot (alapértelmezett 60C) az utolsó bekapcsolás óta.",DescriptionPreviouslyThrottled:"Az rPI ARM-mag(ok) a legutóbbi bekapcsolás óta legalább egyszer túlterhelődtek.",DescriptionPreviouslyUnderVolted:"Az rPI tápfeszültsége az utolsó bekapcsolás óta legalább egyszer 4,65 V alá esett.",DescriptionTemperatureLimitActive:"Az rPi uC(csak 3A+/3B+) hőmérséklete jelenleg az első határérték felett van (alapértelmezett 60C).",DescriptionUnderVoltageDetected:"Az rPI tápfeszültsége jelenleg 4,65 V alatt van",TitleCurrentlyThrottled:"Jelenleg leterhelt",TitleFrequencyCapped:"Frekvencia-korlátozások",TitlePreviouslyFrequencyCapped:"Korábbi frekvencia-korlátozások",TitlePreviouslyTemperatureLimited:"Korábbi hőmérséklet-korlátozás",TitlePreviouslyThrottled:"Korábban túlterhelt",TitlePreviouslyUnderVolted:"Korábbi alacsony tápfesz",TitleTemperatureLimitActive:"Jelenleg leterhelt",TitleUnderVoltageDetected:"Alacsony tápfeszültség"},Titles:{Complete:"Elkészült - {filename}",Error:"HIBA",Pause:"Nyomtatás Állj",PrinterOff:"Nyomtató KI",Printing:"{percent}% Nyomtatás - {filename}",PrintingETA:"{percent}% Nyomtatás - IDŐ: {eta} - {filename}"},TopBar:{CannotUploadTheFile:"A fájl nem feltölthető!",EmergencyStop:"Vészstop",SAVE_CONFIG:"BÁLLÍTÁS_MENTÉSE",Uploading:"Feltöltés",UploadOfFileSuccessful:"{file} feltöltése sikeres!",UploadPrint:"Feltöltés és nyomtatás"},TopCornerMenu:{Cancel:"Mégsem",ConfirmationDialog:{Description:{HostReboot:"A gazda újraindítása a jelenlegi nyomtatás kudarcával fog járni!",HostShutdown:"A gazda leállítása a jelenlegi nyomtatás kudarcával fog járni!",KlipperFirmwareRestart:"A Klipper firmware újraindítása a jelenlegi nyomtatás kudarcával fog járni!",KlipperRestart:"A Klipper újraindítása a jelenlegi nyomtatás kudarcával fog járni!",KlipperStop:"A Klipper leállítása a jelenlegi nyomtatás kudarcával fog járni!",ServiceRestart:"A szolgáltatás újraindítása a jelenlegi nyomtatás kudarcával járhat!",ServiceStart:"A szolgáltatás elindítása a jelenlegi nyomtatás kudarcával járhat!",ServiceStop:"A szolgáltatás leállítása a jelenlegi nyomtatás kudarcával járhat!"},Title:{HostReboot:"Gazda Újraindítása",HostShutdown:"Gazda Leállítása",KlipperFirmwareRestart:"Klipper Firmware Újraindítás",KlipperRestart:"Klipper Újraindítás",ServiceRestart:"Szolgáltatás Újraindítása",ServiceStart:"Szolgáltatás Start",ServiceStop:"Szolgáltatás Stop"}},HostControl:"Gazda vezérlése",KlipperControl:"Klipper vezérlés",KlipperFirmwareRestart:"Firmware újraindítása",KlipperRestart:"Újraindítás",PowerDevices:"Tápegységek",Reboot:"Újraindítás",Restart:"Újraindítás",ServiceControl:"Szolgáltatások vezérlése",Shutdown:"Leállítás",Start:"Start",Stop:"Stop"},UpdateDialog:{Close:"Bezárás",Empty:"Üres",Recovering:"{software} helyreállítása...",RecoveringDone:"{software} helyreállítása kész!",Updating:"{software} frissítése ...",UpdatingDone:"{software} frissítése kész!"}},t={Abort:"megszakít",Accept:"elfogadás",Adjusted:"beállított",Description:"Kattints a BEÁLLÍTVA gombra, ha a jelenlegi csavart beállítottad. Kattints az ELFOGAD gombra ha nem történt állítás.",Headline:"Ágycsavarok",ScrewAccepted:"Csavarok elfogadva",ScrewIndex:"Csavar index",ScrewName:"Csavar neve",ScrewOutput:"{current} / {max}"},a={AreYouSure:"Biztos vagy benne?",CancelJob:"Munka törlése",No:"Nem",Yes:"Igen"},s={CannotConnectTo:"Nem lehet csatlakozni a Moonrakerhez ({host}).",CheckMoonrakerLog:"Ha ez az üzenet többször is megjelenik, nézd meg a naplófájlt, itt:",Connecting:"Csatlakozás ehhez: {host}",ErrorMessage:"Hibaüzenet: {message}",Failed:"Kapcsolódás sikeretelen",Help:"Súgó",Initializing:"Inicializálás",TryAgain:"Próbáld újra"},l={CommandList:"Parancslista",Empty:"Üres",HideTemperatures:"Hőmérséklet elrejtése",HideTimelapse:"Idővonal Elrejtése",SendCode:"Kód küldése...",SetupConsole:"Konzol beállítás"},r={AreYouSure:"Biztos vagy benne?",CoolDown:"Visszahűtés",No:"Nem",Yes:"Igen"},n={CanBusInfo:"Csak a nem hozzárendelt csomópontok észlelhetők. A kommunikációs problémák elkerülése érdekében ajánlott, hogy csak egy nem hozzárendelt eszköz csatlakozzon a CANbus-hoz. További részletekért kattints a linkre:",ClickRefresh:"Kattints a frissítés gombra az eszközök kereséséhez.",DevicePath:"Eszköz elérési útja",Formats:"Formátumok",Headline:"Eszközök",HideSystemEntries:"Rendszerbejegyzések elrejtése",LibcameraId:"Libcamera ID",NoDeviceFound:"Nem található eszköz. Kérjük, ellenőrizd a kapcsolatot, és kattints a frissítés gombra.",PathByHardware:"Útvonal hardver szerint",PathById:"Útvonal ID szerint",Refresh:"frissítés",Resolutions:"Felbontások"},o={StartPrint:{Cancel:"Mégsem",DoYouWantToStartFilename:"Elkezded a {filename} nyomtatását?",DoYouWantToStartFilenameFilament:"Szeretnéd a {filename} fájlt a következő nyomtatószállal indítani?",Headline:"Feladat kezdése",Print:"nyomtatás",Timelapse:"Idővonal"}},i={ConfigReference:"Konfigurációs refencia",DeviceDialog:"Eszközök",DontSave:"Ne mentsd",Downloading:"Letöltés",FailedSave:"Nem tölthető fel: {filename}!",FileReadOnly:"csak olvasható",FileStructure:"Fájl struktúra",SaveClose:"Ment és bezár",SaveRestart:"Ment és újraindít",SuccessfullySaved:"{filename} mentése sikeres.",UnsavedChanges:"Mentetlen Változások",UnsavedChangesMessage:"Szeretnéd menteni a következőn végzett változtatásokat: {filename}?",UnsavedChangesSubMessage:"A változtatásaid elvesznek ha nem mented őket. Ezt az üzenetet az Editor beállításokban kikapcsolhatod.",Uploading:"Feltöltés"},m={AreYouSure:"Biztos?",EmergencyStop:"Vészstop",No:"Nem",Yes:"Igen"},z={AddBatchToQueue:"Tétel hozzáadása a várólistához",AddToQueue:"Várólistához adva",AllFiles:"Mind",BedTemp:"Ágy hőmérs.",Cancel:"Mégsem",ChamberTemp:"Kamra hőmérs.",Count:"Számol",Create:"Létrehoz",CreateNewDirectory:"Új mappa létrehozása",CurrentPath:"Jelenlegi útvonal",Delete:"Törlés",DeleteDirectory:"Mappa törlése",DeleteDirectoryQuestion:'Tényleg szeretnéd törölni a következő "{name}" mappát és minden tartalmát?',DeleteSelectedQuestion:"Tényleg szeretnél törölni {count} darab fájlt?",DeleteSingleFileQuestion:'Biztos törölni szeretnéd a "{name}" fájlt?',Download:"Letöltés",Duplicate:"Duplikált",DuplicateFile:"Duplikált fájl",EditFile:"Fájl szerkesztése",Empty:"Üres",ExtruderTemp:"Adagoló hőmérs.",Filament:"Filament",FilamentName:"Nyomtatószál neve",FilamentType:"Nyomtatószál típusa",FilamentUsage:"Nyomtatószál használat",FilamentWeight:"Nyomtatószál súlya",Files:"Fájlok",Filesize:"Fájl méret",Free:"Szabad",FreeDisk:"Szabad terület",GCodeFiles:"G-Code Fájlok",GcodesRootDirectoryDoesntExists:"Nem találtunk G-kód könyvtárat. Kérjük, ellenőrizd a Klipper konfiguráció [virtual_sdcard] szakaszának „path” opcióját.",HiddenFiles:"Rejtett fájlok",InvalidNameAlreadyExists:"A név már létezik, kérjük válassz másik nevet.",InvalidNameEmpty:"A bemenet nem lehet üres!",LastEndTime:"Legutóbbi Elégzési Idő",LastFilamentUsed:"Legutóbb használt nyomtatószál",LastModified:"Legutóbb módosítva",LastPrintDuration:"Legutóbbi Nyomtatási Idő",LastStartTime:"Legutóbbi Start Ideje",LastTotalDuration:"Legutóbbi Teljes Nyomtatási Idő",LayerHeight:"Rétegmagasság",Name:"Név",NewDirectory:"Új mappa",NozzleDiameter:"Fúvóka Átmérője",ObjectHeight:"Tárgymagasság",Preheat:"Előhevítés",PrintedFiles:"Nyomtatott fájlok",PrintStart:"Nyomtatás kezdete",PrintTime:"Nyomtatási idő",RefreshCurrentDirectory:"Aktuális mappa frissítése",Rename:"Átnevezés",RenameDirectory:"Mappa átnevezése",RenameFile:"Fájl átnevezése",ScanMeta:"Metaadatok beolvasása",ScanMetaSuccess:"Sikeresen beolvasta a metaadatokat: {filename}.",Search:"Keresés",SetupCurrentList:"Aktuális lista készítése",Slicer:"Szeletelő",SuccessfullyCreated:"Sikeresen létrehozva: {filename}.",SuccessfullyDeleted:"Sikeresen törölve: {filename}.",SuccessfullyMoved:"Sikeresen áthelyezve: {filename}.",SuccessfullyRenamed:"Sikeresen átnevezve: {filename}.",SuccessfullyUploaded:"Sikeres feltöltés: {filename}!",Total:"Összesen",UploadNewGcode:"Új Gcode feltöltése",Used:"Felhasznált",View3D:"3D nézet"},d={CannotUploadFile:"Nem tudom feltölteni a fájlt!",DropFilesToUploadFiles:"Húzd át a fájlokat feltöltéshez"},k={ClearLoadedFile:"Kitakarít",CNCMode:"CNC mód",ColorMode:"Színes Mód",Downloading:"Letöltés",ForceLineRendering:"Vonalas renderelés Erőltetése",HDRendering:"HD Renderelés (Íves nyomatok)",High:"Magas",LoadCurrentFile:"Jelenlegi fájl",LoadLocal:"Helyi Fájl",Low:"Alacsony",Max:"Max",Medium:"Közepes",ReloadRequired:"Újratöltés szükséges",Rendering:"Renderelés",RenderQuality:"Renderelési minőség",ShowGCode:"G-kód mutatása",ShowObjectSelection:"Mutasd a kijelölt objektumokat",ShowToolhead:"Fej mutatása",ShowTravelMoves:"Fej mozgásának mutatása",SpecularLighting:"Tükröződő fényvetülés",Title:"G-Code Nézegető",Tracking:"Követés",Transparency:"Áttetszőség",Ultra:"Ultra",VoxelMode:"Voxel Mód (ASMBL)"},g={Abort:"megszakítás",BedMeshCalibrate:"Síkrács kalibrálása",BedMeshRemove:"Síkrács eltávolítása",Calibrate:"kalibrálás",Clear:"tisztázás",CurrentMesh:{Headline:"Aktuális rács",Max:"Max",Min:"Min",Name:"Név",Range:"Távolság",Size:"Méret",Variance:"Eltérés"},DeleteBedMeshProfile:"Síkrács profil törlése",DoYouReallyWantToDelete:'Tényleg törölni akarod a profilt: "{name}"?',ErrorKlipperNotReady:"A Klipper nem áll készen. Magasságtérkép letiltva.",Flat:"Lapos",Heightmap:"Magasságtérkép",InvalidNameAlreadyExists:"A profil neve már létezik, kérjük válassz másik profilnevet.",InvalidNameAscii:"A név érvénytelen. Csak ascii karakterek engedélyezettek.",InvalidNameEmpty:"A bemenet nem lehet üres!",InvalidNameReserved:"Az „alapértelmezett” profil foglalt, kérjük válassz másik profilnevet.",Later:"Később",Mesh:"Síkrács",Name:"Név",NoBedMeshHasBeenLoadedYet:"Még nincs betöltve a síkrács.",NoProfile:"Nincs elérhető profil",Ok:"OK",Probed:"Bemért",Profiles:"Profilok",Remove:"eltávolítás",RemoveSaveDescription:"A bed_mesh profil töröltként került megjegyzésre.Klikkelj a BÁLLÍTÁS_MENTÉS-ÉRE, hogy eltávolítsd a printer.cfg-ből és újraindítsd a Klippert.",Rename:"átnevez",RenameBedMeshProfile:"Síkrács profil átnevezése",SAVE_CONFIG:"BÁLLÍTÁS_MENTÉSE",ScaleGradient:"Gradiens skálázása",ScaleZMax:"Z-max skálázása.",TitleCalibrate:"Új síkrács kalibrálása",TitleClear:"Síkrács tisztázása",TitleHomeAll:"Kezdőpontba áll",Wireframe:"Drótháló"},c={AddANote:"Jegyzet hozzáadása",AddMaintenance:"Karbantartás hozzáadása",AddNote:"Megjegyzés hozzáadása",AddToQueueSuccessful:"Fájl {filename} hozzáadva a várólistához.",AllJobs:"Mind",AvgPrinttime:"Átlag nyomtatási idő - Ø",Cancel:"Mégsem",Chart:"Diagram",CreateNote:"Megjegyzés létrehozása",DateBasedReminder:"Dátum",DateBasedReminderDescription:"Ez az emlékeztető a dátumon alapul.",Days:"napok",Delete:"Törlés",DeleteSelectedQuestion:"Tényleg törölni akarsz {count} kiválasztott munkát?",DeleteSingleJobQuestion:"Tényleg törölni szeretnéd a munkát?",Details:"Részletek",EditMaintenance:"Karbantartás szerkesztése",EditNote:"Megjegyzés módosítása",Empty:"üres",EndTime:"Befejezés",EntryCreatedAt:"Létrehozva {date}.",EntryNextPerform:"Következő elvégzés:",EntryPerformedAt:"Végrehajtva {date}.",EntrySince:"Azóta használt:",EstimatedFilament:"Becsült nyomtatószál",EstimatedFilamentWeight:"Becsült nyomtatószál súly",EstimatedTime:"Becsült idő",FilamentBasedReminder:"Nyomtatószál",FilamentBasedReminderDescription:"Ez az emlékeztető a nyomtatószál felhasználáson alapul.",FilamentCalc:"Számolt nyomtatószál",FilamentUsage:"Nyomtatószál használat",FilamentUsed:"Elhasznált nyomtatószál",Filename:"Fájl név",Filesize:"Fájl méret",FirstLayerBedTemp:"Első réteg asztal hőm.",FirstLayerExtTemp:"Első réteg extr. hőm.",FirstLayerHeight:"Első réteg magassága",HistoryFilamentUsage:"Nyomtatószál",HistoryPrinttimeAVG:"Nyomatok",Hours:"órák",InvalidNameEmpty:"Érvénytelen név. A név nem lehet üres!",JobDetails:"Munka részletei",Jobs:"Munkák",LastModified:"Utolsó módosított",LayerHeight:"Rétegmagasság",LoadCompleteHistory:"Teljes előzmény betöltése",LongestPrinttime:"Leghosszabb nyomtatási idő",Maintenance:"Karbantartás",MaintenanceEntries:"Karbantartási bejegyzések",Meter:"méter",Name:"Név",NoReminder:"Nincs emlékeztető",Note:"Megjegyzés",ObjectHeight:"Tárgy magassága",OneTime:"Egyszeri",Perform:"végezzük",Performed:"elvégzett",PerformedAndReschedule:"elvégzett és átütemezett",PerformMaintenance:"Karbantartás elvégzése",PrintDuration:"Nyomtatás ideje",PrintHistory:"Nyomtatási előzmények",PrintJobs:"Nyomtatási munkák",PrintTime:"Nyomtatási idő",PrinttimeAvg:"Nyomtatási átlag",PrinttimeBasedReminder:"Nyomtatási idő",PrinttimeBasedReminderDescription:"Ez az emlékeztető a nyomtatási időn alapul.",Reminder:"Emlékeztető",Repeat:"Ismétlés",Reprint:"Újranyomtat",Save:"ment",Search:"keresés",SelectedFilamentUsed:"Kiválasztott használt nyomtatószál",SelectedJobs:"Kiválasztott Munkák",SelectedPrinttime:"Kiválasztott Nyomtatási Idő",Settings:"Beállítások",Slicer:"Szeletelő",SlicerVersion:"Slicer verzió",StartTime:"Kezdés",Statistics:"Statisztikák",Status:"Státusz",StatusValues:{cancelled:"Megszakított",completed:"Elkészült",error:"Hiba",in_progress:"Folyamatban",interrupted:"Megszakított",klippy_disconnect:"Klippy lecsatlakotatás",klippy_shutdown:"Klippy leállítás",Others:"Egyebek",server_exit:"Szerverből kilépés"},Table:"Táblázat",TitleExportHistory:"Export Előzmények",TitleRefreshHistory:"Előzmények frissítése",TitleSettings:"Beállítások",TotalDuration:"Teljes idő",TotalFilamentUsed:"Összes elhasznált nyomtatószál",TotalJobs:"Összes munka",TotalPrinttime:"Összes nyomtatási idő",TotalTime:"Teljes idő"},p={AllJobs:"Minden Feladat",Cancel:"Mégsem",ChangeCount:"Számlálás módosítása",Count:"Számol",Empty:"Üres",InvalidCountEmpty:"A bemenet nem lehet üres!",InvalidCountGreaterZero:"A bemenetnek nagyobbnak kell lennie 0-nál!",JobQueue:"Feladatlista",Jobs:"Feladatok",Pause:"Szünet",RemoveFromQueue:"Eltávolítás a Listáról",Start:"Start",StartPrint:"Munkakezdés"},u={ConfigFilesPanel:{AllFiles:"Mind",Cancel:"Mégsem",ConfigFiles:"Konfig fájlok",ConfigRootDirectoryDoesntExists:"Nem találtunk konfigurációs könyvtárat. Kérjük, ellenőrizd a „config_path” opciót a Moonraker konfiguráció [file_manager] szakaszában.",Create:"Létrehoz",CreateDirectory:"Mappa létrehozása",CreateFile:"Fájl létrehozása",CurrentPath:"Aktuális útvonal",Delete:"Törlés",DeleteDirectory:"Mappa törlése",DeleteDirectoryQuestion:'Tényleg szeretnéd törölni a(z) "{name}" mappát és minden tartalmát?',DeleteSelectedQuestion:"Töröljem a kiválasztott {count} elemeket?",DeleteSingleFileQuestion:'Tényleg törölni szeretnéd a fájlt "{name}"?',Download:"Letöltés",Duplicate:"Duplikált",DuplicateFile:"Duplikált fájl",EditFile:"Fájl szerkesztése",Empty:"Üres",Files:"Fájlok",Filesize:"Fájlméret",Free:"Szabad",FreeDisk:"Szabad lemez",HiddenFiles:"Rejtett fájlok",HideBackupFiles:"Visszaállítási fájlok elrejtése",LastModified:"Utoljára módosítva",Name:"Név",RefreshDirectory:"Mappa frissítése",Rename:"Átnevezés",RenameDirectory:"Mappa átnevezése",RenameFile:"Fájl átnevezése",Root:"Root",SetupCurrentList:"Jelenlegi lista beállítása",ShowFile:"Fájl megjelenítése",Total:"Összesen",UploadFile:"Fájl feltöltése",Uploading:"Feltöltés",Used:"Felhasznált"},EndstopPanel:{Endstop:"Végállás",EndstopInfo:"Nyomd meg a jobb-alsó szinkronizáló gombot jelenlegi a végállásállapot betöltéséhez.",Endstops:"Végállások",open:"NYITVA",TRIGGERED:"AKTÍV"},LogfilesPanel:{Accept:"elfogad",Cancel:"mégsem",Logfiles:"Logfájlok",Rollover:"Görgetett naplók",RolloverDescription:"Kérjük, válaszd ki, mely naplókat kell visszaállítani:",RolloverToastFailed:'Görgetett napló: "{name}": {message}',RolloverToastSuccessful:'A "{name}" napló sikeresen visszaállítva.'},SystemPanel:{Constants:"Állandók",Cpu:"CPU",HostDetails:"Gazdagép részletei",LastStats:"Utolsó statisztikák",Load:"Betöltés",Memory:"MEM",NoMoreInfos:"Nincs több Info",SystemLoad:"Rendszerterhelések",Values:{Awake:"Ébredés: {awake}",Bandwidth:"Sávszélesség: {bandwidth}/s",Distro:"Distro: {name} {version_id}",Frequency:"Frek: {frequency}",Load:"Terh: {load}",Memory:"Mem: {memory}",Os:"OS: {os}",Received:"Kapott: {received}",Temp:"Hőm: {temp}°C",TempMax:"max: {temp}°C",TempMin:"min: {temp}°C",Transmitted:"Elküldött: {transmitted}",Version:"Verzió: {version}"}},UpdatePanel:{Abort:"Megszakítás",AreYouSure:"Biztos vagy benne?",CheckForUpdates:"Frissítések keresése",Close:"Bezár",CommitHistory:"Történet rögzítése",Commits:"Véglegesítés",CommitsAvailable:"nincs elérhető véglegesítés | {count} véglegesítés elérhető | {count} véglegesítés elérhető",CommitsOnDate:"véglegesítés ekkor:{date}",CommittedDaysAgo:"véglegesítve {days} nappal ezelőtt",CommittedHoursAgo:"véglegesítve {hours} órával ezelőtt",CommittedOnDate:"véglegesítve ekkor: {date}",CommittedYesterday:"véglegesítve tegnap",ConfigChanges:"Konfigurációs változások",Corrupt:"sérült",CountPackagesCanBeUpgraded:"{count} csomagok frissíthetők",Detached:"leválasztva",Dirty:"megváltoztatott",ERROR:"HIBA",GenericUpdateQuestion:"Ellenőrizd a rögzített történeteket (ha elérhető) és a projekt GitHub oldalát, hogy lásd, szükséges-e bármilyen manuális módosítás a frissítéshez.",GitHubPage:"GitHub oldal",HardRecovery:"Teljes visszaállítás",InitUpdateManager:"A Frissítéskezelő még nem lett inicializálva. Ez a rendszer első indításakor normális. Kérjük, kattints a frissítés gombra az összes komponens inicializálásához.",Invalid:"érvénytelen",IUnderstandTheRisks:"Megértem a kockázatokat",KlipperUpdateQuestionConfig:"Ez a frissítés a konfigurációs paraméterek olyan módosításait is tartalmazhatja, amelyeket módosítani kell a printer.cfg fájlban, a részletekért lásd a változásnaplót.",KlipperUpdateQuestionFirmware:"Ez frissíti a Klipper gazdaszoftvert. A Klipper firmware-t futtató alaplapokat esetleg újrafordított firmware-rel kell feltölteni, mielőtt a gép újra üzembe helyezhető.",LinkToGithub:"Link a GitHub-hoz",MoonrakerUpdateQuestion:"Ez frissíti a Moonraker API-t. A gép további használatához szükség lehet a moonraker.conf fájl módosítására.",MoreCommitsInfo:"Itt legfeljebb 30 megbízás jeleníthető meg. Az összes megbízás megtekintéséhez kattints az alábbi linkre:",OSPackages:"Oprendszer csomagok",PackagesCanBeUpgraded:"a csomagok frissíthetőek",SoftRecovery:"Alaphelyzetbe állítás",StartUpdate:"Frissítés indítása",System:"Rendszer",ThesePackagesCanBeUpgrade:"Ezek a rendszercsomagok frissíthetők:",Unknown:"ismeretlen",Update:"frissítés",UpdateAll:"Minden elem frissítése",UpdateManager:"Frissítéskezelő",UpdateWarning:"Frissítési figyelmeztetés: {name}",Upgrade:"frissítés",UpgradeableSystemPackages:"Frissíthető rendszercsomagok",UpToDate:"legfrissebb",WebClientUpdateQuestion:"Bizonyos esetekben a webes kliens frissítése olyan változásokat eredményezhet, amelyek inkompatibilitást okozhatnak. További információkat lásd a kiadási jegyzékben."}},b={Abort:"megszakít",Accept:"elfogad",Advanced:"Haladó",Headline:"Kézi szintezés"},v={ExtruderControlPanel:{Allowed:"Megengedett",CleanNozzle:"Fúvóka tisztítása",EstimatedExtrusion:"Adagolás:",Extrude:"Adagolás",ExtruderControl:"Adagoló vezérlő",ExtruderTempTooLow:"Extruder hőm. <",ExtrusionFactor:"Adagolási tényező",ExtrusionFeedrate:"Extruder Előtolása",FilamentLength:"Nyomtatószál hossz",FirmwareRetraction:"Firmware-es visszahúzás",FirmwareRetractionSettings:{RetractLength:"Visszahúzás hossza",RetractSpeed:"Visszahúzás sebessége",UnretractExtraLength:"Eresztés Extra Hossza",UnretractSpeed:"Eresztés Sebessége"},Headline:"Extruder",LoadFilament:"Nyomtatószál betöltése",PressureAdvance:"Nyomás előtolás",PressureAdvanceSettings:{Advance:"Fejlett mód",Extruder:"Extruder",SmoothTime:"Simítás ideje"},PurgeFilament:"Tisztítószál",Requested:"Kért",Retract:"Visszahúzás",TooLargeExtrusion:"A visszahúzás túl nagy!",Tools:"Eszközök",UnloadFilament:"Nyomtatószál kiadása"},FarmPrinterPanel:{ReconnectToPrinter:"Újracsatlakozás",SwitchToPrinter:"Váltás a nyomtatóra",WebcamOff:"Ki"},KlippyStatePanel:{CheckKlippyAndUdsAddress:"Ellenőrizd, hogy a Klipper szolgáltatás fut-e, és a klippy_uds_address helyesen van-e beállítva a moonraker.conf állományban.",FirmwareRestart:"Firmware újraindítása",KlipperCheck:"Kérjük, ellenőrizd, a Klipper szolgáltatás fut-e, konfigurálva van-e UDS (Unix Domain Socket).",KlipperLog:"Klipper napló",MoonrakerCannotConnect:"A Moonraker nem tud csatlakozni a Klipperhez!",MoonrakerLog:"Moonraker napló",PowerOn:"Bekapcsolás",PrinterSwitchedOff:"Nyomtató kikapcsolva",PrinterSwitchedOffDescription:"A nyomtató jelenleg ki van kapcsolva, és a Klipper nem tud csatlakozni. A nyomtató bekapcsolásához kattints az alábbi gombra:",Restart:"Újraindítás",ServiceReports:"{service} jelentések"},MachineSettingsPanel:{Headline:"Gép beállításai",MotionSettings:{Acceleration:"Gyorsulás",MaxAccelToDecel:"Lassulás Max Gyorsulása.",MinimumCruiseRatio:"Min. haladási arány",SquareCornerVelocity:"Sebesség a sarkokban",Velocity:"Gyorsaság"}},MacrosPanel:{Headline:"Makrók",Send:"küldés"},MiniconsolePanel:{Autoscroll:"Automatikus görgetés",Headline:"Konzol",HideTemperatures:"Hőmérséklet elrejtése",HideTimelapse:"Idővonal elrejtése",RawOutput:"RAW-kimenet (hibakereséshez)",SendCode:"Kód küldése...",SetupConsole:"Konzol beállítása"},MinSettingsPanel:{IncludeMainsailCfg:"Tedd bele a mainsail.cfg fájlt a printer.cfg fájlba.",IsNotDefinedInConfig:"nincs definiálva a konfigban.",MissingConfiguration:"Hiányzó konfiguráció",MoreInformation:"több információ"},MiscellaneousPanel:{Headline:"Kiegészítők",Light:{Blue:"kék",Green:"zöld",Red:"vörös",White:"fehér"},RunoutSensor:{Detected:"érzékelt",Disabled:"letiltott",Empty:"Üres"}},PowerControlPanel:{Error:"Hiba",Off:"KI",On:"BE",PowerControl:"Tápellátás vezérlés"},SpoolmanPanel:{Cancel:"Mégsem",ChangeSpool:"Orsó cseréje",DaysAgo:"{days} nappal ezelőtt",EjectSpool:"Orsó kiadása",EjectSpoolQuestion:"Biztos, hogy kiveszed az nyomtatószál orsót?",Filament:"Nyomtatószál",FilamentTypeMismatch:"Az aktív orsón lévő anyag ({spoolType}) nem egyezik a G-kódban lévő anyaggal ({fileType}).",Headline:"Orsó segéd",LastUsed:"Legutóbb használt",Location:"Elhelyezkedés",Material:"Anyag",Never:"Soha",NoActiveSpool:"A szálkövetés inaktív. A kezdéshez válassz ki egy orsót.",NoResults:"Az aktuális keresési feltételeknek megfelelő orsó nem található.",NoSpools:"Nincs elérhető orsó",NoSpoolSelected:"Nincs kiválasztott orsó. Kérjük, válassz ki egy orsót, különben a nyomtatás nem lesz nyomonkövethető.",OpenSpoolManager:"Orsókezelő megnyitása",Refresh:"frissítés",Search:"Keresés",SelectSpool:"Válassz orsót",Today:"Ma",TooLessFilament:"Lehet, hogy a jelenlegi orsón nincs elég nyomtatószál ehhez a nyomtatáshoz. ({spoolWeight}g - {fileWeight}g)",Weight:"Súly",Yesterday:"Tegnap"},StatusPanel:{CancelPrint:"Nyomtatás megszakítása",ClearPrintStats:"Nyomtatási statisztikák törlése",Difference:"Különbség",EmptyGcodes:"Nincs elérhető G-Code.",EmptyJobqueue:"Jelenleg nincs munka a várólistán.",Estimate:"Becslés",ETA:"Becs.Idő",ExcludeObject:{Cancel:"mégsem",Excluded:"Kizárva",ExcludeObject:"Test kizárása",ExcludeObjectHeadline:"Test kizárása",ExcludeObjectText:'Tényleg ki akarod zárni ezt: "{name}"?'},Filament:"Nyomtatószál",File:"Fájl",Files:"Fájlok",Flow:"Anyagáramlás",Headline:"Állapot",Jobqueue:"Várólista",JobqueueMoreFiles:"Nincs több munka | Még egy munka | {count} munka hátra",Layer:"Réteg",Max:"max",ObjectHeight:"Tárgy magassága",PauseAtLayer:{Abort:"megszakít",Accept:"elfogad",AtLayer:"Rétegben",Call:"Hívás",DescriptionPauseAtLayerActive:'Ez a funkció már aktív, és a "{call}" funkciót hívja meg a {layer} rétegen. Ha újra elküldöd a parancsot, ezek a beállítások felülíródnak.',DescriptionPauseNextLayerActive:'Ez a funkció már aktív, és a következő rétegnél meghívja a "{call}"-t.',Layer:"Réteg",NextLayer:"következő réteg",PauseAtLayer:"Szünet a rétegnél",Type:"Típus"},PausePrint:"Nyomtatás szüneteltetése",Print:"Nyomtatás",PrintTime:"Nyomtatási Idő",ReprintJob:"Munka újranyomtatása",Requested:"Kért",ResumePrint:"Nyomtatás folytatása",Slicer:"Szeletelő",Speed:"Sebesség",Status:"Státusz",Total:"Összesen",Unknown:"Ismeretlen"},TemperaturePanel:{AutoscaleChart:"Grafikon automatikus méretezése",Avg:"Átl.",Cooldown:"Lehűtés",Current:"Jelenlegi",Dataset:{Power:"PWM-táp",Speed:"PWM-sebesség",Target:"célhőmérséklet",Temperature:"aktuális hőmérséklet"},Headline:"Hőmérsékletek",HideMcuHostSensors:"Gazdagép/MCU érzékelők elrejtése",HideMonitors:"Monitorok elrejtése",Max:"max",Min:"min",Name:"Név",Presets:"Előzetes értékek",SetupTemperatures:"Hőmérsékletek beállítása",ShowChart:"Grafikon megjelenítése",ShowNameInChart:"{name} megjelenítése a diagramon",ShowNameInList:"{name} megjelenítése a listában",State:"Állapot",Target:"Cél",TemperaturesInChart:"Hőmérséklet [°C]",TempTooHigh:"A {name} hőmérséklete túl magas! (max: {max})",TempTooLow:"A {name} hőmérséklete túl alacsony! (min: {min})"},ToolheadControlPanel:{Absolute:"abszolút",ALL:"MIND",ControlButtons:"Vezérlőgombok",CoordinateFields:"Koordinátamezők",Headline:"Fúvókafej",PleaseConfigureSteps:"Kérlek állítsd be a step értékét",Position:"Pozíció",PositionOutput:"Pozíció kimenet",QGL:"QGL",Relative:"relatív",SettingsInterfaceControl:"Beállítások > Kezelőfelület > Vezérlés",SpeedFactor:"Sebességállítás",ZOffset:"Z-eltolás",ZTilt:"Z-dőlésszög"},WebcamPanel:{All:"Mind",ConnectingTo:"Csatlakozás a {url}",Disconnected:"Szétkapcsolt",ErrorWhileConnecting:"Hiba a kapcsolódás közben {url}",FPS:"FPS",Headline:"Webkamera",NoWebcam:'Nincs webkamera. Adj hozzá webkamerát a "Felület beállításai" -> "Webkamerák" menüpont alatt.',UnknownWebcamService:"Ismeretlen webkamera szolgáltatás"},ZoffsetPanel:{Clear:"Tisztítás",Headline:"Z-eltolás",Later:"Később",Ok:"OK",Save:"Mentés",SaveConfig:"BÁLLÍTÁS_MENTÉSE",SaveInfoDescription:'Új Z-eltolás kiszámítva és regisztrálva. Kattints a "BÁLLÍTÁS_MENTÉSE" gombra az új Z-eltolás eltárolásához a printer.cfg-be és indítsd újra a Klippert.',SaveInfoDescriptionPrint:'Új Z-eltolás kiszámítva és regisztrálva. Nyomtatás után kattints a "BÁLLÍTÁS MENTÉSE" gombra a felső sávban, a printer.cfg-be való mentéshez és a Klipper újraindításához.',SaveInfoHeadline:"Információ",ToEndstop:"a végállásig",ToProbe:"szondáig"}},y={AreYouSure:"Biztos?",No:"Nem",TurnDeviceOff:"{device} kikapcsolása",TurnDeviceOn:"{device} bekapcsolása",Yes:"Igen"},h={Console:"Konzol",Dashboard:"Irányítópult","G-Code Files":"G-kód fájlok","G-Code Viewer":"G-kód Nézegető",Heightmap:"Magasságtérkép",History:"Előzmények",Machine:"Gép",Printers:"Nyomtatók",Timelapse:"Idővonal",Webcam:"Webkamera"},S={Accept:"elfogad",Base:"Alap",ErrorText:"Valami rosszul sült el a szintezés során.",Headline:"Csavarok dőlésbeállítás",Retry:"újra"},f={AddPrinter:"Nyomtató hozzáadása",AddPrintersToJson:"Kérjük, add hozzá a nyomtatókat a config.json fájlhoz.",CannotConnectTo:"Kapcsolódás sikertelen ehhez: {host}.",ChangePrinter:"Nyomtatóváltás",Connecting:"Kapcsolódás ehhez: {host}",ConnectionFailed:"Kapcsolódás sikertelen",EditPrinter:"Nyomtató beállítása",Hello:"Szia, üdvözlünk a távoli hozzáférésű Mainsail-ben!",HostnameInvalid:"Gazdanév/IP érvénytelen",HostnameIp:"Gazdanév/IP",HostnameRequired:"Gazdanév szükséges",Name:"Név",Path:"Útvonal",Port:"Port",PortRequired:"Port szükséges",RememberToAdd:"Add hozzá ezt '{cors}' a moonraker.conf-ba a 'cors_domains'-en belül.",SelectPrinter:"Nyomtató választása",TryAgain:"próbáld újra",UpdatePrinter:"Nyomtató frissítése",YouCanFindMore:"További részleteket itt találsz"},C={Cancel:"Mégsem",Close:"Bezárás",ConsoleTab:{AddFilter:"szűrő hozzáadása",Console:"Konzol",CreateHeadline:"Szűrő létrehozása",Direction:"Irány",DirectionShell:"Alul az utolsó bejegyzés",DirectionTable:"Utolsó bejegyzés a tetején",EditHeadline:"Szűrő szerkesztése",EntryStyle:"Alapstílus",EntryStyleCompact:"kompakt",EntryStyleDefault:"alapstílus",Filters:"Filterek",Height:"Magasság",HideTemperatures:"Hőmérsékletek elrejtése",HideTimelapse:"Idővonal elrejtése",Name:"Név",Regex:"Reguláris kifejezés",StoreButton:"Szűrő mentése",UpdateButton:"Szűrő frissítése"},ControlTab:{Bars:"Sávok",Circle:"Kör",Control:"Vezérlés",Cross:"Kereszt",EnableXYHoming:"Kombinált X és Y tengely alapállapot engedélyezése",EstimatedExtrusionInfo:"Mutasd a becsült adagolási időt",EstimatedExtrusionInfoDescription:"Mutasd / rejdtsd el az adagolás mennyisége és előtolása alapján becsült adagolási infókat",HideDuringPrint:"Tengelyvezérlők elrejtése nyomtatás közben",InvertXMovement:"X-mozgás invertálása",InvertYMovement:"Y-mozgás invertálása",InvertZMovement:"Z-mozgás invertálása",IsDefault:" (alapértelmezett)",MaximumValues:"Maximum értékek: {maximum}",MaximumValuesVisibility:"A legjobb láthatósághoz ajánlott Maximum érték: {maximum}",MinimumValues:"Minimum értékek: {minimum}",MotorsOff:"Motorok KI {isDefault}",MoveDistancesEInMm:"E-mozgás táv. mm-ben",MoveDistancesInMm:"Mozgás táv. mm-ben",MoveDistancesXYInMm:"XY mozgás táv. mm-ben",MoveDistancesZInMm:"Z mozdítás mm-ben",QuadGantryLevel:"4 tengelyes szintezés {isDefault}",SpeedEInMms:"E sebessége mm/s-ban",SpeedXY:"XY sebessége",SpeedZ:"Z sebessége",Style:"Stílus",ValueGreaterThan:"Az értéknek nagyobbnak kell lennie mint {value}",ZOffsetIncrements:"Z-Eltolás mérései (in mm)",ZOffsetSaveOption:"Z-eltolás mentési opció",ZOffsetSaveOptionDescription:"A Z-eltolás mentésének beállítása",ZTiltAdjust:"Z-dőlésszög Beállítása{isDefault}"},DashboardTab:{Dashboard:"Irányítópult",Desktop:"Asztal",Mobile:"Mobil",ResetLayout:"Elrendezés visszaállítása",Tablet:"Tablet",Widescreen:"Szélesvásznú"},Edit:"Szerkeszt",EditorTab:{ConfirmUnsavedChanges:"Az új változások mentésének vagy elvetésének kijelzése",ConfirmUnsavedChangesDescription:"Ha engedélyezed, az új változások mentéséhez vagy elvetéséhez megerősítés szükséges. Ha kikapcsolod a változásokat némán eldobja.",Editor:"Szerkesztő",KlipperRestartMethod:"Klipper újraindítási mód",KlipperRestartMethodDescription:"Válaszd ki milyen újraindítási módot használjunk a 'Ment és Újraindít' esetén, amikor a klipper konfig fájlait szerkeszted.",Spaces:"Szóközök: {count}",TabSize:"TAB Méret",TabSizeDescription:"Beállítja, hogy hány szóközzel legyen behúzva a TAB-oknál",UseEscToClose:"Kilépéshez nyomd meg az ESC gombot",UseEscToCloseDescription:"Az ESC gomb megnyomása bezárja a szerkesztőt"},GCodeViewerTab:{BackgroundColor:"Háttérszín",ExtruderColor:"Extruder Színek",GCodeViewer:"G-Code Nézegető",GridColor:"Rács Színe",MaxFeed:"Max Behúzási Ráta",MinFeed:"Min Behúzási Ráta",ProgressColor:"Haladás színei",ShowAxes:"Tengelyek mutatása"},GeneralTab:{"12hours":"12-órás ({time})","24hours":"24-órás ({time})",Backup:"Biztonsági mentés",BackupDialog:"Kérlek jelöld ki az összes biztonsági mentésre jelölt szekciót:",CalcEstimateTime:"Nagyjából becsült idő",CalcEstimateTimeDescription:"Ha többet jelölsz ki, az átlagból számolok",CalcEtaTime:"ETA számítás",CalcEtaTimeDescription:"Ha többet jelölsz ki, az átlagból számolok",CalcPrintProgress:"Nyomtatás előrehaladás számítás",CalcPrintProgressDescription:"A nyomtatás előrehaladásának számítási módja.",CalcPrintProgressItems:{Filament:"Nyomtatószál",FileAbsolute:"Fájl pozíció (abszolút)",FileRelative:"Fájl pozíció (relatív)",Slicer:"Szeletelő (M73)"},CannotReadJson:"Nem olvasható/elemezhető a visszaállítási fájl.",DateFormat:"Dátum formátum",DbConsoleHistory:"Konzol előzmények",DbHistoryJobs:"Elvégzett feladatok",DbHistoryTotals:"Feladatok összesen",DbMaintenance:"Karbantartás",DbNavigation:"Navigáció",DbTimelapseSettings:"Idővonal beállítások",DbView:"Beállítások mutatása",DbWebcams:"Webkamerák",EstimateValues:{Filament:"Nyomtatószál",File:"Fájl",Slicer:"Szeletelő"},Everything:"Mindent",FactoryDialog:"Kérlek válaszd ki a visszaállítandó részeket:",FactoryReset:"Gyári visszaállítás",General:"Általános",Language:"Nyelv",MainsailSettingsMoonrakerDb:"Mainsail beállítások a Moonraker DB-ben",MoonrakerDb:"Moonraker DB",PrinterName:"Nyomtató neve",Reset:"Visszaállítás",Restore:"Helyreállítás",RestoreDialog:"Kérlek jelöld ki az összes helyreállításra kijelölt szekciót:",TimeFormat:"Idő formátum"},HeightmapTab:{ColorSchemes:"Színsémák",DefaultOrientation:"Alapértelmezett orientáció",DefaultOrientationDescription:"Válaszd ki az alapértelmezett orientációt az ágy háló vizualizálására.",Heightmap:"Magasságtérkép",IsDefault:"(Alapértelmezett)",Orientations:{Front:"Elülső",LeftFront:"Bal elülső",RightFront:"Jobb elülső",Top:"Felső"},Schemes:{GrayScale:"Szürkeárnyalat",Hot:"Forró",Hsv:"Hsv",Portland:"Portland",Spring:"Tavaszi"}},InterfaceSettings:"Interfész beállításai",MacrosTab:{Add:"hozzáad",AddGroup:"Csoporthoz adás",AvailableMacros:"Elérhető Makrók",ChangeMacroColor:"Változtasd meg a gomb színét.",Color:"Szín",CountMacros:"Nincs Makró | {count} Makró | {count} Makrók",Custom:"egyedi",CustomColor:"Alapértemezett szín",DeletedMacro:"Törölt Makrók",DeleteMacroFromGroup:"Makró törlése a csoportból.",EditGroup:"Csoport Szerkesztése",Error:"hiba",Expert:"Szakértői",General:"Általános",Group:"Csoport",GroupMacros:"Makrók Csoportjai",Macrogroups:"Csoportok",Macros:"Makrók",Management:"Menedzselés",Name:"Név",NoAvailableMacros:"Nincs elérhető makró.",NoGroups:"Csoport nem található...",NOMacros:"Nem található makró ...",NoMacrosInGroup:"Ebben a csoportban nincsenek makrók.",Primary:"elsődleges",Search:"Keresés",Secondary:"másodlagos",ShowInStatePaused:"Mutasd/Rejtsd el, ha a printer szünetel.",ShowInStatePrinting:"Mutasd/Rejtsd el, ha a printer nyomtat.",ShowInStateStandby:"Mutasd/Rejtsd el, ha a printer készenlétben áll.",Simple:"Egyszerű",Status:"Állapot",Success:"sikeres",UnknownGroup:"Ismeretlen Csoport",Warning:"figyelmeztetés"},MiscellaneousTab:{AddGroup:"csoport felvétele",AddPreset:"előbeállítás hozzáadása",Color:"Szín",CreateGroup:"Csoport létrehozása",CreatePreset:"Előbeállítás készítése",End:"Vége",EndDescription:"A csoport utolsó LED-je.",Groups:"Csoportok",GroupSubTitle:"Kezdés: {start}, Vége: {end}",LightGroups:"{name} - Csoportok",LightPresets:"{name} - Előbeállítások",Miscellaneous:"Kiegészítők",Name:"Név",NoDevicesFound:"Nem találhatóak eszközök",NoGroupFound:"Nem található csoport",NoPresetFound:"Nem található előbeállítás",Presets:"Előbeállítások",Start:"Indítás",StartDescription:"A csoport első LED-je.",UnableToLoadLight:"Nem lehet betölteni a fényt",UnableToLoadPreset:"Előbeállítás betöltése nem lehetséges"},NavigationTab:{Navigation:"Navigáció"},PresetsTab:{AddPreset:"Készérték hozzáadása",Cooldown:"Visszahűtés",CreateHeadline:"Készérték beállítása",CustomGCode:"Egyedi G-kód",EditCooldown:"Visszahűtés szerkesztése",EditHeadline:"Előzetes értékek szerkesztése",ErrorInvalidValue:"Helytelen érték",ErrorNameNotUnique:"A név már létezik",ErrorNameRequired:"A név kötelező",Name:"Név",PreheatPresets:"Előzetes érték",PresetInfo:"Választanod kell min hőmérsékletet, vagy egyedi Gcode-ot.",PresetNamePlaceholder:"Eredeti név(kötelező)",StoreButton:"Előzetes értékek tárolása",UpdateButton:"Előzetes értékek frissítése",UpdateCooldown:"Visszahűtés frissítése"},RemotePrintersTab:{AddPrinter:"Nyomtató hozzáadása",EditPrinter:"Nyomtató beállítása",Hostname:"Gazdagép neve",Name:"Név",NameDescription:"Ez a név nem jelenik meg a felhasználói felületen, és csak az átirányításhoz használatos.",Path:"Útvonal",Port:"Port",RemotePrinters:"Nyomtatók",UpdatePrinter:"Nyomtató frissítése",UseConfigJson:"InstanceDB = JSON észlelve. Kérjük, használd a config.json-t a nyomtatók listájának módosításához."},Store:"áruház",TimelapseTab:{Autorender:"Auto renderelés",AutorenderDescription:"Az idővonal renderélése a nyomtatás végén automatikusan elkezdődik, ha engedélyezed",Camera:"Kamera",CameraDescription:"Válassz melyik kamerát akarod használni",CameraDescriptionWithSnapshotUrl:"Válaszd ki a kamerát (a pillanatfelvétel URL-címével) kívánt használatra",CameraWarningAlreadySet:"Ez az érték már be van állítva a Moonraker konfigurációs fájljában.",CameraWarningAlreadySetSmall:"pillanatképek a [timelapse] szakaszban",ConstantRateFactor:"Videóráta állandó",ConstantRateFactorDescription:"A minőség kontra fájlméret állítását végzi a renderelésben. A CRF értéke 0–51 közötti, ahol 0 iveszteségmentes, 23 az alapértelmezett és 51 a legkisebb méretű(rossz minőség).",duplicatelastframe:"utolsókockaduplázás",duplicatelastframeDescription:"Megduplázza a videó utolsó képkockáját",Enabled:"Engedélyezve",EnabledDescription:"Kikapcsoláskor: G-Code makrókat kihagyása, nincs auto renderelés.",Extraoutputparams:"Extraparaméterekki",ExtraoutputparamsDescription:"Az FFMPEG extra kimeneti beállításait állítja be. Megjegyzés: Bármely itteni beállítás kikapcsolja a forgatási beállításokat",FwRetract:"FW Visszahúzás",FwRetractDescription:"Használt a Firmware visszahúzási sebességét a makróképekhez",GcodeVerbose:"Részletes G-Code",GcodeVerboseDescription:"Bekapcsolás után, a G-Code makrók a konzolra ki lesznek írva",General:"Általános",HyperlapseCycle:"Hyperlapse Ciklus Idő",HyperlapseCycleDescription:"Egy képkocka készül minden x másodpercben",Mode:"Mód",ModeDescription:"Válassza az alábbiak közül: Rétegmakró vagy Hyperlapse (idő alapú) mód",NoWebcamFound:"Nincs elérhető webkamera",OutputFramerate:"Kimenő Képsebesség",OutputFramerateDescription:"Beállítja a videó képsebességét. Megjegyzés: az Állítható FPS bekapcsolása érvényteleníti",Parkhead:"Fej parkoltatása",ParkheadDescription:"Bekapcsolás után, a fej leparkol minden képkocka készítése előtt.",Parkpos:"Parkolási pozíció",ParkposDescription:"Válaszd ki a parkolás helyét",ParkTime:"Parkolási Idő",ParkTimeDescription:"Plusz várakozási idő hozzáadása parkoláskor.",Pixelformat:"Pixelformátum",PixelformatDescription:"Beállítja a kimenő videó pixelformátumát",PosDZ:"Z Pozíció",PosDZDescription:"Z Parkolási Pozíció(relatív)",PosX:"X Pozíció",PosXDescription:"X Parkolási Pozíció(abszolút)",PosY:"Y Pozíció",PosYDescription:"Y Parkolási Pozíció(abszolút)",PreviewImage:"Előnézet",PreviewImageDescription:"Előnézeti kép mentése a videóval egyező néven",RenderingOptions:"Renderelési beállítások",RetractDistance:"Visszahúzási hossz",RetractDistanceDescription:"A nyomtatószál hossza amennyit az extruder visszahúz.",RetractSpeed:"Visszahúzás Sebessége",RetractSpeedDescription:"A sebesség amellyel az adagoló visszahúzza a nyomtatószálat.",RulesBetweenMinMax:"Az értéknek {min} és {max} között kell lennie!",RulesMin:"Az értéknek minimumnak {min} kell lennie!",RulesPositive:"Az értéknek pozitívnak kell lennie!",RulesRequired:"Érték szükséges!",RulesZeroAndPositive:"Az értéknek legalább 0-nak kell lennie!",SaveFrames:"Kocka mentése",SaveFramesDescription:"A képkockák mentése zip-fájlba külső rendereléshez",SelectWebcam:"Válassz webkamerát...",StreamDelayCompensation:"Stream Késés Kompenzáció",StreamDelayCompensationDescription:"Kép mentés késése",Targetlength:"Célhossz",TargetlengthDescription:"A célhossz, ha az állítható FPS be van állítva",TimeFormatCode:"Idő Formátum kódolás",TimeFormatCodeDescription:"Ez írja le a képkocka a kimeneten hogyan legyen kódolva",Timelapse:"Idővonal",TravelSpeed:"Utazási sebesség",TravelSpeedDescription:"A parkolás és a folytatás során használt utazási sebesség",UnretractDistance:"Eresztési hossz",UnretractDistanceDescription:"Az adagoló által visszahúzás után visszahúzott szál hossza.",UnretractSpeed:"Eresztés Sebessége",UnretractSpeedDescription:"A sebesség amennyivel a nyomtatószálat ereszti az adagoló miután visszahúzta.",VariableFps:"Állítható FPS",VariableFpsDescription:"Bekapcsolva a célhossz alapján kalkulálja a kimeneti videó képsebességét",VariableFpsMax:"Állítható maxFPS",VariableFpsMaxDescription:"Maximális változó FPS érték",VariableFpsMin:"Állítható minFPS",VariableFpsMinDescription:"Minimális változó FPS érték"},UiSettingsTab:{BedScrewsDialog:"Ágycsavarok párbeszédpanel",BedScrewsDialogDescription:"A BED_SCREWS_ADJUST segéddialógus megjelenítése.",BigThumbnailBackground:"Nagyméretű miniatűrök háttérszíne",BoolBigThumbnail:"Nagy előnézet",BoolBigThumbnailDescription:"Nagy előnézet mutatása a státusz panelben a nyomtatás alatt.",BoolHideUploadAndPrintButton:"A feltöltés és nyomtatás gombok elrejtése",BoolHideUploadAndPrintButtonDescription:'Mutasd/Rejtsd el a "Feltöltés és Nyomtatás" gombot a felső menüben.',ConfirmOnCancelJob:"Megerősítést kér a Munka törlésekor",ConfirmOnCancelJobDescription:"Megerősítő párbeszédpanel megjelenítése a Munka törlésekor",ConfirmOnCoolDown:"A visszahűtés megerősítést kér",ConfirmOnCoolDownDescription:"Megerősítő párbeszédpanel megjelenítése visszahűtés esetén",ConfirmOnEmergencyStop:"A Vészleállításhoz megerősítés szükséges",ConfirmOnEmergencyStopDescription:"Megerősítő párbeszéd megjelenítése Vészleállításhoz",ConfirmOnPowerDeviceChange:"Az Eszköz Tápellátásának változásához megerősítés szükséges",ConfirmOnPowerDeviceChangeDescription:"Megerősítő párbeszéd megjelenítése az Eszköz Tápellátásának változtatásához",DefaultNavigationState:"Navigáció alapállapot",DefaultNavigationStateAlwaysClosed:"mindig zárva",DefaultNavigationStateAlwaysOpen:"mindig nyitva",DefaultNavigationStateDescription:"Alapértelmezés szerinti navigációs állapot.",DefaultNavigationStateLastState:"utolsó állapot",DisableFanAnimation:"Ventilátor animáció letiltása",DisableFanAnimationDescription:"Ez csökkentheti a böngésző terheltségét.",DisplayCANCEL_PRINT:"Nyomtatás_megszakítása mutatása",DisplayCANCEL_PRINTDescription:"A Nyomtatás megszakítása gomb véglegesítése, megerősítést nem kér.",GcodeThumbnails:"G-Code előképek",GcodeThumbnailsDescription:"Kattints a gombra útmutatásért.",Guide:"Útmutató",HideSaveConfigButtonForBedMesh:"SAVE_CONFIG gomb elrejtése a bed_mesh módosításoknál",HideSaveConfigButtonForBedMeshDescription:"A SAVE_CONFIG elrejtése, ha csak a bed_mesh módosításokat kell elmenteni a Klipperben.",HideUpdateWarnings:"Frissítési figyelmeztetések elrejtése",HideUpdateWarningsDescription:"Ez a beállítás elrejti az összes frissítési figyelmeztetést a frissítéskezelőben.",LockSliders:"Az érintőképernyők csúszkáinak lezárása",LockSlidersDelay:"Csúszkák lezárásái eltelt idő",LockSlidersDelayDescription:"A csúszkák lezárásra kerülnek a megadott idő után. Ha 0 vagy üres az érték, a csúszkák csak az oldal változtatásnál/újratöltésnél záródnak le.",LockSlidersDescription:"Az érintőképernyők csúszkáinak lezárását meg kell szüntetned mielőtt állítani tudnál.",Logo:"Logó",ManualProbeDialog:"Kézi szintezés segéddialógusa",ManualProbeDialogDescription:"A PROBE_CALIBRATE vagy Z_ENDSTOP_CALIBRATE segéddialógus megjelenítése.",Mode:"Mód",ModeDescription:"Az alkalmazás általános megjelenésének megváltoztatása.",NavigationStyle:"Menü Stílusa",NavigationStyleDescription:"Menü megjelenésének megváltoztatása",NavigationStyleIconsAndText:"Ikonok + Szöveg",NavigationStyleIconsOnly:"Csak ikonok",PowerDeviceName:"Nyomtató tápellátó eszköz",PowerDeviceNameDescription:"Válaszd ki, hogy melyik Moonraker tápegységet kívánod használni a nyomtató bekapcsolásához.",Primary:"Elsődleges",PrintstatusThumbnailZoom:"Nagyobb miniatűr nagyítás",PrintstatusThumbnailZoomDescription:"Ezzel kikapcsolod a miniatűrkép nagyítását az állapotpanelen.",ProgressAsFavicon:"Haladás megjelenítése faviconként",ProgressAsFaviconDescription:"A Mainsail logó faviconjának megváltoztatása egy haladás körre.",ScrewsTiltAdjustDialog:"Csavar dőlésbeállítás párbeszédpanel",ScrewsTiltAdjustDialogDescription:"A SCREWS_TILT_CALCULATE segéddialógus megjelenítése.",ShowWebcamInNavigation:"Webkamera mutatása a menüben",TempchartHeight:"Magassági hőmérséklet diagram",TempchartHeightDescription:"Módosíthatod a hőmérséklet-diagram magasságát a műszerfalon.",Theme:"Téma",ThemeDark:"Sötét",ThemeDescription:"A felület márkajelzésének testreszabása.",ThemeLight:"Világos",UiSettings:"Nézet beállítások"},Update:"frissítés",WebcamsTab:{AddWebcam:"Webkamera hozzáadása",CreateWebcam:"Webkamera létrehozása",EditCrowsnestConf:"crowsnest.conf szerkesztő",EditWebcam:"Webkamera szerkesztése",EnableAudio:"Hang engedélyezése",FlipWebcam:"Webkamera tükrözése:",HideFps:"FPS számláló elrejtése",Hlsstream:"HLS Sugárzás",Horizontally:"vízszintes",IconBed:"Asztal",IconCam:"Kamera",IconDoor:"Ajtó",IconFilament:"Nyomtatószál",IconHot:"Forró",IconMcu:"MCU",IconNozzle:"Fúvóka",IconPrinter:"Nyomtató",Ipstream:"IP kamera",JMuxerStream:"Raw h264 sugárzás (jmuxer)",Mjpegstreamer:"MJPEG-Streamelő",MjpegstreamerAdaptive:"Adaptív MJPEG-Streamelő (kísérleti)",Name:"Név",NameAlreadyExists:"A név már létezik",Required:"Szükséges",Rotate:"Forgatás",SaveWebcam:"Webkamera mentése",Service:"Szolgáltatás",TargetFPS:"Cél FPS",UpdateWebcam:"Webkamera frissítése",UrlSnapshot:"Pillanatkép URL-je",UrlStream:"Stream URL-je",Uv4lMjpeg:"UV4L-MJPEG",Vertically:"függőleges",Webcams:"Webkamerák",WebrtcCameraStreamer:"WebRTC (kamera-sugárzás)",WebrtcGo2rtc:"WebRTC (go2rtc)",WebrtcJanus:"WebRTC (janus-átjáró)",WebrtcMediaMTX:"WebRTC (MediaMTX)"}},D={AllFiles:"Mind",Autorender:"Automatikus renderelés",Cancel:"Mégsem",Create:"Létrehoz",CreateNewDirectory:"mappa létrehozása",CurrentPath:"Jelenlegi elérési út",Delete:"Törlés",DeleteDirectory:"Mappa törlése",DeleteDirectoryQuestion:'Tényleg szeretnéd minden összetevőjével együtt törölni a következő mappát: "{name}"?',DeleteSelectedQuestion:"Tényleg törölni szeretnéd a kiválasztott fájlokat {count}?",DeleteSingleFileQuestion:'Tényleg törölni szeretnéd a fájlt "{name}"?',Download:"Letöltés",DuplicateLastframe:"Utolsó képkocka duplikálása",Empty:"Nem találhatóak idővonal fájlok.",Enabled:"Engedélyezve",EstimatedLength:"Becsült hossz",Files:"Fájlok",Filesize:"Fájlméret",Fixed:"fixált",Framerate:"Képsebesség",Frames:"Képkockák",Free:"Szabad",FreeDisk:"Szabad terület",LastModified:"Legutóbb módosítva",MaxFramerate:"Max. képsebesség",MinFramerate:"Min. képsebesség",Name:"Név",NewDirectory:"Új mappa",NoActiveTimelapse:"Nincs felvétel.",Preview:"Előnézet",RefreshCurrentDirectory:"mappa frissítése",Rename:"Átnevezés",RenameDirectory:"Mappa átnevezése",RenameFile:"Fájl átnevezése",Render:"renderel",RenderSettings:"Renderelési beállitások",SaveFrames:"Képkockák mentése",Search:"keresés",StartRender:"Renderelés megkezdése",Status:"Állapot",TargetFps:"Cél FPS",Targetlength:"Célhossz",TimelapseFiles:"Idővonal fájlok",TimelapseRendering:"Idővonal renderelése",TimelapseRenderingSuccessful:"Idővonal renderelése sikeres",Total:"Összes",Type:"Típus",Used:"Felhasznált",Variable:"Variálható",Video:"Videó"},j="Magyar",M={App:e,BedScrews:t,CancelJobDialog:a,ConnectionDialog:s,Console:l,CoolDownDialog:r,DevicesDialog:n,Dialogs:o,Editor:i,EmergencyStopDialog:m,Files:z,FullscreenUpload:d,GCodeViewer:k,Heightmap:g,History:c,JobQueue:p,Machine:u,ManualProbe:b,Panels:v,PowerDeviceChangeDialog:y,Router:h,ScrewsTiltAdjust:S,SelectPrinterDialog:f,Settings:C,Timelapse:D,title:j};export{e as App,t as BedScrews,a as CancelJobDialog,s as ConnectionDialog,l as Console,r as CoolDownDialog,n as DevicesDialog,o as Dialogs,i as Editor,m as EmergencyStopDialog,z as Files,d as FullscreenUpload,k as GCodeViewer,g as Heightmap,c as History,p as JobQueue,u as Machine,b as ManualProbe,v as Panels,y as PowerDeviceChangeDialog,h as Router,S as ScrewsTiltAdjust,f as SelectPrinterDialog,C as Settings,D as Timelapse,M as default,j as title}; diff --git a/assets/index-Bku7SJna.js b/assets/index-Bku7SJna.js new file mode 100644 index 0000000..9924579 --- /dev/null +++ b/assets/index-Bku7SJna.js @@ -0,0 +1,51 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Codemirror--JcAba3g.js","assets/codemirror-ZSHHXwGs.js","assets/vuetify-Ce4WN_Dg.js","assets/overlayscrollbars-CiKU261J.js","assets/overlayscrollbars-BJn_P54_.css","assets/vuetify-BSwS9o2d.css","assets/echarts-DzoUeqWp.js","assets/virtual_pwa-register-DiXdS4qF.js","assets/Hlsstreamer-BpBN3Lzc.js","assets/Hlsstreamer-Dpcrs_uP.css","assets/Ipstreamer-BPf8FdFe.js","assets/Ipstreamer-B2DsK1lF.css","assets/JanusStreamer-CQyYvBpk.js","assets/JanusStreamer-CtR5HFZ8.css","assets/JMuxerStream-Cqmc9Hrb.js","assets/JMuxerStream-COVqP7gw.css","assets/Mjpegstreamer-vxbaTGlP.js","assets/WebcamNozzleCrosshair-OgFJAMdG.js","assets/WebcamNozzleCrosshair-nYNM-zbo.css","assets/Mjpegstreamer-BgvUrWpO.css","assets/MjpegstreamerAdaptive-Boi1-RyL.js","assets/MjpegstreamerAdaptive-BIOOAIPf.css","assets/Uv4lMjpeg-1VbXGWjy.js","assets/Uv4lMjpeg-DO1dNraK.css","assets/WebrtcCameraStreamer-CRSlmQer.js","assets/WebrtcCameraStreamer-CeCrPMao.css","assets/WebrtcMediaMTX-9dkGjohV.js","assets/WebrtcMediaMTX-D-CyIvoY.css","assets/WebrtcGo2rtc-DGvVGkMJ.js","assets/WebrtcGo2rtc-rSd4eisB.css","assets/Heightmap-1ReT1M6e.js","assets/Heightmap-Cx_CgFq_.css","assets/Viewer-DVCEMRp5.js","assets/Viewer-oTo4b16s.css"])))=>i.map(i=>d[i]); +import{V as y,_ as Pe,a as Op,b as ru,c as _,d as ae,e as S$,f as g,g as iu,h as le,i as Z,j as I,k as Ss,l as or,m as x,n as b,o as se,p as oe,q as ge,r as ot,s as $s,t as it,u as Ee,v as Wt,w as xi,x as de,y as J,z as _t,A as Ze,B as Va,C as P$,D as ye,E as Me,F as rl,G as Dr,H as T_,I as Ys,J as D$,K as Qr,L as pi,M as cs,N as gt,O as wr,P as ke,Q as Hs,R as Xt,S as Lr,T as we,U as T$,W as Zs,X as pr,Y as Nn,Z as O$,$ as nu,a0 as O_,a1 as Mp,a2 as M$,a3 as k$,a4 as E$,a5 as jr,a6 as Zn,a7 as M_,a8 as L$,a9 as A$,aa as F$,ab as R$,ac as H$,ad as j$,ae as k_,af as I$,ag as N$,ah as V$,ai as B$,aj as Ag,ak as _o,al as vo,am as U$,an as W$,ao as bo,ap as Fg,aq as z$,ar as G$,as as Z$,at as q$}from"./vuetify-Ce4WN_Dg.js";import{c as Tr,a as en,g as E_,O as jo}from"./overlayscrollbars-CiKU261J.js";import{i as X$,t as Y$,u as J$,a as K$,b as Q$,c as ex,d as tx,e as sx,f as rx,g as ix,h as nx}from"./echarts-DzoUeqWp.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function r(i){if(i.ep)return;i.ep=!0;const n=t(i);fetch(i.href,n)}})();var ax={exports:{}};(function(s){var e=function(t){var r=Object.prototype,i=r.hasOwnProperty,n=Object.defineProperty||function(R,B,T){R[B]=T.value},a,o=typeof Symbol=="function"?Symbol:{},l=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function d(R,B,T){return Object.defineProperty(R,B,{value:T,enumerable:!0,configurable:!0,writable:!0}),R[B]}try{d({},"")}catch{d=function(B,T,A){return B[T]=A}}function m(R,B,T,A){var H=B&&B.prototype instanceof M?B:M,ee=Object.create(H.prototype),ie=new K(A||[]);return n(ee,"_invoke",{value:te(R,T,ie)}),ee}t.wrap=m;function h(R,B,T){try{return{type:"normal",arg:R.call(B,T)}}catch(A){return{type:"throw",arg:A}}}var f="suspendedStart",p="suspendedYield",v="executing",C="completed",P={};function M(){}function F(){}function O(){}var $={};d($,l,function(){return this});var D=Object.getPrototypeOf,V=D&&D(D(Q([])));V&&V!==r&&i.call(V,l)&&($=V);var N=O.prototype=M.prototype=Object.create($);F.prototype=O,n(N,"constructor",{value:O,configurable:!0}),n(O,"constructor",{value:F,configurable:!0}),F.displayName=d(O,c,"GeneratorFunction");function W(R){["next","throw","return"].forEach(function(B){d(R,B,function(T){return this._invoke(B,T)})})}t.isGeneratorFunction=function(R){var B=typeof R=="function"&&R.constructor;return B?B===F||(B.displayName||B.name)==="GeneratorFunction":!1},t.mark=function(R){return Object.setPrototypeOf?Object.setPrototypeOf(R,O):(R.__proto__=O,d(R,c,"GeneratorFunction")),R.prototype=Object.create(N),R},t.awrap=function(R){return{__await:R}};function G(R,B){function T(ee,ie,ue,be){var Se=h(R[ee],R,ie);if(Se.type==="throw")be(Se.arg);else{var rt=Se.arg,Pt=rt.value;return Pt&&typeof Pt=="object"&&i.call(Pt,"__await")?B.resolve(Pt.__await).then(function(jt){T("next",jt,ue,be)},function(jt){T("throw",jt,ue,be)}):B.resolve(Pt).then(function(jt){rt.value=jt,ue(rt)},function(jt){return T("throw",jt,ue,be)})}}var A;function H(ee,ie){function ue(){return new B(function(be,Se){T(ee,ie,be,Se)})}return A=A?A.then(ue,ue):ue()}n(this,"_invoke",{value:H})}W(G.prototype),d(G.prototype,u,function(){return this}),t.AsyncIterator=G,t.async=function(R,B,T,A,H){H===void 0&&(H=Promise);var ee=new G(m(R,B,T,A),H);return t.isGeneratorFunction(B)?ee:ee.next().then(function(ie){return ie.done?ie.value:ee.next()})};function te(R,B,T){var A=f;return function(ee,ie){if(A===v)throw new Error("Generator is already running");if(A===C){if(ee==="throw")throw ie;return re()}for(T.method=ee,T.arg=ie;;){var ue=T.delegate;if(ue){var be=X(ue,T);if(be){if(be===P)continue;return be}}if(T.method==="next")T.sent=T._sent=T.arg;else if(T.method==="throw"){if(A===f)throw A=C,T.arg;T.dispatchException(T.arg)}else T.method==="return"&&T.abrupt("return",T.arg);A=v;var Se=h(R,B,T);if(Se.type==="normal"){if(A=T.done?C:p,Se.arg===P)continue;return{value:Se.arg,done:T.done}}else Se.type==="throw"&&(A=C,T.method="throw",T.arg=Se.arg)}}}function X(R,B){var T=B.method,A=R.iterator[T];if(A===a)return B.delegate=null,T==="throw"&&R.iterator.return&&(B.method="return",B.arg=a,X(R,B),B.method==="throw")||T!=="return"&&(B.method="throw",B.arg=new TypeError("The iterator does not provide a '"+T+"' method")),P;var H=h(A,R.iterator,B.arg);if(H.type==="throw")return B.method="throw",B.arg=H.arg,B.delegate=null,P;var ee=H.arg;if(!ee)return B.method="throw",B.arg=new TypeError("iterator result is not an object"),B.delegate=null,P;if(ee.done)B[R.resultName]=ee.value,B.next=R.nextLoc,B.method!=="return"&&(B.method="next",B.arg=a);else return ee;return B.delegate=null,P}W(N),d(N,c,"Generator"),d(N,l,function(){return this}),d(N,"toString",function(){return"[object Generator]"});function q(R){var B={tryLoc:R[0]};1 in R&&(B.catchLoc=R[1]),2 in R&&(B.finallyLoc=R[2],B.afterLoc=R[3]),this.tryEntries.push(B)}function z(R){var B=R.completion||{};B.type="normal",delete B.arg,R.completion=B}function K(R){this.tryEntries=[{tryLoc:"root"}],R.forEach(q,this),this.reset(!0)}t.keys=function(R){var B=Object(R),T=[];for(var A in B)T.push(A);return T.reverse(),function H(){for(;T.length;){var ee=T.pop();if(ee in B)return H.value=ee,H.done=!1,H}return H.done=!0,H}};function Q(R){if(R||R===""){var B=R[l];if(B)return B.call(R);if(typeof R.next=="function")return R;if(!isNaN(R.length)){var T=-1,A=function H(){for(;++T=0;--A){var H=this.tryEntries[A],ee=H.completion;if(H.tryLoc==="root")return T("end");if(H.tryLoc<=this.prev){var ie=i.call(H,"catchLoc"),ue=i.call(H,"finallyLoc");if(ie&&ue){if(this.prev=0;--T){var A=this.tryEntries[T];if(A.tryLoc<=this.prev&&i.call(A,"finallyLoc")&&this.prev=0;--B){var T=this.tryEntries[B];if(T.finallyLoc===R)return this.complete(T.completion,T.afterLoc),z(T),P}},catch:function(R){for(var B=this.tryEntries.length-1;B>=0;--B){var T=this.tryEntries[B];if(T.tryLoc===R){var A=T.completion;if(A.type==="throw"){var H=A.arg;z(T)}return H}}throw new Error("illegal catch attempt")},delegateYield:function(R,B,T){return this.delegate={iterator:Q(R),resultName:B,nextLoc:T},this.method==="next"&&(this.arg=a),P}},t}(s.exports);try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}})(ax);var L_=function(){if(typeof Map<"u")return Map;function s(e,t){var r=-1;return e.some(function(i,n){return i[0]===t?(r=n,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var r=s(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(t,r){var i=s(this.__entries__,t);~i?this.__entries__[i][1]=r:this.__entries__.push([t,r])},e.prototype.delete=function(t){var r=this.__entries__,i=s(r,t);~i&&r.splice(i,1)},e.prototype.has=function(t){return!!~s(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,r){r===void 0&&(r=null);for(var i=0,n=this.__entries__;i0},s.prototype.connect_=function(){!um||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mx?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},s.prototype.disconnect_=function(){!um||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},s.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=t===void 0?"":t,i=dx.some(function(n){return!!~r.indexOf(n)});i&&this.refresh()},s.getInstance=function(){return this.instance_||(this.instance_=new s),this.instance_},s.instance_=null,s}(),A_=function(s,e){for(var t=0,r=Object.keys(e);t"u"||!(Element instanceof Object))){if(!(e instanceof wi(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new Cx(e)),this.controller_.addObserver(this),this.controller_.refresh())}},s.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof wi(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},s.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},s.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},s.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(r){return new $x(r.target,r.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},s.prototype.clearActive=function(){this.activeObservations_.splice(0)},s.prototype.hasActive=function(){return this.activeObservations_.length>0},s}(),R_=typeof WeakMap<"u"?new WeakMap:new L_,H_=function(){function s(e){if(!(this instanceof s))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=hx.getInstance(),r=new xx(e,t,this);R_.set(this,r)}return s}();["observe","unobserve","disconnect"].forEach(function(s){H_.prototype[s]=function(){var e;return(e=R_.get(this))[s].apply(e,arguments)}});(function(){return typeof il.ResizeObserver<"u"?il.ResizeObserver:H_})();/** + * vue-class-component v7.2.6 + * (c) 2015-present Evan You + * @license MIT + */function Io(s){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Io=function(e){return typeof e}:Io=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Io(s)}function wx(s,e,t){return e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function Sx(s){return Px(s)||Dx(s)||Tx()}function Px(s){if(Array.isArray(s)){for(var e=0,t=new Array(s.length);e1&&arguments[1]!==void 0?arguments[1]:{};e.name=e.name||s._componentTag||s.name;var t=s.prototype;Object.getOwnPropertyNames(t).forEach(function(o){if(o!=="constructor"){if(dm.indexOf(o)>-1){e[o]=t[o];return}var l=Object.getOwnPropertyDescriptor(t,o);l.value!==void 0?typeof l.value=="function"?(e.methods||(e.methods={}))[o]=l.value:(e.mixins||(e.mixins=[])).push({data:function(){return wx({},o,l.value)}}):(l.get||l.set)&&((e.computed||(e.computed={}))[o]={get:l.get,set:l.set})}}),(e.mixins||(e.mixins=[])).push({data:function(){return Ax(this,s)}});var r=s.__decorators__;r&&(r.forEach(function(o){return o(e)}),delete s.__decorators__);var i=Object.getPrototypeOf(s.prototype),n=i instanceof y?i.constructor:y,a=n.extend(e);return Rx(a,s,n),Ox()&&Mx(a,s),a}var Fx={prototype:!0,arguments:!0,callee:!0,caller:!0};function Rx(s,e,t){Object.getOwnPropertyNames(e).forEach(function(r){if(!Fx[r]){var i=Object.getOwnPropertyDescriptor(s,r);if(!(i&&!i.configurable)){var n=Object.getOwnPropertyDescriptor(e,r);if(!Ex){if(r==="cid")return;var a=Object.getOwnPropertyDescriptor(t,r);if(!Lx(n.value)&&a&&a.value===n.value)return}Object.defineProperty(s,r,n)}}})}function S(s){return typeof s=="function"?Hg(s):function(e){return Hg(e,s)}}S.registerHooks=function(e){dm.push.apply(dm,Sx(e))};var Hx=typeof Reflect<"u"&&typeof Reflect.getMetadata<"u";function jx(s,e,t){if(Hx&&!Array.isArray(s)&&typeof s!="function"&&!s.hasOwnProperty("type")&&typeof s.type>"u"){var r=Reflect.getMetadata("design:type",e,t);r!==Object&&(s.type=r)}}function w(s){return s===void 0&&(s={}),function(e,t){jx(s,e,t),ou(function(r,i){(r.props||(r.props={}))[i]=s})(e,t)}}function Ts(s){return ou(function(e,t){e.computed=e.computed||{},e.computed[t]={cache:!1,get:function(){return this.$refs[s||t]}}})}function Ix(s){s===void 0&&(s={});var e="value";return ou(function(t,r){(t.props||(t.props={}))[e]=s,(t.computed||(t.computed={}))[r]={get:function(){return this[e]},set:function(i){this.$emit("input",i)}}})}function he(s,e){e===void 0&&(e={});var t=e.deep,r=t===void 0?!1:t,i=e.immediate,n=i===void 0?!1:i;return ou(function(a,o){typeof a.watch!="object"&&(a.watch=Object.create(null));var l=a.watch;typeof l[s]=="object"&&!Array.isArray(l[s])?l[s]=[l[s]]:typeof l[s]>"u"&&(l[s]=[]),l[s].push({handler:o,deep:r,immediate:n})})}var Nx=Object.getOwnPropertyDescriptor,Vx=(s,e,t,r)=>{for(var i=r>1?void 0:r?Nx(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let L=class extends y{get apiUrl(){return this.$store.getters["socket/getUrl"]}get hostUrl(){return this.$store.getters["socket/getHostUrl"]}get hostPort(){var s;return parseInt((s=this.$store.state.socket.port)!=null?s:80)}get instancesDB(){var s;return(s=this.$store.state.instancesDB)!=null?s:"moonraker"}get socketIsConnected(){var s;return(s=this.$store.state.socket.isConnected)!=null?s:!1}get guiIsReady(){return this.$store.state.socket.initializationList.length===0}get klippyIsConnected(){var s;return(s=this.$store.state.server.klippy_connected)!=null?s:!1}get klipperState(){var s;return this.klippyIsConnected?(s=this.$store.state.server.klippy_state)!=null?s:"":"disconnected"}get klipperReadyForGui(){return this.socketIsConnected&&this.klipperState==="ready"}get klipperAppName(){var s;return(s=this.$store.state.printer.app_name)!=null?s:"Klipper"}get printerIsPrinting(){return this.klipperReadyForGui&&["printing","paused"].includes(this.printer_state)}get printerIsPrintingOnly(){return this.klipperReadyForGui&&this.printer_state==="printing"}get printerPowerDevice(){var t,r,i,n;const s=(t=this.$store.state.gui.uiSettings.powerDeviceName)!=null?t:null;return s!==null?s:(n=(i=((r=this.$store.getters["server/power/getDevices"])!=null?r:[]).find(a=>a.device.toLowerCase()==="printer"))==null?void 0:i.device)!=null?n:"printer"}get isPrinterPowerOff(){var r;const s=(r=this.$store.getters["server/power/getDevices"])!=null?r:[];if(s.length===0)return!1;const e=s.findIndex(i=>i.device===this.printerPowerDevice);return e===-1||s[e].status!=="off"?!1:!this.klippyIsConnected}get loadings(){var s;return(s=this.$store.state.socket.loadings)!=null?s:[]}get printer_state(){var t,r,i,n,a,o;const s=(n=(i=(t=this.$store.state.printer.print_stats)==null?void 0:t.state)!=null?i:(r=this.$store.state.printer.idle_timeout)==null?void 0:r.state)!=null?n:"",e=(o=(a=this.$store.state.printer["gcode_macro TIMELAPSE_TAKE_FRAME"])==null?void 0:a.is_paused)!=null?o:!1;return s==="paused"&&e?"printing":s}get isMobile(){return this.$vuetify.breakpoint.mobile}get isTablet(){return this.$vuetify.breakpoint.smAndUp&&!this.isDesktop&&!this.isWidescreen}get isDesktop(){return this.$vuetify.breakpoint.lgAndUp&&!this.isWidescreen}get isWidescreen(){return this.$vuetify.breakpoint.xl}get viewport(){return this.isMobile?"mobile":this.isTablet?"tablet":this.isDesktop?"desktop":"widescreen"}get isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0&&navigator.maxTouchPoints!==256}get isIOS(){return!!(navigator.userAgent.match(/(iPad|iPhone|iPod)/)||navigator.platform==="MacIntel"&&typeof navigator.standalone<"u")}get moonrakerComponents(){var s,e;return(e=(s=this.$store.state.server)==null?void 0:s.components)!=null?e:[]}get existGcodesRootDirectory(){return this.$store.state.server.registered_directories.findIndex(e=>e==="gcodes")>=0}get formatDateOptions(){switch(this.$store.state.gui.general.dateFormat){case"2-digits":return{day:"2-digit",month:"2-digit",year:"numeric"};case"short":return{day:"2-digit",month:"short",year:"numeric"};default:return{dateStyle:"medium"}}}get formatTimeOptions(){switch(this.$store.state.gui.general.timeFormat){case"24hours":return{hour:"2-digit",minute:"2-digit",hourCycle:"h23"};case"12hours":return{hour:"2-digit",minute:"2-digit",hourCycle:"h12"};default:return{timeStyle:"short"}}}get formatTimeWithSecondsOptions(){switch(this.$store.state.gui.general.timeFormat){case"24hours":return{hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"};case"12hours":return{hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h12"};default:return{timeStyle:"short"}}}get browserLocale(){return navigator.language}get hours12Format(){return this.$store.getters["gui/getHours12Format"]}formatDate(s){let e=null;try{e=typeof s.getMonth=="function"?s:new Date(s)}catch{return"UNKNOWN"}return e.toLocaleDateString(this.browserLocale,this.formatDateOptions)}formatTime(s,e=!1){let t=null;try{t=typeof s.getMonth=="function"?s:new Date(s)}catch{return"UNKNOWN"}return e?t.toLocaleTimeString(this.browserLocale,this.formatTimeWithSecondsOptions):t.toLocaleTimeString(this.browserLocale,this.formatTimeOptions)}formatDateTime(s,e=!1){const t=this.formatDate(s),r=this.formatTime(s,e);return"".concat(t," ").concat(r)}};L=Vx([S],L);var Bx=Object.defineProperty,Ux=Object.getOwnPropertyDescriptor,kp=(s,e,t,r)=>{for(var i=r>1?void 0:r?Ux(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&Bx(e,t,i),i};let qn=class extends k(L){get colorMainsail(){return"200,200,200"}get colorMoonraker(){return this.moonraker?"200,200,200":"115,115,115"}get colorKlipper(){return this.klipper?"200,200,200":"115,115,115"}};kp([w({default:!1})],qn.prototype,"moonraker",2);kp([w({default:!1})],qn.prototype,"klipper",2);qn=kp([S],qn);function E(s,e,t,r,i,n,a,o){var l=typeof s=="function"?s.options:s;return e&&(l.render=e,l.staticRenderFns=t,l._compiled=!0),n&&(l._scopeId="data-v-"+n),{exports:s,options:l}}var Wx=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("svg",{staticStyle:{"fill-rule":"evenodd","clip-rule":"evenodd","stroke-linejoin":"round","stroke-miterlimit":"2"},attrs:{width:"100%",height:"100%",viewBox:"0 0 430 70",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","xml:space":"preserve","xmlns:serif":"http://www.serif.com/"}},[t("g",{attrs:{id:"Mainsail",transform:"matrix(1,0,0,1,10,0)"}},[t("g",{attrs:{id:"Mainsail_text",transform:"matrix(1,0,0,1,-54.2745,6.1424)"}},[t("text",{style:"font-family:Roboto;font-size:16px;fill:rgb("+e.colorMainsail+");",attrs:{x:"47.429px",y:"60.749px"}},[e._v(" Mainsail ")])]),t("g",{attrs:{id:"Mainsail_icon",transform:"matrix(1.00478,0,0,1.00478,-1.35436,-0.18202)"}},[t("g",{attrs:{transform:"matrix(0.101469,0,0,0.101469,1.34792,1.1764)"}},[t("path",{style:"fill:rgb("+e.colorMainsail+");fill-rule:nonzero;",attrs:{d:"M286.718,107.235L99.735,392.115L0,392.01L258.225,0C264.135,36.795 273.9,73.26 286.718,107.235"}})]),t("g",{attrs:{transform:"matrix(0.101469,0,0,0.101469,1.34792,1.1764)"}},[t("path",{style:"fill:rgb("+e.colorMainsail+");fill-rule:nonzero;",attrs:{d:"M309.96,160.155L156.375,392.19L256.08,392.332L357.353,237.585C339.518,213.218 323.648,187.328 309.96,160.155"}})]),t("g",{attrs:{transform:"matrix(0.101469,0,0,0.101469,1.34792,1.1764)"}},[t("path",{style:"fill:rgb("+e.colorMainsail+");fill-rule:nonzero;",attrs:{d:"M449.535,335.768L412.597,392.332L312.75,392.115L388.95,276.862C407.61,298.012 427.868,317.707 449.535,335.767L449.535,335.768Z"}})])])]),t("g",{attrs:{id:"Mainsail_Moonraker",transform:"matrix(1,0,0,1,1.49628,0)"}},[t("g",{attrs:{id:"arrow_left1","serif:id":"arrow_left",transform:"matrix(0.687874,0,0,0.721154,20.3568,-15.8811)"}},[t("path",{style:"fill:rgb("+e.colorMoonraker+")",attrs:{d:"M93.918,56.626L93.918,60.724L73.299,52.528L93.918,44.333L93.918,48.431L118.741,48.431L118.741,56.626L93.918,56.626Z"}})]),t("g",{attrs:{id:"arrow_right1","serif:id":"arrow_right",transform:"matrix(-0.687874,-8.42403e-17,8.83159e-17,-0.721154,217.125,59.8811)"}},[t("path",{style:"fill:rgb("+e.colorMoonraker+")",attrs:{d:"M93.918,56.626L93.918,60.724L73.299,52.528L93.918,44.333L93.918,48.431L118.741,48.431L118.741,56.626L93.918,56.626Z"}})]),e.moonraker?t("g",{attrs:{id:"success1","serif:id":"success",transform:"matrix(1.1,0,0,1.1,105.541,9.8)"}},[t("path",{staticStyle:{fill:"rgb(38, 203, 124)","fill-rule":"nonzero"},attrs:{d:"M20,12C20,16.389 16.389,20 12,20C7.611,20 4,16.389 4,12C4,7.611 7.611,4 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2C6.514,2 2,6.514 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}})]):t("g",{attrs:{id:"alert1","serif:id":"alert",transform:"matrix(1.1,0,0,1.1,105.541,9.8)"}},[t("path",{staticStyle:{fill:"rgb(245, 124, 5)","fill-rule":"nonzero"},attrs:{d:"M11,15L13,15L13,17L11,17L11,15M11,7L13,7L13,13L11,13L11,7M12,2C6.47,2 2,6.5 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12C22,6.514 17.486,2 12,2M12,20C7.611,20 4,16.389 4,12C4,7.611 7.611,4 12,4C16.389,4 20,7.611 20,12C20,16.389 16.389,20 12,20Z"}})])]),t("g",{attrs:{id:"Moonraker",transform:"matrix(1,0,0,1,10,0)"}},[t("g",{attrs:{id:"Moonraker_text",transform:"matrix(1,0,0,1,120.368,6.1424)"}},[t("text",{style:"fill:rgb("+e.colorMoonraker+");font-family:Roboto;font-size:16px;",attrs:{x:"45.429px",y:"60.749px"}},[e._v(" Moonraker ")])]),t("g",{attrs:{id:"Moonraker_icon",transform:"matrix(2,0,0,2,181,-5)"}},[t("path",{style:"fill:rgb("+e.colorMoonraker+");fill-rule:nonzero;",attrs:{d:"M13,19L14,19C14.549,19 15,19.451 15,20L22,20L22,22L15,22C15,22.549 14.549,23 14,23L10,23C9.451,23 9,22.549 9,22L2,22L2,20L9,20C9,19.451 9.451,19 10,19L11,19L11,17L4,17C3.451,17 3,16.549 3,16L3,12C3,11.451 3.451,11 4,11L20,11C20.549,11 21,11.451 21,12L21,16C21,16.549 20.549,17 20,17L13,17L13,19M4,3L20,3C20.549,3 21,3.451 21,4L21,8C21,8.549 20.549,9 20,9L4,9C3.451,9 3,8.549 3,8L3,4C3,3.451 3.451,3 4,3M9,7L10,7L10,5L9,5L9,7M9,15L10,15L10,13L9,13L9,15M5,5L5,7L7,7L7,5L5,5M5,13L5,15L7,15L7,13L5,13Z"}})])]),t("g",{attrs:{id:"Moonraker_Klipper",transform:"matrix(1,0,0,1,194.593,0)"}},[t("g",{attrs:{id:"arrow_left",transform:"matrix(0.687874,0,0,0.721154,20.3568,-15.8811)"}},[t("path",{staticStyle:{fill:"rgb(115, 115, 115)"},attrs:{d:"M93.918,56.626L93.918,60.724L73.299,52.528L93.918,44.333L93.918,48.431L118.741,48.431L118.741,56.626L93.918,56.626Z"}})]),t("g",{attrs:{id:"arrow_right",transform:"matrix(-0.687874,-8.42403e-17,8.83159e-17,-0.721154,217.125,59.8811)"}},[t("path",{staticStyle:{fill:"rgb(115, 115, 115)"},attrs:{d:"M93.918,56.626L93.918,60.724L73.299,52.528L93.918,44.333L93.918,48.431L118.741,48.431L118.741,56.626L93.918,56.626Z"}})]),e.moonraker?[e.klipper?t("g",{attrs:{id:"success",transform:"matrix(1.1,0,0,1.1,105.541,9.8)"}},[t("path",{staticStyle:{fill:"rgb(38, 203, 124)","fill-rule":"nonzero"},attrs:{d:"M20,12C20,16.389 16.389,20 12,20C7.611,20 4,16.389 4,12C4,7.611 7.611,4 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2C6.514,2 2,6.514 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}})]):t("g",{attrs:{id:"alert",transform:"matrix(1.1,0,0,1.1,105.541,9.8)"}},[t("path",{staticStyle:{fill:"rgb(245, 124, 5)","fill-rule":"nonzero"},attrs:{d:"M11,15L13,15L13,17L11,17L11,15M11,7L13,7L13,13L11,13L11,7M12,2C6.47,2 2,6.5 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12C22,6.514 17.486,2 12,2M12,20C7.611,20 4,16.389 4,12C4,7.611 7.611,4 12,4C16.389,4 20,7.611 20,12C20,16.389 16.389,20 12,20Z"}})])]:[t("g",{attrs:{id:"unknown",transform:"matrix(1.1,0,0,1.1,105.541,9.8)"}},[t("path",{staticStyle:{fill:"rgb(115, 115, 115)","fill-rule":"nonzero"},attrs:{d:"M11,18L13,18L13,16L11,16L11,18M12,2C6.514,2 2,6.514 2,12C2,17.486 6.514,22 12,22C17.486,22 22,17.486 22,12C22,6.514 17.486,2 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6C9.806,6 8,7.806 8,10L10,10C10,8.903 10.903,8 12,8C13.097,8 14,8.903 14,10C14,12 11,11.75 11,15L13,15C13,12.75 16,12.5 16,10C16,7.806 14.194,6 12,6Z"}})])]],2),t("g",{attrs:{id:"Klipper",transform:"matrix(1,0,0,1,10,0)"}},[t("g",{attrs:{id:"Klipper_text",transform:"matrix(1,0,0,1,317.036,6.1424)"}},[t("text",{style:"font-family:Roboto;font-size:16px;fill:rgb("+e.colorKlipper+");",attrs:{x:"48.429px",y:"60.749px"}},[e._v(" Klipper ")])]),t("g",{attrs:{id:"Klipper_icon",transform:"matrix(2,0,0,2,366,-3)"}},[t("path",{style:"fill:rgb("+e.colorKlipper+");fill-rule:nonzero;",attrs:{d:"M19,6C19.549,6 20,5.549 20,5C20,4.451 19.549,4 19,4C18.451,4 18,4.451 18,5C18,5.549 18.451,6 19,6M19,2C20.646,2 22,3.354 22,5L22,11L18,11L18,7L6,7L6,11L2,11L2,5C2,3.354 3.354,2 5,2L19,2M18,18.25C18,18.63 17.79,18.96 17.47,19.13L12.57,21.82C12.4,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L6.53,19.13C6.21,18.96 6,18.63 6,18.25L6,13C6,12.62 6.21,12.29 6.53,12.12L11.43,9.68C11.59,9.56 11.79,9.5 12,9.5C12.21,9.5 12.4,9.56 12.57,9.68L17.47,12.12C17.79,12.29 18,12.62 18,13L18,18.25M12,11.65L9.04,13L12,14.6L14.96,13L12,11.65M8,17.66L11,19.29L11,16.33L8,14.71L8,17.66M16,17.66L16,14.71L13,16.33L13,19.29L16,17.66Z"}})])])])},zx=[],Gx=E(qn,Wx,zx,!1,null,null);const lu=Gx.exports,j_="dark",I_="mainsail",Ir="#D41216",al="#2196f3",At="#1e1e1e",jg="v0.11.0-257",Ig="v0.8.0-306",Zx=[{name:"safari",version:"16.5.2"}],qx=["#F44336","#8e379d","#03DAC5","#3F51B5","#ffde03","#009688","#E91E63"],Xx="#2196F3",Yx="#4CAF50",N_="99",V_="44",Si=".theme",Jx=1e3,Ln=["temperature","target","power","speed"],Xn=["power","speed"],Kx=["aht10","bme280","htu21d","sgp40","sht3x"],Pi=[".gcode",".g",".gco",".ufp",".nc"],B_=["history","power","updateManager","timelapse","jobQueue","announcements","spoolman","sensor"],Qx=["virtual_sdcard","pause_resume","gcode_macro pause","gcode_macro resume","gcode_macro cancel_print"],ew=["uuid","estimated_time","filament_name","filament_type","filament_total","filament_weight_total","nozzle_diameter","first_layer_bed_temp","first_layer_extr_temp","chamber_temp","first_layer_height","gcode_end_byte","gcode_start_byte","job_id","layer_height","object_height","print_start_time","size","slicer","slicer_version","thumbnails"],yo=500,tw=50,sw=["toolhead-control","extruder-control","macros","machine-settings","miniconsole","miscellaneous","spoolman","temperature","webcam"],Yt=30,Jt=64,Ls=128,rw=220,iw=48,mm=48,Vn=48,nw=["^_TIMELAPSE_NEW_FRAME","^TIMELAPSE_TAKE_FRAME","^TIMELAPSE_RENDER","^_SET_TIMELAPSE_SETUP","^HYPERLAPSE ACTION=","^SET_GCODE_VARIABLE MACRO=TIMELAPSE_"],aw=["gcodes","timelapse","timelapse_frames"],ow=[".git"],lw=["klippy","moonraker","crowsnest","mmu","sonar"],cw=["klipper","moonraker"],Ci=[{name:"mainsail",displayName:"Mainsail",colorLogo:Ir},{name:"klipper",displayName:"Klipper",colorLogo:"#b12f35",logo:{show:!0,light:!1}},{name:"voron",displayName:"Voron Design",colorLogo:"#FF2300",logo:{show:!0,light:!1}},{name:"ldo",displayName:"LDO Motion (Sponsor)",colorLogo:"#326799",colorPrimary:"#326799",logo:{show:!0,light:!1}},{name:"yumi",displayName:"YUMI (Sponsor)",colorLogo:"#F6CF3D",colorPrimary:"#F6CF3D",logo:{show:!0,light:!1}},{name:"vzbot",displayName:"VzBot",colorLogo:"#FF0000",logo:{show:!0,light:!1},sidebarBackground:{show:!0,light:!1},css:!0},{name:"prusa",displayName:"Prusa Research (Sponsor)",colorLogo:"#fa6831",colorPrimary:"#fa6831",logo:{show:!0,light:!1}},{name:"btt",displayName:"BigTreeTech (Sponsor)",colorLogo:"#ef0025",logo:{show:!0,light:!1}},{name:"multec",displayName:"Multec GmbH (Sponsor)",colorLogo:"#234D7A",colorPrimary:"#234D7A",logo:{show:!0,light:!1}}],Ng={Klipper:{url:"https://www.klipper3d.org/",docsLanguages:["it","hu","zh"]},Kalico:{url:"https://docs.kalico.gg/"}};var tn="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9A3,3 0 0,1 15,12Z",Yn="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z",uw="M9.29,3.25L5.16,6.72L4,5.34L8.14,1.87L9.29,3.25M22,5.35L20.84,6.73L16.7,3.25L17.86,1.87L22,5.35M13,4A8,8 0 0,1 21,12A8,8 0 0,1 13,20A8,8 0 0,1 5,12A8,8 0 0,1 13,4M13,6A6,6 0 0,0 7,12A6,6 0 0,0 13,18A6,6 0 0,0 19,12A6,6 0 0,0 13,6M12,7.5H13.5V12.03L16.72,13.5L16.1,14.86L12,13V7.5M1,14C1,11.5 2.13,9.3 3.91,7.83C3.33,9.1 3,10.5 3,12L3.06,13.13L3,14C3,16.28 4.27,18.26 6.14,19.28C7.44,20.5 9.07,21.39 10.89,21.78C10.28,21.92 9.65,22 9,22A8,8 0 0,1 1,14Z",dw="M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12,16.5C9.5,16.5 7.5,14.5 7.5,12C7.5,9.5 9.5,7.5 12,7.5C14.5,7.5 16.5,9.5 16.5,12C16.5,14.5 14.5,16.5 12,16.5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",mw="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z",U_="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",W_="M8.27,3L3,8.27V15.73L8.27,21H15.73C17.5,19.24 21,15.73 21,15.73V8.27L15.73,3M9.1,5H14.9L19,9.1V14.9L14.9,19H9.1L5,14.9V9.1M11,15H13V17H11V15M11,7H13V13H11V7",Jn="M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",cu="M19.92,12.08L12,20L4.08,12.08L5.5,10.67L11,16.17V2H13V16.17L18.5,10.66L19.92,12.08M12,20H2V22H22V20H12Z",hw="M4,12H20V14H4V12M4,9H20V11H4V9M16,4L12,8L8,4H11V1H13V4H16M8,19L12,15L16,19H13V22H11V19H8Z",pw="M9,4H15V12H19.84L12,19.84L4.16,12H9V4Z",z_="M2,20V22H22V20H13V5.83L18.5,11.33L19.92,9.92L12,2L4.08,9.92L5.5,11.33L11,5.83V20H2Z",fw="M13,9V15H16L12,19L8,15H11V9H8L12,5L16,9H13M4,2H20V4H4V2M4,20H20V22H4V20Z",gw="M15,20H9V12H4.16L12,4.16L19.84,12H15V20Z",_w="M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M14,21A2,2 0 0,1 12,23A2,2 0 0,1 10,21",vw="M22.11,21.46L2.39,1.73L1.11,3L5.83,7.72C5.29,8.73 5,9.86 5,11V17L3,19V20H18.11L20.84,22.73L22.11,21.46M7,18V11C7,10.39 7.11,9.79 7.34,9.23L16.11,18H7M10,21H14A2,2 0 0,1 12,23A2,2 0 0,1 10,21M8.29,5.09C8.82,4.75 9.4,4.5 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V15.8L17,13.8V11A5,5 0 0,0 12,6C11.22,6 10.45,6.2 9.76,6.56L8.29,5.09Z",bw="M10 21H14C14 22.1 13.1 23 12 23S10 22.1 10 21M21 19V20H3V19L5 17V11C5 7.9 7 5.2 10 4.3V4C10 2.9 10.9 2 12 2S14 2.9 14 4V4.3C17 5.2 19 7.9 19 11V17L21 19M17 11C17 8.2 14.8 6 12 6S7 8.2 7 11V18H17V11Z",G_="M19.36,2.72L20.78,4.14L15.06,9.85C16.13,11.39 16.28,13.24 15.38,14.44L9.06,8.12C10.26,7.22 12.11,7.37 13.65,8.44L19.36,2.72M5.93,17.57C3.92,15.56 2.69,13.16 2.35,10.92L7.23,8.83L14.67,16.27L12.58,21.15C10.34,20.81 7.94,19.58 5.93,17.57Z",uu="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z",$te="M20,5H17L15,3H9L7,5H4A2,2 0 0,0 2,7V19A2,2 0 0,0 4,21H20A2,2 0 0,0 22,19V7A2,2 0 0,0 20,5M12,18C10.92,18 9.86,17.65 9,17L10.44,15.56C10.91,15.85 11.45,16 12,16A3,3 0 0,0 15,13A3,3 0 0,0 12,10C10.74,10 9.6,10.8 9.18,12H11L8,15L5,12H7.1C7.65,9.29 10.29,7.55 13,8.1C15.7,8.65 17.45,11.29 16.9,14C16.42,16.33 14.38,18 12,18Z",yw="M15.9,18.5L21.9,20.1L21.5,22L12.1,19.5L2.7,22L2.2,20.1L8.2,18.5L2.1,16.9L2.6,15L12,17.5L21.4,15L21.9,16.9L15.9,18.5M16.07,7.92C15.91,7.7 15.71,7.5 15.5,7.33C15.05,6.9 14.5,6.59 14.06,6.13C13,5.08 12.79,3.34 13.44,2C12.79,2.17 12.18,2.54 11.67,2.95C9.84,4.46 9.11,7.1 10,9.38C10,9.45 10.04,9.53 10.04,9.62C10.04,9.78 9.93,9.92 9.79,10C9.63,10.05 9.46,10 9.33,9.9C9.28,9.86 9.25,9.82 9.22,9.77C8.42,8.74 8.29,7.26 8.84,6.07C7.65,7.06 7,8.72 7.11,10.29C7.13,10.65 7.18,11 7.3,11.36C7.41,11.8 7.59,12.23 7.82,12.61C8.57,13.86 9.9,14.76 11.32,14.94C12.84,15.14 14.46,14.85 15.63,13.79C16.93,12.59 17.4,10.67 16.71,9L16.61,8.83C16.47,8.5 16.28,8.2 16.04,7.93L16.07,7.92M13.83,12.47C13.63,12.65 13.31,12.83 13.05,12.91C12.26,13.19 11.46,12.79 11,12.31C11.84,12.11 12.34,11.47 12.5,10.83C12.61,10.25 12.39,9.78 12.29,9.22C12.21,8.69 12.22,8.23 12.42,7.73C12.55,8 12.69,8.28 12.86,8.5C13.41,9.22 14.27,9.54 14.45,10.5C14.47,10.63 14.5,10.72 14.5,10.83C14.5,11.43 14.26,12.07 13.82,12.47",Z_="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",Cw="M17,19H7V5H17M17,1H7C5.89,1 5,1.89 5,3V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3C19,1.89 18.1,1 17,1Z",$w="M17.45,15.18L22,7.31V19L22,21H2V3H4V15.54L9.5,6L16,9.78L20.24,2.45L21.97,3.45L16.74,12.5L10.23,8.75L4.31,19H6.57L10.96,11.44L17.45,15.18Z",q_="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",Ep="M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z",Lp="M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",X_="M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",xw="M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z",ww="M5.59,7.41L7,6L13,12L7,18L5.59,16.59L10.17,12L5.59,7.41M11.59,7.41L13,6L19,12L13,18L11.59,16.59L16.17,12L11.59,7.41Z",fr="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",Sw="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",Pw="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",Dw="M9.42,7.41L4.83,12L9.42,16.59L8,18L2,12L8,6L9.42,7.41M15.42,7.41L10.83,12L15.42,16.59L14,18L8,12L14,6L15.42,7.41M21.42,7.41L16.83,12L21.42,16.59L20,18L14,12L20,6L21.42,7.41Z",Tw="M14.58,16.59L19.17,12L14.58,7.41L16,6L22,12L16,18L14.58,16.59M8.58,16.59L13.17,12L8.58,7.41L10,6L16,12L10,18L8.58,16.59M2.58,16.59L7.17,12L2.58,7.41L4,6L10,12L4,18L2.58,16.59Z",du="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z",Ow="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z",Ba="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",Mw="M20 2H8C6.9 2 6 2.9 6 4V16C6 17.11 6.9 18 8 18H20C21.11 18 22 17.11 22 16V4C22 2.9 21.11 2 20 2M20 16H8V4H20V16M4 6V20H18V22H4C2.9 22 2 21.11 2 20V6H4M9.77 12.84L12.6 10L9.77 7.15L11.17 5.75L14 8.6L16.84 5.77L18.24 7.17L15.4 10L18.23 12.84L16.83 14.24L14 11.4L11.17 14.24L9.77 12.84Z",ol="M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z",kw="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2M14.59,8L12,10.59L9.41,8L8,9.41L10.59,12L8,14.59L9.41,16L12,13.41L14.59,16L16,14.59L13.41,12L16,9.41L14.59,8Z",pe="M20 6.91L17.09 4L12 9.09L6.91 4L4 6.91L9.09 12L4 17.09L6.91 20L12 14.91L17.09 20L20 17.09L14.91 12L20 6.91Z",Kn="M6.5 20Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.83 7.13 7.39 5.75 8.95 4.38 11 4.08V12.15L9.4 10.6L8 12L12 16L16 12L14.6 10.6L13 12.15V4.08Q15.58 4.43 17.29 6.39 19 8.35 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20Z",Qn="M14.6,16.6L19.2,12L14.6,7.4L16,6L22,12L16,18L14.6,16.6M9.4,16.6L4.8,12L9.4,7.4L8,6L2,12L8,18L9.4,16.6Z",ss="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",Ew="M22.12 21.46L2.4 1.73L1.12 3L4 5.87L2.34 8.73C2.21 8.95 2.27 9.22 2.46 9.37L4.57 11C4.53 11.34 4.5 11.67 4.5 12S4.53 12.65 4.57 12.97L2.46 14.63C2.27 14.78 2.21 15.05 2.34 15.27L4.34 18.73C4.46 18.95 4.73 19.03 4.95 18.95L7.44 17.94C7.96 18.34 8.5 18.68 9.13 18.93L9.5 21.58C9.54 21.82 9.75 22 10 22H14C14.25 22 14.46 21.82 14.5 21.58L14.87 18.93C15.38 18.72 15.83 18.45 16.26 18.14L20.85 22.73L22.12 21.46M12 15.5C10.07 15.5 8.5 13.93 8.5 12C8.5 11.5 8.62 11.08 8.79 10.67L13.33 15.21C12.92 15.39 12.5 15.5 12 15.5M11.74 8.53L8.56 5.35C8.75 5.25 8.93 5.15 9.13 5.07L9.5 2.42C9.54 2.18 9.75 2 10 2H14C14.25 2 14.46 2.18 14.5 2.42L14.87 5.07C15.5 5.32 16.04 5.66 16.56 6.05L19.05 5.05C19.27 4.96 19.54 5.05 19.66 5.27L21.66 8.73C21.78 8.95 21.73 9.22 21.54 9.37L19.43 11C19.47 11.34 19.5 11.67 19.5 12S19.47 12.65 19.43 12.97L21.54 14.63C21.73 14.78 21.78 15.05 21.66 15.27L20.5 17.29L15.47 12.26C15.5 12.18 15.5 12.09 15.5 12C15.5 10.07 13.93 8.5 12 8.5C11.91 8.5 11.83 8.5 11.74 8.53Z",Lw="M15.9,18.45C17.25,18.45 18.35,17.35 18.35,16C18.35,14.65 17.25,13.55 15.9,13.55C14.54,13.55 13.45,14.65 13.45,16C13.45,17.35 14.54,18.45 15.9,18.45M21.1,16.68L22.58,17.84C22.71,17.95 22.75,18.13 22.66,18.29L21.26,20.71C21.17,20.86 21,20.92 20.83,20.86L19.09,20.16C18.73,20.44 18.33,20.67 17.91,20.85L17.64,22.7C17.62,22.87 17.47,23 17.3,23H14.5C14.32,23 14.18,22.87 14.15,22.7L13.89,20.85C13.46,20.67 13.07,20.44 12.71,20.16L10.96,20.86C10.81,20.92 10.62,20.86 10.54,20.71L9.14,18.29C9.05,18.13 9.09,17.95 9.22,17.84L10.7,16.68L10.65,16L10.7,15.31L9.22,14.16C9.09,14.05 9.05,13.86 9.14,13.71L10.54,11.29C10.62,11.13 10.81,11.07 10.96,11.13L12.71,11.84C13.07,11.56 13.46,11.32 13.89,11.15L14.15,9.29C14.18,9.13 14.32,9 14.5,9H17.3C17.47,9 17.62,9.13 17.64,9.29L17.91,11.15C18.33,11.32 18.73,11.56 19.09,11.84L20.83,11.13C21,11.07 21.17,11.13 21.26,11.29L22.66,13.71C22.75,13.86 22.71,14.05 22.58,14.16L21.1,15.31L21.15,16L21.1,16.68M6.69,8.07C7.56,8.07 8.26,7.37 8.26,6.5C8.26,5.63 7.56,4.92 6.69,4.92A1.58,1.58 0 0,0 5.11,6.5C5.11,7.37 5.82,8.07 6.69,8.07M10.03,6.94L11,7.68C11.07,7.75 11.09,7.87 11.03,7.97L10.13,9.53C10.08,9.63 9.96,9.67 9.86,9.63L8.74,9.18L8,9.62L7.81,10.81C7.79,10.92 7.7,11 7.59,11H5.79C5.67,11 5.58,10.92 5.56,10.81L5.4,9.62L4.64,9.18L3.5,9.63C3.41,9.67 3.3,9.63 3.24,9.53L2.34,7.97C2.28,7.87 2.31,7.75 2.39,7.68L3.34,6.94L3.31,6.5L3.34,6.06L2.39,5.32C2.31,5.25 2.28,5.13 2.34,5.03L3.24,3.47C3.3,3.37 3.41,3.33 3.5,3.37L4.63,3.82L5.4,3.38L5.56,2.19C5.58,2.08 5.67,2 5.79,2H7.59C7.7,2 7.79,2.08 7.81,2.19L8,3.38L8.74,3.82L9.86,3.37C9.96,3.33 10.08,3.37 10.13,3.47L11.03,5.03C11.09,5.13 11.07,5.25 11,5.32L10.03,6.06L10.06,6.5L10.03,6.94Z",Ap="M21.4 7.5C22.2 8.3 22.2 9.6 21.4 10.3L18.6 13.1L10.8 5.3L13.6 2.5C14.4 1.7 15.7 1.7 16.4 2.5L18.2 4.3L21.2 1.3L22.6 2.7L19.6 5.7L21.4 7.5M15.6 13.3L14.2 11.9L11.4 14.7L9.3 12.6L12.1 9.8L10.7 8.4L7.9 11.2L6.4 9.8L3.6 12.6C2.8 13.4 2.8 14.7 3.6 15.4L5.4 17.2L1.4 21.2L2.8 22.6L6.8 18.6L8.6 20.4C9.4 21.2 10.7 21.2 11.4 20.4L14.2 17.6L12.8 16.2L15.6 13.3Z",Ua="M13,19V16H21V19H13M8.5,13L2.47,7H6.71L11.67,11.95C12.25,12.54 12.25,13.5 11.67,14.07L6.74,19H2.5L8.5,13Z",Fp="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",Rp="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z",Y_="M4,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M4,6V18H11V6H4M20,18V6H18.76C19,6.54 18.95,7.07 18.95,7.13C18.88,7.8 18.41,8.5 18.24,8.75L15.91,11.3L19.23,11.28L19.24,12.5L14.04,12.47L14,11.47C14,11.47 17.05,8.24 17.2,7.95C17.34,7.67 17.91,6 16.5,6C15.27,6.05 15.41,7.3 15.41,7.3L13.87,7.31C13.87,7.31 13.88,6.65 14.25,6H13V18H15.58L15.57,17.14L16.54,17.13C16.54,17.13 17.45,16.97 17.46,16.08C17.5,15.08 16.65,15.08 16.5,15.08C16.37,15.08 15.43,15.13 15.43,15.95H13.91C13.91,15.95 13.95,13.89 16.5,13.89C19.1,13.89 18.96,15.91 18.96,15.91C18.96,15.91 19,17.16 17.85,17.63L18.37,18H20M8.92,16H7.42V10.2L5.62,10.76V9.53L8.76,8.41H8.92V16Z",Aw="M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M3.05,13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z",Fw="M12,3C7.58,3 4,4.79 4,7C4,9.21 7.58,11 12,11C16.42,11 20,9.21 20,7C20,4.79 16.42,3 12,3M4,9V12C4,14.21 7.58,16 12,16C16.42,16 20,14.21 20,12V9C20,11.21 16.42,13 12,13C7.58,13 4,11.21 4,9M4,14V17C4,19.21 7.58,21 12,21C16.42,21 20,19.21 20,17V14C20,16.21 16.42,18 12,18C7.58,18 4,16.21 4,14Z",J_="M20 13.09V7C20 4.79 16.42 3 12 3S4 4.79 4 7V17C4 19.21 7.59 21 12 21C12.46 21 12.9 21 13.33 20.94C13.12 20.33 13 19.68 13 19L13 18.95C12.68 19 12.35 19 12 19C8.13 19 6 17.5 6 17V14.77C7.61 15.55 9.72 16 12 16C12.65 16 13.27 15.96 13.88 15.89C14.93 14.16 16.83 13 19 13C19.34 13 19.67 13.04 20 13.09M18 12.45C16.7 13.4 14.42 14 12 14S7.3 13.4 6 12.45V9.64C7.47 10.47 9.61 11 12 11S16.53 10.47 18 9.64V12.45M12 9C8.13 9 6 7.5 6 7S8.13 5 12 5 18 6.5 18 7 15.87 9 12 9M22 20L19 23L16 20H18V16H20V20H22Z",Rw="M17.86 18L18.9 19C17.5 20.2 14.94 21 12 21C7.59 21 4 19.21 4 17V7C4 4.79 7.58 3 12 3C14.95 3 17.5 3.8 18.9 5L17.86 6L17.5 6.4C16.65 5.77 14.78 5 12 5C8.13 5 6 6.5 6 7S8.13 9 12 9C13.37 9 14.5 8.81 15.42 8.54L16.38 9.5H13.5V10.92C13 10.97 12.5 11 12 11C9.61 11 7.47 10.47 6 9.64V12.45C7.3 13.4 9.58 14 12 14C12.5 14 13 13.97 13.5 13.92V14.5H16.38L15.38 15.5L15.5 15.61C14.41 15.86 13.24 16 12 16C9.72 16 7.61 15.55 6 14.77V17C6 17.5 8.13 19 12 19C14.78 19 16.65 18.23 17.5 17.61L17.86 18M18.92 7.08L17.5 8.5L20 11H15V13H20L17.5 15.5L18.92 16.92L23.84 12L18.92 7.08Z",Ue="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",Hw="M4.15,21.46L5.47,19.58C3.35,17.74 2,15.03 2,12A10,10 0 0,1 12,2C13.78,2 15.44,2.46 16.89,3.27L18.21,1.39L19.85,2.54L18.53,4.42C20.65,6.26 22,8.97 22,12A10,10 0 0,1 12,22C10.22,22 8.56,21.54 7.11,20.73L5.79,22.61L4.15,21.46M12,4A8,8 0 0,0 4,12C4,14.35 5,16.46 6.63,17.93L15.73,4.92C14.62,4.33 13.35,4 12,4M12,20A8,8 0 0,0 20,12C20,9.65 19,7.54 17.37,6.07L8.27,19.08C9.38,19.67 10.65,20 12,20Z",Hp="M3,4H7A1,1 0 0,1 8,5V19A1,1 0 0,1 7,20H3A1,1 0 0,1 2,19V5A1,1 0 0,1 3,4M10,4H14A1,1 0 0,1 15,5V19A1,1 0 0,1 14,20H10A1,1 0 0,1 9,19V5A1,1 0 0,1 10,4M17,4H21A1,1 0 0,1 22,5V19A1,1 0 0,1 21,20H17A1,1 0 0,1 16,19V5A1,1 0 0,1 17,4M4,18H6V13H4V18M11,11H13V6H11V11M18,18H20V13H18V18Z",jw="M8,3C6.89,3 6,3.89 6,5V21H18V5C18,3.89 17.11,3 16,3H8M8,5H16V19H8V5M13,11V13H15V11H13Z",Iw="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z",mu="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",K_="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z",Wa="M9,3H11V5H9V3M13,3H15V5H13V3M9,7H11V9H9V7M13,7H15V9H13V7M9,11H11V13H9V11M13,11H15V13H13V11M9,15H11V17H9V15M13,15H15V17H13V15M9,19H11V21H9V19M13,19H15V21H13V19Z",Q_="M12,5L5.33,15H18.67M5,17H19V19H5V17Z",ev="M7,4V6H10V8H7L5,10V13H3V10H1V18H3V15H5V18H8L10,20H18V16H20V19H23V9H20V12H18V8H12V6H15V4H7Z",jp="M3.78,2.5L21.5,20.22L20.23,21.5L18,19.27V20H10L8,18H5V15H3V18H1V10H3V13H5V10L6.87,8.14L2.5,3.77L3.78,2.5M20,9V12H18V8H12V6H15V4H7.82L22.82,19H23V9H20Z",Nw="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",Ip="M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",xte="M13,6V18L21.5,12M4,18L12.5,12L4,6V18Z",Bs="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z",Vw="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M10.5,11C8,11 6,13 6,15.5C6,18 8,20 10.5,20C13,20 15,18 15,15.5C15,13 13,11 10.5,11M10.5,12.5A3,3 0 0,1 13.5,15.5C13.5,16.06 13.35,16.58 13.08,17L9,12.92C9.42,12.65 9.94,12.5 10.5,12.5M7.5,15.5C7.5,14.94 7.65,14.42 7.92,14L12,18.08C11.58,18.35 11.06,18.5 10.5,18.5A3,3 0 0,1 7.5,15.5Z",Bw="M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H10V20.09L12.09,18H6V16H14.09L16.09,14H6V12H18.09L20,10.09V8L14,2H6M13,3.5L18.5,9H13V3.5M20.15,13C20,13 19.86,13.05 19.75,13.16L18.73,14.18L20.82,16.26L21.84,15.25C22.05,15.03 22.05,14.67 21.84,14.46L20.54,13.16C20.43,13.05 20.29,13 20.15,13M18.14,14.77L12,20.92V23H14.08L20.23,16.85L18.14,14.77Z",za="M8,12H16V14H8V12M10,20H6V4H13V9H18V12.1L20,10.1V8L14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H10V20M8,18H12.1L13,17.1V16H8V18M20.2,13C20.3,13 20.5,13.1 20.6,13.2L21.9,14.5C22.1,14.7 22.1,15.1 21.9,15.3L20.9,16.3L18.8,14.2L19.8,13.2C19.9,13.1 20,13 20.2,13M20.2,16.9L14.1,23H12V20.9L18.1,14.8L20.2,16.9Z",Ga="M16 0H8C6.9 0 6 .9 6 2V18C6 19.1 6.9 20 8 20H20C21.1 20 22 19.1 22 18V6L16 0M20 18H8V2H15V7H20V18M4 4V22H20V24H4C2.9 24 2 23.1 2 22V4H4M10 10V12H18V10H10M10 14V16H15V14H10Z",Uw="M6,2A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6M6,4H13V9H18V20H6V4M8,12V14H16V12H8M8,16V18H13V16H8Z",Ww="M15,7H20.5L15,1.5V7M8,0H16L22,6V18A2,2 0 0,1 20,20H8C6.89,20 6,19.1 6,18V2A2,2 0 0,1 8,0M4,4V22H20V24H4A2,2 0 0,1 2,22V4H4Z",tv="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z",zw="M14 2H6C4.89 2 4 2.89 4 4V20C4 21.11 4.89 22 6 22H13.81C13.28 21.09 13 20.05 13 19C13 15.69 15.69 13 19 13C19.34 13 19.67 13.03 20 13.08V8L14 2M13 9V3.5L18.5 9H13M23 20H20V23H18V20H15V18H18V15H20V18H23V20Z",sv="M12.8 22H6C4.9 22 4 21.1 4 20V4C4 2.9 4.9 2 6 2H14L20 8V11.5C19.4 11.2 18.7 11.1 18 11V9H13V4H6V20H11.5C11.8 20.7 12.3 21.4 12.8 22M17 12L14.8 14.2L17 16.4V15C18.4 15 19.5 16.1 19.5 17.5C19.5 17.9 19.4 18.3 19.2 18.6L20.3 19.7C20.7 19.1 21 18.3 21 17.5C21 15.3 19.2 13.5 17 13.5V12M19.2 20.8L17 18.5V20C15.6 20 14.5 18.9 14.5 17.5C14.5 17.1 14.6 16.7 14.8 16.4L13.7 15.3C13.3 15.9 13 16.7 13 17.5C13 19.7 14.8 21.5 17 21.5V23L19.2 20.8Z",rv="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13.5,16V19H10.5V16H8L12,12L16,16H13.5M13,9V3.5L18.5,9H13Z",Gw="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M17,19V13L14,15.2V13H7V19H14V16.8L17,19Z",Zw="M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z",qw="M2.39 1.73L1.11 3L9.5 11.37L9.97 12H10V17.87C9.96 18.16 10.06 18.47 10.29 18.7L12.3 20.71C12.69 21.1 13.32 21.1 13.71 20.71C13.94 20.5 14.04 20.18 14 19.88V15.89L20.84 22.73L22.11 21.46L14 13.35L9.41 8.76L4.15 3.5L2.39 1.73M6.21 3L14.54 11.34L19.79 4.62C20.13 4.19 20.05 3.56 19.62 3.22C19.43 3.08 19.22 3 19 3H6.21Z",sn="M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",Vg="M7,2V13H10V22L17,10H13L17,2H7Z",Np="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",Vp="M13 19C13 19.34 13.04 19.67 13.09 20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V13.81C21.12 13.3 20.1 13 19 13C15.69 13 13 15.69 13 19M20 18V15H18V18H15V20H18V23H20V20H23V18H20Z",Bp="M20,6A2,2 0 0,1 22,8V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4H10L12,6H20M10.75,13H14V17H16V13H19.25L15,8.75",Xw="M20 6H12L10 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V8C22 6.9 21.1 6 20 6M20 18H16V16H14V18H4V8H14V10H16V8H20V18M16 12V10H18V12H16M14 12H16V14H14V12M18 16H16V14H18V16Z",Yw="M21,19V17H8V19H21M21,13V11H8V13H21M8,7H21V5H8V7M4,5V7H6V5H4M3,5A1,1 0 0,1 4,4H6A1,1 0 0,1 7,5V7A1,1 0 0,1 6,8H4A1,1 0 0,1 3,7V5M4,11V13H6V11H4M3,11A1,1 0 0,1 4,10H6A1,1 0 0,1 7,11V13A1,1 0 0,1 6,14H4A1,1 0 0,1 3,13V11M4,17V19H6V17H4M3,17A1,1 0 0,1 4,16H6A1,1 0 0,1 7,17V19A1,1 0 0,1 6,20H4A1,1 0 0,1 3,19V17Z",Up="M16.5,9L13.5,12L16.5,15H22V9M9,16.5V22H15V16.5L12,13.5M7.5,9H2V15H7.5L10.5,12M15,7.5V2H9V7.5L12,10.5L15,7.5Z",Jw="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4A8,8 0 0,1 20,12C20,14.4 19,16.5 17.3,18C15.9,16.7 14,16 12,16C10,16 8.2,16.7 6.7,18C5,16.5 4,14.4 4,12A8,8 0 0,1 12,4M14,5.89C13.62,5.9 13.26,6.15 13.1,6.54L11.81,9.77L11.71,10C11,10.13 10.41,10.6 10.14,11.26C9.73,12.29 10.23,13.45 11.26,13.86C12.29,14.27 13.45,13.77 13.86,12.74C14.12,12.08 14,11.32 13.57,10.76L13.67,10.5L14.96,7.29L14.97,7.26C15.17,6.75 14.92,6.17 14.41,5.96C14.28,5.91 14.15,5.89 14,5.89M10,6A1,1 0 0,0 9,7A1,1 0 0,0 10,8A1,1 0 0,0 11,7A1,1 0 0,0 10,6M7,9A1,1 0 0,0 6,10A1,1 0 0,0 7,11A1,1 0 0,0 8,10A1,1 0 0,0 7,9M17,9A1,1 0 0,0 16,10A1,1 0 0,0 17,11A1,1 0 0,0 18,10A1,1 0 0,0 17,9Z",hu="M10,4V8H14V4H10M16,4V8H20V4H16M16,10V14H20V10H16M16,16V20H20V16H16M14,20V16H10V20H14M8,20V16H4V20H8M8,14V10H4V14H8M8,8V4H4V8H8M10,14H14V10H10V14M4,2H20A2,2 0 0,1 22,4V20A2,2 0 0,1 20,22H4C2.92,22 2,21.1 2,20V4A2,2 0 0,1 4,2Z",Wp="M10,19H13V22H10V19M12,2C17.35,2.22 19.68,7.62 16.5,11.67C15.67,12.67 14.33,13.33 13.67,14.17C13,15 13,16 13,17H10C10,15.33 10,13.92 10.67,12.92C11.33,11.92 12.67,11.33 13.5,10.67C15.92,8.43 15.32,5.26 12,5A3,3 0 0,0 9,8H6A6,6 0 0,1 12,2Z",pu="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",iv="M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z",nv="M13.5,8H12V13L16.28,15.54L17,14.33L13.5,12.25V8M13,3A9,9 0 0,0 4,12H1L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3",av="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z",Ht="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",ov="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",Kw="M12 22C17.5 22 22 17.5 22 12C22 6.5 17.5 2 12 2C6.5 2 2 6.5 2 12C2 17.5 6.5 22 12 22M12.3 7.29C12.5 7.11 12.74 7 13 7C13.27 7 13.5 7.11 13.71 7.29C13.9 7.5 14 7.74 14 8C14 8.27 13.9 8.5 13.71 8.71C13.5 8.9 13.27 9 13 9C12.74 9 12.5 8.9 12.3 8.71C12.11 8.5 12 8.27 12 8C12 7.74 12.11 7.5 12.3 7.29M9.8 11.97C9.8 11.97 11.97 10.25 12.76 10.18C13.5 10.12 13.35 10.97 13.28 11.41L13.27 11.47C13.13 12 12.96 12.64 12.79 13.25C12.41 14.64 12.04 16 12.13 16.25C12.23 16.59 12.85 16.16 13.3 15.86C13.36 15.82 13.41 15.78 13.46 15.75C13.46 15.75 13.54 15.67 13.62 15.78C13.64 15.81 13.66 15.84 13.68 15.86C13.77 16 13.82 16.05 13.7 16.13L13.66 16.15C13.44 16.3 12.5 16.96 12.12 17.2C11.71 17.47 10.14 18.37 10.38 16.62C10.59 15.39 10.87 14.33 11.09 13.5C11.5 12 11.68 11.32 10.76 11.91C10.39 12.13 10.17 12.27 10.04 12.36C9.93 12.44 9.92 12.44 9.85 12.31L9.82 12.25L9.77 12.17C9.7 12.07 9.7 12.06 9.8 11.97Z",Qw="M12,18.54L19.37,12.8L21,14.07L12,21.07L3,14.07L4.62,12.81L12,18.54M12,16L3,9L12,2L21,9L12,16M12,4.53L6.26,9L12,13.47L17.74,9L12,4.53Z",hm="M17,14H19V17H22V19H19V22H17V19H14V17H17V14M11,16L2,9L11,2L20,9L11,16M11,18.54L12,17.75V18C12,18.71 12.12,19.39 12.35,20L11,21.07L2,14.07L3.62,12.81L11,18.54Z",lv="M20,11H23V13H20V11M1,11H4V13H1V11M13,1V4H11V1H13M4.92,3.5L7.05,5.64L5.63,7.05L3.5,4.93L4.92,3.5M16.95,5.63L19.07,3.5L20.5,4.93L18.37,7.05L16.95,5.63M12,6A6,6 0 0,1 18,12C18,14.22 16.79,16.16 15,17.2V19A1,1 0 0,1 14,20H10A1,1 0 0,1 9,19V17.2C7.21,16.16 6,14.22 6,12A6,6 0 0,1 12,6M14,21V22A1,1 0 0,1 13,23H11A1,1 0 0,1 10,22V21H14M11,18H13V15.87C14.73,15.43 16,13.86 16,12A4,4 0 0,0 12,8A4,4 0 0,0 8,12C8,13.86 9.27,15.43 11,15.87V18Z",zp="M12,2A7,7 0 0,1 19,9C19,11.38 17.81,13.47 16,14.74V17A1,1 0 0,1 15,18H9A1,1 0 0,1 8,17V14.74C6.19,13.47 5,11.38 5,9A7,7 0 0,1 12,2M9,21V20H15V21A1,1 0 0,1 14,22H10A1,1 0 0,1 9,21M12,4A5,5 0 0,0 7,9C7,11.05 8.23,12.81 10,13.58V16H14V13.58C15.77,12.81 17,11.05 17,9A5,5 0 0,0 12,4Z",Co="M11 9.47V11H14.76L13 14.53V13H9.24L11 9.47M13 1L6 15H11V23L18 9H13V1Z",cv="M10.59,13.41C11,13.8 11,14.44 10.59,14.83C10.2,15.22 9.56,15.22 9.17,14.83C7.22,12.88 7.22,9.71 9.17,7.76V7.76L12.71,4.22C14.66,2.27 17.83,2.27 19.78,4.22C21.73,6.17 21.73,9.34 19.78,11.29L18.29,12.78C18.3,11.96 18.17,11.14 17.89,10.36L18.36,9.88C19.54,8.71 19.54,6.81 18.36,5.64C17.19,4.46 15.29,4.46 14.12,5.64L10.59,9.17C9.41,10.34 9.41,12.24 10.59,13.41M13.41,9.17C13.8,8.78 14.44,8.78 14.83,9.17C16.78,11.12 16.78,14.29 14.83,16.24V16.24L11.29,19.78C9.34,21.73 6.17,21.73 4.22,19.78C2.27,17.83 2.27,14.66 4.22,12.71L5.71,11.22C5.7,12.04 5.83,12.86 6.11,13.65L5.64,14.12C4.46,15.29 4.46,17.19 5.64,18.36C6.81,19.54 8.71,19.54 9.88,18.36L13.41,14.83C14.59,13.66 14.59,11.76 13.41,10.59C13,10.2 13,9.56 13.41,9.17Z",eS="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z",uv="M10 13C11.1 13 12 13.89 12 15C12 16.11 11.11 17 10 17S8 16.11 8 15 8.9 13 10 13M18 1C15.24 1 13 3.24 13 6V8H4C2.9 8 2 8.9 2 10V20C2 21.1 2.9 22 4 22H16C17.1 22 18 21.1 18 20V10C18 8.9 17.1 8 16 8H15V6C15 4.34 16.34 3 18 3S21 4.34 21 6V8H23V6C23 3.24 20.76 1 18 1M16 10V20H4V10H16Z",fu="M12,17C10.89,17 10,16.1 10,15C10,13.89 10.89,13 12,13A2,2 0 0,1 14,15A2,2 0 0,1 12,17M18,20V10H6V20H18M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10C4,8.89 4.89,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z",rn="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z",dv="M17,17H7V7H17M21,11V9H19V7C19,5.89 18.1,5 17,5H15V3H13V5H11V3H9V5H7C5.89,5 5,5.89 5,7V9H3V11H5V13H3V15H5V17A2,2 0 0,0 7,19H9V21H11V19H13V21H15V19H17A2,2 0 0,0 19,17V15H21V13H19V11M13,13H11V11H13M15,9H9V15H15V9Z",tS="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z",gr="M7,10L12,15L17,10H7Z",sS="M20 2H4C2.9 2 2 2.9 2 4V22L6 18H20C21.1 18 22 17.1 22 16V4C22 2.9 21.1 2 20 2M20 16H5.2L4 17.2V4H20V16Z",rS="M20 2H4C2.9 2 2 2.9 2 4V22L6 18H20C21.1 18 22 17.1 22 16V4C22 2.9 21.1 2 20 2M20 16H5.2L4 17.2V4H20V16M17 11H15V9H17M13 11H11V9H13M9 11H7V9H9",iS="M21 11C21 6.03 16.97 2 12 2S3 6.03 3 11C3 14.92 5.5 18.24 9 19.5V22H11V19.94C11.33 20 11.66 20 12 20S12.67 20 13 19.94V22H15V19.5C18.5 18.24 21 14.92 21 11M12 18C8.14 18 5 14.86 5 11S8.14 4 12 4 19 7.14 19 11 15.86 18 12 18M8 7H16V9H8V7M12.75 10L9.75 13L11 14.25L9.75 15.5L11.25 17L14.25 14L13 12.75L14.25 11.5L12.75 10Z",mv="M19,13H5V11H19V13Z",nS="M20 14H4V10H20",Gp="M21,16V4H3V16H21M21,2A2,2 0 0,1 23,4V16A2,2 0 0,1 21,18H14V20H16V22H8V20H10V18H3C1.89,18 1,17.1 1,16V4C1,2.89 1.89,2 3,2H21M5,6H14V11H5V6M15,6H19V8H15V6M19,9V14H15V9H19M5,12H9V14H5V12M10,12H14V14H10V12Z",aS="M9,6H5V10H7V8H9M19,10H17V12H15V14H19M21,16H3V4H21M21,2H3C1.89,2 1,2.89 1,4V16A2,2 0 0,0 3,18H10V20H8V22H16V20H14V18H21A2,2 0 0,0 23,16V4C23,2.89 22.1,2 21,2",oS="M2 12A10 10 0 0 0 15 21.54A10 10 0 0 1 15 2.46A10 10 0 0 0 2 12Z",hv="M18.13 12L19.39 10.74C19.83 10.3 20.39 10.06 21 10V9L15 3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.89 21 5 21H11V19.13L11.13 19H5V5H12V12H18.13M14 4.5L19.5 10H14V4.5M19.13 13.83L21.17 15.87L15.04 22H13V19.96L19.13 13.83M22.85 14.19L21.87 15.17L19.83 13.13L20.81 12.15C21 11.95 21.33 11.95 21.53 12.15L22.85 13.47C23.05 13.67 23.05 14 22.85 14.19Z",pv="M5 19V5H12V12H19V13C19.7 13 20.37 13.13 21 13.35V9L15 3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.89 21 5 21H13.35C13.13 20.37 13 19.7 13 19H5M14 4.5L19.5 10H14V4.5M23 18V20H20V23H18V20H15V18H18V15H20V18H23Z",lS="M15 3H5A2 2 0 0 0 3 5V19A2 2 0 0 0 5 21H19A2 2 0 0 0 21 19V9L15 3M19 19H5V5H14V10H19M17 14H7V12H17M14 17H7V15H14",gu="M3,7V5H5V4C5,2.89 5.9,2 7,2H13V9L15.5,7.5L18,9V2H19C20.05,2 21,2.95 21,4V20C21,21.05 20.05,22 19,22H7C5.95,22 5,21.05 5,20V19H3V17H5V13H3V11H5V7H3M7,11H5V13H7V11M7,7V5H5V7H7M7,19V17H5V19H7Z",cS="M16.75 22.16L14 19.16L15.16 18L16.75 19.59L20.34 16L21.5 17.41L16.75 22.16M3 7V5H5V4C5 2.89 5.9 2 7 2H13V9L15.5 7.5L18 9V2H19C20.05 2 21 2.95 21 4V13.8C20.12 13.29 19.09 13 18 13C14.69 13 12 15.69 12 19C12 20.09 12.29 21.12 12.8 22H7C5.95 22 5 21.05 5 20V19H3V17H5V13H3V11H5V7H3M5 5V7H7V5H5M5 19H7V17H5V19M5 13H7V11H5V13Z",fv="M3 7V5H5V4C5 2.9 5.9 2 7 2H13V9L15.5 7.5L18 9V2H19C20 2 21 3 21 4V13.8C20.1 13.3 19.1 13 18 13C14.7 13 12 15.7 12 19C12 20.1 12.3 21.1 12.8 22H7C5.9 22 5 21 5 20V19H3V17H5V13H3V11H5V7H3M5 5V7H7V5H5M5 19H7V17H5V19M5 13H7V11H5V13M17 15V18H14V20H17V23H19V20H22V18H19V15H17Z",gv="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",uS="M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L10.11,5.22L16,8.61L17.96,7.5L12,4.15M6.04,7.5L12,10.85L13.96,9.75L8.08,6.35L6.04,7.5M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V9.21L13,12.58V19.29L19,15.91Z",_u="M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z",Zp="M14,19H18V5H14M6,19H10V5H6V19Z",bt="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",nn="M8,5.14V19.14L19,12.14L8,5.14Z",Za="M3 16H10V14H3M18 14V10H16V14H12V16H16V20H18V16H22V14M14 6H3V8H14M14 10H3V12H14V10Z",dS="M14 10H3V12H14V10M14 6H3V8H14V6M3 16H10V14H3V16M14.4 22L17 19.4L19.6 22L21 20.6L18.4 18L21 15.4L19.6 14L17 16.6L14.4 14L13 15.4L15.6 18L13 20.6L14.4 22Z",qp="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",mS="M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z",_v="M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",hS="M13,3H11V13H13V3M17.83,5.17L16.41,6.59C18.05,7.91 19,9.9 19,12A7,7 0 0,1 12,19C8.14,19 5,15.88 5,12C5,9.91 5.95,7.91 7.58,6.58L6.17,5.17C2.38,8.39 1.92,14.07 5.14,17.86C8.36,21.64 14.04,22.1 17.83,18.88C19.85,17.17 21,14.65 21,12C21,9.37 19.84,6.87 17.83,5.17Z",Xp="M18,3H6V7H18M19,12A1,1 0 0,1 18,11A1,1 0 0,1 19,10A1,1 0 0,1 20,11A1,1 0 0,1 19,12M16,19H8V14H16M19,8H5A3,3 0 0,0 2,11V17H6V21H18V17H22V11A3,3 0 0,0 19,8Z",qa="M19,6A1,1 0 0,0 20,5A1,1 0 0,0 19,4A1,1 0 0,0 18,5A1,1 0 0,0 19,6M19,2A3,3 0 0,1 22,5V11H18V7H6V11H2V5A3,3 0 0,1 5,2H19M18,18.25C18,18.63 17.79,18.96 17.47,19.13L12.57,21.82C12.4,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L6.53,19.13C6.21,18.96 6,18.63 6,18.25V13C6,12.62 6.21,12.29 6.53,12.12L11.43,9.68C11.59,9.56 11.79,9.5 12,9.5C12.21,9.5 12.4,9.56 12.57,9.68L17.47,12.12C17.79,12.29 18,12.62 18,13V18.25M12,11.65L9.04,13L12,14.6L14.96,13L12,11.65M8,17.66L11,19.29V16.33L8,14.71V17.66M16,17.66V14.71L13,16.33V19.29L16,17.66Z",Us="M7,2H17V8H19V13H16.5L13,17H11L7.5,13H5V8H7V2M10,22H2V20H10A1,1 0 0,0 11,19V18H13V19A3,3 0 0,1 10,22Z",vv="M7 2H17V8H19V13H16.5L13 17H11L7.5 13H5V8H7V2M10 22H2V20H10C10.6 20 11 19.5 11 19V18H13V19C13 20.7 11.7 22 10 22M21 13V7H23V13H21M21 17V15H23V17H21Z",pS="M7,2H17V7H19V13H16.5L13,17H11L7.5,13H5V7H7V2M10,22H2V20H10A1,1 0 0,0 11,19V18H13V19A3,3 0 0,1 10,22M7,9V11H8.5L12,15L15.5,11H17V9H15V4H9V9H7Z",fS="M13,2.03V2.05L13,4.05C17.39,4.59 20.5,8.58 19.96,12.97C19.5,16.61 16.64,19.5 13,19.93V21.93C18.5,21.38 22.5,16.5 21.95,11C21.5,6.25 17.73,2.5 13,2.03M11,2.06C9.05,2.25 7.19,3 5.67,4.26L7.1,5.74C8.22,4.84 9.57,4.26 11,4.06V2.06M4.26,5.67C3,7.19 2.25,9.04 2.05,11H4.05C4.24,9.58 4.8,8.23 5.69,7.1L4.26,5.67M2.06,13C2.26,14.96 3.03,16.81 4.27,18.33L5.69,16.9C4.81,15.77 4.24,14.42 4.06,13H2.06M7.1,18.37L5.67,19.74C7.18,21 9.04,21.79 11,22V20C9.58,19.82 8.23,19.25 7.1,18.37M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z",bv="M13 18H11V16H13V18M13 15H11C11 11.75 14 12 14 10C14 8.9 13.1 8 12 8C10.9 8 10 8.9 10 10H8C8 7.79 9.79 6 12 6C14.21 6 16 7.79 16 10C16 12.5 13 12.75 13 15M22 12C22 17.18 18.05 21.45 13 21.95V19.94C16.95 19.45 20 16.08 20 12C20 7.92 16.95 4.55 13 4.06V2.05C18.05 2.55 22 6.82 22 12M11 2.05V4.06C9.54 4.24 8.2 4.82 7.09 5.68L5.67 4.26C7.15 3.05 9 2.25 11 2.05M4.06 11H2.05C2.25 9 3.05 7.15 4.26 5.67L5.68 7.1C4.82 8.2 4.24 9.54 4.06 11M11 19.94V21.95C9 21.75 7.15 20.96 5.67 19.74L7.09 18.32C8.2 19.18 9.54 19.76 11 19.94M2.05 13H4.06C4.24 14.46 4.82 15.8 5.68 16.91L4.26 18.33C3.05 16.85 2.25 15 2.05 13Z",ll="M13,2.03C17.73,2.5 21.5,6.25 21.95,11C22.5,16.5 18.5,21.38 13,21.93V19.93C16.64,19.5 19.5,16.61 19.96,12.97C20.5,8.58 17.39,4.59 13,4.05V2.05L13,2.03M11,2.06V4.06C9.57,4.26 8.22,4.84 7.1,5.74L5.67,4.26C7.19,3 9.05,2.25 11,2.06M4.26,5.67L5.69,7.1C4.8,8.23 4.24,9.58 4.05,11H2.05C2.25,9.04 3,7.19 4.26,5.67M2.06,13H4.06C4.24,14.42 4.81,15.77 5.69,16.9L4.27,18.33C3.03,16.81 2.26,14.96 2.06,13M7.1,18.37C8.23,19.25 9.58,19.82 11,20V22C9.04,21.79 7.18,21 5.67,19.74L7.1,18.37M12,7.5L7.5,12H11V16H13V12H16.5L12,7.5Z",gS="M7.95,3L6.53,5.19L7.95,7.4H7.94L5.95,10.5L4.22,9.6L5.64,7.39L4.22,5.19L6.22,2.09L7.95,3M13.95,2.89L12.53,5.1L13.95,7.3L13.94,7.31L11.95,10.4L10.22,9.5L11.64,7.3L10.22,5.1L12.22,2L13.95,2.89M20,2.89L18.56,5.1L20,7.3V7.31L18,10.4L16.25,9.5L17.67,7.3L16.25,5.1L18.25,2L20,2.89M2,22V14A2,2 0 0,1 4,12H20A2,2 0 0,1 22,14V22H20V20H4V22H2M6,14A1,1 0 0,0 5,15V17A1,1 0 0,0 6,18A1,1 0 0,0 7,17V15A1,1 0 0,0 6,14M10,14A1,1 0 0,0 9,15V17A1,1 0 0,0 10,18A1,1 0 0,0 11,17V15A1,1 0 0,0 10,14M14,14A1,1 0 0,0 13,15V17A1,1 0 0,0 14,18A1,1 0 0,0 15,17V15A1,1 0 0,0 14,14M18,14A1,1 0 0,0 17,15V17A1,1 0 0,0 18,18A1,1 0 0,0 19,17V15A1,1 0 0,0 18,14Z",yv="M20,12H4A2,2 0 0,0 2,14V22H4V20H20V22H22V14A2,2 0 0,0 20,12M7,17A1,1 0 0,1 6,18A1,1 0 0,1 5,17V15A1,1 0 0,1 6,14A1,1 0 0,1 7,15V17M11,17A1,1 0 0,1 10,18A1,1 0 0,1 9,17V15A1,1 0 0,1 10,14A1,1 0 0,1 11,15V17M15,17A1,1 0 0,1 14,18A1,1 0 0,1 13,17V15A1,1 0 0,1 14,14A1,1 0 0,1 15,15V17M19,17A1,1 0 0,1 18,18A1,1 0 0,1 17,17V15A1,1 0 0,1 18,14A1,1 0 0,1 19,15V17Z",_S="M20,8H22V10H20V8M4,5H20A2,2 0 0,1 22,7H19V9H5V13H8V16H19V17H22A2,2 0 0,1 20,19H16V20H14V19H11V20H7V19H4A2,2 0 0,1 2,17V7A2,2 0 0,1 4,5M19,15H9V10H19V11H22V13H19V15M13,12V14H15V12H13M5,6V8H6V6H5M7,6V8H8V6H7M9,6V8H10V6H9M11,6V8H12V6H11M13,6V8H14V6H13M15,6V8H16V6H15M20,14H22V16H20V14Z",an="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",vS="M2 12C2 16.97 6.03 21 11 21C13.39 21 15.68 20.06 17.4 18.4L15.9 16.9C14.63 18.25 12.86 19 11 19C4.76 19 1.64 11.46 6.05 7.05C10.46 2.64 18 5.77 18 12H15L19 16H19.1L23 12H20C20 7.03 15.97 3 11 3C6.03 3 2 7.03 2 12Z",wte="M2 12C2 17 6 21 11 21C13.4 21 15.7 20.1 17.4 18.4L15.9 16.9C14.6 18.3 12.9 19 11 19C4.8 19 1.6 11.5 6.1 7.1S18 5.8 18 12H15L19 16H19.1L23 12H20C20 7 16 3 11 3S2 7 2 12M10 15H12V17H10V15M10 7H12V13H10V7",vu="M18,17H10.5L12.5,15H18M6,17V14.5L13.88,6.65C14.07,6.45 14.39,6.45 14.59,6.65L16.35,8.41C16.55,8.61 16.55,8.92 16.35,9.12L8.47,17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",_r="M12,4C14.1,4 16.1,4.8 17.6,6.3C20.7,9.4 20.7,14.5 17.6,17.6C15.8,19.5 13.3,20.2 10.9,19.9L11.4,17.9C13.1,18.1 14.9,17.5 16.2,16.2C18.5,13.9 18.5,10.1 16.2,7.7C15.1,6.6 13.5,6 12,6V10.6L7,5.6L12,0.6V4M6.3,17.6C3.7,15 3.3,11 5.1,7.9L6.6,9.4C5.5,11.6 5.9,14.4 7.8,16.2C8.3,16.7 8.9,17.1 9.6,17.4L9,19.4C8,19 7.1,18.4 6.3,17.6Z",bS="M13,3A9,9 0 0,0 4,12H1L4.89,15.89L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3Z",yS="M13.13 22.19L11.5 18.36C13.07 17.78 14.54 17 15.9 16.09L13.13 22.19M5.64 12.5L1.81 10.87L7.91 8.1C7 9.46 6.22 10.93 5.64 12.5M21.61 2.39C21.61 2.39 16.66 .269 11 5.93C8.81 8.12 7.5 10.53 6.65 12.64C6.37 13.39 6.56 14.21 7.11 14.77L9.24 16.89C9.79 17.45 10.61 17.63 11.36 17.35C13.5 16.53 15.88 15.19 18.07 13C23.73 7.34 21.61 2.39 21.61 2.39M14.54 9.46C13.76 8.68 13.76 7.41 14.54 6.63S16.59 5.85 17.37 6.63C18.14 7.41 18.15 8.68 17.37 9.46C16.59 10.24 15.32 10.24 14.54 9.46M8.88 16.53L7.47 15.12L8.88 16.53M6.24 22L9.88 18.36C9.54 18.27 9.21 18.12 8.91 17.91L4.83 22H6.24M2 22H3.41L8.18 17.24L6.76 15.83L2 20.59V22M2 19.17L6.09 15.09C5.88 14.79 5.73 14.47 5.64 14.12L2 17.76V19.17Z",CS="M13,4.07V1L8.45,5.55L13,10V6.09C15.84,6.57 18,9.03 18,12C18,14.97 15.84,17.43 13,17.91V19.93C16.95,19.44 20,16.08 20,12C20,7.92 16.95,4.56 13,4.07M7.1,18.32C8.26,19.22 9.61,19.76 11,19.93V17.9C10.13,17.75 9.29,17.41 8.54,16.87L7.1,18.32M6.09,13H4.07C4.24,14.39 4.79,15.73 5.69,16.89L7.1,15.47C6.58,14.72 6.23,13.88 6.09,13M7.11,8.53L5.7,7.11C4.8,8.27 4.24,9.61 4.07,11H6.09C6.23,10.13 6.58,9.28 7.11,8.53Z",$S="M16.89,15.5L18.31,16.89C19.21,15.73 19.76,14.39 19.93,13H17.91C17.77,13.87 17.43,14.72 16.89,15.5M13,17.9V19.92C14.39,19.75 15.74,19.21 16.9,18.31L15.46,16.87C14.71,17.41 13.87,17.76 13,17.9M19.93,11C19.76,9.61 19.21,8.27 18.31,7.11L16.89,8.53C17.43,9.28 17.77,10.13 17.91,11M15.55,5.55L11,1V4.07C7.06,4.56 4,7.92 4,12C4,16.08 7.05,19.44 11,19.93V17.91C8.16,17.43 6,14.97 6,12C6,9.03 8.16,6.57 11,6.09V10L15.55,5.55Z",xS="M8.46,15.06L7.05,16.47L5.68,15.1C4.82,16.21 4.24,17.54 4.06,19H6V21H2V20C2,15.16 5.44,11.13 10,10.2V8.2L2,5V3H22V5L14,8.2V10.2C18.56,11.13 22,15.16 22,20V21H18V19H19.94C19.76,17.54 19.18,16.21 18.32,15.1L16.95,16.47L15.54,15.06L16.91,13.68C15.8,12.82 14.46,12.24 13,12.06V14H11V12.06C9.54,12.24 8.2,12.82 7.09,13.68L8.46,15.06M12,18A2,2 0 0,1 14,20A2,2 0 0,1 12,22C11.68,22 11.38,21.93 11.12,21.79L7.27,20L11.12,18.21C11.38,18.07 11.68,18 12,18Z",cl="M20 20V17H22V20C22 21.11 21.1 22 20 22H17V20H20M2 20V17H4V20H7V22H4C2.9 22 2 21.1 2 20M10 20H14V22H10V20M14.59 8L12 10.59L9.41 8L8 9.41L10.59 12L8 14.59L9.41 16L12 13.41L14.59 16L16 14.59L13.41 12L16 9.41L14.59 8M20 10H22V14H20V10M2 10H4V14H2V10M2 4C2 2.89 2.9 2 4 2H7V4H4V7H2V4M22 4V7H20V4H17V2H20C21.1 2 22 2.9 22 4M10 2H14V4H10V2Z",wS="M2,21L23,12L2,3V10L17,12L2,14V21Z",SS="M23,12H17V10L20.39,6H17V4H23V6L19.62,10H23V12M15,16H9V14L12.39,10H9V8H15V10L11.62,14H15V16M7,20H1V18L4.39,14H1V12H7V14L3.62,18H7V20Z",bu="M20.79,13.95L18.46,14.57L16.46,13.44V10.56L18.46,9.43L20.79,10.05L21.31,8.12L19.54,7.65L20,5.88L18.07,5.36L17.45,7.69L15.45,8.82L13,7.38V5.12L14.71,3.41L13.29,2L12,3.29L10.71,2L9.29,3.41L11,5.12V7.38L8.5,8.82L6.5,7.69L5.92,5.36L4,5.88L4.47,7.65L2.7,8.12L3.22,10.05L5.55,9.43L7.55,10.56V13.45L5.55,14.58L3.22,13.96L2.7,15.89L4.47,16.36L4,18.12L5.93,18.64L6.55,16.31L8.55,15.18L11,16.62V18.88L9.29,20.59L10.71,22L12,20.71L13.29,22L14.7,20.59L13,18.88V16.62L15.5,15.17L17.5,16.3L18.12,18.63L20,18.12L19.53,16.35L21.3,15.88L20.79,13.95M9.5,10.56L12,9.11L14.5,10.56V13.44L12,14.89L9.5,13.44V10.56Z",Cv="M12,16A3,3 0 0,1 9,13C9,11.88 9.61,10.9 10.5,10.39L20.21,4.77L14.68,14.35C14.18,15.33 13.17,16 12,16M12,3C13.81,3 15.5,3.5 16.97,4.32L14.87,5.53C14,5.19 13,5 12,5A8,8 0 0,0 4,13C4,15.21 4.89,17.21 6.34,18.65H6.35C6.74,19.04 6.74,19.67 6.35,20.06C5.96,20.45 5.32,20.45 4.93,20.07V20.07C3.12,18.26 2,15.76 2,13A10,10 0 0,1 12,3M22,13C22,15.76 20.88,18.26 19.07,20.07V20.07C18.68,20.45 18.05,20.45 17.66,20.06C17.27,19.67 17.27,19.04 17.66,18.65V18.65C19.11,17.2 20,15.21 20,13C20,12 19.81,11 19.46,10.1L20.67,8C21.5,9.5 22,11.18 22,13Z",Ste="M17.36,20.2V14.82H19.15V22H3V14.82H4.8V20.2H17.36M6.77,14.32L7.14,12.56L15.93,14.41L15.56,16.17L6.77,14.32M7.93,10.11L8.69,8.5L16.83,12.28L16.07,13.9L7.93,10.11M10.19,6.12L11.34,4.74L18.24,10.5L17.09,11.87L10.19,6.12M14.64,1.87L20,9.08L18.56,10.15L13.2,2.94L14.64,1.87M6.59,18.41V16.61H15.57V18.41H6.59Z",$v="M18,18H6V6H18V18Z",PS="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4M9,9V15H15V9",xv="M9,3L5,7H8V14H10V7H13M16,17V10H14V17H11L15,21L19,17H16Z",wv="M12,18A6,6 0 0,1 6,12C6,11 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12A8,8 0 0,0 12,20V23L16,19L12,15M12,4V1L8,5L12,9V6A6,6 0 0,1 18,12C18,13 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12A8,8 0 0,0 12,4Z",DS="M19,18H5V6H19M21,4H3C1.89,4 1,4.89 1,6V18A2,2 0 0,0 3,20H21A2,2 0 0,0 23,18V6C23,4.89 22.1,4 21,4Z",Sv="M15.5,12C18,12 20,14 20,16.5C20,17.38 19.75,18.21 19.31,18.9L22.39,22L21,23.39L17.88,20.32C17.19,20.75 16.37,21 15.5,21C13,21 11,19 11,16.5C11,14 13,12 15.5,12M15.5,14A2.5,2.5 0 0,0 13,16.5A2.5,2.5 0 0,0 15.5,19A2.5,2.5 0 0,0 18,16.5A2.5,2.5 0 0,0 15.5,14M7,15V17H9C9.14,18.55 9.8,19.94 10.81,21H5C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H19A2,2 0 0,1 21,5V13.03C19.85,11.21 17.82,10 15.5,10C14.23,10 13.04,10.37 12.04,11H7V13H10C9.64,13.6 9.34,14.28 9.17,15H7M17,9V7H7V9H17Z",Pv="M15.5,12C18,12 20,14 20,16.5C20,17.38 19.75,18.21 19.31,18.9L22.39,22L21,23.39L17.88,20.32C17.19,20.75 16.37,21 15.5,21C13,21 11,19 11,16.5C11,14 13,12 15.5,12M15.5,14A2.5,2.5 0 0,0 13,16.5A2.5,2.5 0 0,0 15.5,19A2.5,2.5 0 0,0 18,16.5A2.5,2.5 0 0,0 15.5,14M5,3H19C20.11,3 21,3.89 21,5V13.03C20.5,12.23 19.81,11.54 19,11V5H5V19H9.5C9.81,19.75 10.26,20.42 10.81,21H5C3.89,21 3,20.11 3,19V5C3,3.89 3.89,3 5,3M7,7H17V9H7V7M7,11H12.03C11.23,11.5 10.54,12.19 10,13H7V11M7,15H9.17C9.06,15.5 9,16 9,16.5V17H7V15Z",fi="M15 13V5A3 3 0 0 0 9 5V13A5 5 0 1 0 15 13M12 4A1 1 0 0 1 13 5V8H11V5A1 1 0 0 1 12 4Z",Dv="M17 3H21V5H17V3M17 7H21V9H17V7M17 11H21V13H17.75L17 12.1V11M21 15V17H19C19 16.31 18.9 15.63 18.71 15H21M7 3V5H3V3H7M7 7V9H3V7H7M7 11V12.1L6.25 13H3V11H7M3 15H5.29C5.1 15.63 5 16.31 5 17H3V15M15 13V5C15 3.34 13.66 2 12 2S9 3.34 9 5V13C6.79 14.66 6.34 17.79 8 20S12.79 22.66 15 21 17.66 16.21 16 14C15.72 13.62 15.38 13.28 15 13M12 4C12.55 4 13 4.45 13 5V8H11V5C11 4.45 11.45 4 12 4Z",Tv="M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.24,7.76C15.07,6.58 13.53,6 12,6V12L7.76,16.24C10.1,18.58 13.9,18.58 16.24,16.24C18.59,13.9 18.59,10.1 16.24,7.76Z",TS="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M19.03,7.39L20.45,5.97C20,5.46 19.55,5 19.04,4.56L17.62,6C16.07,4.74 14.12,4 12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22C17,22 21,17.97 21,13C21,10.88 20.26,8.93 19.03,7.39M11,14H13V8H11M15,1H9V3H15V1Z",Yp="M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z",OS="M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M7,15A3,3 0 0,1 4,12A3,3 0 0,1 7,9A3,3 0 0,1 10,12A3,3 0 0,1 7,15Z",Ov="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",Mv="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z",MS="M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z",kv="M18 5H6V7H18M6 9H18V11H6M2 12H4V17H20V12H22V17A2 2 0 0 1 20 19H4A2 2 0 0 1 2 17M18 13H6V15H18Z",kS="M3,17V19H9V17H3M3,5V7H13V5H3M13,21V19H21V17H13V15H11V21H13M7,9V11H3V13H7V15H9V9H7M21,13V11H11V13H21M15,9H17V7H21V5H17V3H15V9Z",Xa="M21,10.12H14.22L16.96,7.3C14.23,4.6 9.81,4.5 7.08,7.2C4.35,9.91 4.35,14.28 7.08,17C9.81,19.7 14.23,19.7 16.96,17C18.32,15.65 19,14.08 19,12.1H21C21,14.08 20.12,16.65 18.36,18.39C14.85,21.87 9.15,21.87 5.64,18.39C2.14,14.92 2.11,9.28 5.62,5.81C9.13,2.34 14.76,2.34 18.27,5.81L21,3V10.12M12.5,8V12.25L16,14.33L15.28,15.54L11,13V8H12.5Z",ES="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z",Jp="M15,7V11H16V13H13V5H15L12,1L9,5H11V13H8V10.93C8.7,10.56 9.2,9.85 9.2,9C9.2,7.78 8.21,6.8 7,6.8C5.78,6.8 4.8,7.78 4.8,9C4.8,9.85 5.3,10.56 6,10.93V13A2,2 0 0,0 8,15H11V18.05C10.29,18.41 9.8,19.15 9.8,20A2.2,2.2 0 0,0 12,22.2A2.2,2.2 0 0,0 14.2,20C14.2,19.15 13.71,18.41 13,18.05V15H16A2,2 0 0,0 18,13V11H19V7H15Z",yu="M5,7H9A2,2 0 0,1 11,9V15A2,2 0 0,1 9,17H5V15H9V13H6V11H9V9H5V7M13,7H16A3,3 0 0,1 19,10V14A3,3 0 0,1 16,17H13V7M16,15A1,1 0 0,0 17,14V10A1,1 0 0,0 16,9H15V15H16Z",LS="M19,5V7H15V5H19M9,5V11H5V5H9M19,13V19H15V13H19M9,17V19H5V17H9M21,3H13V9H21V3M11,3H3V13H11V3M21,11H13V21H21V11M11,15H3V21H11V15Z",Bg="M3,11H11V3H3M3,21H11V13H3M13,21H21V13H13M13,3V11H21V3",on="M12,2A7,7 0 0,1 19,9A7,7 0 0,1 12,16A7,7 0 0,1 5,9A7,7 0 0,1 12,2M12,4A5,5 0 0,0 7,9A5,5 0 0,0 12,14A5,5 0 0,0 17,9A5,5 0 0,0 12,4M12,6A3,3 0 0,1 15,9A3,3 0 0,1 12,12A3,3 0 0,1 9,9A3,3 0 0,1 12,6M6,22A2,2 0 0,1 4,20C4,19.62 4.1,19.27 4.29,18.97L6.11,15.81C7.69,17.17 9.75,18 12,18C14.25,18 16.31,17.17 17.89,15.81L19.71,18.97C19.9,19.27 20,19.62 20,20A2,2 0 0,1 18,22H6Z",AS="M12 6C13.66 6 15 7.34 15 9C15 9.78 14.7 10.5 14.21 11L10 6.79C10.5 6.3 11.22 6 12 6M12 4C14.76 4 17 6.24 17 9C17 10.33 16.47 11.53 15.62 12.42L17.04 13.84C18.25 12.59 19 10.88 19 9C19 5.13 15.87 2 12 2C10.12 2 8.41 2.75 7.16 3.96L8.58 5.38C9.47 4.53 10.67 4 12 4M22.11 21.46L20.84 22.73L19.46 21.35C19.1 21.75 18.58 22 18 22H6C4.89 22 4 21.11 4 20C4 19.62 4.1 19.27 4.29 18.97L6.11 15.81C7.69 17.17 9.75 18 12 18C13.21 18 14.37 17.75 15.43 17.32L13.85 15.74C13.26 15.91 12.64 16 12 16C8.13 16 5 12.87 5 9C5 8.36 5.09 7.74 5.26 7.15L1.11 3L2.39 1.73L22.11 21.46M12.1 14L7 8.9C7 8.93 7 8.97 7 9C7 11.76 9.24 14 12 14C12.03 14 12.07 14 12.1 14Z",FS="M22.7,19L13.6,9.9C14.5,7.6 14,4.9 12.1,3C10.1,1 7.1,0.6 4.7,1.7L9,6L6,9L1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1C4.8,14 7.5,14.5 9.8,13.6L18.9,22.7C19.3,23.1 19.9,23.1 20.3,22.7L22.6,20.4C23.1,20 23.1,19.3 22.7,19Z",RS=Object.defineProperty,HS=Object.getOwnPropertyDescriptor,Os=(s,e,t,r)=>{for(var i=r>1?void 0:r?HS(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&RS(e,t,i),i};let Qt=class extends k(L){constructor(){super(...arguments),this.mdiChevronDown=fr,this.panelToolbarHeight=mm}get expand(){return this.$store.getters["gui/getPanelExpand"](this.cardClass,this.viewport)}set expand(e){this.$store.dispatch("gui/saveExpandPanel",{name:this.cardClass,value:e,viewport:this.viewport})}get hasIconSlot(){return!!this.$slots.icon}get hasButtonsSlot(){return!!this.$slots.buttons}get getToolbarClass(){let e=this.toolbarClass;return this.collapsible&&(e+=" collapsible"),e}get additionalStyle(){return this.$vuetify.theme.dark?"":"border-bottom: 1px solid #A8A8A8"}};Os([w({default:null})],Qt.prototype,"icon",2);Os([w({required:!0,default:""})],Qt.prototype,"title",2);Os([w({default:!1})],Qt.prototype,"collapsible",2);Os([w({required:!0})],Qt.prototype,"cardClass",2);Os([w({default:""})],Qt.prototype,"toolbarColor",2);Os([w({default:""})],Qt.prototype,"toolbarClass",2);Os([w({default:!1})],Qt.prototype,"loading",2);Os([w({default:!0})],Qt.prototype,"marginBottom",2);Os([w({default:!1})],Qt.prototype,"hideButtonsOnCollapse",2);Qt=Os([S],Qt);var jS=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{class:"panel "+e.cardClass+" "+(e.marginBottom?"mb-3 mb-md-6":"")+" "+(e.expand?"":"expanded"),attrs:{loading:e.loading}},[t(Op,{staticClass:"panel-toolbar",class:e.getToolbarClass,style:e.additionalStyle,attrs:{flat:"",dense:"",color:e.toolbarColor,height:e.panelToolbarHeight}},[e._t("buttons-left"),t(ru,{staticClass:"d-flex align-center"},[e.hasIconSlot?e._t("icon"):e._e(),e.icon!==null&&!e.hasIconSlot?t(_,{attrs:{left:""}},[e._v(e._s(e.icon))]):e._e(),e.title?t("span",{staticClass:"subheading"},[e._v(e._s(e.title))]):e._e()],2),e._t("buttons-title"),t(ae),t(S$,{directives:[{name:"show",rawName:"v-show",value:e.hasButtonsSlot||e.collapsible,expression:"hasButtonsSlot || collapsible"}]},[e.expand||!e.hideButtonsOnCollapse?t("div",{staticClass:"d-flex align-center"},[e._t("buttons")],2):e._e(),e.collapsible?t(g,{staticClass:"btn-collapsible",attrs:{icon:"",ripple:!0},on:{click:function(r){e.expand=!e.expand}}},[t(_,{class:e.expand?"":"icon-rotate-90"},[e._v(e._s(e.mdiChevronDown))])],1):e._e()],1)],2),t(iu,[t("div",{directives:[{name:"show",rawName:"v-show",value:e.expand||!e.collapsible,expression:"expand || !collapsible"}]},[e._t("default")],2)])],1)},IS=[],NS=E(Qt,jS,IS,!1,null,"36b00e8e");const U=NS.exports;var VS=Object.getOwnPropertyDescriptor,BS=(s,e,t,r)=>{for(var i=r>1?void 0:r?VS(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let vt=class extends y{fgColor(s=1,e=this.$vuetify.theme.dark){const t=e?255:0;return"rgba(".concat(t,", ").concat(t,", ").concat(t,", ").concat(s,")")}bgColor(s=1){return this.fgColor(s,!this.$vuetify.theme.dark)}get themeName(){return this.$store.getters["gui/theme"]}get theme(){return this.$store.getters["gui/getTheme"]}get themeMode(){var s;return(s=this.$store.state.gui.uiSettings.mode)!=null?s:"dark"}get fgColorHi(){return this.fgColor(.8)}get fgColorMid(){return this.fgColor(.5)}get fgColorLow(){return this.fgColor(.2)}get fgColorFaint(){return this.fgColor(.1)}get machineButtonCol(){return this.$vuetify.theme.dark?"grey darken-3":"grey lighten-1"}get draggableBgStyle(){const s=this.$vuetify.theme.dark?"#282828":"#e7e7e7";return"background-color: ".concat(s)}get progressBarColor(){return this.$vuetify.theme.dark?"white":"primary"}get sidebarBgImage(){var s,e;return(s=this.theme.sidebarBackground)!=null&&s.show?(e=this.theme.sidebarBackground)!=null&&e.light&&this.themeMode==="light"?"/img/themes/sidebarBackground-".concat(this.themeName,"-light.png"):"/img/themes/sidebarBackground-".concat(this.themeName,".png"):this.$vuetify.theme.dark?"/img/sidebar-background.svg":"/img/sidebar-background-light.svg"}get sidebarLogo(){var e,t,r;const s=this.$store.getters["files/getSidebarLogo"];return s!==""||this.themeName==="mainsail"?s:(t=(e=this.theme.logo)==null?void 0:e.show)!=null&&t?(r=this.theme.logo)!=null&&r.light&&this.themeMode==="light"?"/img/themes/sidebarLogo-".concat(this.themeName,"-light.svg"):"/img/themes/sidebarLogo-".concat(this.themeName,".svg"):""}get mainBgImage(){var e,t;const s=this.$store.getters["files/getMainBackground"];return s||this.themeName==="mainsail"?s:(e=this.theme.mainBackground)!=null&&e.show?(t=this.theme.mainBackground)!=null&&t.light&&this.themeMode==="light"?"/img/themes/mainBackground-".concat(this.themeName,"-light.png"):"/img/themes/mainBackground-".concat(this.themeName,".png"):null}get themeCss(){var s;return(s=this.theme.css)!=null&&s?"/css/themes/".concat(this.themeName,".css"):null}};vt=BS([S],vt);var US=Object.getOwnPropertyDescriptor,WS=(s,e,t,r)=>{for(var i=r>1?void 0:r?US(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let pm=class extends k(L,vt){constructor(){super(...arguments),this.mdiConnection=Ap,this.mdiHelp=Wp,this.counter=0}get hostname(){return this.$store.state.socket.hostname}get port(){return this.$store.state.socket.port}get path(){return this.$store.state.socket.path}get formatHostname(){return parseInt(this.port)!==80&&this.port!==""?this.hostname+":"+this.port+this.path:this.hostname+this.path}get isConnecting(){return this.$store.state.socket.isConnecting}get connectingFailed(){return this.$store.state.socket.connectingFailed}get showDialog(){return!0}get titleText(){return this.connectingFailed?this.$t("ConnectionDialog.Failed",{host:this.formatHostname}):this.isConnecting?this.$t("ConnectionDialog.Connecting",{host:this.formatHostname}):this.guiIsReady?this.formatHostname:this.$t("ConnectionDialog.Initializing")}get connectionFailedMessage(){var s;return(s=this.$store.state.socket.connectionFailedMessage)!=null?s:null}get helpButtonUrl(){var s;return this.$store.state.socket.connectionFailedMessage?"https://docs.mainsail.xyz/faq/mainsail_errors/connection-".concat((s=this.connectionFailedMessage)==null?void 0:s.toLowerCase()):null}reconnect(){this.counter++,this.$store.dispatch("socket/setData",{connectingFailed:!1}),this.$socket.connect()}};pm=WS([S({components:{ConnectionStatus:lu}})],pm);var zS=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{persistent:"",width:400},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(U,{attrs:{title:e.titleText,icon:e.mdiConnection,"card-class":"the-connection-dialog","margin-bottom":!1}},[e.connectingFailed?t(Z,{staticClass:"pt-5"},[t(lu,{attrs:{moonraker:!1}}),t("p",{staticClass:"text-center mt-3 mb-0"},[e._v(" "+e._s(e.$t("ConnectionDialog.CannotConnectTo",{host:e.formatHostname}))+" ")]),e.connectionFailedMessage?t("p",{staticClass:"text-center mt-1 red--text"},[e._v(" "+e._s(e.$t("ConnectionDialog.ErrorMessage",{message:e.connectionFailedMessage}))+" ")]):e._e(),e.counter>2?[t(I,{staticClass:"my-3"}),t("p",[e._v(e._s(e.$t("ConnectionDialog.CheckMoonrakerLog")))]),t("ul",[t("li",[e._v("~/printer_data/logs/moonraker.log")])]),t(I,{staticClass:"mt-4 mb-5"})]:e._e(),t("div",{staticClass:"text-center mt-3"},[e.helpButtonUrl?t(g,{staticClass:"text--disabled mr-3",attrs:{href:e.helpButtonUrl,target:"_blank"}},[t(_,{attrs:{left:""}},[e._v(e._s(e.mdiHelp))]),e._v(" "+e._s(e.$t("ConnectionDialog.Help"))+" ")],1):e._e(),t(g,{staticClass:"primary--text",on:{click:e.reconnect}},[e._v(e._s(e.$t("ConnectionDialog.TryAgain")))])],1)],2):t(Z,{staticClass:"pt-5"},[t(Ss,{attrs:{color:e.progressBarColor,indeterminate:""}})],1)],1)],1)},GS=[],ZS=E(pm,zS,GS,!1,null,null);const Ev=ZS.exports;var qS=Object.getOwnPropertyDescriptor,XS=(s,e,t,r)=>{for(var i=r>1?void 0:r?qS(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let fm=class extends k(L){constructor(){super(...arguments),this.addPrinterValid=!1,this.dialogAddPrinter={bool:!1,hostname:"",port:7125,path:"/",name:""},this.editPrinterValid=!1,this.dialogEditPrinter={bool:!1,id:"",hostname:"",port:0,path:"/",name:""},this.showOptionalSettings=!1,this.mdiConnection=Ap,this.mdiCloseThick=pe,this.mdiSync=wv,this.mdiDelete=Ue,this.mdiPencil=bt,this.mdiCheckboxMarkedCircle=X_,this.mdiCancel=Z_,this.mdiShowOptional=ss,this.mdiHideOptional=Ew}get printers(){var s;return(s=this.$store.getters["gui/remoteprinters/getRemoteprinters"])!=null?s:[]}get canAddPrinters(){return this.instancesDB!=="json"}get protocol(){return this.$store.state.socket.protocol}get defaultMoonrakerPort(){return this.protocol==="wss"?7130:7125}get hostname(){return this.$store.state.socket.hostname}get port(){return this.$store.state.socket.port}get path(){return this.$store.state.socket.path}get name(){return this.$store.state.printer}get formatHostname(){return this.hostname+(this.port!==""?":"+this.port:"")+(this.path!==""?this.path:"")}get isConnected(){return this.$store.state.socket.isConnected}get isConnecting(){return this.$store.state.socket.isConnecting}get connectingFailed(){return this.$store.state.socket.connectingFailed}get showDialog(){return!this.isConnected||this.isConnected&&!this.guiIsReady}get currentUrl(){let s=document.location.protocol+"//"+window.location.hostname;return parseInt(window.location.port)!==80&&window.location.port!==""&&(s+=":"+window.location.port),s}get showCorsInfo(){return this.printers.length?(this.printers.forEach(s=>{var e;if(s&&!((e=s.socket)!=null&&e.isConnected))return!0}),!1):!0}get panelTitle(){return this.dialogAddPrinter.bool?this.$t("SelectPrinterDialog.AddPrinter"):this.dialogEditPrinter.bool?this.$t("SelectPrinterDialog.EditPrinter"):this.isConnecting?this.$t("SelectPrinterDialog.Connecting",{host:this.formatHostname}):this.isConnected&&!this.guiIsReady?this.$t("ConnectionDialog.Initializing"):this.connectingFailed?this.$t("SelectPrinterDialog.ConnectionFailed",{host:this.formatHostname}):this.$t("SelectPrinterDialog.SelectPrinter")}getPrinterName(s){return this.$store.getters["farm/getPrinterName"](s)}createPrinter(){this.dialogAddPrinter.hostname="",this.dialogAddPrinter.port=this.defaultMoonrakerPort,this.dialogAddPrinter.bool=!0}addPrinter(){const s={hostname:this.dialogAddPrinter.hostname,port:this.dialogAddPrinter.port,path:this.dialogAddPrinter.path,name:this.dialogAddPrinter.name};this.$store.dispatch("gui/remoteprinters/store",{values:s}),this.dialogAddPrinter.hostname="",this.dialogAddPrinter.bool=!1,this.dialogAddPrinter.path="/",this.dialogAddPrinter.name=""}editPrinter(s){var e,t,r;this.dialogEditPrinter.hostname=s.hostname,this.dialogEditPrinter.port=s.port,this.dialogEditPrinter.id=(e=s.id)!=null?e:"",this.dialogEditPrinter.path=(t=s.path)!=null?t:"/",this.dialogEditPrinter.name=(r=s.name)!=null?r:"",this.dialogEditPrinter.bool=!0,this.showOptionalSettings=s.name?s.name.length>0:!1}updatePrinter(){const s={hostname:this.dialogEditPrinter.hostname,port:this.dialogEditPrinter.port,path:this.dialogEditPrinter.path,id:this.dialogEditPrinter.id,name:this.dialogEditPrinter.name};this.$store.dispatch("gui/remoteprinters/update",{id:this.dialogEditPrinter.id,values:s}),this.dialogEditPrinter.bool=!1}delPrinter(){this.$store.dispatch("gui/remoteprinters/delete",this.dialogEditPrinter.id),this.dialogEditPrinter.bool=!1}connect(s){this.$store.dispatch("socket/setData",{hostname:s.socket.hostname,port:s.socket.port,path:s.socket.path});const e=s.socket.path.replaceAll(/(^\/*)|(\/*$)/g,""),t=this.protocol+"://"+s.socket.hostname+":"+s.socket.port+(e.length>0?"/".concat(e):"")+"/websocket";this.$socket.setUrl(t),this.$socket.connect()}reconnect(){this.$store.dispatch("socket/setData",{connectingFailed:!1}),this.$socket.connect()}switchToChangePrinter(){this.$store.dispatch("socket/setData",{connectingFailed:!1})}checkPrinters(){this.printers.forEach(s=>{var e,t;s&&!((e=s.socket)!=null&&e.isConnected)&&!((t=s.socket)!=null&&t.isConnecting)&&this.$store.dispatch("farm/"+s.id+"/connect")})}mounted(){this.$store.dispatch("gui/remoteprinters/initFromLocalstorage").then(()=>{if(!("printer"in this.$route.query))return;let s=this.$route.query.printer.toString().toLowerCase(),e=this.printers.filter(t=>{var r;return((r=t.name)==null?void 0:r.toLowerCase())===s});if(e.length==0){window.console.error("No printer with given name '".concat(s,"' found. Showing selection dialog instead."));return}if(e.length>1){window.console.error("Multiple printers with name '".concat(s,"' found. Showing selection dialog instead."));return}this.connect(e[0])})}};fm=XS([S({components:{Panel:U}})],fm);var YS=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{persistent:"",width:400},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(U,{attrs:{"card-class":"select-printer-dialog",icon:e.mdiConnection,title:e.panelTitle,"margin-bottom":!1,"toolbar-color":"toolbar"},scopedSlots:e._u([{key:"buttons",fn:function(){return[!e.isConnecting&&!e.connectingFailed?[e.dialogEditPrinter.bool?[t(g,{staticClass:"minwidth-0",attrs:{icon:"",tile:""},on:{click:function(r){e.dialogEditPrinter.bool=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]:e.dialogAddPrinter.bool?[e.dialogAddPrinter.bool?t(g,{staticClass:"minwidth-0",attrs:{icon:"",tile:""},on:{click:function(r){e.dialogAddPrinter.bool=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1):e._e()]:e.printers.length>0?[t(g,{staticClass:"minwidth-0",attrs:{icon:"",tile:"",color:"primary"},on:{click:e.checkPrinters}},[t(_,[e._v(e._s(e.mdiSync))])],1)]:e._e()]:e._e()]},proxy:!0}])},[e.isConnecting||e.isConnected&&!e.guiIsReady?[t(Z,[t(Ss,{attrs:{color:"primary",indeterminate:""}})],1)]:e.connectingFailed?[t(Z,[t("p",[e._v(" "+e._s(e.$t("SelectPrinterDialog.CannotConnectTo",{host:parseInt(e.port)!==80?e.hostname+":"+e.port:e.hostname}))+" ")]),t("div",{staticClass:"text-center"},[t(g,{staticClass:"mr-3",attrs:{text:"",color:"white"},on:{click:e.switchToChangePrinter}},[e._v(" "+e._s(e.$t("SelectPrinterDialog.ChangePrinter"))+" ")]),t(g,{attrs:{text:"",color:"primary"},on:{click:e.reconnect}},[e._v(e._s(e.$t("SelectPrinterDialog.TryAgain")))])],1)])]:e.dialogAddPrinter.bool?[t(or,{on:{submit:function(r){return r.preventDefault(),e.addPrinter.apply(null,arguments)}},model:{value:e.addPrinterValid,callback:function(r){e.addPrinterValid=r},expression:"addPrinterValid"}},[t(Z,[t(x,[t(b,{staticClass:"col-8"},[t(se,{attrs:{rules:[r=>!!r||e.$t("SelectPrinterDialog.HostnameRequired"),r=>!r.startsWith("http:")||e.$t("SelectPrinterDialog.HostnameInvalid"),r=>!r.startsWith("https:")||e.$t("SelectPrinterDialog.HostnameInvalid")],label:e.$t("SelectPrinterDialog.HostnameIp"),required:"",outlined:"","hide-details":"auto",dense:""},model:{value:e.dialogAddPrinter.hostname,callback:function(r){e.$set(e.dialogAddPrinter,"hostname",r)},expression:"dialogAddPrinter.hostname"}})],1),t(b,{staticClass:"col-4"},[t(se,{attrs:{rules:[r=>!!r||e.$t("SelectPrinterDialog.PortRequired")],label:e.$t("SelectPrinterDialog.Port"),"hide-details":"auto",required:"",outlined:"",dense:""},model:{value:e.dialogAddPrinter.port,callback:function(r){e.$set(e.dialogAddPrinter,"port",r)},expression:"dialogAddPrinter.port"}})],1)],1),e.showOptionalSettings?t(x,[t(b,{attrs:{cols:6}},[t(se,{attrs:{rules:[r=>!r||r.startsWith("/")||"Path must start with /"],label:e.$t("SelectPrinterDialog.Path"),"hide-details":"auto",outlined:"",dense:""},model:{value:e.dialogAddPrinter.path,callback:function(r){e.$set(e.dialogAddPrinter,"path",r)},expression:"dialogAddPrinter.path"}})],1),t(b,{attrs:{cols:6}},[t(se,{attrs:{label:e.$t("SelectPrinterDialog.Name"),outlined:"","hide-details":"auto",dense:""},model:{value:e.dialogAddPrinter.name,callback:function(r){e.$set(e.dialogAddPrinter,"name",r)},expression:"dialogAddPrinter.name"}})],1)],1):e._e()],1),t(oe,[t(ge,{staticClass:"ml-2",attrs:{"on-icon":e.mdiShowOptional,"off-icon":e.mdiHideOptional,"true-value":!1,"false-value":!0},model:{value:e.showOptionalSettings,callback:function(r){e.showOptionalSettings=r},expression:"showOptionalSettings"}}),t(ae),t(g,{staticClass:"middle",attrs:{color:"primary",text:"",type:"submit",disabled:!e.addPrinterValid}},[e._v(" "+e._s(e.$t("SelectPrinterDialog.AddPrinter"))+" ")])],1)],1)]:e.dialogEditPrinter.bool?[t(or,{on:{submit:function(r){return r.preventDefault(),e.updatePrinter.apply(null,arguments)}},model:{value:e.editPrinterValid,callback:function(r){e.editPrinterValid=r},expression:"editPrinterValid"}},[t(Z,[t(x,[t(b,{staticClass:"col-8"},[t(se,{attrs:{rules:[r=>!!r||e.$t("SelectPrinterDialog.HostnameRequired"),r=>!r.startsWith("http:")||e.$t("SelectPrinterDialog.HostnameInvalid"),r=>!r.startsWith("https:")||e.$t("SelectPrinterDialog.HostnameInvalid")],label:e.$t("SelectPrinterDialog.HostnameIp"),required:"",outlined:"",dense:"","hide-details":"auto"},model:{value:e.dialogEditPrinter.hostname,callback:function(r){e.$set(e.dialogEditPrinter,"hostname",r)},expression:"dialogEditPrinter.hostname"}})],1),t(b,{staticClass:"col-4"},[t(se,{attrs:{rules:[r=>!!r||e.$t("SelectPrinterDialog.PortRequired")],label:e.$t("SelectPrinterDialog.Port"),required:"",outlined:"",dense:"","hide-details":"auto"},model:{value:e.dialogEditPrinter.port,callback:function(r){e.$set(e.dialogEditPrinter,"port",r)},expression:"dialogEditPrinter.port"}})],1)],1),e.showOptionalSettings?t(x,[t(b,{attrs:{cols:6}},[t(se,{attrs:{rules:[r=>!r||r.startsWith("/")||"Path must start with /"],label:e.$t("SelectPrinterDialog.Path"),"hide-details":"auto",outlined:"",dense:""},model:{value:e.dialogEditPrinter.path,callback:function(r){e.$set(e.dialogEditPrinter,"path",r)},expression:"dialogEditPrinter.path"}})],1),t(b,{attrs:{cols:6}},[t(se,{attrs:{label:e.$t("SelectPrinterDialog.Name"),outlined:"","hide-details":"auto",dense:""},model:{value:e.dialogEditPrinter.name,callback:function(r){e.$set(e.dialogEditPrinter,"name",r)},expression:"dialogEditPrinter.name"}})],1)],1):e._e()],1),t(oe,[t(g,{staticClass:"minwidth-0 rounded",attrs:{color:"red",icon:"",tile:""},on:{click:e.delPrinter}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1),t(ge,{staticClass:"ml-2",attrs:{"on-icon":e.mdiShowOptional,"off-icon":e.mdiHideOptional,"true-value":!1,"false-value":!0},model:{value:e.showOptionalSettings,callback:function(r){e.showOptionalSettings=r},expression:"showOptionalSettings"}}),t(ae),t(g,{attrs:{color:"primary",text:"",type:"submit",disabled:!e.editPrinterValid}},[e._v(" "+e._s(e.$t("SelectPrinterDialog.UpdatePrinter"))+" ")])],1)],1)]:[t(Z,{staticClass:"mt-3"},[e.printers.length?t(x,[t(b,{staticClass:"px-6"},e._l(e.printers,function(r,i){return t(x,{key:i},[t(b,{staticClass:"rounded transition-swing toolbar py-2 px-2 mb-2 overflow-hidden",staticStyle:{cursor:"pointer"},on:{click:function(n){return e.connect(r)}}},[t(x,{attrs:{align:"center"}},[t(b,{staticClass:"col-auto pr-0"},[r.socket.isConnecting?t(ot,{attrs:{indeterminate:"",color:"primary",size:"24",width:"2.5"}}):e._e(),r.socket.isConnecting?e._e():t(_,{attrs:{color:r.socket.isConnected?"green":"red"}},[e._v(" "+e._s(r.socket.isConnected?e.mdiCheckboxMarkedCircle:e.mdiCancel)+" ")])],1),t(b,[e._v(e._s(e.getPrinterName(r.id)))]),e.canAddPrinters?t(b,{staticClass:"col-auto pa-0"},[t(g,{staticClass:"mr-1",attrs:{tile:"",text:"",icon:"",large:""},on:{click:function(n){return n.stopPropagation(),n.preventDefault(),e.editPrinter(r)}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiPencil))])],1)],1):e._e()],1)],1)],1)}),1)],1):e._e(),e.instancesDB==="browser"?[e.showCorsInfo?t(x,[t(b,[e.printers.length===0?t("p",{staticClass:"text-center"},[e._v(" "+e._s(e.$t("SelectPrinterDialog.Hello"))+" ")]):e._e(),t("p",{staticClass:"text-center"},[e._v(" "+e._s(e.$t("SelectPrinterDialog.RememberToAdd",{cors:e.currentUrl}))+" ")]),t("p",{staticClass:"text-center mb-0"},[e._v(" "+e._s(e.$t("SelectPrinterDialog.YouCanFindMore"))+" "),t("br"),t("a",{attrs:{href:"https://docs.mainsail.xyz/remotemode",target:"_blank"}},[e._v(" https://docs.mainsail.xyz/remotemode ")]),e._v(" . ")])])],1):e._e(),t(x,[t(b,{staticClass:"text-center mt-0"},[t(g,{attrs:{text:"",color:"primary"},on:{click:e.createPrinter}},[e._v(" "+e._s(e.$t("SelectPrinterDialog.AddPrinter"))+" ")])],1)],1)]:e.instancesDB==="json"&&e.printers.length===0?t(x,[t(b,{staticClass:"text-center mt-0"},[t("p",{staticClass:"text-center"},[e._v(" "+e._s(e.$t("SelectPrinterDialog.AddPrintersToJson"))+" ")])])],1):e._e()],2)]],2)],1)},JS=[],KS=E(fm,YS,JS,!1,null,null);const Kp=KS.exports;var QS=Object.defineProperty,eP=Object.getOwnPropertyDescriptor,Lv=(s,e,t,r)=>{for(var i=r>1?void 0:r?eP(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&QS(e,t,i),i};let ul=class extends k(L){get splits(){return this.event.message.split("|")}get text(){return this.splits[0]}get command(){var s;return(s=this.splits[1])!=null?s:this.text}get color(){var s;return(s=this.splits[2])!=null?s:""}clickButton(){this.$store.dispatch("server/addEvent",{message:this.command,type:"command"}),this.$socket.emit("printer.gcode.script",{script:this.command})}};Lv([w({type:Object,required:!0})],ul.prototype,"event",2);ul=Lv([S({})],ul);var tP=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(g,{attrs:{color:e.color,text:""},on:{click:e.clickButton}},[e._v(" "+e._s(e.text)+" ")])},sP=[],rP=E(ul,tP,sP,!1,null,"ece2d321");const Av=rP.exports;var iP=Object.defineProperty,nP=Object.getOwnPropertyDescriptor,Fv=(s,e,t,r)=>{for(var i=r>1?void 0:r?nP(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&iP(e,t,i),i};let dl=class extends k(L){get splits(){return this.event.message.split("|")}get text(){return this.splits[0]}get command(){var e;return(e=this.splits[1])!=null?e:this.text}get color(){var e;return(e=this.splits[2])!=null?e:""}sendCommand(){this.$store.dispatch("server/addEvent",{message:this.command,type:"command"}),this.$socket.emit("printer.gcode.script",{script:this.command})}};Fv([w({type:Object,required:!0})],dl.prototype,"event",2);dl=Fv([S({})],dl);var aP=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(g,{staticClass:"mx-2",attrs:{color:e.color},on:{click:e.sendCommand}},[e._v(e._s(e.text))])},oP=[],lP=E(dl,aP,oP,!1,null,null);const Rv=lP.exports;var cP=Object.defineProperty,uP=Object.getOwnPropertyDescriptor,Qp=(s,e,t,r)=>{for(var i=r>1?void 0:r?uP(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&cP(e,t,i),i};let ea=class extends k(L){};Qp([w({type:Array,required:!0})],ea.prototype,"children",2);Qp([w({type:Number,required:!0})],ea.prototype,"groupIndex",2);ea=Qp([S({})],ea);var dP=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,[t(b,{staticClass:"text-center"},e._l(e.children,function(r,i){return t(Rv,{key:"prompt_"+e.groupIndex+"_"+i,attrs:{event:r}})}),1)],1)},mP=[],hP=E(ea,dP,mP,!1,null,null);const gm=hP.exports;var pP=Object.defineProperty,fP=Object.getOwnPropertyDescriptor,Hv=(s,e,t,r)=>{for(var i=r>1?void 0:r?fP(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&pP(e,t,i),i};let ml=class extends k(L){get text(){return this.event.message}};Hv([w({type:Object,required:!0})],ml.prototype,"event",2);ml=Hv([S({})],ml);var gP=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,[t(b,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.text))])])],1)},_P=[],vP=E(ml,gP,_P,!1,null,null);const jv=vP.exports;var bP=Object.getOwnPropertyDescriptor,yP=(s,e,t,r)=>{for(var i=r>1?void 0:r?bP(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let _m=class extends k(L){constructor(){super(...arguments),this.mdiInformation=Ht,this.mdiCloseThick=pe,this.internalCloseCommand=null,this.checkpointEvent=null,this.currentPrompt=[],this.promptMessageExp=/^\/\/ action:prompt_(?[^\s]+) *(?.*)$/}get events(){return this.$store.state.server.events}get macroPromptEvents(){var t,r,i,n;const s=this.events,e=[];for(let a=s.length-1;a>=0;a--){const o=s[a];if(o===this.checkpointEvent)break;if(o.type!=="action"||!((t=o.message)!=null&&t.startsWith("// action:prompt_")))continue;const l=o.message.match(this.promptMessageExp),u=(i=(r=l==null?void 0:l.groups)==null?void 0:r.type)!=null?i:"";if(u==="end"){this.currentPrompt=[];break}const c=(((n=l==null?void 0:l.groups)==null?void 0:n.msg)||"").trim();if(e.unshift({date:o.date,type:u,message:c}),u==="begin"){this.currentPrompt=[];break}}return this.checkpointEvent=s[s.length-1],e.length>0&&(this.currentPrompt=[...this.currentPrompt,...e]),this.currentPrompt}get lastPromptBeginPos(){return this.lastPromptShowPos===-1?-1:this.macroPromptEvents.findLastIndex(s=>s.type==="begin",this.lastPromptShowPos)}get lastPromptShowPos(){return this.macroPromptEvents.findLastIndex(s=>s.type==="show")}get lastPromptClosePos(){return this.macroPromptEvents.findLastIndex(s=>s.type==="end")}get showDialog(){var e,t,r;if(this.lastPromptBeginPos===-1)return!1;const s=(e=this.macroPromptEvents[this.lastPromptBeginPos])!=null?e:null;return this.internalCloseCommand!==null&&this.internalCloseCommand==((r=(t=s==null?void 0:s.date)==null?void 0:t.getTime())!=null?r:null)?!1:this.lastPromptBeginPos>this.lastPromptClosePos&&this.activePromptContent.length>0}get activePrompt(){return this.lastPromptShowPos===-1?[]:this.macroPromptEvents.slice(this.lastPromptBeginPos,this.lastPromptShowPos)}get activePromptContent(){const s=["button","text","button_group_start","button_group_end"],e=this.activePrompt.filter(t=>s.includes(t.type));for(;e.findIndex(t=>t.type==="button_group_start")!==-1&&e.findIndex(t=>t.type==="button_group_end")!==-1;){const t=e.findIndex(n=>n.type==="button_group_start"),r=e.findIndex(n=>n.type==="button_group_end"),i=e.slice(t+1,r);e[t]={date:i[0].date,type:"button_group",message:"",children:i.filter(n=>n.type==="button")},e.splice(t+1,i.length+1)}return e}get headline(){var s,e;return!this.showDialog||this.lastPromptBeginPos===-1?"":(e=(s=this.macroPromptEvents[this.lastPromptBeginPos])==null?void 0:s.message)!=null?e:""}get footerButtons(){return!this.showDialog||this.lastPromptBeginPos===-1?[]:this.activePrompt.filter(s=>s.type==="footer_button")}closePrompt(){var e,t,r;this.internalCloseCommand=(r=(t=(e=this.macroPromptEvents[this.lastPromptBeginPos])==null?void 0:e.date)==null?void 0:t.getTime())!=null?r:null;const s='RESPOND type="command" msg="action:prompt_end"';this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s})}};_m=yP([S({components:{MacroPromptButtonGroup:gm,MacroPromptButton:Rv,MacroPromptText:jv,MacroPromptFooterButton:Av,Panel:U}})],_m);var CP=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.showDialog,width:"400",persistent:"",fullscreen:e.isMobile}},[t(U,{staticStyle:{overflow:"hidden"},attrs:{title:e.headline,icon:e.mdiInformation,"card-class":"macro_prompt-dialog","margin-bottom":!1,height:e.isMobile?0:548},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closePrompt}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[e._l(e.activePromptContent,function(r,i){var n;return[r.type==="text"?t(jv,{key:"prompt_"+i,attrs:{event:r}}):e._e(),r.type==="button_group"?t(gm,{key:"prompt_"+i,attrs:{"group-index":i,children:(n=r.children)!=null?n:[]}}):e._e(),r.type==="button"?t(gm,{key:"prompt_"+i,attrs:{"group-index":i,children:[r]}}):e._e()]})],2),e.footerButtons.length?t(oe,[t(ae),e._l(e.footerButtons,function(r,i){return t(Av,{key:"prompt_footer_"+i,attrs:{event:r}})})],2):e._e()],1)],1)},$P=[],xP=E(_m,CP,$P,!1,null,"473b6448");const Iv=xP.exports;var wP=Object.defineProperty,SP=Object.getOwnPropertyDescriptor,ei=(s,e,t,r)=>{for(var i=r>1?void 0:r?SP(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&wP(e,t,i),i};let js=class extends k(L){get firstColClasses(){const s=" d-flex justify-center";return this.dynamicSlotWidth?"col"+s:this.mobileSecondRow?"col-12 col-md-6"+s:"col-6"+s}get secondColClasses(){const s=" d-flex justify-end align-center settings-row-slot";return this.dynamicSlotWidth?"col-auto"+s:this.mobileSecondRow?"col-12 col-md-6 pt-0 pt-md-3"+s:"col-6"+s}};ei([w({required:!1,default:!1})],js.prototype,"loading",2);ei([w({required:!1,default:""})],js.prototype,"icon",2);ei([w({required:!0})],js.prototype,"title",2);ei([w({required:!1})],js.prototype,"subTitle",2);ei([w({required:!1,default:!1})],js.prototype,"dynamicSlotWidth",2);ei([w({required:!1,default:!1})],js.prototype,"mobileSecondRow",2);js=ei([S],js);var PP=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,[t(b,{class:e.firstColClasses},[t(x,{staticClass:"d-flex flex-row"},[e.loading?t(b,{staticClass:"col-auto d-flex justify-center align-center pr-0"},[t(ot,{attrs:{indeterminate:"",color:"primary",size:24}})],1):e.icon?t(b,{staticClass:"col-auto d-flex justify-center align-center pr-0"},[t(_,[e._v(e._s(e.icon))])],1):e._e(),t(b,{staticClass:"col d-flex justify-center flex-column"},[t("span",{staticClass:"settings-row-title"},[e._v(e._s(e.title))]),e.subTitle?t("span",{staticClass:"settings-row-subtitle"},[e._v(e._s(e.subTitle))]):e._e()])],1)],1),t(b,{class:e.secondColClasses},[e._t("default")],2)],1)},DP=[],TP=E(js,PP,DP,!1,null,"c095664a");const j=TP.exports;var Nv="Expected a function",Ug=NaN,OP="[object Symbol]",MP=/^\s+|\s+$/g,kP=/^[-+]0x[0-9a-f]+$/i,EP=/^0b[01]+$/i,LP=/^0o[0-7]+$/i,AP=parseInt,FP=typeof Tr=="object"&&Tr&&Tr.Object===Object&&Tr,RP=typeof self=="object"&&self&&self.Object===Object&&self,HP=FP||RP||Function("return this")(),jP=Object.prototype,IP=jP.toString,NP=Math.max,VP=Math.min,Md=function(){return HP.Date.now()};function BP(s,e,t){var r,i,n,a,o,l,u=0,c=!1,d=!1,m=!0;if(typeof s!="function")throw new TypeError(Nv);e=Wg(e)||0,hl(t)&&(c=!!t.leading,d="maxWait"in t,n=d?NP(Wg(t.maxWait)||0,e):n,m="trailing"in t?!!t.trailing:m);function h($){var D=r,V=i;return r=i=void 0,u=$,a=s.apply(V,D),a}function f($){return u=$,o=setTimeout(C,e),c?h($):a}function p($){var D=$-l,V=$-u,N=e-D;return d?VP(N,n-V):N}function v($){var D=$-l,V=$-u;return l===void 0||D>=e||D<0||d&&V>=n}function C(){var $=Md();if(v($))return P($);o=setTimeout(C,p($))}function P($){return o=void 0,m&&r?h($):(r=i=void 0,a)}function M(){o!==void 0&&clearTimeout(o),u=0,r=l=i=o=void 0}function F(){return o===void 0?a:P(Md())}function O(){var $=Md(),D=v($);if(r=arguments,i=this,l=$,D){if(o===void 0)return f(l);if(d)return o=setTimeout(C,e),h(l)}return o===void 0&&(o=setTimeout(C,e)),a}return O.cancel=M,O.flush=F,O}function UP(s,e,t){var r=!0,i=!0;if(typeof s!="function")throw new TypeError(Nv);return hl(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),BP(s,e,{leading:r,maxWait:e,trailing:i})}function hl(s){var e=typeof s;return!!s&&(e=="object"||e=="function")}function WP(s){return!!s&&typeof s=="object"}function zP(s){return typeof s=="symbol"||WP(s)&&IP.call(s)==OP}function Wg(s){if(typeof s=="number")return s;if(zP(s))return Ug;if(hl(s)){var e=typeof s.valueOf=="function"?s.valueOf():s;s=hl(e)?e+"":e}if(typeof s!="string")return s===0?s:+s;s=s.replace(MP,"");var t=EP.test(s);return t||LP.test(s)?AP(s.slice(2),t?2:8):kP.test(s)?Ug:+s}var GP=UP;const Vv=en(GP);var ZP=Object.defineProperty,qP=Object.getOwnPropertyDescriptor,Bv=(s,e,t,r)=>{for(var i=r>1?void 0:r?qP(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&ZP(e,t,i),i};let pl=class extends L{constructor(){super(...arguments),this.el={is:{}}}mounted(){this.breakpoints&&this.$nextTick(()=>{this.observer=new ResizeObserver(Vv(this.onResize,50)),this.$el instanceof Element&&this.observer.observe(this.$el)})}beforeDestroy(){var s;this.$el instanceof Element&&((s=this.observer)==null||s.unobserve(this.$el))}onResize(s){if(s[0].contentRect.height===0&&s[0].contentRect.width===0)return;const e=s[0].contentRect,t=this.breakpoints;for(const r in t)this.$set(this.el.is,r,t[r](e))}};Bv([w()],pl.prototype,"breakpoints",2);pl=Bv([S],pl);var XP=Object.defineProperty,YP=Object.getOwnPropertyDescriptor,Uv=(s,e,t,r)=>{for(var i=r>1?void 0:r?YP(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&XP(e,t,i),i};let fl=class extends k(pl){constructor(){super(...arguments),this.init=!1}mounted(){this.init=!0}};Uv([w({default:!1})],fl.prototype,"noHide",2);fl=Uv([S],fl);var JP=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[!e.noHide&&!e.init?t("div",{staticStyle:{visibility:"hidden"}},[e._t("default",null,{el:e.el})],2):e._e(),e._t("default",null,{el:e.el})],2)},KP=[],QP=E(fl,JP,KP,!1,null,null);const tt=QP.exports;var e3=Object.getOwnPropertyDescriptor,t3=(s,e,t,r)=>{for(var i=r>1?void 0:r?e3(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Je=class extends y{get absolute_coordinates(){var s,e,t;return(t=(e=(s=this.$store.state.printer)==null?void 0:s.gcode_move)==null?void 0:e.absolute_coordinates)!=null?t:!0}get enableXYHoming(){return this.$store.state.gui.control.enableXYHoming}get feedrateXY(){var s,e;return(e=(s=this.$store.state.gui.control)==null?void 0:s.feedrateXY)!=null?e:100}get feedrateZ(){var s,e;return(e=(s=this.$store.state.gui.control)==null?void 0:s.feedrateZ)!=null?e:10}get existsQGL(){return this.$store.getters["printer/existsQGL"]}get existsZtilt(){return this.$store.getters["printer/existsZtilt"]}get existsBedTilt(){return this.$store.getters["printer/existsBedTilt"]}get existsBedScrews(){return this.$store.getters["printer/existsBedScrews"]}get existsDeltaCalibrate(){return this.$store.getters["printer/existsDeltaCalibrate"]}get existsScrewsTilt(){return this.$store.getters["printer/existsScrewsTilt"]}get existsFirmwareRetraction(){return this.$store.getters["printer/existsFirmwareRetraction"]}get colorQuadGantryLevel(){var e,t;return((t=(e=this.$store.state.printer.quad_gantry_level)==null?void 0:e.applied)!=null?t:!0)?"primary":"warning"}get colorZTilt(){var e,t;let s=!0;return"z_tilt"in this.$store.state.printer?s=(e=this.$store.state.printer.z_tilt)==null?void 0:e.applied:"z_tilt_ng"in this.$store.state.printer&&(s=(t=this.$store.state.printer.z_tilt_ng)==null?void 0:t.applied),s?"primary":"warning"}get defaultActionButton(){return this.$store.getters["gui/getDefaultControlActionButton"]}get actionButton(){var e;const s=(e=this.$store.state.gui.control.actionButton)!=null?e:this.defaultActionButton;return s==="qgl"&&!this.$store.getters["printer/existsQGL"]||s==="ztilt"&&!this.$store.getters["printer/existsZTilt"]?this.defaultActionButton:s}get homedAxes(){var s,e,t;return(t=(e=(s=this.$store.state.printer)==null?void 0:s.toolhead)==null?void 0:e.homed_axes)!=null?t:""}get xAxisHomed(){return this.homedAxes.includes("x")}get yAxisHomed(){return this.homedAxes.includes("y")}get zAxisHomed(){return this.homedAxes.includes("z")}get macros(){return this.$store.getters["printer/getMacros"]}get toolchangeMacros(){var t,r;const s=(i,n)=>{const a=parseInt(i.slice(1)),o=parseInt(n.slice(1));return a-o},e=(r=(t=this.$store.state.printer.gcode)==null?void 0:t.commands)!=null?r:null;return e?Object.keys(e).filter(i=>i.match(/^T\d+/)).sort(s):Object.keys(this.$store.state.printer).filter(i=>i.toLowerCase().match(/^gcode_macro t\d+/)).map(i=>i.slice(i.indexOf(" ")+1)).sort(s)}get existsClientLinearMoveMacro(){var e,t,r;return"_CLIENT_LINEAR_MOVE"in((r=(t=(e=this.$store.state.printer)==null?void 0:e.gcode)==null?void 0:t.commands)!=null?r:{})}doHome(){this.$store.dispatch("server/addEvent",{message:"G28",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"G28"},{loading:"homeAll"})}doHomeX(){this.$store.dispatch("server/addEvent",{message:"G28 X",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"G28 X"},{loading:"homeX"})}doHomeY(){this.$store.dispatch("server/addEvent",{message:"G28 Y",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"G28 Y"},{loading:"homeY"})}doHomeXY(){this.$store.dispatch("server/addEvent",{message:"G28 X Y",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"G28 X Y"},{loading:"homeXY"})}doHomeZ(){this.$store.dispatch("server/addEvent",{message:"G28 Z",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"G28 Z"},{loading:"homeZ"})}doQGL(){this.$store.dispatch("server/addEvent",{message:"QUAD_GANTRY_LEVEL",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"QUAD_GANTRY_LEVEL"},{loading:"qgl"})}doZtilt(){this.$store.dispatch("server/addEvent",{message:"Z_TILT_ADJUST",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"Z_TILT_ADJUST"},{loading:"zTilt"})}doSendMove(s,e){let t="SAVE_GCODE_STATE NAME=_ui_movement\nG91\nG1 ".concat(s," F").concat(e*60,"\nRESTORE_GCODE_STATE NAME=_ui_movement");this.existsClientLinearMoveMacro&&(s=s.split(" ").map(r=>{const i=r.slice(0,1),n=parseFloat(r.slice(1));return"".concat(i,"=").concat(n)}).join(" "),t="_CLIENT_LINEAR_MOVE ".concat(s," F=").concat(e*60)),this.doSend(t)}doSend(s){this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s})}};Je=t3([S],Je);var s3=Object.defineProperty,r3=Object.getOwnPropertyDescriptor,ef=(s,e,t,r)=>{for(var i=r>1?void 0:r?r3(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&s3(e,t,i),i};let ta=class extends k(L,Je){constructor(){super(...arguments),this.mdiRotateLeft=CS,this.mdiCloseThick=pe,this.mdiRotateRight=$S}get settings(){var s,e,t;return(t=(e=(s=this.$store.state.printer.configfile)==null?void 0:s.settings)==null?void 0:e.screws_tilt_adjust)!=null?t:{}}get outputName(){var s;return(s=this.settings[this.name+"_name"])!=null?s:"Unknown"}get coordinates(){var s;return(s=this.settings[this.name])!=null?s:[0,0]}get x(){var s;return(s=this.coordinates[0])!=null?s:0}get y(){var s;return(s=this.coordinates[1])!=null?s:0}get z(){return this.result.z.toFixed(3)}get subTitle(){return"(X: ".concat(this.x,", Y: ").concat(this.y,", Z: ").concat(this.z,")")}get sign(){var s;return(s=this.result.sign)!=null?s:""}get adjust(){var s;return(s=this.result.adjust)!=null?s:"00:00"}get is_base(){var s;return(s=this.result.is_base)!=null?s:!1}};ef([w({required:!0})],ta.prototype,"name",2);ef([w({required:!0})],ta.prototype,"result",2);ta=ef([S({components:{Panel:U,Responsive:tt,SettingsRow:j}})],ta);var i3=function(){var r;var e=this,t=e._self._c;return e._self._setupProxy,t(j,{attrs:{title:e.outputName,"sub-title":e.subTitle}},[(r=e.is_base)!=null&&r?t($s,{attrs:{label:"",small:""}},[e._v(e._s(e.$t("ScrewsTiltAdjust.Base")))]):t($s,{attrs:{label:"",small:""}},[e.sign==="CCW"?t(_,{attrs:{small:"",left:""}},[e._v(e._s(e.mdiRotateLeft))]):e._e(),e.sign==="CW"?t(_,{attrs:{small:"",left:""}},[e._v(e._s(e.mdiRotateRight))]):e._e(),e._v(" "+e._s(e.adjust)+" ")],1)],1)},n3=[],a3=E(ta,i3,n3,!1,null,null);const Wv=a3.exports;var o3=Object.getOwnPropertyDescriptor,l3=(s,e,t,r)=>{for(var i=r>1?void 0:r?o3(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let vm=class extends k(L,Je){constructor(){super(...arguments),this.mdiArrowCollapseDown=cu,this.mdiCloseThick=pe}get state(){var s;return(s=this.$store.state.printer.screws_tilt_adjust)!=null?s:{}}get error(){var s,e;return(e=(s=this.$store.state.printer.screws_tilt_adjust)==null?void 0:s.error)!=null?e:!1}get max_deviation(){var s,e;return(e=(s=this.$store.state.printer.screws_tilt_adjust)==null?void 0:s.max_deviation)!=null?e:null}get results(){var s,e;return(e=(s=this.$store.state.printer.screws_tilt_adjust)==null?void 0:s.results)!=null?e:{}}get showDialog(){return!this.boolScrewsTiltAdjustDialog||this.max_deviation!==null?!1:this.error||Object.keys(this.results).length}get boolScrewsTiltAdjustDialog(){var s;return(s=this.$store.state.gui.uiSettings.boolScrewsTiltAdjustDialog)!=null?s:!0}clearScrewsTiltAdjust(){this.$store.dispatch("printer/clearScrewsTiltAdjust")}async retryScrewsTiltAdjust(){var t,r;const e=[...(t=this.$store.state.server.events)!=null?t:[]].reverse().find(i=>i.type==="command"&&i.message.startsWith("SCREWS_TILT_CALCULATE"));await this.$store.dispatch("printer/clearScrewsTiltAdjust"),this.doSend((r=e==null?void 0:e.message)!=null?r:"SCREWS_TILT_CALCULATE")}};vm=l3([S({components:{TheScrewsTiltAdjustDialogEntry:Wv,Panel:U,Responsive:tt,SettingsRow:j}})],vm);var c3=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.showDialog,width:"400",persistent:"",fullscreen:e.isMobile}},[t(U,{staticStyle:{overflow:"hidden"},attrs:{title:e.$t("ScrewsTiltAdjust.Headline"),icon:e.mdiArrowCollapseDown,"card-class":"manual_probe-dialog","margin-bottom":!1,height:e.isMobile?0:548},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.clearScrewsTiltAdjust}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[e.error?t(Z,[t(x,[t(b,[t(it,{attrs:{border:"left",text:"",type:"error"}},[e._v(e._s(e.$t("ScrewsTiltAdjust.ErrorText")))])],1)],1)],1):e._e(),Object.keys(e.results).length?t(Z,[e._l(e.results,function(r,i,n){return[n?t(I,{key:"result-divider-".concat(i),staticClass:"my-1"}):e._e(),t(Wv,{key:"result-".concat(i,"-").concat(i),attrs:{name:i.toString(),result:r}})]})],2):e._e(),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.retryScrewsTiltAdjust}},[e._v(" "+e._s(e.$t("ScrewsTiltAdjust.Retry"))+" ")]),t(g,{attrs:{color:"primary",text:""},on:{click:e.clearScrewsTiltAdjust}},[e._v(" "+e._s(e.$t("ScrewsTiltAdjust.Accept"))+" ")])],1)],1)],1)},u3=[],d3=E(vm,c3,u3,!1,null,null);const zv=d3.exports;var m3=Object.getOwnPropertyDescriptor,h3=(s,e,t,r)=>{for(var i=r>1?void 0:r?m3(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let bm=class extends k(L,Je){constructor(){super(...arguments),this.mdiArrowCollapseDown=cu,this.mdiInformation=Ht,this.mdiCloseThick=pe}get showDialog(){var e,t;return this.boolBedScrewsDialog?((t=(e=this.$store.state.printer.bed_screws)==null?void 0:e.is_active)!=null?t:!1)&&this.homedAxes.includes("xyz"):!1}get boolBedScrewsDialog(){var s;return(s=this.$store.state.gui.uiSettings.boolBedScrewsDialog)!=null?s:!0}get config(){var s,e,t;return(t=(e=(s=this.$store.state.printer.configfile)==null?void 0:s.settings)==null?void 0:e.bed_screws)!=null?t:{}}get bed_screws_state(){var s;return(s=this.$store.state.printer.bed_screws)==null?void 0:s.state}get current_screw(){var s;return(s=this.$store.state.printer.bed_screws)==null?void 0:s.current_screw}get accepted_screws(){var s;return(s=this.$store.state.printer.bed_screws)==null?void 0:s.accepted_screws}get loadingAbort(){return this.loadings.includes("bedScrewsAbort")}get loadingAccept(){return this.loadings.includes("bedScrewsAccept")}get loadingAdjusted(){return this.loadings.includes("bedScrewsAdjusted")}get screwNames(){const e=Object.keys(this.config).filter(r=>r.startsWith("screw")&&r.endsWith("_name")),t=[];return e==null||e.forEach(r=>{var a;const i=r.indexOf("_"),n=parseInt(r.slice(5,i));t[n-1]=(a=this.config["screw".concat(n,"_name")])!=null?a:""}),t}get countScrews(){return this.screwNames.length}get currentScrewName(){var s;return(s=this.screwNames[this.current_screw])!=null?s:"UNKNOWN"}get currentScrewOutput(){return this.$t("BedScrews.ScrewOutput",{current:this.current_screw,max:this.countScrews})}get acceptedScrewOutput(){return this.$t("BedScrews.ScrewOutput",{current:this.accepted_screws,max:this.countScrews})}sendAbort(){const s="ABORT";this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s},{loading:"manualProbeAbort"})}sendAccept(){const s="ACCEPT";this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s},{loading:"manualProbeAccept"})}sendAdjusted(){const s="ADJUSTED";this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s},{loading:"manualProbeAccept"})}};bm=h3([S({components:{Panel:U,Responsive:tt}})],bm);var p3=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.showDialog,width:"400",persistent:"",fullscreen:e.isMobile}},[t(U,{staticStyle:{overflow:"hidden"},attrs:{title:e.$t("BedScrews.Headline").toString(),icon:e.mdiArrowCollapseDown,"card-class":"manual_probe-dialog","margin-bottom":!1,height:e.isMobile?0:548},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.sendAbort}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(x,[t(b,[t(se,{attrs:{label:e.$t("BedScrews.ScrewName"),outlined:"",dense:"",clearable:"","hide-details":""},model:{value:e.currentScrewName,callback:function(r){e.currentScrewName=r},expression:"currentScrewName"}})],1)],1),t(x,[t(b,{attrs:{cols:"6"}},[t(se,{attrs:{label:e.$t("BedScrews.ScrewIndex"),outlined:"",dense:"",clearable:"","hide-details":""},model:{value:e.currentScrewOutput,callback:function(r){e.currentScrewOutput=r},expression:"currentScrewOutput"}})],1),t(b,{attrs:{cols:"6"}},[t(se,{attrs:{label:e.$t("BedScrews.ScrewAccepted"),outlined:"",dense:"",clearable:"","hide-details":""},model:{value:e.acceptedScrewOutput,callback:function(r){e.acceptedScrewOutput=r},expression:"acceptedScrewOutput"}})],1)],1),t(x,[t(b,[t("p",{staticClass:"text-center mb-0",domProps:{innerHTML:e._s(e.$t("BedScrews.Description"))}})])],1)],1),t(oe,[t(ae),t(g,{attrs:{text:"",loading:e.loadingAbort},on:{click:e.sendAbort}},[e._v(" "+e._s(e.$t("BedScrews.Abort"))+" ")]),t(g,{attrs:{color:"primary",text:"",loading:e.loadingAdjusted},on:{click:e.sendAdjusted}},[e._v(" "+e._s(e.$t("BedScrews.Adjusted"))+" ")]),t(g,{attrs:{color:"primary",text:"",loading:e.loadingAccept},on:{click:e.sendAccept}},[e._v(" "+e._s(e.$t("BedScrews.Accept"))+" ")])],1)],1)],1)},f3=[],g3=E(bm,p3,f3,!1,null,"8e6140c4");const Gv=g3.exports;var _3=Object.defineProperty,v3=Object.getOwnPropertyDescriptor,Ya=(s,e,t,r)=>{for(var i=r>1?void 0:r?v3(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&_3(e,t,i),i};let Nr=class extends k(L){get expand(){return this.$store.getters["gui/getPanelExpand"](this.subPanelClass,this.viewport)}set expand(s){this.$store.dispatch("gui/saveExpandPanel",{name:this.subPanelClass,value:s,viewport:this.viewport})}};Ya([w({required:!1,default:fr})],Nr.prototype,"iconExpanded",2);Ya([w({required:!1,default:fr})],Nr.prototype,"iconCollapsed",2);Ya([w({required:!0,default:""})],Nr.prototype,"title",2);Ya([w({required:!0})],Nr.prototype,"subPanelClass",2);Nr=Ya([S],Nr);var b3=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t("div",{staticClass:"px-3 d-flex align-center"},[t(g,{staticClass:"px-0 btn-collapsible",attrs:{plain:"",small:"",ripple:!1},on:{click:function(r){e.expand=!e.expand}}},[t(_,{class:e.expand?"":"icon-rotate-n90",attrs:{small:""}},[e._v(" "+e._s(e.expand?e.iconExpanded:e.iconCollapsed)+" ")]),t("span",{staticClass:"pl-1"},[e._v(e._s(e.title))])],1),t(I,{staticClass:"ml-3"})],1),t(iu,[t("div",{directives:[{name:"show",rawName:"v-show",value:e.expand,expression:"expand"}]},[e._t("default")],2)])],1)},y3=[],C3=E(Nr,b3,y3,!1,null,"fed68b4f");const $3=C3.exports;var x3=Object.getOwnPropertyDescriptor,w3=(s,e,t,r)=>{for(var i=r>1?void 0:r?x3(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let ym=class extends k(L){constructor(){super(...arguments),this.mdiArrowCollapseDown=cu,this.mdiArrowExpandUp=z_,this.mdiInformation=Ht,this.mdiPlusThick=mS,this.mdiMinusThick=nS,this.mdiChevronTripleLeft=Dw,this.mdiChevronTripleRight=Tw,this.mdiCloseThick=pe}get showDialog(){var s,e;return this.boolManualProbeDialog&&(e=(s=this.$store.state.printer.manual_probe)==null?void 0:s.is_active)!=null?e:!1}get boolManualProbeDialog(){var s;return(s=this.$store.state.gui.uiSettings.boolManualProbeDialog)!=null?s:!0}get offsetsZ(){return[1,.1,.05,.01,.005].sort()}get z_position(){var s,e;return((e=(s=this.$store.state.printer.manual_probe)==null?void 0:s.z_position)!=null?e:0).toFixed(3)}get z_position_lower(){var e,t;const s=(t=(e=this.$store.state.printer.manual_probe)==null?void 0:e.z_position_lower)!=null?t:null;return s===null?"??????":s.toFixed(3)}get z_position_upper(){var e,t;const s=(t=(e=this.$store.state.printer.manual_probe)==null?void 0:e.z_position_upper)!=null?t:null;return s===null?"??????":s.toFixed(3)}get loadingAbort(){return this.loadings.includes("manualProbeAbort")}get loadingAccept(){return this.loadings.includes("manualProbeAccept")}sendTestZ(s){const e="TESTZ Z=".concat(s);this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e})}sendAbort(){const s="ABORT";this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s},{loading:"manualProbeAbort"})}sendAccept(){const s="ACCEPT";this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s},{loading:"manualProbeAccept"})}};ym=w3([S({components:{Panel:U,Responsive:tt}})],ym);var S3=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.showDialog,width:"400",persistent:"",fullscreen:e.isMobile}},[t(U,{staticStyle:{overflow:"hidden"},attrs:{title:e.$t("ManualProbe.Headline").toString(),icon:e.mdiArrowCollapseDown,"card-class":"manual_probe-dialog","margin-bottom":!1,height:e.isMobile?0:548},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.sendAbort}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Ee,[t(x,[t(b,{staticClass:"d-flex align-center justify-center"},[t("span",{staticClass:"text-h5"},[e._v(e._s(e.z_position_lower))]),t(_,{staticClass:"mx-2"},[e._v(e._s(e.mdiChevronTripleRight))]),t("span",{staticClass:"text-h4"},[e._v(e._s(e.z_position))]),t(_,{staticClass:"mx-2"},[e._v(e._s(e.mdiChevronTripleLeft))]),t("span",{staticClass:"text-h5"},[e._v(e._s(e.z_position_upper))])],1)],1),t(x,[t(b,{staticClass:"text-left"},[t(g,{attrs:{color:"primary"},on:{click:function(r){return e.sendTestZ("--")}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiMinusThick))]),t(_,{attrs:{small:""}},[e._v(e._s(e.mdiMinusThick))])],1)],1),t(b,{staticClass:"text-left"},[t(g,{attrs:{color:"primary"},on:{click:function(r){return e.sendTestZ("-")}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiMinusThick))])],1)],1),t(b,{staticClass:"text-right"},[t(g,{attrs:{color:"primary"},on:{click:function(r){return e.sendTestZ("+")}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiPlusThick))])],1)],1),t(b,{staticClass:"text-right"},[t(g,{attrs:{color:"primary"},on:{click:function(r){return e.sendTestZ("++")}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiPlusThick))]),t(_,{attrs:{small:""}},[e._v(e._s(e.mdiPlusThick))])],1)],1)],1)],1),t($3,{staticClass:"mb-n2",attrs:{title:e.$t("ManualProbe.Advanced"),"sub-panel-class":"manual-probe-dialog-advanced"}},[t(Ee,[t(Wt,{staticClass:"_btn-group"},e._l(e.offsetsZ,function(r,i){return t(g,{key:"offsetsUp-".concat(i),staticClass:"_btn-qs flex-grow-1 px-1",attrs:{small:""},on:{click:function(n){e.sendTestZ(r.toString())}}},[i===0?t(_,{staticClass:"mr-1 ml-n1",attrs:{left:"",small:""}},[e._v(" "+e._s(e.mdiArrowExpandUp)+" ")]):e._e(),t("span",[e._v("+"+e._s(r))])],1)}),1),t(Wt,{staticClass:"_btn-group mt-6 mt-sm-3"},e._l(e.offsetsZ,function(r,i){return t(g,{key:"offsetsDown-".concat(i),staticClass:"_btn-qs flex-grow-1 px-1",attrs:{small:""},on:{click:function(n){e.sendTestZ((r*-1).toString())}}},[i===0?t(_,{staticClass:"mr-1 ml-n1",attrs:{left:"",small:""}},[e._v(" "+e._s(e.mdiArrowCollapseDown)+" ")]):e._e(),t("span",[e._v("−"+e._s(r))])],1)}),1)],1)],1),t(oe,[t(ae),t(g,{attrs:{text:"",loading:e.loadingAbort},on:{click:e.sendAbort}},[e._v(" "+e._s(e.$t("ManualProbe.Abort"))+" ")]),t(g,{attrs:{color:"primary",text:"",loading:e.loadingAccept},on:{click:e.sendAccept}},[e._v(" "+e._s(e.$t("ManualProbe.Accept"))+" ")])],1)],1)],1)},P3=[],D3=E(ym,S3,P3,!1,null,"eed61d3e");const Zv=D3.exports,tf=(s,e)=>{e!==null&&typeof e=="object"&&Object.keys(e).forEach(t=>{const r=e[t];typeof r=="object"&&!Array.isArray(r)&&t in s&&r!==null&&s[t]!==null?tf(s[t],r):y.set(s,t,r)})},Nt=(s,e)=>{if(s!=null&&e.length){const t=s==null?void 0:s.find(r=>r.isDirectory&&r.filename===e[0]);if(t){if(e.shift(),t.childrens&&e.length)return Nt(t.childrens,e);if(t.childrens)return t.childrens}return s}return null},Ft=(s,e)=>s.sort((t,r)=>{const i=t[e].toLowerCase(),n=r[e].toLowerCase();return in?1:0}),lr=s=>s.charAt(0).toUpperCase()+s.slice(1),T3=s=>s.replace(/_/g," ").replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>t===0?e.toLowerCase():e.toUpperCase()).replace(/\s+/g,"");function sf(s){return s=s.replace(/^!! /g,""),s=s.replace(/\n!! /g,"\n"),s=s.replace(/^\/\/ /g,""),s=s.replace(/\n\/\/ /g,"\n"),s=s.replace(/^echo:/g,""),s=s.replace(/^debug:/g,""),s=s.replace("\n// ","
"),s=s.replace(/\r\n|\r|\n/g,"
"),s.trim()}const Ye=s=>{let e="";return s=s.replace(/_/g," "),s.split(" ").forEach(t=>{e+=" "+t.charAt(0).toUpperCase()+t.slice(1)}),e=e.slice(1),e},Xe=s=>{let e=-1;const t=[" kB"," MB"," GB"," TB"," PB"," EB"," ZB"," YB"];do s=s/1024,e++;while(s>1024);return Math.max(s,.1).toFixed(1)+t[e]},O3=s=>{let e=-1;const t=[" kHz"," MHz"," GHz"];do s=s/1e3,e++;while(s>1e3);return Math.max(s,.1).toFixed()+t[e]},Is=(s,e=!0)=>{if(!s)return"--";const t=[];if(e){const a=Math.floor(s/86400);a&&(s%=3600*24,t.push("".concat(a,"d")))}const r=Math.floor(s/3600);s%=3600,r&&t.push("".concat(r,"h"));const i=Math.floor(s/60);i&&t.push("".concat(i,"m"));const n=s%60;return n&&t.push("".concat(n.toFixed(0),"s")),t.join(" ")},rf=(s,e,t)=>{const r=e.length?e[0]:"filename",i=t[0];return s!==null&&(s.sort(function(n,a){if(n[r]===a[r])return 0;if(n[r]===null||n[r]===void 0)return-1;if(a[r]===null||a[r]===void 0)return 1;if(n[r].constructor===String&&a[r].constructor===String)return n[r].localeCompare(a[r],void 0,{sensivity:"base"});if(n[r]instanceof Array&&a[r]instanceof Array){const o=n[r].length?n.filament.reduce((u,c)=>u+c):0,l=a[r].length?a.filament.reduce((u,c)=>u+c):0;return o-l}return n[r]-a[r]}),i&&s.reverse(),s.sort((n,a)=>n.isDirectory===a.isDirectory?0:n.isDirectory?-1:1)),s!=null?s:[]};function M3(s,e){var i,n;const t=Math.min((i=s==null?void 0:s.length)!=null?i:Number.MAX_VALUE,(n=e==null?void 0:e.length)!=null?n:Number.MAX_VALUE);let r=0;for(;rencodeURIComponent(e)).join("/")}const Xv=s=>{var e;return(e={wh:Co,kwh:Co,mwh:Co,j:Co,w:Vg,v:Vg,a:iS,"°c":fi,c:fi,"°f":fi,f:fi,"°":fi,g:xS}[s==null?void 0:s.toLowerCase()])!=null?e:Jw};var L3=Object.defineProperty,A3=Object.getOwnPropertyDescriptor,Yv=(s,e,t,r)=>{for(var i=r>1?void 0:r?A3(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&L3(e,t,i),i};let gl=class extends k(L){constructor(){super(...arguments),this.mdiClose=Ba,this.formatFilesize=Xe}get show(){var s;return(s=this.$store.state.files.upload.show)!=null?s:!1}get cancelTokenSource(){return this.$store.state.files.upload.cancelTokenSource}get filename(){var s;return(s=this.$store.state.files.upload.filename)!=null?s:""}get currentNumber(){var s;return(s=this.$store.state.files.upload.currentNumber)!=null?s:0}get maxNumber(){var s;return(s=this.$store.state.files.upload.maxNumber)!=null?s:0}get speed(){var s;return Xe(Math.round((s=this.$store.state.files.upload.speed)!=null?s:0))}get percent(){var s;return Math.round((s=this.$store.state.files.upload.percent)!=null?s:0)}cancelUpload(){var s;(s=this.cancelTokenSource)==null||s.cancel(),this.$store.dispatch("files/uploadSetShow",!1),this.$store.dispatch("socket/removeLoading",{name:"gcodeUpload"}),this.$store.dispatch("socket/removeLoading",{name:"configFileUpload"})}showChanged(s){const e=document.getElementsByTagName("body")[0];s?e.classList.add("fullscreenUpload--active"):e.classList.remove("fullscreenUpload--active")}};Yv([he("show")],gl.prototype,"showChanged",1);gl=Yv([S({components:{}})],gl);var F3=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.show?t(xi,{attrs:{timeout:-1,value:!0,fixed:"",right:"",bottom:""},scopedSlots:e._u([{key:"action",fn:function({attrs:r}){return[t(g,e._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:""},on:{click:e.cancelUpload}},"v-btn",r,!1),[t(_,{staticClass:"0"},[e._v(e._s(e.mdiClose))])],1)]}}],null,!1,2940317734)},[e.maxNumber>1?t("span",{staticClass:"mr-1"},[e._v("("+e._s(e.currentNumber)+"/"+e._s(e.maxNumber)+")")]):e._e(),t("strong",[e._v(e._s(e.$t("Editor.Uploading")+" "+e.filename))]),t("br"),e._v(" "+e._s(e.percent)+" % @ "+e._s(e.speed)+"/s "),t("br"),t(Ss,{staticClass:"mt-2",attrs:{value:e.percent}})],1):e._e()},R3=[],H3=E(gl,F3,R3,!1,null,null);const Jv=H3.exports;var j3=Object.getOwnPropertyDescriptor,I3=(s,e,t,r)=>{for(var i=r>1?void 0:r?j3(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let $m=class extends k(L){constructor(){super(...arguments),this.mdiTrayArrowDown=MS,this.visible=!1}get dropzoneClasses(){return{"fullscreen-upload__dragzone--visible":this.visible}}get currentRoute(){var s;return(s=this.$route.path)!=null?s:""}get currentPathGcodes(){var s;return(s=this.$store.state.gui.view.gcodefiles.currentPath)!=null?s:""}get currentPathConfig(){var s;return(s=this.$store.state.gui.view.configfiles.currentPath)!=null?s:""}mounted(){window.addEventListener("dragenter",this.onDragOverWindow),window.addEventListener("dragover",this.onDragOverWindow),window.addEventListener("dragleave",this.onDragLeaveWindow)}beforeDestroy(){window.removeEventListener("dragenter",this.onDragOverWindow),window.removeEventListener("dragover",this.onDragOverWindow),window.removeEventListener("dragleave",this.onDragLeaveWindow)}showDropZone(){this.visible=!0}hideDropZone(){this.visible=!1}onDragOverWindow(s){var t,r;((r=(t=s.dataTransfer)==null?void 0:t.types)!=null?r:[]).includes("Files")&&(s.preventDefault(),!this.visible&&this.showDropZone())}onDragLeaveWindow(s){s.preventDefault(),this.hideDropZone()}async onDrop(s){var e,t;if(s.preventDefault(),this.hideDropZone(),(t=(e=s.dataTransfer)==null?void 0:e.files)!=null&&t.length){const r=[...s.dataTransfer.files];await this.$store.dispatch("socket/addLoading",{name:"gcodeUpload"}),await this.$store.dispatch("files/uploadSetCurrentNumber",0),await this.$store.dispatch("files/uploadSetMaxNumber",r.length);for(const i of r){const n=i.name.lastIndexOf("."),a=i.name.slice(n),o=Pi.includes(a);let l="";this.currentRoute==="/files"&&o?l=this.currentPathGcodes:this.currentRoute==="/config"&&!o&&(l=this.currentPathConfig);const u=o?"gcodes":"config";await this.$store.dispatch("files/uploadIncrementCurrentNumber");const c=await this.$store.dispatch("files/uploadFile",{file:i,path:l,root:u});c!==!1&&this.$toast.success(this.$t("Files.SuccessfullyUploaded",{filename:c}).toString())}await this.$store.dispatch("socket/removeLoading",{name:"gcodeUpload"})}}};$m=I3([S],$m);var N3=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"d-flex justify-center flex-column fullscreen-upload__dragzone",class:e.dropzoneClasses,on:{drop:e.onDrop}},[t(_,{staticClass:"fullscreen-upload__icon"},[e._v(e._s(e.mdiTrayArrowDown))]),t("div",{staticClass:"textnode"},[e._v(e._s(e.$t("FullscreenUpload.DropFilesToUploadFiles")))])],1)},V3=[],B3=E($m,N3,V3,!1,null,null);const Kv=B3.exports;var U3=Object.getOwnPropertyDescriptor,W3=(s,e,t,r)=>{for(var i=r>1?void 0:r?U3(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let xm=class extends k(L){get boolShowDialogRunning(){return this.status==="running"}get boolShowDialogSuccess(){return this.status==="success"}set boolShowDialogSuccess(s){s||this.$store.dispatch("server/timelapse/resetSnackbar")}get status(){var s;return(s=this.$store.state.server.timelapse.rendering.status)!=null?s:""}get progress(){var s;return(s=this.$store.state.server.timelapse.rendering.progress)!=null?s:""}get filename(){var s;return(s=this.$store.state.server.timelapse.rendering.filename)!=null?s:""}};xm=W3([S({components:{}})],xm);var z3=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(xi,{attrs:{timeout:-1,value:!0,fixed:"",right:"",bottom:""},model:{value:e.boolShowDialogRunning,callback:function(r){e.boolShowDialogRunning=r},expression:"boolShowDialogRunning"}},[t("div",[e._v(e._s(e.$t("Timelapse.TimelapseRendering"))+"...")]),e.progress>0?t(Ss,{staticClass:"mt-2",attrs:{value:e.progress,indeterminate:""}}):e._e(),e.progress===0?t(Ss,{staticClass:"mt-2",attrs:{indeterminate:""}}):e._e()],1),t(xi,{attrs:{timeout:5e3,value:!0,fixed:"",right:"",bottom:""},model:{value:e.boolShowDialogSuccess,callback:function(r){e.boolShowDialogSuccess=r},expression:"boolShowDialogSuccess"}},[t("div",[e._v(" "+e._s(e.$t("Timelapse.TimelapseRenderingSuccessful"))+" "),t("br"),t("strong",[e._v(e._s(e.filename))])])])],1)},G3=[],Z3=E(xm,z3,G3,!1,null,null);const Qv=Z3.exports;let $o;const q3=new Uint8Array(16);function X3(){if(!$o&&($o=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!$o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $o(q3)}const ct=[];for(let s=0;s<256;++s)ct.push((s+256).toString(16).slice(1));function Y3(s,e=0){return ct[s[e+0]]+ct[s[e+1]]+ct[s[e+2]]+ct[s[e+3]]+"-"+ct[s[e+4]]+ct[s[e+5]]+"-"+ct[s[e+6]]+ct[s[e+7]]+"-"+ct[s[e+8]]+ct[s[e+9]]+"-"+ct[s[e+10]]+ct[s[e+11]]+ct[s[e+12]]+ct[s[e+13]]+ct[s[e+14]]+ct[s[e+15]]}const J3=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),zg={randomUUID:J3};function ds(s,e,t){if(zg.randomUUID&&!s)return zg.randomUUID();s=s||{};const r=s.random||(s.rng||X3)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Y3(r)}var K3=Object.defineProperty,Q3=Object.getOwnPropertyDescriptor,nf=(s,e,t,r)=>{for(var i=r>1?void 0:r?Q3(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&K3(e,t,i),i};let sa=class extends k(L){constructor(){super(...arguments),this.mdiContentCopy=Fp,this.isShowTooltip=!1,this.cssClassName=""}mounted(){this.cssClassName="textfield-with-copy-".concat(ds())}copy(){E3(this.value),this.isShowTooltip=!0,setTimeout(()=>this.isShowTooltip=!1,2e3)}};nf([w({type:String,required:!0})],sa.prototype,"label",2);nf([w({type:String,required:!0})],sa.prototype,"value",2);sa=nf([S],sa);var eD=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(se,{class:e.cssClassName,attrs:{readonly:"",dense:"",outlined:"","hide-details":"",label:e.label,value:e.value},scopedSlots:e._u([{key:"append",fn:function(){return[t(_,{on:{click:e.copy}},[e._v(e._s(e.mdiContentCopy))]),t(de,{attrs:{"open-on-click":"","open-on-hover":!1,attach:"."+e.cssClassName,"position-x":50,"position-y":0},model:{value:e.isShowTooltip,callback:function(r){e.isShowTooltip=r},expression:"isShowTooltip"}},[t("span",[e._v(e._s(e.$t("App.TextfieldWithCopy.Copied")))])])]},proxy:!0}])})},tD=[],sD=E(sa,eD,tD,!1,null,"8d851db2");const Kt=sD.exports;var rD=Object.defineProperty,iD=Object.getOwnPropertyDescriptor,eb=(s,e,t,r)=>{for(var i=r>1?void 0:r?iD(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&rD(e,t,i),i};let _l=class extends k(L){get identicalResolutions(){const s=this.device.modes.map(e=>e.resolutions.sort(qv).join(","));return s.every(e=>e===s[0])}get resolutions(){var s,e,t;return(t=(e=(s=this.device.modes[0])==null?void 0:s.resolutions)==null?void 0:e.join(", "))!=null?t:""}get formats(){return this.device.modes.map(s=>"".concat(s.description," (").concat(s.format,")")).join(", ")}get show_alt_name(){return this.device.alt_name===null?!1:this.device.alt_name!==this.device.camera_name}};eb([w({type:Object,required:!0})],_l.prototype,"device",2);_l=eb([S({components:{TextfieldWithCopy:Kt}})],_l);var nD=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{staticClass:"mt-3 w-100",attrs:{outlined:""}},[t(J,{attrs:{"three-line":""}},[t(_t,[t("div",{staticClass:"text-overline mb-2 d-flex flex-row"},[e._v("V4L2")]),t(Ze,{staticClass:"text-h5 mb-0"},[e._v(e._s(e.device.camera_name))]),e.show_alt_name?t(Va,[e._v(e._s(e.device.alt_name))]):e._e()],1)],1),t(Z,[t(x,[t(b,[t(Kt,{attrs:{label:e.$t("DevicesDialog.DevicePath"),value:e.device.device_path}})],1)],1),e.device.path_by_id?t(x,[t(b,[t(Kt,{attrs:{label:e.$t("DevicesDialog.PathById"),value:e.device.path_by_id}})],1)],1):e._e(),e.device.path_by_hardware?t(x,[t(b,[t(Kt,{attrs:{label:e.$t("DevicesDialog.PathByHardware"),value:e.device.path_by_hardware}})],1)],1):e._e(),e.device.modes.length?[e.identicalResolutions?[t(x,{staticClass:"mt-0"},[t(b,{staticClass:"py-2",attrs:{cols:"4"}},[e._v(e._s(e.$t("DevicesDialog.Formats")))]),t(b,{staticClass:"py-2"},[e._v(e._s(e.formats))])],1),t(x,{staticClass:"mt-0"},[t(b,{staticClass:"py-2",attrs:{cols:"4"}},[e._v(e._s(e.$t("DevicesDialog.Resolutions")))]),t(b,{staticClass:"py-2"},[e._v(e._s(e.resolutions))])],1)]:e._l(e.device.modes,function(r){return t(x,{key:r.format,staticClass:"mt-0"},[t(b,{staticClass:"py-2",attrs:{cols:"4"}},[e._v(" "+e._s(r.description)+" "),t("br"),t("small",[e._v(e._s(r.format))])]),t(b,{staticClass:"py-2"},[e._v(e._s(r.resolutions.join(", ")))])],1)})]:e._e()],2)],1)},aD=[],oD=E(_l,nD,aD,!1,null,null);const lD=oD.exports;var cD=Object.defineProperty,uD=Object.getOwnPropertyDescriptor,tb=(s,e,t,r)=>{for(var i=r>1?void 0:r?uD(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&cD(e,t,i),i};let vl=class extends k(L){get identicalResolutions(){const s=this.device.modes.map(e=>e.resolutions.sort(qv).join(","));return s.every(e=>e===s[0])}get resolutions(){return this.device.modes[0].resolutions.join(", ")}get formats(){return this.device.modes.map(s=>s.format).join(", ")}};tb([w({type:Object,required:!0})],vl.prototype,"device",2);vl=tb([S({components:{TextfieldWithCopy:Kt}})],vl);var dD=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{staticClass:"mt-3 w-100",attrs:{outlined:""}},[t(J,{attrs:{"three-line":""}},[t(_t,[t("div",{staticClass:"text-overline mb-2 d-flex flex-row"},[e._v("Libcamera")]),t(Ze,{staticClass:"text-h5 mb-0"},[e._v(e._s(e.device.model))])],1)],1),t(Z,[t(x,{staticClass:"mb-1"},[t(b,[t(Kt,{attrs:{label:e.$t("DevicesDialog.LibcameraId"),value:e.device.libcamera_id}})],1)],1),e.identicalResolutions?[t(x,{staticClass:"mt-0"},[t(b,{staticClass:"py-2",attrs:{cols:"4"}},[e._v(e._s(e.$t("DevicesDialog.Formats")))]),t(b,{staticClass:"py-2"},[e._v(e._s(e.formats))])],1),t(x,{staticClass:"mt-0"},[t(b,{staticClass:"py-2",attrs:{cols:"4"}},[e._v(e._s(e.$t("DevicesDialog.Resolutions")))]),t(b,{staticClass:"py-2"},[e._v(e._s(e.resolutions))])],1)]:e._l(e.device.modes,function(r){return t(x,{key:r.format,staticClass:"mt-0"},[t(b,{staticClass:"py-2",attrs:{cols:"4"}},[e._v(e._s(r.format))]),t(b,{staticClass:"py-2"},[e._v(e._s(r.resolutions.join(", ")))])],1)})],2)],1)},mD=[],hD=E(vl,dD,mD,!1,null,null);const pD=hD.exports;var fD=Object.defineProperty,gD=Object.getOwnPropertyDescriptor,sb=(s,e,t,r)=>{for(var i=r>1?void 0:r?gD(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&fD(e,t,i),i};let bl=class extends k(L){constructor(){super(...arguments),this.v4l2Devices=[],this.libcameraDevices=[],this.loading=!1,this.loaded=!1}get filteredLibcameraDevices(){return this.hideSystemEntries?this.libcameraDevices.filter(s=>!s.libcamera_id.includes("usb@")):this.libcameraDevices}get filteredV4l2Devices(){return this.v4l2Devices.filter(s=>this.hideSystemEntries?this.libcameraDevices.length===0&&s.hardware_bus.endsWith("csi")?!0:!s.hardware_bus.startsWith("platform:"):!0)}async refresh(){var e,t;this.loading=!0;const s=await fetch(this.apiUrl+"/machine/peripherals/video").then(r=>r.json()).then(r=>{var i;return(i=r.result)!=null?i:{}});this.v4l2Devices=(e=s.v4l2_devices)!=null?e:[],this.libcameraDevices=(t=s.libcamera_devices)!=null?t:[],this.loading=!1,this.loaded=!0}};sb([w({type:Boolean,default:!1})],bl.prototype,"hideSystemEntries",2);bl=sb([S],bl);var _D=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Z,[t(x,[t(b,{staticClass:"text-center"},[t(g,{attrs:{loading:e.loading,color:"primary"},on:{click:e.refresh}},[e._v(e._s(e.$t("DevicesDialog.Refresh")))])],1)],1),e.libcameraDevices.length||e.filteredV4l2Devices.length?t(x,{staticClass:"mt-0"},[t(b,[e._l(e.filteredLibcameraDevices,function(r,i){return t(pD,{key:"libcamera_".concat(r.libcamera_id,"_").concat(i),attrs:{device:r}})}),e._l(e.filteredV4l2Devices,function(r,i){return t(lD,{key:"v4l2_".concat(r.hardware_bus,"_").concat(i),attrs:{device:r}})})],2)],1):e.loaded?t(x,{staticClass:"mt-0"},[t(b,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.NoDeviceFound")))])])],1):t(x,{staticClass:"mt-0"},[t(b,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.ClickRefresh")))])])],1)],1)},vD=[],bD=E(bl,_D,vD,!1,null,"dcdc8e37");const yD=bD.exports;var CD=Object.defineProperty,$D=Object.getOwnPropertyDescriptor,rb=(s,e,t,r)=>{for(var i=r>1?void 0:r?$D(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&CD(e,t,i),i};let yl=class extends k(L){get details(){const s=["protocol","class","serial","usb_location"],e=[];return Object.keys(this.device).forEach(t=>{var i;let r=(i=this.device[t])!=null?i:null;!s.includes(t)||r===null||(t==="class"&&this.device.subclass&&(r+=", ".concat(this.device.subclass)),e.push({key:t,value:r}))}),e}};rb([w({type:Object,required:!0})],yl.prototype,"device",2);yl=rb([S],yl);var xD=function(){var r,i;var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{staticClass:"mt-3",attrs:{outlined:""}},[t(J,{attrs:{"three-line":""}},[t(_t,[t("div",{staticClass:"text-overline mb-2 d-flex flex-row"},[t("span",[e._v(e._s((r=e.device.manufacturer)!=null?r:"Unknown"))]),t(ae),t("span",[e._v(e._s(e.device.vendor_id)+":"+e._s(e.device.product_id))])],1),t(Ze,{staticClass:"text-h5 mb-1"},[e._v(e._s((i=e.device.product)!=null?i:"Unknown"))]),e.device.description?t(Va,[e._v(e._s(e.device.description))]):e._e()],1)],1),t(Z,{staticClass:"pt-0"},e._l(e.details,function(n){return t(x,{key:n.key,staticClass:"mt-0"},[t(b,{staticClass:"py-2",attrs:{cols:"3"}},[e._v(e._s(n.key))]),t(b,{staticClass:"py-2"},[e._v(e._s(n.value))])],1)}),1)],1)},wD=[],SD=E(yl,xD,wD,!1,null,null);const PD=SD.exports;var DD=Object.defineProperty,TD=Object.getOwnPropertyDescriptor,ib=(s,e,t,r)=>{for(var i=r>1?void 0:r?TD(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&DD(e,t,i),i};let Cl=class extends k(L){constructor(){super(...arguments),this.devices=[],this.loading=!1,this.loaded=!1}get filteredDevices(){return this.hideSystemEntries?this.devices.filter(s=>s.class!=="Hub"):this.devices}async refresh(){this.loading=!0,this.devices=await fetch(this.apiUrl+"/machine/peripherals/usb").then(s=>s.json()).then(s=>{var e,t;return(t=(e=s.result)==null?void 0:e.usb_devices)!=null?t:[]}),this.loading=!1,this.loaded=!0}};ib([w({type:Boolean,default:!1})],Cl.prototype,"hideSystemEntries",2);Cl=ib([S],Cl);var OD=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Z,[t(x,[t(b,{staticClass:"text-center"},[t(g,{attrs:{loading:e.loading,color:"primary"},on:{click:e.refresh}},[e._v(e._s(e.$t("DevicesDialog.Refresh")))])],1)],1),e.filteredDevices.length?t(x,{staticClass:"mt-0"},[t(b,e._l(e.filteredDevices,function(r){return t(PD,{key:r.usb_location,attrs:{device:r}})}),1)],1):e.loaded?t(x,{staticClass:"mt-0"},[t(b,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.NoDeviceFound")))])])],1):t(x,{staticClass:"mt-0"},[t(b,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.ClickRefresh")))])])],1)],1)},MD=[],kD=E(Cl,OD,MD,!1,null,"0262a811");const ED=kD.exports;var LD=Object.defineProperty,AD=Object.getOwnPropertyDescriptor,nb=(s,e,t,r)=>{for(var i=r>1?void 0:r?AD(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&LD(e,t,i),i};let $l=class extends k(L){};nb([w({type:Object,required:!0})],$l.prototype,"device",2);$l=nb([S({components:{TextfieldWithCopy:Kt}})],$l);var FD=function(){var r,i;var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{staticClass:"mt-3 w-100",attrs:{outlined:""}},[t(J,{attrs:{"three-line":""}},[t(_t,[t("div",{staticClass:"text-overline mb-2 d-flex flex-row"},[t("span",[e._v(e._s(e.device.device_type.toUpperCase().replaceAll("_"," ")))]),t(ae),t("span",[e._v(e._s(e.device.driver_name))])],1),t(Ze,{staticClass:"text-h5 mb-0"},[e._v(e._s(e.device.device_name))])],1)],1),t(Z,[t(x,[t(b,[t(Kt,{attrs:{label:e.$t("DevicesDialog.DevicePath"),value:e.device.device_path}})],1)],1),(r=e.device.path_by_id)!=null&&r?t(x,[t(b,[t(Kt,{attrs:{label:e.$t("DevicesDialog.PathById"),value:e.device.path_by_id}})],1)],1):e._e(),(i=e.device.path_by_hardware)!=null&&i?t(x,[t(b,[t(Kt,{attrs:{label:e.$t("DevicesDialog.PathByHardware"),value:e.device.path_by_hardware}})],1)],1):e._e()],1)],1)},RD=[],HD=E($l,FD,RD,!1,null,null);const jD=HD.exports;var ID=Object.defineProperty,ND=Object.getOwnPropertyDescriptor,ab=(s,e,t,r)=>{for(var i=r>1?void 0:r?ND(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&ID(e,t,i),i};let xl=class extends k(L){constructor(){super(...arguments),this.devices=[],this.loading=!1,this.loaded=!1}get filteredDevices(){return this.hideSystemEntries?this.devices.filter(s=>s.device_type!=="hardware_uart"):this.devices}async refresh(){this.loading=!0,this.devices=await fetch(this.apiUrl+"/machine/peripherals/serial").then(s=>s.json()).then(s=>{var e,t;return(t=(e=s.result)==null?void 0:e.serial_devices)!=null?t:[]}),this.loading=!1,this.loaded=!0}};ab([w({type:Boolean,default:!1})],xl.prototype,"hideSystemEntries",2);xl=ab([S],xl);var VD=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Z,[t(x,[t(b,{staticClass:"text-center"},[t(g,{attrs:{loading:e.loading,color:"primary"},on:{click:e.refresh}},[e._v(e._s(e.$t("DevicesDialog.Refresh")))])],1)],1),e.filteredDevices.length?t(x,{staticClass:"mt-0"},[t(b,[t(P$,{attrs:{accordion:""}},e._l(e.filteredDevices,function(r){var i;return t(jD,{key:(i=r.path_by_hardware)!=null?i:r.device_path,attrs:{device:r}})}),1)],1)],1):e.loaded?t(x,{staticClass:"mt-0"},[t(b,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.NoDeviceFound")))])])],1):t(x,{staticClass:"mt-0"},[t(b,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.ClickRefresh")))])])],1)],1)},BD=[],UD=E(xl,VD,BD,!1,null,"17c3494f");const WD=UD.exports;var zD=Object.defineProperty,GD=Object.getOwnPropertyDescriptor,ob=(s,e,t,r)=>{for(var i=r>1?void 0:r?GD(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&zD(e,t,i),i};let wl=class extends k(L){};ob([w({type:Object,required:!0})],wl.prototype,"device",2);wl=ob([S({components:{TextfieldWithCopy:Kt}})],wl);var ZD=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{staticClass:"mt-3 w-100",attrs:{outlined:""}},[t(Z,[t(x,[t(b,[t("div",{staticClass:"text-overline mb-2 d-flex flex-row"},[t("span",[e._v(e._s(e.device.application))])])])],1),t(x,{staticClass:"mt-0"},[t(b,[t(Kt,{attrs:{label:"UUID",value:e.device.uuid}})],1)],1)],1)],1)},qD=[],XD=E(wl,ZD,qD,!1,null,null);const lb=XD.exports;var YD=Object.defineProperty,JD=Object.getOwnPropertyDescriptor,af=(s,e,t,r)=>{for(var i=r>1?void 0:r?JD(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&YD(e,t,i),i};let ra=class extends k(L){constructor(){super(...arguments),this.mdiInformationVariantCircle=Kw,this.devices=[],this.loading=!1,this.loaded=!1}async refresh(){this.loading=!0,this.devices=await fetch("".concat(this.apiUrl,"/machine/peripherals/canbus?interface=").concat(this.name)).then(s=>s.json()).then(s=>{var e;return(e=s.result.can_uuids)!=null?e:[]}),this.loading=!1,this.loaded=!0}};af([w({type:String,required:!0})],ra.prototype,"name",2);af([w({type:Boolean,default:!1})],ra.prototype,"hideSystemEntries",2);ra=af([S({components:{DevicesDialogCanDevice:lb}})],ra);var KD=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("overlay-scrollbars",{staticStyle:{"max-height":"400px","overflow-x":"hidden"}},[t(Z,[t(x,[t(b,{staticClass:"text-center"},[t(g,{attrs:{loading:e.loading,color:"primary"},on:{click:e.refresh}},[e._v(e._s(e.$t("DevicesDialog.Refresh")))])],1)],1),e.devices.length?t(x,{staticClass:"mt-0"},[t(b,e._l(e.devices,function(r){return t(lb,{key:r.uuid,attrs:{device:r}})}),1)],1):e.loaded?t(x,{staticClass:"mt-0"},[t(b,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.NoDeviceFound")))])])],1):t(x,{staticClass:"mt-0"},[t(b,{staticClass:"col-8 mx-auto"},[t("p",{staticClass:"text-center text--disabled mb-0"},[e._v(e._s(e.$t("DevicesDialog.ClickRefresh")))])])],1),e.devices.length===0?t(x,[t(b,[t(it,{attrs:{dense:"",outlined:"",type:"info",icon:e.mdiInformationVariantCircle}},[e._v(" "+e._s(e.$t("DevicesDialog.CanBusInfo"))+" "),t(x,{staticClass:"my-0"},[t(b,{staticClass:"text-center"},[t(g,{attrs:{href:"https://docs.mainsail.xyz/overview/features/query-devices#can-devices",color:"info",outlined:"",text:"",small:""}},[e._v(" open guide ")])],1)],1)],1)],1)],1):e._e()],1)],1)},QD=[],e5=E(ra,KD,QD,!1,null,"dde76904");const t5=e5.exports;var s5=Object.defineProperty,r5=Object.getOwnPropertyDescriptor,cb=(s,e,t,r)=>{for(var i=r>1?void 0:r?r5(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&s5(e,t,i),i};let Sl=class extends k(L){constructor(){super(...arguments),this.mdiCog=ss,this.mdiUsb=Jp,this.mdiCloseThick=pe,this.tab="serial",this.hideSystemEntries=!0}get tabs(){const s=[{tab:"serial",title:"Serial"},{tab:"usb",title:"USB"},{tab:"video",title:"Video"}];return this.canInterfaces.forEach(e=>{s.push({tab:e,title:e.toUpperCase()})}),s.sort((e,t)=>e.title.localeCompare(t.title))}get canInterfaces(){var s,e;return Object.keys((e=(s=this.$store.state.server.system_info)==null?void 0:s.canbus)!=null?e:{})}closePrompt(){this.$emit("close")}};cb([w({type:Boolean,default:!1})],Sl.prototype,"showDialog",2);Sl=cb([S({components:{Panel:U}})],Sl);var i5=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.showDialog,width:"500",persistent:"",fullscreen:e.isMobile}},[t(U,{staticStyle:{overflow:"hidden"},attrs:{id:"devices-dialog",title:e.$t("DevicesDialog.Headline"),icon:e.mdiUsb,"card-class":"devices-dialog","margin-bottom":!1,height:e.isMobile?0:548},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(ye,{attrs:{left:!0,"offset-y":!0,"close-on-content-click":!1,attach:"#devices-dialog"},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",i,!1),r),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Me,[t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("DevicesDialog.HideSystemEntries")},model:{value:e.hideSystemEntries,callback:function(r){e.hideSystemEntries=r},expression:"hideSystemEntries"}})],1)],1)],1),t(g,{attrs:{icon:"",tile:""},on:{click:e.closePrompt}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(rl,{attrs:{"fixed-tabs":""},model:{value:e.tab,callback:function(r){e.tab=r},expression:"tab"}},e._l(e.tabs,function(r){return t(Dr,{key:r.tab},[e._v(e._s(r.title))])}),1),t("overlay-scrollbars",{staticStyle:{"max-height":"400px","overflow-x":"hidden"}},[t(T_,{model:{value:e.tab,callback:function(r){e.tab=r},expression:"tab"}},[e._l(e.canInterfaces,function(r){return t(Ys,{key:r},[t(t5,{attrs:{"hide-system-entries":e.hideSystemEntries,name:r}})],1)}),t(Ys,{key:"serial"},[t(WD,{attrs:{"hide-system-entries":e.hideSystemEntries}})],1),t(Ys,{key:"usb"},[t(ED,{attrs:{"hide-system-entries":e.hideSystemEntries}})],1),t(Ys,{key:"video"},[t(yD,{attrs:{"hide-system-entries":e.hideSystemEntries}})],1)],2)],1)],1)],1)},n5=[],a5=E(Sl,i5,n5,!1,null,"309be890");const of=a5.exports,o5="modulepreload",l5=function(s){return"/"+s},Gg={},fe=function(e,t,r){let i=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(t.map(l=>{if(l=l5(l),l in Gg)return;Gg[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector('link[href="'.concat(l,'"]').concat(c)))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":o5,u||(d.as="script"),d.crossOrigin="",d.href=l,o&&d.setAttribute("nonce",o),document.head.appendChild(d),u)return new Promise((m,h)=>{d.addEventListener("load",m),d.addEventListener("error",()=>h(new Error("Unable to preload CSS for ".concat(l))))})}))}function n(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&n(o.reason);return e().catch(n)})},c5=y.component("CodemirrorAsync",()=>fe(()=>import("./Codemirror--JcAba3g.js"),__vite__mapDeps([0,1,2,3,4,5,6])));var u5=Object.defineProperty,d5=Object.getOwnPropertyDescriptor,lf=(s,e,t,r)=>{for(var i=r>1?void 0:r?d5(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&u5(e,t,i),i};let ia=class extends k(L){constructor(){super(...arguments),this.dialogConfirmChange=!1,this.dialogDevices=!1,this.treeviewItemKeyProp="line",this.structureActive=[],this.structureOpen=[],this.structureActiveChangedBySidebar=!1,this.formatFilesize=Xe,this.mdiCloseThick=pe,this.mdiHelp=Wp,this.mdiContentSave=Rp,this.mdiRestart=_r,this.mdiClose=Ba,this.mdiHelpCircle=pu,this.mdiFileDocumentEditOutline=za,this.mdiFileDocumentOutline=Uw,this.mdiUsb=Jp,this.mdiFormatListCheckbox=Yw}get changed(){var s;return(s=this.$store.state.editor.changed)!=null?s:!1}get changedOutput(){return this.changed?"*":""}get show(){var s;return(s=this.$store.state.editor.bool)!=null?s:!1}get filepath(){var s;return(s=this.$store.state.editor.filepath)!=null?s:""}get filename(){var s;return(s=this.$store.state.editor.filename)!=null?s:""}get filenameWithoutExtension(){return this.filename.lastIndexOf(".")?this.filename.slice(0,this.filename.lastIndexOf(".")):this.filename}get fileExtension(){return this.filename.lastIndexOf(".")?this.filename.slice(this.filename.lastIndexOf(".")+1):""}get fileroot(){var s;return(s=this.$store.state.editor.fileroot)!=null?s:"gcodes"}get permissions(){var s;return(s=this.$store.state.editor.permissions)!=null?s:"r"}get isWriteable(){return this.permissions.includes("w")}get sourcecode(){var s;return(s=this.$store.state.editor.sourcecode)!=null?s:""}set sourcecode(s){this.$store.dispatch("editor/updateSourcecode",s)}get loaderBool(){var s;return(s=this.$store.state.editor.loaderBool)!=null?s:!1}get loaderProgress(){var s;return(s=this.$store.state.editor.loaderProgress)!=null?s:{}}get snackbarHeadline(){let s=this.$t("Editor.Downloading");return this.loaderProgress.direction&&(s=lr(this.loaderProgress.direction)),this.$t("Editor.".concat(s))}get availableServices(){var s,e;return(e=(s=this.$store.state.server.system_info)==null?void 0:s.available_services)!=null?e:[]}get restartAllowedOrPossible(){return!this.isWriteable||["printing","paused"].includes(this.printer_state)?null:!0}get restartServiceName(){return this.availableServices.includes(this.filenameWithoutExtension)&&this.fileExtension==="conf"?this.filenameWithoutExtension:this.filename.startsWith("webcam")&&["conf","txt"].includes(this.fileExtension)?"webcamd":this.filename.startsWith("mooncord")&&this.fileExtension==="json"?"mooncord":this.filename==="moonraker.conf"?"moonraker":this.fileExtension==="cfg"?"klipper":null}get restartServiceNameExists(){return!this.restartAllowedOrPossible||this.restartServiceName===null?!1:["klipper","moonraker"].includes(this.restartServiceName)?!0:this.availableServices.includes(this.restartServiceName)}get confirmUnsavedChanges(){var s;return(s=this.$store.state.gui.editor.confirmUnsavedChanges)!=null?s:!1}get escToClose(){var s;return(s=this.$store.state.gui.editor.escToClose)!=null?s:!1}get title(){const s=this.filepath?"".concat(this.filepath,"/").concat(this.filename):this.filename;return this.isWriteable?"".concat(s," ").concat(this.changedOutput):"".concat(s," (").concat(this.$t("Editor.FileReadOnly"),")")}get currentLanguage(){return this.$store.state.gui.general.language}get klipperConfigReference(){var r,i;const s=this.currentLanguage,e=(r=Ng[this.klipperAppName])!=null?r:Ng.Klipper;let t=e.url;return(i=e.docsLanguages)!=null&&i.includes(s)&&(t+="".concat(s,"/")),t+="Config_Reference.html",t}get fileStructureSidebar(){return this.$store.state.gui.editor.fileStructureSidebar}set fileStructureSidebar(s){this.$store.dispatch("gui/saveSetting",{name:"editor.fileStructureSidebar",value:s})}get configFileStructure(){if(!["conf","cfg"].includes(this.fileExtension))return[];const s=this.sourcecode.split(/\n/gi),e=/^[^#\S]*?(\[(?
.*?)]|(?\w+)\s*?[:=])/gim,t=[];for(let r=0;r0}toggleFileStructure(){this.fileStructureSidebar=!this.fileStructureSidebar}cancelDownload(){this.$store.dispatch("editor/cancelLoad")}escClose(){this.escToClose&&this.close()}close(){this.confirmUnsavedChanges?this.promptUnsavedChanges():this.$store.dispatch("editor/close")}discardChanges(){this.dialogConfirmChange=!1,this.$store.dispatch("editor/close")}promptUnsavedChanges(){!this.changed||!this.isWriteable?this.$store.dispatch("editor/close"):this.dialogConfirmChange=!0}save(s=null){this.dialogConfirmChange=!1,this.$store.dispatch("editor/saveFile",{content:this.sourcecode,restartServiceName:s})}activeChangesItemClick(){this.structureActiveChangedBySidebar=!0}activeChanges(s){var e;this.structureActiveChangedBySidebar&&(this.structureActiveChangedBySidebar=!1,s.length&&((e=this.editor)==null||e.gotoLine(s[0])))}lineChanges(s){var e;(e=this.configFileStructure)==null||e.map(t=>{var r;t.line==s?this.structureActive=[s]:(r=t.children)==null||r.map(i=>{i.line==s&&(this.structureActive=[s],this.structureOpen.includes(t.line)||this.structureOpen.push(t.line))})})}changedChanged(s){if(this.confirmUnsavedChanges){if(s){window.addEventListener("beforeunload",Cm);return}window.removeEventListener("beforeunload",Cm)}}};lf([Ts("editor")],ia.prototype,"editor",2);lf([he("changed")],ia.prototype,"changedChanged",1);ia=lf([S({components:{DevicesDialog:of,Panel:U,CodemirrorAsync:c5}})],ia);var m5=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(le,{attrs:{persistent:"",fullscreen:"","hide-overlay":"",transition:!1},on:{close:e.close,keydown:[function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.escClose.apply(null,arguments)},function(r){if(!r.type.indexOf("key")&&e._k(r.keyCode,"s",void 0,r.key,void 0)||!r.ctrlKey||!r.shiftKey)return null;r.preventDefault(),e.restartServiceNameExists&&e.save(e.restartServiceName)},function(r){if(!r.type.indexOf("key")&&e._k(r.keyCode,"s",void 0,r.key,void 0)||!r.metaKey||!r.shiftKey)return null;r.preventDefault(),e.restartServiceNameExists&&e.save(e.restartServiceName)},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"s",void 0,r.key,void 0)||!r.ctrlKey?null:(r.preventDefault(),e.save(null))},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"s",void 0,r.key,void 0)||!r.metaKey?null:(r.preventDefault(),e.save(null))}]},model:{value:e.show,callback:function(r){e.show=r},expression:"show"}},[t(U,{attrs:{"card-class":"editor-dialog",icon:e.isWriteable?e.mdiFileDocumentEditOutline:e.mdiFileDocumentOutline,title:e.title},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{staticClass:"d-none d-md-flex",attrs:{text:"",tile:""},on:{click:function(r){e.dialogDevices=!0}}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiUsb))]),e._v(" "+e._s(e.$t("Editor.DeviceDialog"))+" ")],1),e.restartServiceName==="klipper"?t(g,{staticClass:"d-none d-md-flex",attrs:{text:"",tile:"",href:e.klipperConfigReference,target:"_blank"}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiHelp))]),e._v(" "+e._s(e.$t("Editor.ConfigReference"))+" ")],1):e._e(),e.existsFileStructure?t(g,{staticClass:"d-none d-md-flex",attrs:{text:"",tile:""},on:{click:e.toggleFileStructure}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiFormatListCheckbox))]),e._v(" "+e._s(e.$t("Editor.FileStructure"))+" ")],1):e._e(),e.restartServiceNameExists?t(g,{staticClass:"d-none d-sm-flex",attrs:{color:"primary",text:"",tile:""},on:{click:function(r){return e.save(e.restartServiceName)}}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiRestart))]),e._v(" "+e._s(e.$t("Editor.SaveRestart"))+" ")],1):e._e(),e.isWriteable?t(g,{attrs:{icon:"",tile:""},on:{click:function(r){return e.save(null)}}},[t(_,[e._v(e._s(e.mdiContentSave))])],1):e._e(),t(g,{attrs:{icon:"",tile:""},on:{click:e.close}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"pa-0 d-flex"},[e.show?t("codemirror-async",{ref:"editor",staticClass:"codemirror",class:{withSidebar:e.existsFileStructure&&e.fileStructureSidebar},attrs:{name:e.filename,"file-extension":e.fileExtension},on:{lineChange:e.lineChanges},model:{value:e.sourcecode,callback:function(r){e.sourcecode=r},expression:"sourcecode"}}):e._e(),e.existsFileStructure&&e.fileStructureSidebar?t("div",{staticClass:"d-none d-md-flex structure-sidebar"},[t(D$,{staticClass:"w-100",attrs:{activatable:"",dense:"",active:e.structureActive,open:e.structureOpen,"item-key":e.treeviewItemKeyProp,items:e.configFileStructure},on:{"update:active":e.activeChanges},scopedSlots:e._u([{key:"label",fn:function({item:r}){return[t("div",{staticClass:"cursor-pointer _structure-sidebar-item",class:r.type=="item"?"ͼp":"ͼt",on:{click:e.activeChangesItemClick}},[e._v(" "+e._s(r.name)+" ")])]}},e.restartServiceName==="klipper"?{key:"append",fn:function({item:r}){return[r.type=="section"?t(g,{attrs:{icon:"",small:"",plain:"",color:"grey darken-2",href:e.klipperConfigReference+"#"+r.name.split(" ")[0],target:"_blank"}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiHelpCircle))])],1):e._e()]}}:null],null,!0)})],1):e._e()],1)],1)],1),t(xi,{attrs:{timeout:-1,fixed:"",right:"",bottom:""},scopedSlots:e._u([{key:"action",fn:function({attrs:r}){return[t(g,e._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:"",tile:""},on:{click:e.cancelDownload}},"v-btn",r,!1),[t(_,{staticClass:"0"},[e._v(e._s(e.mdiClose))])],1)]}}]),model:{value:e.loaderBool,callback:function(r){e.loaderBool=r},expression:"loaderBool"}},[t("div",[e._v(" "+e._s(e.snackbarHeadline)+" "),t("br"),t("strong",[e._v(e._s(e.filename))])]),e.loaderProgress.total>0?[t("span",{staticClass:"mr-1"},[e._v(" ("+e._s(e.formatFilesize(e.loaderProgress.loaded))+"/"+e._s(e.formatFilesize(e.loaderProgress.total))+") ")]),e._v(" "+e._s(Math.round(100*e.loaderProgress.loaded/e.loaderProgress.total))+" % @ "+e._s(e.loaderProgress.speed)+"/s "),t("br"),t(Ss,{staticClass:"mt-2",attrs:{value:100*e.loaderProgress.loaded/e.loaderProgress.total}})]:[t(Ss,{staticClass:"mt-2",attrs:{indeterminate:""}})]],2),t(le,{attrs:{persistent:"",width:600},model:{value:e.dialogConfirmChange,callback:function(r){e.dialogConfirmChange=r},expression:"dialogConfirmChange"}},[t(U,{attrs:{"card-class":"editor-confirm-change-dialog",icon:e.mdiHelpCircle,title:e.$t("Editor.UnsavedChanges"),"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogConfirmChange=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"pt-3"},[t(x,[t(b,[t("p",{staticClass:"body-1 mb-2"},[e._v(e._s(e.$t("Editor.UnsavedChangesMessage",{filename:e.filename})))]),t("p",{staticClass:"body-2"},[e._v(e._s(e.$t("Editor.UnsavedChangesSubMessage")))])])],1)],1),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.discardChanges}},[e._v(" "+e._s(e.$t("Editor.DontSave"))+" ")]),t(g,{attrs:{text:"",color:"primary"},on:{click:e.save}},[e._v(" "+e._s(e.$t("Editor.SaveClose"))+" ")]),e.restartServiceNameExists?[t(g,{attrs:{text:"",color:"primary"},on:{click:function(r){return e.save(e.restartServiceName)}}},[e._v(" "+e._s(e.$t("Editor.SaveRestart"))+" ")])]:e._e()],2)],1)],1),t(of,{attrs:{"show-dialog":e.dialogDevices},on:{close:function(r){e.dialogDevices=!1}}})],1)},h5=[],p5=E(ia,m5,h5,!1,null,"9cf62f8a");const ub=p5.exports;var f5=Object.defineProperty,g5=Object.getOwnPropertyDescriptor,db=(s,e,t,r)=>{for(var i=r>1?void 0:r?g5(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&f5(e,t,i),i};let Pl=class extends k(L){constructor(){super(...arguments),this.mdiUpdate=Xa,this.headers=[{text:"Date",value:"date",width:"1%",dateType:"Date"},{text:"Message",sortable:!1,value:"message",width:"99%"}]}get application(){var s;return(s=this.$store.state.server.updateManager.updateResponse.application)!=null?s:""}get messages(){var s;return(s=this.$store.state.server.updateManager.updateResponse.messages)!=null?s:[]}get complete(){var s;return(s=this.$store.state.server.updateManager.updateResponse.complete)!=null?s:!0}customSort(s,e,t){return s.sort((r,i)=>{if(e[0]==="date")return t[0]?new Date(r[e]).getTime()-new Date(i[e]).getTime():new Date(i[e]).getTime()-new Date(r[e]).getTime();if(typeof r[e]<"u")return t[0]?i[e].toLowerCase().localeCompare(r[e].toLowerCase()):r[e].toLowerCase().localeCompare(i[e].toLowerCase())}),s}formatTime(s){const e=s.getHours()<10?"0"+s.getHours().toString():s.getHours(),t=s.getMinutes()<10?"0"+s.getMinutes().toString():s.getMinutes(),r=s.getSeconds()<10?"0"+s.getSeconds().toString():s.getSeconds();return e+":"+t+":"+r}close(){this.application!==null&&this.complete&&["client","mainsail","full"].includes(this.application.toLowerCase())?window.location.reload():(this.$store.commit("server/updateManager/resetUpdateResponse"),this.$socket.emit("machine.update.status",{refresh:!1},{action:"server/updateManager/onUpdateStatus"}))}messagesChanged(){setTimeout(()=>{this.$nextTick(()=>{if(this.$refs.updaterLogScroll){const s=this.$refs.updaterLogScroll.osInstance();s==null||s.scroll({y:"100%"})}})},50)}};db([he("messages")],Pl.prototype,"messagesChanged",1);Pl=db([S({components:{}})],Pl);var _5=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{staticClass:"mx-0",attrs:{value:e.application!=="",persistent:"","max-width":"800"}},[t(Pe,{attrs:{loading:!e.complete}},[t("template",{slot:"progress"},[t(Ss,{attrs:{color:"primary",indeterminate:""}})],1),t(Op,{attrs:{flat:"",dense:""}},[t(ru,[t("span",{staticClass:"subheading"},[t(_,{attrs:{left:""}},[e._v(e._s(e.mdiUpdate))]),e.application.substr(0,8)==="recover_"&&!e.complete?[e._v(" "+e._s(e.$t("App.UpdateDialog.Recovering",{software:e.application.substr(8)}))+" ")]:e.application.substr(0,8)==="recover_"?[e._v(" "+e._s(e.$t("App.UpdateDialog.RecoveringDone",{software:e.application.substr(8)}))+" ")]:e.complete?[e._v(" "+e._s(e.$t("App.UpdateDialog.UpdatingDone",{software:e.application}))+" ")]:[e._v(" "+e._s(e.$t("App.UpdateDialog.Updating",{software:e.application}))+" ")]],2)])],1),t(Z,{staticClass:"px-3"},[t(x,[t(b,{staticClass:"py-6 px-0"},[t("overlay-scrollbars",{ref:"updaterLogScroll",staticClass:"updaterLogScroll"},[t(Qr,{ref:"updaterLog",staticClass:"updaterLog",attrs:{headers:e.headers,items:e.messages,"item-key":"date","hide-default-footer":"","hide-default-header":"","disable-pagination":"","custom-sort":e.customSort,"sort-by":"date","sort-desc":!0,color:"primary"},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"py-2"},[e._v(e._s(e.$t("App.UpdateDialog.Empty")))])]},proxy:!0},{key:"item",fn:function({item:r}){return[t("tr",[t("td",{staticClass:"log-cell title-cell py-2"},[e._v(" "+e._s(e.formatTime(r.date))+" ")]),t("td",{staticClass:"log-cell content-cell pl-0 py-2",staticStyle:{width:"100%"},attrs:{colspan:"2"}},[r.message?t("span",{staticClass:"message",domProps:{innerHTML:e._s(r.message)}}):e._e()])])]}}])})],1)],1)],1),t(x,[t(b,{staticClass:"text-center pt-5"},[t(g,{attrs:{text:"",disabled:!e.complete,color:"primary"},on:{click:e.close}},[e._v(" "+e._s(e.$t("App.UpdateDialog.Close"))+" ")])],1)],1)],1)],2)],1)},v5=[],b5=E(Pl,_5,v5,!1,null,"7932e4ad");const mb=b5.exports;var y5=Object.getOwnPropertyDescriptor,C5=(s,e,t,r)=>{for(var i=r>1?void 0:r?y5(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let wm=class extends k(L){constructor(){super(...arguments),this.showDialog=!1,this.updateSW=null}onOfflineReady(){window.console.info("PWA is offline ready")}onNeedRefresh(){window.console.warn("PWA needs to refresh"),this.showDialog=!0}onRegistered(){window.console.debug("PWA is registered")}onRegisterError(s){window.console.error("PWA registration error:",s)}update(){var s;(s=this.updateSW)==null||s.call(this,!0),this.showDialog=!1}async mounted(){const{registerSW:s}=await fe(async()=>{const{registerSW:e}=await import("./virtual_pwa-register-DiXdS4qF.js");return{registerSW:e}},__vite__mapDeps([7,2,3,4,5,6]));this.updateSW=s({immediate:!0,onOfflineReady:this.onOfflineReady,onNeedRefresh:this.onNeedRefresh,onRegistered:this.onRegistered,onRegisterError:this.onRegisterError})}};wm=C5([S],wm);var $5=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{staticClass:"mx-0",attrs:{persistent:"","max-width":"400"},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(U,{attrs:{title:e.$t("App.TheServiceWorker.TitleNeedUpdate"),"card-class":"service-worker-dialog","margin-bottom":!1}},[t(Z,[t("p",[e._v(e._s(e.$t("App.TheServiceWorker.DescriptionNeedUpdate")))])]),t(oe,[t(ae),t(g,{attrs:{text:"",color:"primary"},on:{click:e.update}},[e._v(e._s(e.$t("App.TheServiceWorker.Update")))])],1)],1)],1)},x5=[],w5=E(wm,$5,x5,!1,null,null);const S5=w5.exports;var P5=Object.defineProperty,D5=Object.getOwnPropertyDescriptor,hb=(s,e,t,r)=>{for(var i=r>1?void 0:r?D5(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&P5(e,t,i),i};let Dl=class extends k(L){constructor(){super(...arguments),this.mdiAlertOctagonOutline=W_,this.mdiCloseThick=pe}emergencyStop(){this.$socket.emit("printer.emergency_stop",{},{loading:"topbarEmergencyStop"}),this.closePrompt()}closePrompt(){this.$emit("close")}};hb([w({type:Boolean,default:!1})],Dl.prototype,"showDialog",2);Dl=hb([S({components:{Panel:U}})],Dl);var T5=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.showDialog,width:"400",persistent:""}},[t(U,{attrs:{title:e.$t("EmergencyStopDialog.EmergencyStop"),"toolbar-color":"error","card-class":"emergency-stop-dialog",icon:e.mdiAlertOctagonOutline,"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closePrompt}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[e._v(e._s(e.$t("EmergencyStopDialog.AreYouSure")))]),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.closePrompt}},[e._v(e._s(e.$t("EmergencyStopDialog.No")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.emergencyStop}},[e._v(e._s(e.$t("EmergencyStopDialog.Yes")))])],1)],1)],1)},O5=[],M5=E(Dl,T5,O5,!1,null,"3fed6302");const pb=M5.exports;var k5=Object.defineProperty,E5=Object.getOwnPropertyDescriptor,ln=(s,e,t,r)=>{for(var i=r>1?void 0:r?E5(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&k5(e,t,i),i};let cr=class extends k(L){constructor(){super(...arguments),this.mdiAlert=mw,this.mdiCloseThick=pe}action(){this.$emit("action")}close(){this.$emit("close")}};ln([w({type:Boolean,required:!0})],cr.prototype,"show",2);ln([w({type:String,required:!0})],cr.prototype,"title",2);ln([w({type:String,required:!0})],cr.prototype,"text",2);ln([w({type:String,required:!0})],cr.prototype,"actionButtonText",2);ln([w({type:String,required:!0})],cr.prototype,"cancelButtonText",2);cr=ln([S({components:{Panel:U}})],cr);var L5=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.show,width:"400",fullscreen:e.isMobile}},[t(U,{attrs:{"card-class":"confirm-top-corner-menu-dialog",icon:e.mdiAlert,title:e.title,"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.close}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"pt-3"},[t(x,[t(b,[t("p",{staticClass:"body-2"},[e._v(e._s(e.text))])])],1)],1),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.close}},[e._v(e._s(e.cancelButtonText))]),t(g,{attrs:{text:"",color:"error"},on:{click:e.action}},[e._v(e._s(e.actionButtonText))])],1)],1)],1)},A5=[],F5=E(cr,L5,A5,!1,null,null);const Tl=F5.exports;var R5=Object.getOwnPropertyDescriptor,H5=(s,e,t,r)=>{for(var i=r>1?void 0:r?R5(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Ol=class extends y{get hideOtherInstances(){var s;return(s=this.$store.state.gui.uiSettings.hideOtherInstances)!=null?s:!1}get instance_ids(){var s,e;return(e=(s=this.$store.state.server.system_info)==null?void 0:s.instance_ids)!=null?e:{}}get klipperInstance(){var s;return(s=this.instance_ids.klipper)!=null?s:""}get moonrakerInstance(){var s;return(s=this.instance_ids.moonraker)!=null?s:""}};Ol=H5([S],Ol);var j5=Object.defineProperty,I5=Object.getOwnPropertyDescriptor,fb=(s,e,t,r)=>{for(var i=r>1?void 0:r?I5(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&j5(e,t,i),i};let Ml=class extends k(L,Ol){constructor(){super(...arguments),this.mdiPlay=nn,this.mdiRestart=_r,this.mdiStop=$v,this.showRestartDialog=!1,this.showStopDialog=!1}get name(){return this.hideOtherInstances&&this.service===this.klipperInstance?"Klipper":this.hideOtherInstances&&this.service===this.moonrakerInstance?"Moonraker":lr(this.service)}get service_states(){var s,e;return(e=(s=this.$store.state.server.system_info)==null?void 0:s.service_state)!=null?e:{}}get state(){return this.service in this.service_states?this.service_states[this.service].active_state:null}get subState(){return this.service in this.service_states?this.service_states[this.service].sub_state:null}get dialogRestartTitle(){return this.service===this.klipperInstance?this.$t("App.TopCornerMenu.ConfirmationDialog.Title.KlipperRestart"):this.$t("App.TopCornerMenu.ConfirmationDialog.Title.ServiceRestart")}get dialogStopTitle(){return this.$t("App.TopCornerMenu.ConfirmationDialog.Title.ServiceStop")}get dialogRestartDescription(){return this.service===this.klipperInstance?this.$t("App.TopCornerMenu.ConfirmationDialog.Description.KlipperRestart"):this.$t("App.TopCornerMenu.ConfirmationDialog.Description.ServiceRestart")}get dialogStopDescription(){return this.service===this.klipperInstance?this.$t("App.TopCornerMenu.ConfirmationDialog.Description.KlipperStop"):this.$t("App.TopCornerMenu.ConfirmationDialog.Description.ServiceStop")}get disableStopButton(){return this.state==="inactive"||this.service===this.moonrakerInstance}get styleStopButton(){return this.service===this.moonrakerInstance?"visibility: hidden;":""}clickStart(){this.$socket.emit("machine.services.start",{service:this.service}),this.closeMenu()}clickRestart(){if(this.printerIsPrinting){this.showRestartDialog=!0;return}this.serviceRestart()}clickStop(){if(this.printerIsPrinting){this.showStopDialog=!0;return}this.serviceStop()}serviceRestart(){this.showRestartDialog=!1,this.$socket.emit("machine.services.restart",{service:this.service}),this.closeMenu()}serviceStop(){this.showStopDialog=!1,this.$socket.emit("machine.services.stop",{service:this.service}),this.closeMenu()}closeMenu(){this.$emit("close-menu")}};fb([w({type:String,required:!0})],Ml.prototype,"service",2);Ml=fb([S({})],Ml);var N5=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(J,{staticClass:"minHeight30 pr-2"},[t(Ze,[t(de,{attrs:{left:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("span",e._g(e._b({},"span",i,!1),r),[e._v(e._s(e.name))])]}}])},[t("span",[e._v(e._s(e.state)+" ("+e._s(e.subState)+")")])])],1),t(pi,{staticClass:"my-0 d-flex flex-row",staticStyle:{"min-width":"auto"}},[e.state==="inactive"?t(g,{attrs:{icon:"",small:""},on:{click:e.clickStart}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiPlay))])],1):t(g,{attrs:{icon:"",small:""},on:{click:e.clickRestart}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiRestart))])],1),t(g,{style:e.styleStopButton,attrs:{icon:"",small:"",disabled:e.disableStopButton},on:{click:e.clickStop}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiStop))])],1)],1),t(Tl,{attrs:{show:e.showRestartDialog,title:e.dialogRestartTitle,text:e.dialogRestartDescription,"action-button-text":e.$t("App.TopCornerMenu.Restart"),"cancel-button-text":e.$t("App.TopCornerMenu.Cancel")},on:{action:e.serviceRestart,close:function(r){e.showRestartDialog=!1}}}),t(Tl,{attrs:{show:e.showStopDialog,title:e.dialogStopTitle,text:e.dialogStopDescription,"action-button-text":e.$t("App.TopCornerMenu.Stop"),"cancel-button-text":e.$t("App.TopCornerMenu.Cancel")},on:{action:e.serviceStop,close:function(r){e.showStopDialog=!1}}})],1)},V5=[],B5=E(Ml,N5,V5,!1,null,null);const gb=B5.exports;var U5=Object.getOwnPropertyDescriptor,W5=(s,e,t,r)=>{for(var i=r>1?void 0:r?U5(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Sm=class extends k(L,Ol){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiPowerStandby=hS,this.mdiRestart=_r,this.mdiPower=_v,this.mdiToggleSwitch=Yp,this.mdiToggleSwitchOff=OS,this.showMenu=!1,this.dialogPowerDeviceChange={show:!1,device:"",value:""},this.dialogConfirmation={show:!1,serviceName:null,executableFunction:null,title:"",description:"",actionButtonText:""}}get services(){var e,t,r;let s=(r=(t=(e=this.$store.state.server.system_info)==null?void 0:e.available_services)==null?void 0:t.filter(i=>i!=="klipper_mcu"))!=null?r:[];return this.hideOtherInstances&&this.klipperInstance!==""&&(s=s.filter(i=>!i.toLowerCase().startsWith("klipper-")&&i.toLowerCase()!=="klipper"||i===this.klipperInstance)),this.hideOtherInstances&&this.moonrakerInstance!==""&&(s=s.filter(i=>!i.toLowerCase().startsWith("moonraker-")&&i.toLowerCase()!=="moonraker"||i===this.moonrakerInstance)),s.sort()}get powerDevices(){var e;return((e=this.$store.getters["server/power/getDevices"])!=null?e:[]).filter(t=>!t.device.startsWith("_"))}checkDialog(s,e,t){if(!this.printerIsPrinting){s(e);return}this.dialogConfirmation.executableFunction=s,this.dialogConfirmation.serviceName=e;const r=t.trim().charAt(0).toUpperCase()+t.trim().slice(1);let i="App.TopCornerMenu.ConfirmationDialog.Title.Service"+r,n="App.TopCornerMenu.ConfirmationDialog.Description.Service"+r,a="App.TopCornerMenu."+r;e==="klipper"&&["stop","restart","firmwareRestart"].includes(t)?(i="App.TopCornerMenu.ConfirmationDialog.Title."+(t!=="stop"?"Klipper":"Service")+r,n="App.TopCornerMenu.ConfirmationDialog.Description.Klipper"+r,t==="firmwareRestart"&&(a="App.TopCornerMenu.KlipperFirmwareRestart")):e==="host"&&(i="App.TopCornerMenu.ConfirmationDialog.Title.Host"+r,n="App.TopCornerMenu.ConfirmationDialog.Description.Host"+r),this.dialogConfirmation.title=this.$t(i).toString(),this.dialogConfirmation.description=this.$t(n).toString(),this.dialogConfirmation.actionButtonText=this.$t(a).toString(),this.dialogConfirmation.show=!0}executeDialog(){this.dialogConfirmation.executableFunction(this.dialogConfirmation.serviceName),this.dialogConfirmation.show=!1}klipperRestart(){this.showMenu=!1,this.$store.dispatch("server/addEvent",{message:"RESTART",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"RESTART"})}klipperFirmwareRestart(){this.showMenu=!1,this.$store.dispatch("server/addEvent",{message:"FIRMWARE_RESTART",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"FIRMWARE_RESTART"})}changeSwitch(s,e){this.dialogPowerDeviceChange.device=s.device,this.dialogPowerDeviceChange.value=e,this.$store.state.gui.uiSettings.confirmOnPowerDeviceChange?this.dialogPowerDeviceChange.show=!0:this.powerDeviceToggle()}powerDeviceToggle(){this.dialogPowerDeviceChange.show=!1;const s=this.dialogPowerDeviceChange.value==="off"?"machine.device_power.on":"machine.device_power.off";this.$socket.emit(s,{[this.dialogPowerDeviceChange.device]:null},{action:"server/power/responseToggle"})}hostReboot(){this.showMenu=!1,this.$socket.emit("machine.reboot",{})}hostShutdown(){this.showMenu=!1,this.$socket.emit("machine.shutdown",{})}};Sm=W5([S({components:{ConfirmationDialog:Tl,TopCornerMenuService:gb,Panel:U}})],Sm);var z5=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(ye,{attrs:{bottom:"",left:"","offset-y":!0,"close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiPowerStandby))])],1)]}}]),model:{value:e.showMenu,callback:function(r){e.showMenu=r},expression:"showMenu"}},[t(Me,{attrs:{dense:""}},[e.klipperState!=="disconnected"?[t(cs,{staticStyle:{height:"auto"}},[e._v(" "+e._s(e.$t("App.TopCornerMenu.KlipperControl"))+" ")]),t(J,{staticClass:"minHeight30 pr-2",attrs:{link:""},on:{click:function(r){return e.checkDialog(e.klipperRestart,"klipper","restart")}}},[t(Ze,[e._v(e._s(e.$t("App.TopCornerMenu.KlipperRestart")))]),t(pi,{staticClass:"my-0 d-flex flex-row",staticStyle:{"min-width":"auto"}},[t(_,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiRestart))])],1)],1),t(J,{staticClass:"minHeight30 pr-2",attrs:{link:""},on:{click:function(r){return e.checkDialog(e.klipperFirmwareRestart,"klipper","firmwareRestart")}}},[t(Ze,[e._v(e._s(e.$t("App.TopCornerMenu.KlipperFirmwareRestart")))]),t(pi,{staticClass:"my-0 d-flex flex-row",staticStyle:{"min-width":"auto"}},[t(_,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiRestart))])],1)],1)]:e._e(),e.services.length?[e.klipperState!=="disconnected"?t(I,{staticClass:"mt-0"}):e._e(),t(cs,{staticClass:"pt-2",staticStyle:{height:"auto"}},[e._v(" "+e._s(e.$t("App.TopCornerMenu.ServiceControl"))+" ")]),e._l(e.services,function(r){return t(gb,{key:r,attrs:{service:r},on:{"close-menu":function(i){e.showMenu=!1}}})})]:e._e(),e.powerDevices.length?[t(I,{staticClass:"mt-0"}),t(cs,{staticClass:"pt-2",staticStyle:{height:"auto"}},[e._v(" "+e._s(e.$t("App.TopCornerMenu.PowerDevices"))+" ")]),e._l(e.powerDevices,function(r,i){return t(J,{key:i,staticClass:"minHeight30 pr-2",attrs:{disabled:r.status==="error"||r.locked_while_printing&&["printing","paused"].includes(e.printer_state)},on:{click:function(n){return e.changeSwitch(r,r.status)}}},[t(Ze,[e._v(e._s(r.device))]),t(pi,{staticClass:"my-0 d-flex flex-row",staticStyle:{"min-width":"auto"}},[t(_,{staticClass:"mr-2",attrs:{color:r.status==="on"?"":"grey darken-2"}},[e._v(" "+e._s(r.status==="on"?e.mdiToggleSwitch:e.mdiToggleSwitchOff)+" ")])],1)],1)})]:e._e(),t(I,{staticClass:"mt-0"}),t(cs,{staticClass:"pt-2",staticStyle:{height:"auto"}},[e._v(e._s(e.$t("App.TopCornerMenu.HostControl")))]),t(J,{staticClass:"minHeight30 pr-2",attrs:{link:""},on:{click:function(r){return e.checkDialog(e.hostReboot,"host","reboot")}}},[t(Ze,[e._v(e._s(e.$t("App.TopCornerMenu.Reboot")))]),t(pi,{staticClass:"my-0 d-flex flex-row",staticStyle:{"min-width":"auto"}},[t(_,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiPower))])],1)],1),t(J,{staticClass:"minHeight30 pr-2",attrs:{link:""},on:{click:function(r){return e.checkDialog(e.hostShutdown,"host","shutdown")}}},[t(Ze,[e._v(e._s(e.$t("App.TopCornerMenu.Shutdown")))]),t(pi,{staticClass:"my-0 d-flex flex-row",staticStyle:{"min-width":"auto"}},[t(_,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiPower))])],1)],1)],2)],1),t(le,{attrs:{width:"400",fullscreen:e.isMobile},model:{value:e.dialogPowerDeviceChange.show,callback:function(r){e.$set(e.dialogPowerDeviceChange,"show",r)},expression:"dialogPowerDeviceChange.show"}},[t(Pe,[t(gt,{staticClass:"headline"},[e._v(" "+e._s(e.dialogPowerDeviceChange.value==="off"?e.$t("PowerDeviceChangeDialog.TurnDeviceOn",{device:e.dialogPowerDeviceChange.device}):e.$t("PowerDeviceChangeDialog.TurnDeviceOff",{device:e.dialogPowerDeviceChange.device}))+" ")]),t(Z,[e._v(e._s(e.$t("PowerDeviceChangeDialog.AreYouSure")))]),t(oe,[t(ae),t(g,{attrs:{color:"red darken-1",text:""},on:{click:function(r){e.dialogPowerDeviceChange.show=!1}}},[e._v(" "+e._s(e.$t("PowerDeviceChangeDialog.No"))+" ")]),t(g,{attrs:{color:"green darken-1",text:""},on:{click:e.powerDeviceToggle}},[e._v(" "+e._s(e.$t("PowerDeviceChangeDialog.Yes"))+" ")])],1)],1)],1),t(Tl,{attrs:{show:e.dialogConfirmation.show,title:e.dialogConfirmation.title,text:e.dialogConfirmation.description,"action-button-text":e.dialogConfirmation.actionButtonText,"cancel-button-text":e.$t("App.TopCornerMenu.Cancel")},on:{action:e.executeDialog,close:function(r){e.dialogConfirmation.show=!1}}})],1)},G5=[],Z5=E(Sm,z5,G5,!1,null,null);const _b=Z5.exports;var q5=Object.defineProperty,X5=Object.getOwnPropertyDescriptor,cf=(s,e,t,r)=>{for(var i=r>1?void 0:r?X5(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&q5(e,t,i),i};let na=class extends k(L){constructor(){super(...arguments),this.selectedCheckboxes=[],this.selectAllIndeterminate=!1,this.selectAllModel=wr({get:this.getSelectAll,set:this.setSelectAll})}getSelectAll(){return this.selectAllIndeterminate=!1,0t.value);return}this.selectedCheckboxes=[]}};cf([w({required:!0})],na.prototype,"options",2);cf([w({type:Boolean,required:!1,default:!1})],na.prototype,"selectAll",2);na=cf([S],na);var Y5=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(b,{staticClass:"pl-6"},[e.selectAll?[t(ge,{staticClass:"mt-0",attrs:{label:e.$t("Settings.GeneralTab.Everything"),"hide-details":"",indeterminate:e.selectAllIndeterminate},on:{change:function(r){return e.$emit("update:selectedCheckboxes",e.selectedCheckboxes)}},model:{value:e.selectAllModel,callback:function(r){e.selectAllModel=r},expression:"selectAllModel"}}),t(I,{staticClass:"my-2"})]:e._e(),e._l(e.options,function(r){return[t(ge,{key:r.value,staticClass:"mt-0",attrs:{label:r.label,"hide-details":"",value:r.value},on:{change:function(i){return e.$emit("update:selectedCheckboxes",e.selectedCheckboxes)}},model:{value:e.selectedCheckboxes,callback:function(i){e.selectedCheckboxes=i},expression:"selectedCheckboxes"}})]})],2)},J5=[],K5=E(na,Y5,J5,!1,null,null);const ti=K5.exports;var Q5=Object.getOwnPropertyDescriptor,eT=(s,e,t,r)=>{for(var i=r>1?void 0:r?Q5(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Di=class extends L{get availableKeys(){return[{value:"general",label:this.$t("Settings.GeneralTab.General")},{value:"control",label:this.$t("Settings.ControlTab.Control")},{value:"dashboard",label:this.$t("Settings.DashboardTab.Dashboard")},{value:"editor",label:this.$t("Settings.EditorTab.Editor")},{value:"gcodeViewer",label:this.$t("Settings.GCodeViewerTab.GCodeViewer")},{value:"navigation",label:this.$t("Settings.GeneralTab.DbNavigation")},{value:"uiSettings",label:this.$t("Settings.UiSettingsTab.UiSettings")},{value:"view",label:this.$t("Settings.GeneralTab.DbView")},{value:"console",label:this.$t("Settings.ConsoleTab.Console")},{value:"gcodehistory",label:this.$t("Settings.GeneralTab.DbConsoleHistory")},{value:"macros",label:this.$t("Settings.MacrosTab.Macros")},{value:"notifications",label:this.$t("App.Notifications.Notifications")},{value:"presets",label:this.$t("Settings.PresetsTab.PreheatPresets")},{value:"remoteprinters",label:this.$t("Settings.RemotePrintersTab.RemotePrinters")},{value:"timelapse",label:this.$t("Settings.TimelapseTab.Timelapse")}]}async loadBackupableNamespaces(){let s=[];const e=this.$store.getters["socket/getUrl"]+"/server/database/list",t=await fetch(e).then(r=>r==null?void 0:r.json()).then(r=>{var i,n;return(n=(i=r==null?void 0:r.result)==null?void 0:i.namespaces)!=null?n:[]}).catch(()=>(window.console.error("Cannot load Moonraker DB namespaces"),[]));if(t.includes("mainsail")){const r=this.$store.getters["socket/getUrl"]+"/server/database/item?namespace=mainsail";s=await fetch(r).then(i=>i==null?void 0:i.json()).then(i=>{var n,a;return(a=(n=i==null?void 0:i.result)==null?void 0:n.value)!=null?a:{}}).then(i=>Object.keys(i)).then(i=>i.filter(n=>n!=="initVersion")).then(i=>i.map(n=>{const a=this.availableKeys.find(o=>o.value===n);return a||{value:n,label:n}})),s=s.sort(this.sortNamespaces)}return t.includes("maintenance")&&s.push({value:"maintenance",label:this.$t("Settings.GeneralTab.DbMaintenance")}),t.includes("timelapse")&&s.push({value:"timelapse",label:this.$t("Settings.GeneralTab.DbTimelapseSettings")}),t.includes("webcams")&&s.push({value:"webcams",label:this.$t("Settings.WebcamsTab.Webcams")}),s}sortNamespaces(s,e){if(s.value==="general")return-1;if(e.value==="general")return 1;const t=s.label.toString().toLowerCase(),r=e.label.toString().toLowerCase();return tr?1:0}};Di=eT([S],Di);var tT=Object.getOwnPropertyDescriptor,sT=(s,e,t,r)=>{for(var i=r>1?void 0:r?tT(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Pm=class extends k(L,Di){constructor(){super(...arguments),this.mdiHelpCircle=pu,this.mdiCloseThick=pe,this.showDialog=!1,this.backupableNamespaces=[],this.backupCheckboxes=[]}async mounted(){this.backupableNamespaces=await this.loadBackupableNamespaces()}onSelectBackupCheckboxes(e){this.backupCheckboxes=e}async backupMainsail(){await this.$store.dispatch("socket/addLoading","backupMainsail"),await this.$store.dispatch("gui/backupMoonrakerDB",this.backupCheckboxes),await this.$store.dispatch("socket/removeLoading","backupMainsail"),this.closeDialog()}async openDialog(){this.backupableNamespaces=await this.loadBackupableNamespaces(),this.showDialog=!0}closeDialog(){this.showDialog=!1}};Pm=sT([S({components:{Panel:U,SettingsRow:j,CheckboxList:ti}})],Pm);var rT=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(g,{attrs:{loading:e.loadings.includes("backupDbButton"),small:""},on:{click:e.openDialog}},[e._v(" "+e._s(e.$t("Settings.GeneralTab.Backup"))+" ")]),t(le,{attrs:{persistent:"",width:360},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(U,{attrs:{title:e.$t("Settings.GeneralTab.Backup"),"card-class":"mainsail-backup-dialog","margin-bottom":!1,icon:e.mdiHelpCircle},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(x,[t(b,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Settings.GeneralTab.BackupDialog")))])])],1),t(x,[t(ti,{attrs:{options:e.backupableNamespaces,"select-all":""},on:{"update:selectedCheckboxes":e.onSelectBackupCheckboxes}})],1),t(x,[t(b,{staticClass:"text-center"},[t(g,{attrs:{color:"red",loading:e.loadings.includes("backupMainsail")},on:{click:e.backupMainsail}},[e._v(" "+e._s(e.$t("Settings.GeneralTab.Backup"))+" ")])],1)],1)],1)],1)],1)],1)},iT=[],nT=E(Pm,rT,iT,!1,null,null);const vb=nT.exports;var aT=Object.getOwnPropertyDescriptor,oT=(s,e,t,r)=>{for(var i=r>1?void 0:r?aT(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Dm=class extends k(L,Di){constructor(){super(...arguments),this.mdiHelpCircle=pu,this.mdiCloseThick=pe,this.showDialog=!1,this.restoreableNamespaces=[],this.restoreCheckboxes=[],this.restoreObjects={}}onSelectRestoreCheckboxes(e){this.restoreCheckboxes=e}async restoreDb(){var e,t;(t=(e=this.$refs)==null?void 0:e.uploadBackupFile)==null||t.click()}uploadRestore(){var r,i,n,a;if(((i=(r=this.$refs.uploadBackupFile.files)==null?void 0:r.length)!=null?i:0)===0){window.console.error("No json uploaded");return}const e=(a=(n=this.$refs)==null?void 0:n.uploadBackupFile)==null?void 0:a.files[0],t=new FileReader;t.readAsText(e,"UTF-8"),t.onload=o=>{var l;this.restoreableNamespaces=[];try{this.restoreObjects=JSON.parse(((l=o==null?void 0:o.target)==null?void 0:l.result)+"");const u=Object.keys(this.restoreObjects);this.restoreableNamespaces=u.map(c=>{const d=this.availableKeys.find(m=>m.value===c);return d||{value:c,label:c}}),this.restoreableNamespaces=this.restoreableNamespaces.sort(this.sortNamespaces),this.openDialog()}catch{y.$toast.error(this.$t("Settings.GeneralTab.CannotReadJson").toString())}},t.onerror=o=>{window.console.error(o)},this.$refs.uploadBackupFile.value=""}openDialog(){this.showDialog=!0}closeDialog(){this.showDialog=!1}restoreDbAction(){this.$store.dispatch("socket/addLoading","restoreDbAction"),this.$store.dispatch("gui/restoreMoonrakerDB",{dbCheckboxes:this.restoreCheckboxes,restoreObjects:this.restoreObjects})}};Dm=oT([S({components:{SettingsGeneralTabBackupDatabase:vb,Panel:U,SettingsRow:j,CheckboxList:ti}})],Dm);var lT=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t("input",{ref:"uploadBackupFile",staticClass:"d-none",attrs:{type:"file",accept:[".json"]},on:{change:e.uploadRestore}}),t(g,{staticClass:"ml-3",attrs:{small:"",loading:e.loadings.includes("restoreUploadButton")},on:{click:e.restoreDb}},[e._v(" "+e._s(e.$t("Settings.GeneralTab.Restore"))+" ")]),t(le,{attrs:{value:e.showDialog,persistent:"",width:360}},[t(U,{attrs:{title:e.$t("Settings.GeneralTab.Restore"),"card-class":"mainsail-restore-dialog","margin-bottom":!1,icon:e.mdiHelpCircle},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(x,[t(b,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Settings.GeneralTab.RestoreDialog")))])])],1),t(x,[t(ti,{attrs:{options:e.restoreableNamespaces,"select-all":""},on:{"update:selectedCheckboxes":e.onSelectRestoreCheckboxes}})],1),t(x,[t(b,{staticClass:"text-center"},[t(g,{attrs:{color:"red",loading:e.loadings.includes("restoreMainsail")},on:{click:e.restoreDbAction}},[e._v(" "+e._s(e.$t("Settings.GeneralTab.Restore"))+" ")])],1)],1)],1)],1)],1)],1)},cT=[],uT=E(Dm,lT,cT,!1,null,null);const dT=uT.exports;var mT=Object.getOwnPropertyDescriptor,hT=(s,e,t,r)=>{for(var i=r>1?void 0:r?mT(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Tm=class extends k(L,Di){constructor(){super(...arguments),this.mdiHelpCircle=pu,this.mdiCloseThick=pe,this.showDialog=!1,this.resetableNamespaces=[],this.resetCheckboxes=[]}async mounted(){await this.loadResetableNamespaces()}onSelectResetCheckboxes(e){this.resetCheckboxes=e}resetMainsailAction(){this.$store.dispatch("socket/addLoading","resetMainsail"),this.$store.dispatch("gui/resetMoonrakerDB",this.resetCheckboxes)}async openDialog(){await this.loadResetableNamespaces(),this.showDialog=!0}async loadResetableNamespaces(){this.resetableNamespaces=await this.loadBackupableNamespaces(),this.moonrakerComponents.includes("history")&&(this.resetableNamespaces.push({value:"history_jobs",label:this.$t("Settings.GeneralTab.DbHistoryJobs")}),this.resetableNamespaces.push({value:"history_totals",label:this.$t("Settings.GeneralTab.DbHistoryTotals")}))}closeDialog(){this.showDialog=!1}};Tm=hT([S({components:{Panel:U,SettingsRow:j,CheckboxList:ti}})],Tm);var pT=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(g,{attrs:{color:"error",small:""},on:{click:e.openDialog}},[e._v(" "+e._s(e.$t("Settings.GeneralTab.FactoryReset"))+" ")]),t(le,{attrs:{persistent:"",width:360},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(U,{attrs:{title:e.$t("Settings.GeneralTab.FactoryReset"),"card-class":"mainsail-reset-dialog","margin-bottom":!1,icon:e.mdiHelpCircle},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(x,[t(b,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Settings.GeneralTab.FactoryDialog")))])])],1),t(x,[t(ti,{attrs:{options:e.resetableNamespaces,"select-all":""},on:{"update:selectedCheckboxes":e.onSelectResetCheckboxes}})],1),t(x,[t(b,{staticClass:"text-center"},[t(g,{attrs:{color:"red",loading:e.loadings.includes("resetMainsail")},on:{click:e.resetMainsailAction}},[e._v(" "+e._s(e.$t("Settings.GeneralTab.Reset"))+" ")])],1)],1)],1)],1)],1)],1)},fT=[],gT=E(Tm,pT,fT,!1,null,null);const _T=gT.exports;var vT=Object.getOwnPropertyDescriptor,bT=(s,e,t,r)=>{for(var i=r>1?void 0:r?vT(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Om=class extends k(L,Di){constructor(){super(...arguments),this.availableLanguages=[]}async created(){const e=Object.assign({"../../locales/cz.json":()=>fe(()=>import("./cz-D8m9rjS3.js"),[]).then(r=>r.default),"../../locales/da.json":()=>fe(()=>import("./da-DYgaz82Z.js"),[]).then(r=>r.default),"../../locales/de.json":()=>fe(()=>import("./de-P4W13_SZ.js"),[]).then(r=>r.default),"../../locales/en.json":()=>fe(()=>import("./en-o7vnTKjO.js"),[]).then(r=>r.default),"../../locales/es.json":()=>fe(()=>import("./es-DJtSPj3U.js"),[]).then(r=>r.default),"../../locales/fr.json":()=>fe(()=>import("./fr-BgUf3CTX.js"),[]).then(r=>r.default),"../../locales/hu.json":()=>fe(()=>import("./hu-B1cvWa_J.js"),[]).then(r=>r.default),"../../locales/it.json":()=>fe(()=>import("./it-CPOq0Dki.js"),[]).then(r=>r.default),"../../locales/ja.json":()=>fe(()=>import("./ja-CS5xLYiw.js"),[]).then(r=>r.default),"../../locales/ko.json":()=>fe(()=>import("./ko-D481bVT5.js"),[]).then(r=>r.default),"../../locales/nl.json":()=>fe(()=>import("./nl-B9Xo5zsI.js"),[]).then(r=>r.default),"../../locales/pl.json":()=>fe(()=>import("./pl-bBR_77jy.js"),[]).then(r=>r.default),"../../locales/pt.json":()=>fe(()=>import("./pt-D716Rj3y.js"),[]).then(r=>r.default),"../../locales/ru.json":()=>fe(()=>import("./ru-BYzx4dUn.js"),[]).then(r=>r.default),"../../locales/se.json":()=>fe(()=>import("./se-Dt3G_241.js"),[]).then(r=>r.default),"../../locales/tr.json":()=>fe(()=>import("./tr-cyYpyxgv.js"),[]).then(r=>r.default),"../../locales/uk.json":()=>fe(()=>import("./uk-DIP7xo0c.js"),[]).then(r=>r.default),"../../locales/zh.json":()=>fe(()=>import("./zh-T9gotgQQ.js"),[]).then(r=>r.default),"../../locales/zh_TW.json":()=>fe(()=>import("./zh_TW-BFyG3P84.js"),[]).then(r=>r.default)}),t=[];for(const r in e){const i=r.slice(r.lastIndexOf("/")+1,r.lastIndexOf(".")),n=await e[r]();t.push({text:n.title,value:i})}this.availableLanguages=t.sort((r,i)=>r.text.localeCompare(i.text))}get printerName(){return this.$store.state.gui.general.printername}set printerName(e){this.$store.dispatch("gui/saveSetting",{name:"general.printername",value:e})}get currentLanguage(){return this.$store.state.gui.general.language}set currentLanguage(e){this.$store.dispatch("gui/saveSetting",{name:"general.language",value:e})}get dateFormat(){return this.$store.state.gui.general.dateFormat}set dateFormat(e){this.$store.dispatch("gui/saveSetting",{name:"general.dateFormat",value:e})}get dateFormatItems(){const e=new Date,t=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language;return[{value:null,text:"Browser (".concat(e.toLocaleDateString(t,{dateStyle:"medium"}),")")},{value:"2-digits",text:e.toLocaleDateString(t,{day:"2-digit",month:"2-digit",year:"numeric"})},{value:"short",text:e.toLocaleDateString(t,{day:"2-digit",month:"short",year:"numeric"})}]}get timeFormat(){return this.$store.state.gui.general.timeFormat}set timeFormat(e){this.$store.dispatch("gui/saveSetting",{name:"general.timeFormat",value:e})}get timeFormatItems(){const e=new Date,t=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language;return[{value:null,text:"Browser (".concat(e.toLocaleTimeString(t,{timeStyle:"short"}),")")},{value:"24hours",text:this.$t("Settings.GeneralTab.24hours",{time:e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"})})},{value:"12hours",text:this.$t("Settings.GeneralTab.12hours",{time:e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit",hourCycle:"h12"})})}]}get calcPrintProgressItems(){return[{value:"file-relative",text:this.$t("Settings.GeneralTab.CalcPrintProgressItems.FileRelative")},{value:"file-absolute",text:this.$t("Settings.GeneralTab.CalcPrintProgressItems.FileAbsolute")},{value:"slicer",text:this.$t("Settings.GeneralTab.CalcPrintProgressItems.Slicer")},{value:"filament",text:this.$t("Settings.GeneralTab.CalcPrintProgressItems.Filament")}]}get calcPrintProgress(){var e;return(e=this.$store.state.gui.general.calcPrintProgress)!=null?e:"file-relative"}set calcPrintProgress(e){this.$store.dispatch("gui/saveSetting",{name:"general.calcPrintProgress",value:e})}get calcEstimateItems(){return[{value:"file",text:this.$t("Settings.GeneralTab.EstimateValues.File")},{value:"filament",text:this.$t("Settings.GeneralTab.EstimateValues.Filament")}]}get calcEstimateTime(){return this.$store.state.gui.general.calcEstimateTime}set calcEstimateTime(e){this.$store.dispatch("gui/saveSetting",{name:"general.calcEstimateTime",value:e})}get calcEtaTimeItems(){return[{value:"file",text:this.$t("Settings.GeneralTab.EstimateValues.File")},{value:"filament",text:this.$t("Settings.GeneralTab.EstimateValues.Filament")},{value:"slicer",text:this.$t("Settings.GeneralTab.EstimateValues.Slicer")}]}get calcEtaTime(){return this.$store.state.gui.general.calcEtaTime}set calcEtaTime(e){this.$store.dispatch("gui/saveSetting",{name:"general.calcEtaTime",value:e})}};Om=bT([S({components:{Panel:U,SettingsRow:j,CheckboxList:ti,SettingsGeneralTabBackupDatabase:vb,SettingsGeneralTabRestoreDatabase:dT,SettingsGeneralTabResetDatabase:_T}})],Om);var yT=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(Pe,{attrs:{flat:""}},[t(Z,[t(j,{attrs:{title:e.$t("Settings.GeneralTab.PrinterName")}},[t(se,{attrs:{"hide-details":"",outlined:"",dense:""},model:{value:e.printerName,callback:function(r){e.printerName=r},expression:"printerName"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.GeneralTab.Language")}},[t(ke,{attrs:{items:e.availableLanguages,"hide-details":"",outlined:"",dense:""},model:{value:e.currentLanguage,callback:function(r){e.currentLanguage=r},expression:"currentLanguage"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.GeneralTab.DateFormat")}},[t(ke,{attrs:{items:e.dateFormatItems,"hide-details":"",outlined:"",dense:""},model:{value:e.dateFormat,callback:function(r){e.dateFormat=r},expression:"dateFormat"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.GeneralTab.TimeFormat")}},[t(ke,{attrs:{items:e.timeFormatItems,"hide-details":"",outlined:"",dense:""},model:{value:e.timeFormat,callback:function(r){e.timeFormat=r},expression:"timeFormat"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.GeneralTab.CalcPrintProgress"),"sub-title":e.$t("Settings.GeneralTab.CalcPrintProgressDescription")}},[t(ke,{attrs:{items:e.calcPrintProgressItems,"hide-details":"",dense:"",outlined:""},model:{value:e.calcPrintProgress,callback:function(r){e.calcPrintProgress=r},expression:"calcPrintProgress"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.GeneralTab.CalcEstimateTime"),"sub-title":e.$t("Settings.GeneralTab.CalcEstimateTimeDescription")}},[t(ke,{attrs:{items:e.calcEstimateItems,multiple:"","hide-details":"",dense:"",outlined:""},model:{value:e.calcEstimateTime,callback:function(r){e.calcEstimateTime=r},expression:"calcEstimateTime"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.GeneralTab.CalcEtaTime"),"sub-title":e.$t("Settings.GeneralTab.CalcEtaTimeDescription")}},[t(ke,{attrs:{items:e.calcEtaTimeItems,multiple:"","hide-details":"",dense:"",outlined:""},model:{value:e.calcEtaTime,callback:function(r){e.calcEtaTime=r},expression:"calcEtaTime"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.GeneralTab.MainsailSettingsMoonrakerDb"),"dynamic-slot-width":!0}},[t("settings-general-tab-backup-database"),t("settings-general-tab-restore-database")],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.GeneralTab.FactoryReset"),"dynamic-slot-width":!0}},[t("settings-general-tab-reset-database")],1)],1)],1)],1)},CT=[],$T=E(Om,yT,CT,!1,null,null);const xT=$T.exports;function wT(s){switch(s){case"Hlsstreamer":return()=>fe(()=>import("./Hlsstreamer-BpBN3Lzc.js"),__vite__mapDeps([8,2,3,4,5,6,9]));case"Ipstreamer":return()=>fe(()=>import("./Ipstreamer-BPf8FdFe.js"),__vite__mapDeps([10,2,3,4,5,6,11]));case"JanusStreamer":return()=>fe(()=>import("./JanusStreamer-CQyYvBpk.js"),__vite__mapDeps([12,3,4,6,2,5,13]));case"JMuxerStream":return()=>fe(()=>import("./JMuxerStream-Cqmc9Hrb.js"),__vite__mapDeps([14,3,4,2,5,6,15]));case"Mjpegstreamer":return()=>fe(()=>import("./Mjpegstreamer-vxbaTGlP.js"),__vite__mapDeps([16,17,18,2,3,4,5,6,19]));case"MjpegstreamerAdaptive":return()=>fe(()=>import("./MjpegstreamerAdaptive-Boi1-RyL.js"),__vite__mapDeps([20,17,18,2,3,4,5,6,21]));case"Uv4lMjpeg":return()=>fe(()=>import("./Uv4lMjpeg-1VbXGWjy.js"),__vite__mapDeps([22,2,3,4,5,6,23]));case"WebrtcCameraStreamer":return()=>fe(()=>import("./WebrtcCameraStreamer-CRSlmQer.js"),__vite__mapDeps([24,17,18,2,3,4,5,6,25]));case"WebrtcMediaMTX":return()=>fe(()=>import("./WebrtcMediaMTX-9dkGjohV.js"),__vite__mapDeps([26,2,3,4,5,6,27]));case"WebrtcGo2rtc":return()=>fe(()=>import("./WebrtcGo2rtc-DGvVGkMJ.js"),__vite__mapDeps([28,2,3,4,5,6,29]))}}const bs=s=>y.component(s,wT(s));var ST=Object.defineProperty,PT=Object.getOwnPropertyDescriptor,Ja=(s,e,t,r)=>{for(var i=r>1?void 0:r?PT(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&ST(e,t,i),i};let Vr=class extends k(L){get service(){var s,e;return(e=(s=this.webcam)==null?void 0:s.service)!=null?e:"unknown"}};Ja([w({type:Object,required:!0})],Vr.prototype,"webcam",2);Ja([w({type:Boolean,default:!0})],Vr.prototype,"showFps",2);Ja([w({default:null})],Vr.prototype,"printerUrl",2);Ja([w({type:String,default:null})],Vr.prototype,"page",2);Vr=Ja([S({components:{HlsstreamerAsync:bs("Hlsstreamer"),IpstreamerAsync:bs("Ipstreamer"),JanusStreamerAsync:bs("JanusStreamer"),JMuxerStreamAsync:bs("JMuxerStream"),MjpegstreamerAsync:bs("Mjpegstreamer"),MjpegstreamerAdaptiveAsync:bs("MjpegstreamerAdaptive"),Uv4lMjpegAsync:bs("Uv4lMjpeg"),WebrtcCameraStreamerAsync:bs("WebrtcCameraStreamer"),WebrtcMediaMTXAsync:bs("WebrtcMediaMTX"),WebrtcGo2rtcAsync:bs("WebrtcGo2rtc")}})],Vr);var DT=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.service==="mjpegstreamer"?[t("mjpegstreamer-async",{attrs:{"cam-settings":e.webcam,"show-fps":e.showFps,"printer-url":e.printerUrl,page:e.page}})]:e.service==="mjpegstreamer-adaptive"?[t("mjpegstreamer-adaptive-async",{attrs:{"cam-settings":e.webcam,"show-fps":e.showFps,"printer-url":e.printerUrl}})]:e.service==="uv4l-mjpeg"?[t("uv4l-mjpeg-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:e.service==="ipstream"?[t("ipstreamer-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:e.service==="hlsstream"?[t("hlsstreamer-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:e.service==="jmuxer-stream"?[t("j-muxer-stream-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:e.service==="webrtc-camerastreamer"?[t("webrtc-camera-streamer-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl,page:e.page}})]:e.service==="webrtc-janus"?[t("janus-streamer-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:e.service==="webrtc-mediamtx"?[t("webrtc-media-m-t-x-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl,page:e.page}})]:e.service==="webrtc-go2rtc"?[t("webrtc-go2rtc-async",{attrs:{"cam-settings":e.webcam,"printer-url":e.printerUrl}})]:[t("p",{staticClass:"text-center py-3 font-italic"},[e._v(e._s(e.$t("Panels.WebcamPanel.UnknownWebcamService")))])]],2)},TT=[],OT=E(Vr,DT,TT,!1,null,"23c5e0fb");const Mm=OT.exports;var MT=Object.defineProperty,kT=Object.getOwnPropertyDescriptor,Ka=(s,e,t,r)=>{for(var i=r>1?void 0:r?kT(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&MT(e,t,i),i};let Br=class extends k(L){get webcams(){return this.$store.getters["gui/webcams/getWebcams"]}};Ka([w({type:Object,required:!0})],Br.prototype,"webcam",2);Ka([w({type:Boolean,default:!0})],Br.prototype,"showFps",2);Ka([w({type:String,default:null})],Br.prototype,"printerUrl",2);Ka([w({type:String,default:null})],Br.prototype,"page",2);Br=Ka([S({components:{WebcamWrapperItem:Mm}})],Br);var ET=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.webcam.service==="grid"?[e.webcams?t(Ee,{staticClass:"pb-4",attrs:{fluid:""}},[t(x,{attrs:{dense:""}},e._l(e.webcams,function(r){return t(b,{key:r.name,attrs:{cols:"6"}},[t(Mm,{attrs:{webcam:r,"printer-url":e.printerUrl,"show-fps":e.showFps,page:e.page}})],1)}),1)],1):e._e()]:[t(Mm,{attrs:{webcam:e.webcam,"printer-url":e.printerUrl,"show-fps":e.showFps,page:e.page}})]],2)},LT=[],AT=E(Br,ET,LT,!1,null,"ecfdaad2");const Cu=AT.exports;var FT=Object.getOwnPropertyDescriptor,RT=(s,e,t,r)=>{for(var i=r>1?void 0:r?FT(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let ur=class extends k(L){convertUrl(s,e){var r,i,n,a,o,l,u,c;let t=new URL(s,this.hostUrl.toString());if(e!==null&&(t=new URL(s,e)),(s.startsWith("http")||s.startsWith("://"))&&(t=new URL(s)),s.startsWith("/webcam")){const d=[80];d.push((a=(n=(i=(r=this.$store.state.server.config)==null?void 0:r.config)==null?void 0:i.server)==null?void 0:n.port)!=null?a:7125),d.push((c=(u=(l=(o=this.$store.state.server.config)==null?void 0:o.config)==null?void 0:l.server)==null?void 0:u.ssl_port)!=null?c:7130),d.includes(this.hostPort)||(t.port=this.hostPort.toString())}return decodeURIComponent(t.toString())}convertWebcamIcon(s){switch(s){case"mdiAlbum":return dw;case"mdiCampfire":return yw;case"mdiDoor":return jw;case"mdiRadiatorDisabled":return yv;case"mdiPrinter3d":return qa;case"mdiPrinter3dNozzle":return Us;case"mdiRaspberryPi":return _S;default:return on}}generateTransform(s,e,t){let r="";return s&&(r+=" scaleX(-1)"),e&&(r+=" scaleY(-1)"),t===180&&(r+=" rotate(180deg)"),r.trimStart().length?r.trimStart():"none"}};ur=RT([S],ur);var HT=Object.defineProperty,jT=Object.getOwnPropertyDescriptor,uf=(s,e,t,r)=>{for(var i=r>1?void 0:r?jT(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&HT(e,t,i),i};let aa=class extends k(L,ur){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=Ue,this.mdiMenuDown=gr,this.selectIcon=!1,this.valid=!1,this.oldWebcamName="",this.rules={required:s=>s!==""||this.$t("Settings.WebcamsTab.Required"),unique:s=>!this.existsWebcamName(s)||this.$t("Settings.WebcamsTab.NameAlreadyExists")}}get webcams(){var s,e;return(e=(s=this.$store.state.gui.webcams)==null?void 0:s.webcams)!=null?e:[]}get title(){return this.type==="create"?this.$t("Settings.WebcamsTab.CreateWebcam"):this.$t("Settings.WebcamsTab.EditWebcam")}get actionButtonText(){return this.type==="create"?this.$t("Settings.WebcamsTab.SaveWebcam"):this.$t("Settings.WebcamsTab.UpdateWebcam")}get rotationItems(){const s=[0,90,180,270],e=[];return s.forEach(t=>{e.push({value:t,text:"".concat(t,"°")})}),e}get rulesStreamUrl(){let s=[];return this.webcam.service!=="mjpegstreamer-adaptive"&&s.push(this.rules.required),s}get rulesSnapshotUrl(){let s=[];return this.webcam.service==="mjpegstreamer-adaptive"&&s.push(this.rules.required),s}get serviceItems(){return[{value:"mjpegstreamer",text:this.$t("Settings.WebcamsTab.Mjpegstreamer")},{value:"mjpegstreamer-adaptive",text:this.$t("Settings.WebcamsTab.MjpegstreamerAdaptive")},{value:"uv4l-mjpeg",text:this.$t("Settings.WebcamsTab.Uv4lMjpeg")},{value:"ipstream",text:this.$t("Settings.WebcamsTab.Ipstream")},{value:"webrtc-camerastreamer",text:this.$t("Settings.WebcamsTab.WebrtcCameraStreamer")},{value:"webrtc-go2rtc",text:this.$t("Settings.WebcamsTab.WebrtcGo2rtc")},{value:"webrtc-mediamtx",text:this.$t("Settings.WebcamsTab.WebrtcMediaMTX")},{value:"hlsstream",text:this.$t("Settings.WebcamsTab.Hlsstream")},{value:"jmuxer-stream",text:this.$t("Settings.WebcamsTab.JMuxerStream")},{value:"webrtc-janus",text:this.$t("Settings.WebcamsTab.WebrtcJanus")}]}get iconItems(){return[{value:"mdiPrinter3d",text:this.$t("Settings.WebcamsTab.IconPrinter")},{value:"mdiPrinter3dNozzle",text:this.$t("Settings.WebcamsTab.IconNozzle")},{value:"mdiRadiatorDisabled",text:this.$t("Settings.WebcamsTab.IconBed")},{value:"mdiWebcam",text:this.$t("Settings.WebcamsTab.IconCam")},{value:"mdiAlbum",text:this.$t("Settings.WebcamsTab.IconFilament")},{value:"mdiDoor",text:this.$t("Settings.WebcamsTab.IconDoor")},{value:"mdiRaspberryPi",text:this.$t("Settings.WebcamsTab.IconMcu")},{value:"mdiCampfire",text:this.$t("Settings.WebcamsTab.IconHot")}]}get classIconButtonArrow(){let s=["_transition"];return this.selectIcon&&s.push("_rotate-180"),s}get hasFpsCounter(){return["mjpegstreamer","mjpegstreamer-adaptive"].includes(this.webcam.service)}get hasAudioOption(){return["webrtc-go2rtc"].includes(this.webcam.service)}get hideFps(){var s,e;return(e=(s=this.webcam.extra_data)==null?void 0:s.hideFps)!=null?e:!1}set hideFps(s){if(!("extra_data"in this.webcam)){this.webcam.extra_data={hideFps:s};return}this.webcam.extra_data.hideFps=s}get enableAudio(){var s,e;return(e=(s=this.webcam.extra_data)==null?void 0:s.enableAudio)!=null?e:!1}set enableAudio(s){if(!("extra_data"in this.webcam)){this.webcam.extra_data={enableAudio:s};return}this.webcam.extra_data.enableAudio=s}get nozzleCrosshairAvialable(){return["mjpegstreamer","mjpegstreamer-adaptive","webrtc-camerastreamer"].includes(this.webcam.service)}get nozzleCrosshair(){var s,e;return(e=(s=this.webcam.extra_data)==null?void 0:s.nozzleCrosshair)!=null?e:!1}set nozzleCrosshair(s){var t;const e={...(t=this.webcam.extra_data)!=null?t:{}};e.nozzleCrosshair=s,this.webcam.extra_data=e}get nozzleCrosshairColor(){var s,e;return(e=(s=this.webcam.extra_data)==null?void 0:s.nozzleCrosshairColor)!=null?e:"#ff0000"}set nozzleCrosshairColor(s){var t;const e={...(t=this.webcam.extra_data)!=null?t:{}};e.nozzleCrosshairColor=s,this.webcam.extra_data=e}updateLogoColor(s){if(typeof s=="object"){this.nozzleCrosshairColor=s.hex;return}this.nozzleCrosshairColor=s}get nozzleCrosshairSize(){var s,e;return(e=(s=this.webcam.extra_data)==null?void 0:s.nozzleCrosshairSize)!=null?e:.1}set nozzleCrosshairSize(s){var t;const e={...(t=this.webcam.extra_data)!=null?t:{}};e.nozzleCrosshairSize=s,this.webcam.extra_data=e}mounted(){this.oldWebcamName=this.webcam.name}existsWebcamName(s){var t,r;s=s.toLowerCase().trim();const e=(r=(t=this.webcams.find(i=>i.name.toLowerCase().trim()===s))==null?void 0:t.length)!=null?r:0;return this.type==="create"?e!==0:e>=1}submit(){if(this.type==="create"){this.save();return}this.update()}async save(){await this.$store.dispatch("gui/webcams/store",this.webcam),this.$emit("close")}async update(){await this.$store.dispatch("gui/webcams/update",{webcam:this.webcam,oldWebcamName:this.oldWebcamName}),this.$emit("close")}closeForm(){this.$emit("close")}};uf([w({type:Object,required:!0})],aa.prototype,"webcam",2);uf([w({type:String,default:"create"})],aa.prototype,"type",2);aa=uf([S({components:{SettingsRow:j}})],aa);var IT=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(or,{ref:"webcamForm",on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(r){e.valid=r},expression:"valid"}},[t(gt,[e._v(e._s(e.title))]),t(Z,[t(x,[t(b,{staticClass:"col-12 col-sm-6"},[t(x,[t(b,{staticClass:"d-flex"},[t(Wt,[t(ye,{attrs:{"offset-y":!0,title:"Icon"},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"px-2 mr-2 _transition _menu-button",attrs:{color:"transparent",elevation:"0",ripple:!1}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.convertWebcamIcon(e.webcam.icon)))]),t(_,{staticClass:"pl-1 mr-n2",class:e.classIconButtonArrow},[e._v(" "+e._s(e.mdiMenuDown)+" ")])],1)]}}]),model:{value:e.selectIcon,callback:function(r){e.selectIcon=r},expression:"selectIcon"}},[t(Me,{staticClass:"py-0",attrs:{dense:""}},e._l(e.iconItems,function(r){return t(J,{key:r.value,attrs:{link:""},on:{click:function(i){e.webcam.icon=r.value}}},[t(Hs,{staticClass:"mr-2"},[t(_,{staticClass:"mt-1",attrs:{small:""}},[e._v(" "+e._s(e.convertWebcamIcon(r.value))+" ")])],1),t(_t,[t(Ze,{domProps:{textContent:e._s(r.text)}})],1)],1)}),1)],1)],1),t(se,{staticClass:"_webcam-settings-name-field",attrs:{label:e.$t("Settings.WebcamsTab.Name"),"hide-details":"auto",outlined:"",rules:[e.rules.required,e.rules.unique],dense:""},model:{value:e.webcam.name,callback:function(r){e.$set(e.webcam,"name",r)},expression:"webcam.name"}})],1)],1),t(x,[t(b,{staticClass:"py-2"},[t(se,{attrs:{label:e.$t("Settings.WebcamsTab.UrlStream"),"hide-details":"auto",outlined:"",dense:"",rules:e.rulesStreamUrl},model:{value:e.webcam.stream_url,callback:function(r){e.$set(e.webcam,"stream_url",r)},expression:"webcam.stream_url"}})],1)],1),t(x,[t(b,{staticClass:"py-2"},[t(se,{attrs:{label:e.$t("Settings.WebcamsTab.UrlSnapshot"),"hide-details":"auto",outlined:"",dense:"",rules:e.rulesSnapshotUrl},model:{value:e.webcam.snapshot_url,callback:function(r){e.$set(e.webcam,"snapshot_url",r)},expression:"webcam.snapshot_url"}})],1)],1),t(x,[t(b,{staticClass:"py-2"},[t(ke,{attrs:{items:e.serviceItems,"hide-details":"",outlined:"",dense:"",label:e.$t("Settings.WebcamsTab.Service")},model:{value:e.webcam.service,callback:function(r){e.$set(e.webcam,"service",r)},expression:"webcam.service"}})],1)],1),["mjpegstreamer-adaptive","jmuxer-stream"].includes(e.webcam.service)?t(x,[t(b,{staticClass:"py-2 col-6"},[t(se,{attrs:{outlined:"",dense:"","hide-details":"",label:e.$t("Settings.WebcamsTab.TargetFPS")},model:{value:e.webcam.target_fps,callback:function(r){e.$set(e.webcam,"target_fps",r)},expression:"webcam.target_fps"}})],1),t(b,{staticClass:"py-2 col-6"},[t(ke,{attrs:{items:e.rotationItems,outlined:"",dense:"","hide-details":"",label:e.$t("Settings.WebcamsTab.Rotate")},model:{value:e.webcam.rotation,callback:function(r){e.$set(e.webcam,"rotation",r)},expression:"webcam.rotation"}})],1)],1):e._e(),e.hasFpsCounter?t(x,[t(b,{staticClass:"pt-1 pb-3"},[t(ge,{staticClass:"mt-1",attrs:{"hide-details":"",label:e.$t("Settings.WebcamsTab.HideFps")},model:{value:e.hideFps,callback:function(r){e.hideFps=r},expression:"hideFps"}})],1)],1):e._e(),e.hasAudioOption?t(x,[t(b,{staticClass:"pt-1 pb-3"},[t(ge,{staticClass:"mt-1",attrs:{"hide-details":"",label:e.$t("Settings.WebcamsTab.EnableAudio")},model:{value:e.enableAudio,callback:function(r){e.enableAudio=r},expression:"enableAudio"}})],1)],1):e._e(),t(x,[t(b,{staticClass:"pt-1 pb-3"},[t("div",{staticClass:"v-label v-label--active theme--dark text-subtitle-1"},[e._v(" "+e._s(e.$t("Settings.WebcamsTab.FlipWebcam"))+" ")])])],1),t(x,{staticClass:"mt-0"},[t(b,{staticClass:"py-0"},[t(ge,{staticClass:"mt-1",attrs:{"hide-details":"",label:e.$t("Settings.WebcamsTab.Horizontally")},model:{value:e.webcam.flip_horizontal,callback:function(r){e.$set(e.webcam,"flip_horizontal",r)},expression:"webcam.flip_horizontal"}})],1),t(b,{staticClass:"py-0"},[t(ge,{staticClass:"mt-1",attrs:{"hide-details":"",label:e.$t("Settings.WebcamsTab.Vertically")},model:{value:e.webcam.flip_vertical,callback:function(r){e.$set(e.webcam,"flip_vertical",r)},expression:"webcam.flip_vertical"}})],1)],1),e.nozzleCrosshairAvialable?[t(x,[t(b,{staticClass:"pt-3 pb-3"},[t("div",{staticClass:"v-label v-label--active theme--dark text-subtitle-1"},[e._v(" "+e._s(e.$t("Settings.WebcamsTab.NozzleCrosshair"))+": ")])])],1),t(x,{staticClass:"mt-0"},[t(b,{staticClass:"py-0"},[t(ge,{staticClass:"mt-1",attrs:{"hide-details":"",label:e.$t("Settings.WebcamsTab.Enable")},model:{value:e.nozzleCrosshair,callback:function(r){e.nozzleCrosshair=r},expression:"nozzleCrosshair"}})],1),e.nozzleCrosshair?t(b,{staticClass:"py-0"},[t(ye,{attrs:{bottom:"",left:"","offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"minwidth-0 px-5",attrs:{color:e.nozzleCrosshairColor,small:""}},"v-btn",i,!1),r))]}}],null,!1,3652875639)},[t(Xt,{attrs:{value:e.nozzleCrosshairColor,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":e.updateLogoColor}})],1),t("div",{staticClass:"v-label v-label--active theme--dark text-subtitle-1 d-inline-block ml-2 mt-2"},[e._v(" "+e._s(e.$t("Settings.WebcamsTab.Color"))+" ")])],1):e._e()],1),e.nozzleCrosshair?t(x,[t(b,[t(Lr,{attrs:{max:1,min:.01,step:.01,"thumb-label":"","thumb-size":"24","hide-details":"",label:e.$t("Settings.WebcamsTab.Size")},model:{value:e.nozzleCrosshairSize,callback:function(r){e.nozzleCrosshairSize=r},expression:"nozzleCrosshairSize"}})],1)],1):e._e()]:e._e()],2),t(b,{staticClass:"col-12 col-sm-6 text-center",attrs:{"align-self":"center"}},[t(Cu,{attrs:{webcam:e.webcam,page:"settings"}})],1)],1)],1),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:e.closeForm}},[e._v(e._s(e.$t("Settings.Cancel")))]),t(g,{attrs:{color:"primary",text:"",type:"submit",disabled:!e.valid}},[e._v(e._s(e.actionButtonText))])],1)],1)},NT=[],VT=E(aa,IT,NT,!1,null,"7419c62c");const bb=VT.exports;var BT=Object.defineProperty,UT=Object.getOwnPropertyDescriptor,df=(s,e,t,r)=>{for(var i=r>1?void 0:r?UT(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&BT(e,t,i),i};let oa=class extends k(L,ur){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=Ue,this.mdiLightbulbOutline=zp}get icon(){return this.convertWebcamIcon(this.webcam.icon)}get subtitle(){return this.webcam.service==="mjpegstreamer-adaptive"?"URL: ".concat(this.webcam.snapshot_url):"URL: ".concat(this.webcam.stream_url)}toogleStatus(){let s={...this.webcam};s.enabled=!s.enabled,this.$store.dispatch("gui/webcams/update",{webcam:s,oldWebcamName:s.name})}edit(){this.$emit("edit-webcam",this.webcam)}deleteWebcam(){this.$store.dispatch("gui/webcams/delete",this.webcam.name)}};df([w({type:Object,default:()=>{}})],oa.prototype,"webcam",2);df([w({type:Boolean,default:!1})],oa.prototype,"boolBorderTop",2);oa=df([S({components:{SettingsRow:j}})],oa);var WT=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.boolBorderTop?t(I,{staticClass:"my-2"}):e._e(),t(j,{attrs:{title:e.webcam.name,icon:e.icon,"sub-title":e.subtitle}},[e.webcam.source==="database"?[t(g,{staticClass:"minwidth-0 px-2",attrs:{small:"",outlined:"",color:e.webcam.enabled?"":"secondary"},on:{click:e.toogleStatus}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiLightbulbOutline))])],1),t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:e.edit}},[t(_,{attrs:{small:"",left:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:e.deleteWebcam}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)]:e._e()],2)],1)},zT=[],GT=E(oa,WT,zT,!1,null,"a57386ad");const yb=GT.exports;var ZT=Object.getOwnPropertyDescriptor,qT=(s,e,t,r)=>{for(var i=r>1?void 0:r?ZT(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let km=class extends k(L,ur){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=Ue,this.boolForm=!1,this.typeForm="create",this.formWebcam={}}get webcams(){var e;return(e=this.$store.state.gui.webcams.webcams)!=null?e:[]}get configfiles(){var e,t;return(t=(e=this.$store.getters["files/getDirectory"]("config"))==null?void 0:e.childrens)!=null?t:[]}get crowsnestConf(){return this.configfiles.find(e=>e.filename==="crowsnest.conf")}get existCrowsnestConf(){return this.configfiles.findIndex(e=>e.filename==="crowsnest.conf")!==-1}openCrowsnestConf(){var e,t,r;this.$store.dispatch("editor/openFile",{root:"config",path:"/",filename:(e=this.crowsnestConf)==null?void 0:e.filename,size:(t=this.crowsnestConf)==null?void 0:t.size,permissions:(r=this.crowsnestConf)==null?void 0:r.permissions})}createWebcam(){this.formWebcam={name:"",enabled:!0,icon:"mdiWebcam",service:"mjpegstreamer-adaptive",target_fps:15,target_fps_idle:15,stream_url:"/webcam/?action=stream",snapshot_url:"/webcam/?action=snapshot",rotation:0,flip_horizontal:!1,flip_vertical:!1,extra_data:{}},this.typeForm="create",this.boolForm=!0}closeForm(){this.boolForm=!1}editWebcam(e){this.formWebcam={...e},this.typeForm="edit",this.boolForm=!0}};km=qT([S({components:{SettingsRow:j,WebcamForm:bb,WebcamListEntry:yb}})],km);var XT=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.boolForm?t(Pe,{attrs:{flat:""}},[t(bb,{attrs:{webcam:e.formWebcam,type:e.typeForm},on:{close:e.closeForm}})],1):t(Pe,{attrs:{flat:""}},[t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.WebcamsTab.Webcams")))]),e._l(e.webcams,function(r,i){return t(yb,{key:r.name,attrs:{webcam:r,"bool-border-top":i>0},on:{"edit-webcam":e.editWebcam}})})],2),t(oe,[e.existCrowsnestConf?t(g,{attrs:{text:"",color:"primary"},on:{click:e.openCrowsnestConf}},[e._v(" "+e._s(e.$t("Settings.WebcamsTab.EditCrowsnestConf"))+" ")]):e._e(),t(ae),t(g,{attrs:{text:"",color:"primary"},on:{click:e.createWebcam}},[e._v(e._s(e.$t("Settings.WebcamsTab.AddWebcam")))])],1)],1)],1)},YT=[],JT=E(km,XT,YT,!1,null,null);const KT=JT.exports;var QT=Object.getOwnPropertyDescriptor,eO=(s,e,t,r)=>{for(var i=r>1?void 0:r?QT(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Em=class extends k(L){constructor(){super(...arguments),this.mdiMagnify=rn,this.searchMacros=""}get macros(){var e;return((e=this.$store.getters["printer/getMacros"])!=null?e:[]).filter(t=>{var r;return t.name.toLowerCase().includes(this.searchMacros.toLowerCase())||((r=t.description)==null?void 0:r.toLowerCase().includes(this.searchMacros.toLowerCase()))})}get hiddenMacros(){var s;return(s=this.$store.state.gui.macros.hiddenMacros)!=null?s:[]}getMacroStatus(s){return!this.hiddenMacros.includes(s.toUpperCase())}changeMacroStatus(s){const e=[...this.hiddenMacros];this.hiddenMacros.includes(s.toUpperCase())?e.splice(e.indexOf(s.toUpperCase()),1):e.push(s.toUpperCase()),this.$store.dispatch("gui/macros/saveSetting",{name:"hiddenMacros",value:e})}};Em=eO([S({components:{SettingsRow:j}})],Em);var tO=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Z,[t(x,{staticClass:"mt-6 mb-3 flex-column flex-md-row"},[t(b,{staticClass:"py-0 align-content-center mb-3 mb-md-0"},[t("h3",{staticClass:"text-h5"},[e._v(e._s(e.$t("Settings.MacrosTab.Macros")))])]),t(b,{staticClass:"py-0"},[t(se,{attrs:{"append-icon":e.mdiMagnify,label:e.$t("Settings.MacrosTab.Search"),"single-line":"",outlined:"",clearable:"","hide-details":"",dense:""},model:{value:e.searchMacros,callback:function(r){e.searchMacros=r},expression:"searchMacros"}})],1)],1),e.macros.length?[e._l(e.macros,function(r,i){return[i?t(I,{key:i+"_divider",staticClass:"my-2"}):e._e(),t(j,{key:i,attrs:{title:r.name,"sub-title":r.description,"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"input-value":e.getMacroStatus(r.name),"hide-details":""},on:{change:function(n){return e.changeMacroStatus(r.name)}}})],1)]})]:t(x,[t(b,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(e._s(e.$t("Settings.MacrosTab.NOMacros")))])])],1)],2)},sO=[],rO=E(Em,tO,sO,!1,null,null);const Cb=rO.exports;var $b={exports:{}};/**! + * Sortable 1.10.2 + * @author RubaXa + * @author owenm + * @license MIT + */function No(s){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?No=function(e){return typeof e}:No=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},No(s)}function iO(s,e,t){return e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function es(){return es=Object.assign||function(s){for(var e=1;e=0)&&(t[i]=s[i]);return t}function aO(s,e){if(s==null)return{};var t=nO(s,e),r,i;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(s);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(s,r)&&(t[r]=s[r])}return t}function oO(s){return lO(s)||cO(s)||uO()}function lO(s){if(Array.isArray(s)){for(var e=0,t=new Array(s.length);e"&&(e=e.substring(1)),s)try{if(s.matches)return s.matches(e);if(s.msMatchesSelector)return s.msMatchesSelector(e);if(s.webkitMatchesSelector)return s.webkitMatchesSelector(e)}catch{return!1}return!1}}function hO(s){return s.host&&s!==document&&s.host.nodeType?s.host:s.parentNode}function os(s,e,t,r){if(s){t=t||document;do{if(e!=null&&(e[0]===">"?s.parentNode===t&&kl(s,e):kl(s,e))||r&&s===t)return s;if(s===t)break}while(s=hO(s))}return null}var qg=/\s+/g;function Ve(s,e,t){if(s&&e)if(s.classList)s.classList[t?"add":"remove"](e);else{var r=(" "+s.className+" ").replace(qg," ").replace(" "+e+" "," ");s.className=(r+(t?" "+e:"")).replace(qg," ")}}function me(s,e,t){var r=s&&s.style;if(r){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(s,""):s.currentStyle&&(t=s.currentStyle),e===void 0?t:t[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=t+(typeof t=="string"?"":"px")}}function Ar(s,e){var t="";if(typeof s=="string")t=s;else do{var r=me(s,"transform");r&&r!=="none"&&(t=r+" "+t)}while(!e&&(s=s.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(t)}function Sb(s,e,t){if(s){var r=s.getElementsByTagName(e),i=0,n=r.length;if(t)for(;i=n,!a)return r;if(r===xs())break;r=Js(r,!1)}return!1}function El(s,e,t){for(var r=0,i=0,n=s.children;i2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,n=aO(r,["evt"]);eo.pluginEvent.bind(_e)(e,t,dr({dragEl:ne,parentEl:Qe,ghostEl:$e,rootEl:Ne,nextEl:Sr,lastDownEl:Vo,cloneEl:We,cloneHidden:Xs,dragStarted:Fn,putSortable:ut,activeSortable:_e.active,originalEvent:i,oldIndex:_i,oldDraggableIndex:Un,newIndex:Bt,newDraggableIndex:qs,hideGhostForTarget:kb,unhideGhostForTarget:Eb,cloneNowHidden:function(){Xs=!0},cloneNowShown:function(){Xs=!1},dispatchSortableEvent:function(o){yt({sortable:t,name:o,originalEvent:i})}},n))};function yt(s){An(dr({putSortable:ut,cloneEl:We,targetEl:ne,rootEl:Ne,oldIndex:_i,oldDraggableIndex:Un,newIndex:Bt,newDraggableIndex:qs},s))}var ne,Qe,$e,Ne,Sr,Vo,We,Xs,_i,Bt,Un,qs,xo,ut,gi=!1,Ll=!1,Al=[],Cr,is,Ad,Fd,Kg,Qg,Fn,li,Wn,zn=!1,wo=!1,Bo,ht,Rd=[],Am=!1,Fl=[],$u=typeof document<"u",So=xb,e1=Qa||Ws?"cssFloat":"float",yO=$u&&!mO&&!xb&&"draggable"in document.createElement("div"),Tb=function(){if($u){if(Ws)return!1;var s=document.createElement("x");return s.style.cssText="pointer-events:auto",s.style.pointerEvents==="auto"}}(),Ob=function(e,t){var r=me(e),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),n=El(e,0,t),a=El(e,1,t),o=n&&me(n),l=a&&me(a),u=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+Ge(n).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ge(a).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(n&&o.float&&o.float!=="none"){var d=o.float==="left"?"left":"right";return a&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return n&&(o.display==="block"||o.display==="flex"||o.display==="table"||o.display==="grid"||u>=i&&r[e1]==="none"||a&&r[e1]==="none"&&u+c>i)?"vertical":"horizontal"},CO=function(e,t,r){var i=r?e.left:e.top,n=r?e.right:e.bottom,a=r?e.width:e.height,o=r?t.left:t.top,l=r?t.right:t.bottom,u=r?t.width:t.height;return i===o||n===l||i+a/2===o+u/2},$O=function(e,t){var r;return Al.some(function(i){if(!mf(i)){var n=Ge(i),a=i[pt].options.emptyInsertThreshold,o=e>=n.left-a&&e<=n.right+a,l=t>=n.top-a&&t<=n.bottom+a;if(a&&o&&l)return r=i}}),r},Mb=function(e){function t(n,a){return function(o,l,u,c){var d=o.options.group.name&&l.options.group.name&&o.options.group.name===l.options.group.name;if(n==null&&(a||d))return!0;if(n==null||n===!1)return!1;if(a&&n==="clone")return n;if(typeof n=="function")return t(n(o,l,u,c),a)(o,l,u,c);var m=(a?o:l).options.group.name;return n===!0||typeof n=="string"&&n===m||n.join&&n.indexOf(m)>-1}}var r={},i=e.group;(!i||No(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=t(i.pull,!0),r.checkPut=t(i.put),r.revertClone=i.revertClone,e.group=r},kb=function(){!Tb&&$e&&me($e,"display","none")},Eb=function(){!Tb&&$e&&me($e,"display","")};$u&&document.addEventListener("click",function(s){if(Ll)return s.preventDefault(),s.stopPropagation&&s.stopPropagation(),s.stopImmediatePropagation&&s.stopImmediatePropagation(),Ll=!1,!1},!0);var $r=function(e){if(ne){e=e.touches?e.touches[0]:e;var t=$O(e.clientX,e.clientY);if(t){var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);r.target=r.rootEl=t,r.preventDefault=void 0,r.stopPropagation=void 0,t[pt]._onDragOver(r)}}},xO=function(e){ne&&ne.parentNode[pt]._isOutsideThisEl(e.target)};function _e(s,e){if(!(s&&s.nodeType&&s.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(s));this.el=s,this.options=e=es({},e),s[pt]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(s.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ob(s,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,o){a.setData("Text",o.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:_e.supportPointer!==!1&&"PointerEvent"in window,emptyInsertThreshold:5};eo.initializePlugins(this,s,t);for(var r in t)!(r in e)&&(e[r]=t[r]);Mb(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:yO,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Oe(s,"pointerdown",this._onTapStart):(Oe(s,"mousedown",this._onTapStart),Oe(s,"touchstart",this._onTapStart)),this.nativeDraggable&&(Oe(s,"dragover",this),Oe(s,"dragenter",this)),Al.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),es(this,_O())}_e.prototype={constructor:_e,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(li=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,ne):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,r=this.el,i=this.options,n=i.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(o||e).target,u=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=i.filter;if(MO(r),!ne&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||i.disabled)&&!u.isContentEditable&&(l=os(l,i.draggable,r,!1),!(l&&l.animated)&&Vo!==l)){if(_i=ze(l),Un=ze(l,i.draggable),typeof c=="function"){if(c.call(this,e,l,this)){yt({sortable:t,rootEl:u,name:"filter",targetEl:l,toEl:r,fromEl:r}),Dt("filter",t,{evt:e}),n&&e.cancelable&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(d){if(d=os(u,d.trim(),r,!1),d)return yt({sortable:t,rootEl:d,name:"filter",targetEl:l,fromEl:r,toEl:r}),Dt("filter",t,{evt:e}),!0}),c)){n&&e.cancelable&&e.preventDefault();return}i.handle&&!os(u,i.handle,r,!1)||this._prepareDragStart(e,o,l)}}},_prepareDragStart:function(e,t,r){var i=this,n=i.el,a=i.options,o=n.ownerDocument,l;if(r&&!ne&&r.parentNode===n){var u=Ge(r);if(Ne=n,ne=r,Qe=ne.parentNode,Sr=ne.nextSibling,Vo=r,xo=a.group,_e.dragged=ne,Cr={target:ne,clientX:(t||e).clientX,clientY:(t||e).clientY},Kg=Cr.clientX-u.left,Qg=Cr.clientY-u.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,ne.style["will-change"]="all",l=function(){if(Dt("delayEnded",i,{evt:e}),_e.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Zg&&i.nativeDraggable&&(ne.draggable=!0),i._triggerDragStart(e,t),yt({sortable:i,name:"choose",originalEvent:e}),Ve(ne,a.chosenClass,!0)},a.ignore.split(",").forEach(function(c){Sb(ne,c.trim(),jd)}),Oe(o,"dragover",$r),Oe(o,"mousemove",$r),Oe(o,"touchmove",$r),Oe(o,"mouseup",i._onDrop),Oe(o,"touchend",i._onDrop),Oe(o,"touchcancel",i._onDrop),Zg&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ne.draggable=!0),Dt("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Qa||Ws))){if(_e.eventCanceled){this._onDrop();return}Oe(o,"mouseup",i._disableDelayedDrag),Oe(o,"touchend",i._disableDelayedDrag),Oe(o,"touchcancel",i._disableDelayedDrag),Oe(o,"mousemove",i._delayedDragTouchMoveHandler),Oe(o,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&Oe(o,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(l,a.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ne&&jd(ne),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;De(e,"mouseup",this._disableDelayedDrag),De(e,"touchend",this._disableDelayedDrag),De(e,"touchcancel",this._disableDelayedDrag),De(e,"mousemove",this._delayedDragTouchMoveHandler),De(e,"touchmove",this._delayedDragTouchMoveHandler),De(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?Oe(document,"pointermove",this._onTouchMove):t?Oe(document,"touchmove",this._onTouchMove):Oe(document,"mousemove",this._onTouchMove):(Oe(ne,"dragend",this),Oe(Ne,"dragstart",this._onDragStart));try{document.selection?Uo(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(gi=!1,Ne&&ne){Dt("dragStarted",this,{evt:t}),this.nativeDraggable&&Oe(document,"dragover",xO);var r=this.options;!e&&Ve(ne,r.dragClass,!1),Ve(ne,r.ghostClass,!0),_e.active=this,e&&this._appendGhost(),yt({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(is){this._lastX=is.clientX,this._lastY=is.clientY,kb();for(var e=document.elementFromPoint(is.clientX,is.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(is.clientX,is.clientY),e!==t);)t=e;if(ne.parentNode[pt]._isOutsideThisEl(e),t)do{if(t[pt]){var r=void 0;if(r=t[pt]._onDragOver({clientX:is.clientX,clientY:is.clientY,target:e,rootEl:t}),r&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Eb()}},_onTouchMove:function(e){if(Cr){var t=this.options,r=t.fallbackTolerance,i=t.fallbackOffset,n=e.touches?e.touches[0]:e,a=$e&&Ar($e,!0),o=$e&&a&&a.a,l=$e&&a&&a.d,u=So&&ht&&Yg(ht),c=(n.clientX-Cr.clientX+i.x)/(o||1)+(u?u[0]-Rd[0]:0)/(o||1),d=(n.clientY-Cr.clientY+i.y)/(l||1)+(u?u[1]-Rd[1]:0)/(l||1);if(!_e.active&&!gi){if(r&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))=0&&(yt({rootEl:Qe,name:"add",toEl:Qe,fromEl:Ne,originalEvent:e}),yt({sortable:this,name:"remove",toEl:Qe,originalEvent:e}),yt({rootEl:Qe,name:"sort",toEl:Qe,fromEl:Ne,originalEvent:e}),yt({sortable:this,name:"sort",toEl:Qe,originalEvent:e})),ut&&ut.save()):Bt!==_i&&Bt>=0&&(yt({sortable:this,name:"update",toEl:Qe,originalEvent:e}),yt({sortable:this,name:"sort",toEl:Qe,originalEvent:e})),_e.active&&((Bt==null||Bt===-1)&&(Bt=_i,qs=Un),yt({sortable:this,name:"end",toEl:Qe,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Dt("nulling",this),Ne=ne=Qe=$e=Sr=We=Vo=Xs=Cr=is=Fn=Bt=qs=_i=Un=li=Wn=ut=xo=_e.dragged=_e.ghost=_e.clone=_e.active=null,Fl.forEach(function(e){e.checked=!0}),Fl.length=Ad=Fd=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":ne&&(this._onDragOver(e),wO(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,r=this.el.children,i=0,n=r.length,a=this.options;ir.right+i||s.clientX<=r.right&&s.clientY>r.bottom&&s.clientX>=r.left:s.clientX>r.right&&s.clientY>r.top||s.clientX<=r.right&&s.clientY>r.bottom+i}function DO(s,e,t,r,i,n,a,o){var l=r?s.clientY:s.clientX,u=r?t.height:t.width,c=r?t.top:t.left,d=r?t.bottom:t.right,m=!1;if(!a){if(o&&Boc+u*n/2:ld-Bo)return-Wn}else if(l>c+u*(1-i)/2&&ld-u*n/2)?l>c+u/2?1:-1:0}function TO(s){return ze(ne)1&&(Ce.forEach(function(o){n.addAnimationState({target:o,rect:It?Ge(o):a}),Ed(o),o.fromRect=a,r.removeAnimationState(o)}),It=!1,FO(!this.options.removeCloneOnHide,i))},dragOverCompleted:function(t){var r=t.sortable,i=t.isOwner,n=t.insertion,a=t.activeSortable,o=t.parentEl,l=t.putSortable,u=this.options;if(n){if(i&&a._hideClone(),xn=!1,u.animation&&Ce.length>1&&(It||!i&&!a.options.sort&&!l)){var c=Ge(Re,!1,!0,!0);Ce.forEach(function(m){m!==Re&&(Jg(m,c),o.appendChild(m))}),It=!0}if(!i)if(It||Do(),Ce.length>1){var d=Po;a._showClone(r),a.options.animation&&!Po&&d&&Vt.forEach(function(m){a.addAnimationState({target:m,rect:wn}),m.fromRect=wn,m.thisAnimationDuration=null})}else a._showClone(r)}},dragOverAnimationCapture:function(t){var r=t.dragRect,i=t.isOwner,n=t.activeSortable;if(Ce.forEach(function(o){o.thisAnimationDuration=null}),n.options.animation&&!i&&n.multiDrag.isMultiDrag){wn=es({},r);var a=Ar(Re,!0);wn.top-=a.f,wn.left-=a.e}},dragOverAnimationComplete:function(){It&&(It=!1,Do())},drop:function(t){var r=t.originalEvent,i=t.rootEl,n=t.parentEl,a=t.sortable,o=t.dispatchSortableEvent,l=t.oldIndex,u=t.putSortable,c=u||this.sortable;if(r){var d=this.options,m=n.children;if(!ci)if(d.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),Ve(Re,d.selectedClass,!~Ce.indexOf(Re)),~Ce.indexOf(Re))Ce.splice(Ce.indexOf(Re),1),$n=null,An({sortable:a,rootEl:i,name:"deselect",targetEl:Re});else{if(Ce.push(Re),An({sortable:a,rootEl:i,name:"select",targetEl:Re}),r.shiftKey&&$n&&a.el.contains($n)){var h=ze($n),f=ze(Re);if(~h&&~f&&h!==f){var p,v;for(f>h?(v=h,p=f):(v=f,p=h+1);v1){var C=Ge(Re),P=ze(Re,":not(."+this.options.selectedClass+")");if(!xn&&d.animation&&(Re.thisAnimationDuration=null),c.captureAnimationState(),!xn&&(d.animation&&(Re.fromRect=C,Ce.forEach(function(F){if(F.thisAnimationDuration=null,F!==Re){var O=It?Ge(F):C;F.fromRect=O,c.addAnimationState({target:F,rect:O})}})),Do(),Ce.forEach(function(F){m[P]?n.insertBefore(F,m[P]):n.appendChild(F),P++}),l===ze(Re))){var M=!1;Ce.forEach(function(F){if(F.sortableIndex!==ze(F)){M=!0;return}}),M&&o("update")}Ce.forEach(function(F){Ed(F)}),c.animateAll()}ns=c}(i===n||u&&u.lastPutMode!=="clone")&&Vt.forEach(function(F){F.parentNode&&F.parentNode.removeChild(F)})}},nullingGlobal:function(){this.isMultiDrag=ci=!1,Vt.length=0},destroyGlobal:function(){this._deselectMultiDrag(),De(document,"pointerup",this._deselectMultiDrag),De(document,"mouseup",this._deselectMultiDrag),De(document,"touchend",this._deselectMultiDrag),De(document,"keydown",this._checkKeyDown),De(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(typeof ci<"u"&&ci)&&ns===this.sortable&&!(t&&os(t.target,this.options.draggable,this.sortable.el,!1))&&!(t&&t.button!==0))for(;Ce.length;){var r=Ce[0];Ve(r,this.options.selectedClass,!1),Ce.shift(),An({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:r})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},es(s,{pluginName:"multiDrag",utils:{select:function(t){var r=t.parentNode[pt];!r||!r.options.multiDrag||~Ce.indexOf(t)||(ns&&ns!==r&&(ns.multiDrag._deselectMultiDrag(),ns=r),Ve(t,r.options.selectedClass,!0),Ce.push(t))},deselect:function(t){var r=t.parentNode[pt],i=Ce.indexOf(t);!r||!r.options.multiDrag||!~i||(Ve(t,r.options.selectedClass,!1),Ce.splice(i,1))}},eventProperties:function(){var t=this,r=[],i=[];return Ce.forEach(function(n){r.push({multiDragElement:n,index:n.sortableIndex});var a;It&&n!==Re?a=-1:It?a=ze(n,":not(."+t.options.selectedClass+")"):a=ze(n),i.push({multiDragElement:n,index:a})}),{items:oO(Ce),clones:[].concat(Vt),oldIndicies:r,newIndicies:i}},optionListeners:{multiDragKey:function(t){return t=t.toLowerCase(),t==="ctrl"?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function FO(s,e){Ce.forEach(function(t,r){var i=e.children[t.sortableIndex+(s?Number(r):0)];i?e.insertBefore(t,i):e.appendChild(t)})}function s1(s,e){Vt.forEach(function(t,r){var i=e.children[t.sortableIndex+(s?Number(r):0)];i?e.insertBefore(t,i):e.appendChild(t)})}function Do(){Ce.forEach(function(s){s!==Re&&s.parentNode&&s.parentNode.removeChild(s)})}_e.mount(new kO);_e.mount(ff,pf);const RO=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:AO,Sortable:_e,Swap:EO,default:_e},Symbol.toStringTag,{value:"Module"})),HO=E_(RO);(function(s,e){(function(r,i){s.exports=i(HO)})(typeof self<"u"?self:Tr,function(t){return function(r){var i={};function n(a){if(i[a])return i[a].exports;var o=i[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=r,n.c=i,n.d=function(a,o,l){n.o(a,o)||Object.defineProperty(a,o,{enumerable:!0,get:l})},n.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},n.t=function(a,o){if(o&1&&(a=n(a)),o&8||o&4&&typeof a=="object"&&a&&a.__esModule)return a;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:a}),o&2&&typeof a!="string")for(var u in a)n.d(l,u,(function(c){return a[c]}).bind(null,u));return l},n.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(o,"a",o),o},n.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},n.p="",n(n.s="fb15")}({"01f9":function(r,i,n){var a=n("2d00"),o=n("5ca1"),l=n("2aba"),u=n("32e9"),c=n("84f2"),d=n("41a0"),m=n("7f20"),h=n("38fd"),f=n("2b4c")("iterator"),p=!([].keys&&"next"in[].keys()),v="@@iterator",C="keys",P="values",M=function(){return this};r.exports=function(F,O,$,D,V,N,W){d($,O,D);var G=function(H){if(!p&&H in z)return z[H];switch(H){case C:return function(){return new $(this,H)};case P:return function(){return new $(this,H)}}return function(){return new $(this,H)}},te=O+" Iterator",X=V==P,q=!1,z=F.prototype,K=z[f]||z[v]||V&&z[V],Q=K||G(V),re=V?X?G("entries"):Q:void 0,R=O=="Array"&&z.entries||K,B,T,A;if(R&&(A=h(R.call(new F)),A!==Object.prototype&&A.next&&(m(A,te,!0),!a&&typeof A[f]!="function"&&u(A,f,M))),X&&K&&K.name!==P&&(q=!0,Q=function(){return K.call(this)}),(!a||W)&&(p||q||!z[f])&&u(z,f,Q),c[O]=Q,c[te]=M,V)if(B={values:X?Q:G(P),keys:N?Q:G(C),entries:re},W)for(T in B)T in z||l(z,T,B[T]);else o(o.P+o.F*(p||q),O,B);return B}},"02f4":function(r,i,n){var a=n("4588"),o=n("be13");r.exports=function(l){return function(u,c){var d=String(o(u)),m=a(c),h=d.length,f,p;return m<0||m>=h?l?"":void 0:(f=d.charCodeAt(m),f<55296||f>56319||m+1===h||(p=d.charCodeAt(m+1))<56320||p>57343?l?d.charAt(m):f:l?d.slice(m,m+2):(f-55296<<10)+(p-56320)+65536)}}},"0390":function(r,i,n){var a=n("02f4")(!0);r.exports=function(o,l,u){return l+(u?a(o,l).length:1)}},"0bfb":function(r,i,n){var a=n("cb7c");r.exports=function(){var o=a(this),l="";return o.global&&(l+="g"),o.ignoreCase&&(l+="i"),o.multiline&&(l+="m"),o.unicode&&(l+="u"),o.sticky&&(l+="y"),l}},"0d58":function(r,i,n){var a=n("ce10"),o=n("e11e");r.exports=Object.keys||function(u){return a(u,o)}},1495:function(r,i,n){var a=n("86cc"),o=n("cb7c"),l=n("0d58");r.exports=n("9e1e")?Object.defineProperties:function(c,d){o(c);for(var m=l(d),h=m.length,f=0,p;h>f;)a.f(c,p=m[f++],d[p]);return c}},"214f":function(r,i,n){n("b0c5");var a=n("2aba"),o=n("32e9"),l=n("79e5"),u=n("be13"),c=n("2b4c"),d=n("520a"),m=c("species"),h=!l(function(){var p=/./;return p.exec=function(){var v=[];return v.groups={a:"7"},v},"".replace(p,"$")!=="7"}),f=function(){var p=/(?:)/,v=p.exec;p.exec=function(){return v.apply(this,arguments)};var C="ab".split(p);return C.length===2&&C[0]==="a"&&C[1]==="b"}();r.exports=function(p,v,C){var P=c(p),M=!l(function(){var N={};return N[P]=function(){return 7},""[p](N)!=7}),F=M?!l(function(){var N=!1,W=/a/;return W.exec=function(){return N=!0,null},p==="split"&&(W.constructor={},W.constructor[m]=function(){return W}),W[P](""),!N}):void 0;if(!M||!F||p==="replace"&&!h||p==="split"&&!f){var O=/./[P],$=C(u,P,""[p],function(W,G,te,X,q){return G.exec===d?M&&!q?{done:!0,value:O.call(G,te,X)}:{done:!0,value:W.call(te,G,X)}:{done:!1}}),D=$[0],V=$[1];a(String.prototype,p,D),o(RegExp.prototype,P,v==2?function(N,W){return V.call(N,this,W)}:function(N){return V.call(N,this)})}}},"230e":function(r,i,n){var a=n("d3f4"),o=n("7726").document,l=a(o)&&a(o.createElement);r.exports=function(u){return l?o.createElement(u):{}}},"23c6":function(r,i,n){var a=n("2d95"),o=n("2b4c")("toStringTag"),l=a(function(){return arguments}())=="Arguments",u=function(c,d){try{return c[d]}catch{}};r.exports=function(c){var d,m,h;return c===void 0?"Undefined":c===null?"Null":typeof(m=u(d=Object(c),o))=="string"?m:l?a(d):(h=a(d))=="Object"&&typeof d.callee=="function"?"Arguments":h}},2621:function(r,i){i.f=Object.getOwnPropertySymbols},"2aba":function(r,i,n){var a=n("7726"),o=n("32e9"),l=n("69a8"),u=n("ca5a")("src"),c=n("fa5b"),d="toString",m=(""+c).split(d);n("8378").inspectSource=function(h){return c.call(h)},(r.exports=function(h,f,p,v){var C=typeof p=="function";C&&(l(p,"name")||o(p,"name",f)),h[f]!==p&&(C&&(l(p,u)||o(p,u,h[f]?""+h[f]:m.join(String(f)))),h===a?h[f]=p:v?h[f]?h[f]=p:o(h,f,p):(delete h[f],o(h,f,p)))})(Function.prototype,d,function(){return typeof this=="function"&&this[u]||c.call(this)})},"2aeb":function(r,i,n){var a=n("cb7c"),o=n("1495"),l=n("e11e"),u=n("613b")("IE_PROTO"),c=function(){},d="prototype",m=function(){var h=n("230e")("iframe"),f=l.length,p="<",v=">",C;for(h.style.display="none",n("fab2").appendChild(h),h.src="javascript:",C=h.contentWindow.document,C.open(),C.write(p+"script"+v+"document.F=Object"+p+"/script"+v),C.close(),m=C.F;f--;)delete m[d][l[f]];return m()};r.exports=Object.create||function(f,p){var v;return f!==null?(c[d]=a(f),v=new c,c[d]=null,v[u]=f):v=m(),p===void 0?v:o(v,p)}},"2b4c":function(r,i,n){var a=n("5537")("wks"),o=n("ca5a"),l=n("7726").Symbol,u=typeof l=="function",c=r.exports=function(d){return a[d]||(a[d]=u&&l[d]||(u?l:o)("Symbol."+d))};c.store=a},"2d00":function(r,i){r.exports=!1},"2d95":function(r,i){var n={}.toString;r.exports=function(a){return n.call(a).slice(8,-1)}},"2fdb":function(r,i,n){var a=n("5ca1"),o=n("d2c8"),l="includes";a(a.P+a.F*n("5147")(l),"String",{includes:function(c){return!!~o(this,c,l).indexOf(c,arguments.length>1?arguments[1]:void 0)}})},"32e9":function(r,i,n){var a=n("86cc"),o=n("4630");r.exports=n("9e1e")?function(l,u,c){return a.f(l,u,o(1,c))}:function(l,u,c){return l[u]=c,l}},"38fd":function(r,i,n){var a=n("69a8"),o=n("4bf8"),l=n("613b")("IE_PROTO"),u=Object.prototype;r.exports=Object.getPrototypeOf||function(c){return c=o(c),a(c,l)?c[l]:typeof c.constructor=="function"&&c instanceof c.constructor?c.constructor.prototype:c instanceof Object?u:null}},"41a0":function(r,i,n){var a=n("2aeb"),o=n("4630"),l=n("7f20"),u={};n("32e9")(u,n("2b4c")("iterator"),function(){return this}),r.exports=function(c,d,m){c.prototype=a(u,{next:o(1,m)}),l(c,d+" Iterator")}},"456d":function(r,i,n){var a=n("4bf8"),o=n("0d58");n("5eda")("keys",function(){return function(u){return o(a(u))}})},4588:function(r,i){var n=Math.ceil,a=Math.floor;r.exports=function(o){return isNaN(o=+o)?0:(o>0?a:n)(o)}},4630:function(r,i){r.exports=function(n,a){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:a}}},"4bf8":function(r,i,n){var a=n("be13");r.exports=function(o){return Object(a(o))}},5147:function(r,i,n){var a=n("2b4c")("match");r.exports=function(o){var l=/./;try{"/./"[o](l)}catch{try{return l[a]=!1,!"/./"[o](l)}catch{}}return!0}},"520a":function(r,i,n){var a=n("0bfb"),o=RegExp.prototype.exec,l=String.prototype.replace,u=o,c="lastIndex",d=function(){var f=/a/,p=/b*/g;return o.call(f,"a"),o.call(p,"a"),f[c]!==0||p[c]!==0}(),m=/()??/.exec("")[1]!==void 0,h=d||m;h&&(u=function(p){var v=this,C,P,M,F;return m&&(P=new RegExp("^"+v.source+"$(?!\\s)",a.call(v))),d&&(C=v[c]),M=o.call(v,p),d&&M&&(v[c]=v.global?M.index+M[0].length:C),m&&M&&M.length>1&&l.call(M[0],P,function(){for(F=1;F1?arguments[1]:void 0)}}),n("9c6c")("includes")},6821:function(r,i,n){var a=n("626a"),o=n("be13");r.exports=function(l){return a(o(l))}},"69a8":function(r,i){var n={}.hasOwnProperty;r.exports=function(a,o){return n.call(a,o)}},"6a99":function(r,i,n){var a=n("d3f4");r.exports=function(o,l){if(!a(o))return o;var u,c;if(l&&typeof(u=o.toString)=="function"&&!a(c=u.call(o))||typeof(u=o.valueOf)=="function"&&!a(c=u.call(o))||!l&&typeof(u=o.toString)=="function"&&!a(c=u.call(o)))return c;throw TypeError("Can't convert object to primitive value")}},7333:function(r,i,n){var a=n("0d58"),o=n("2621"),l=n("52a7"),u=n("4bf8"),c=n("626a"),d=Object.assign;r.exports=!d||n("79e5")(function(){var m={},h={},f=Symbol(),p="abcdefghijklmnopqrst";return m[f]=7,p.split("").forEach(function(v){h[v]=v}),d({},m)[f]!=7||Object.keys(d({},h)).join("")!=p})?function(h,f){for(var p=u(h),v=arguments.length,C=1,P=o.f,M=l.f;v>C;)for(var F=c(arguments[C++]),O=P?a(F).concat(P(F)):a(F),$=O.length,D=0,V;$>D;)M.call(F,V=O[D++])&&(p[V]=F[V]);return p}:d},7726:function(r,i){var n=r.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=n)},"77f1":function(r,i,n){var a=n("4588"),o=Math.max,l=Math.min;r.exports=function(u,c){return u=a(u),u<0?o(u+c,0):l(u,c)}},"79e5":function(r,i){r.exports=function(n){try{return!!n()}catch{return!0}}},"7f20":function(r,i,n){var a=n("86cc").f,o=n("69a8"),l=n("2b4c")("toStringTag");r.exports=function(u,c,d){u&&!o(u=d?u:u.prototype,l)&&a(u,l,{configurable:!0,value:c})}},8378:function(r,i){var n=r.exports={version:"2.6.5"};typeof __e=="number"&&(__e=n)},"84f2":function(r,i){r.exports={}},"86cc":function(r,i,n){var a=n("cb7c"),o=n("c69a"),l=n("6a99"),u=Object.defineProperty;i.f=n("9e1e")?Object.defineProperty:function(d,m,h){if(a(d),m=l(m,!0),a(h),o)try{return u(d,m,h)}catch{}if("get"in h||"set"in h)throw TypeError("Accessors not supported!");return"value"in h&&(d[m]=h.value),d}},"9b43":function(r,i,n){var a=n("d8e8");r.exports=function(o,l,u){if(a(o),l===void 0)return o;switch(u){case 1:return function(c){return o.call(l,c)};case 2:return function(c,d){return o.call(l,c,d)};case 3:return function(c,d,m){return o.call(l,c,d,m)}}return function(){return o.apply(l,arguments)}}},"9c6c":function(r,i,n){var a=n("2b4c")("unscopables"),o=Array.prototype;o[a]==null&&n("32e9")(o,a,{}),r.exports=function(l){o[a][l]=!0}},"9def":function(r,i,n){var a=n("4588"),o=Math.min;r.exports=function(l){return l>0?o(a(l),9007199254740991):0}},"9e1e":function(r,i,n){r.exports=!n("79e5")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},a352:function(r,i){r.exports=t},a481:function(r,i,n){var a=n("cb7c"),o=n("4bf8"),l=n("9def"),u=n("4588"),c=n("0390"),d=n("5f1b"),m=Math.max,h=Math.min,f=Math.floor,p=/\$([$&`']|\d\d?|<[^>]*>)/g,v=/\$([$&`']|\d\d?)/g,C=function(P){return P===void 0?P:String(P)};n("214f")("replace",2,function(P,M,F,O){return[function(V,N){var W=P(this),G=V==null?void 0:V[M];return G!==void 0?G.call(V,W,N):F.call(String(W),V,N)},function(D,V){var N=O(F,D,this,V);if(N.done)return N.value;var W=a(D),G=String(this),te=typeof V=="function";te||(V=String(V));var X=W.global;if(X){var q=W.unicode;W.lastIndex=0}for(var z=[];;){var K=d(W,G);if(K===null||(z.push(K),!X))break;var Q=String(K[0]);Q===""&&(W.lastIndex=c(G,l(W.lastIndex),q))}for(var re="",R=0,B=0;B=R&&(re+=G.slice(R,A)+be,R=A+T.length)}return re+G.slice(R)}];function $(D,V,N,W,G,te){var X=N+D.length,q=W.length,z=v;return G!==void 0&&(G=o(G),z=p),F.call(te,z,function(K,Q){var re;switch(Q.charAt(0)){case"$":return"$";case"&":return D;case"`":return V.slice(0,N);case"'":return V.slice(X);case"<":re=G[Q.slice(1,-1)];break;default:var R=+Q;if(R===0)return K;if(R>q){var B=f(R/10);return B===0?K:B<=q?W[B-1]===void 0?Q.charAt(1):W[B-1]+Q.charAt(1):K}re=W[R-1]}return re===void 0?"":re})}})},aae3:function(r,i,n){var a=n("d3f4"),o=n("2d95"),l=n("2b4c")("match");r.exports=function(u){var c;return a(u)&&((c=u[l])!==void 0?!!c:o(u)=="RegExp")}},ac6a:function(r,i,n){for(var a=n("cadf"),o=n("0d58"),l=n("2aba"),u=n("7726"),c=n("32e9"),d=n("84f2"),m=n("2b4c"),h=m("iterator"),f=m("toStringTag"),p=d.Array,v={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},C=o(v),P=0;Pp;)if(v=h[p++],v!=v)return!0}else for(;f>p;p++)if((u||p in h)&&h[p]===d)return u||p||0;return!u&&-1}}},c649:function(r,i,n){(function(a){n.d(i,"c",function(){return h}),n.d(i,"a",function(){return d}),n.d(i,"b",function(){return l}),n.d(i,"d",function(){return m}),n("a481");function o(){return typeof window<"u"?window.console:a.console}var l=o();function u(f){var p=Object.create(null);return function(C){var P=p[C];return P||(p[C]=f(C))}}var c=/-(\w)/g,d=u(function(f){return f.replace(c,function(p,v){return v?v.toUpperCase():""})});function m(f){f.parentElement!==null&&f.parentElement.removeChild(f)}function h(f,p,v){var C=v===0?f.children[0]:f.children[v-1].nextSibling;f.insertBefore(p,C)}}).call(this,n("c8ba"))},c69a:function(r,i,n){r.exports=!n("9e1e")&&!n("79e5")(function(){return Object.defineProperty(n("230e")("div"),"a",{get:function(){return 7}}).a!=7})},c8ba:function(r,i){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch{typeof window=="object"&&(n=window)}r.exports=n},ca5a:function(r,i){var n=0,a=Math.random();r.exports=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++n+a).toString(36))}},cadf:function(r,i,n){var a=n("9c6c"),o=n("d53b"),l=n("84f2"),u=n("6821");r.exports=n("01f9")(Array,"Array",function(c,d){this._t=u(c),this._i=0,this._k=d},function(){var c=this._t,d=this._k,m=this._i++;return!c||m>=c.length?(this._t=void 0,o(1)):d=="keys"?o(0,m):d=="values"?o(0,c[m]):o(0,[m,c[m]])},"values"),l.Arguments=l.Array,a("keys"),a("values"),a("entries")},cb7c:function(r,i,n){var a=n("d3f4");r.exports=function(o){if(!a(o))throw TypeError(o+" is not an object!");return o}},ce10:function(r,i,n){var a=n("69a8"),o=n("6821"),l=n("c366")(!1),u=n("613b")("IE_PROTO");r.exports=function(c,d){var m=o(c),h=0,f=[],p;for(p in m)p!=u&&a(m,p)&&f.push(p);for(;d.length>h;)a(m,p=d[h++])&&(~l(f,p)||f.push(p));return f}},d2c8:function(r,i,n){var a=n("aae3"),o=n("be13");r.exports=function(l,u,c){if(a(u))throw TypeError("String#"+c+" doesn't accept regex!");return String(o(l))}},d3f4:function(r,i){r.exports=function(n){return typeof n=="object"?n!==null:typeof n=="function"}},d53b:function(r,i){r.exports=function(n,a){return{value:a,done:!!n}}},d8e8:function(r,i){r.exports=function(n){if(typeof n!="function")throw TypeError(n+" is not a function!");return n}},e11e:function(r,i){r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},f559:function(r,i,n){var a=n("5ca1"),o=n("9def"),l=n("d2c8"),u="startsWith",c=""[u];a(a.P+a.F*n("5147")(u),"String",{startsWith:function(m){var h=l(this,m,u),f=o(Math.min(arguments.length>1?arguments[1]:void 0,h.length)),p=String(m);return c?c.call(h,p,f):h.slice(f,f+p.length)===p}})},f6fd:function(r,i){(function(n){var a="currentScript",o=n.getElementsByTagName("script");a in n||Object.defineProperty(n,a,{get:function(){try{throw new Error}catch(c){var l,u=(/.*at [^\(]*\((.*):.+:.+\)$/ig.exec(c.stack)||[!1])[1];for(l in o)if(o[l].src==u||o[l].readyState=="interactive")return o[l];return null}}})})(document)},f751:function(r,i,n){var a=n("5ca1");a(a.S+a.F,"Object",{assign:n("7333")})},fa5b:function(r,i,n){r.exports=n("5537")("native-function-to-string",Function.toString)},fab2:function(r,i,n){var a=n("7726").document;r.exports=a&&a.documentElement},fb15:function(r,i,n){if(n.r(i),typeof window<"u"){n("f6fd");var a;(a=window.document.currentScript)&&(a=a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=a[1])}n("f751"),n("f559"),n("ac6a"),n("cadf"),n("456d");function o(T){if(Array.isArray(T))return T}function l(T,A){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(T)))){var H=[],ee=!0,ie=!1,ue=void 0;try{for(var be=T[Symbol.iterator](),Se;!(ee=(Se=be.next()).done)&&(H.push(Se.value),!(A&&H.length===A));ee=!0);}catch(rt){ie=!0,ue=rt}finally{try{!ee&&be.return!=null&&be.return()}finally{if(ie)throw ue}}return H}}function u(T,A){(A==null||A>T.length)&&(A=T.length);for(var H=0,ee=new Array(A);H=ue?ie.length:ie.indexOf(Se)});return H?be.filter(function(Se){return Se!==-1}):be}function D(T,A){var H=this;this.$nextTick(function(){return H.$emit(T.toLowerCase(),A)})}function V(T){var A=this;return function(H){A.realList!==null&&A["onDrag"+T](H),D.call(A,T,H)}}function N(T){return["transition-group","TransitionGroup"].includes(T)}function W(T){if(!T||T.length!==1)return!1;var A=m(T,1),H=A[0].componentOptions;return H?N(H.tag):!1}function G(T,A,H){return T[H]||(A[H]?A[H]():void 0)}function te(T,A,H){var ee=0,ie=0,ue=G(A,H,"header");ue&&(ee=ue.length,T=T?[].concat(v(ue),v(T)):v(ue));var be=G(A,H,"footer");return be&&(ie=be.length,T=T?[].concat(v(T),v(be)):v(be)),{children:T,headerOffset:ee,footerOffset:ie}}function X(T,A){var H=null,ee=function(Pt,jt){H=F(H,Pt,jt)},ie=Object.keys(T).filter(function(rt){return rt==="id"||rt.startsWith("data-")}).reduce(function(rt,Pt){return rt[Pt]=T[Pt],rt},{});if(ee("attrs",ie),!A)return H;var ue=A.on,be=A.props,Se=A.attrs;return ee("on",ue),ee("props",be),Object.assign(H.attrs,Se),H}var q=["Start","Add","Remove","Update","End"],z=["Choose","Unchoose","Sort","Filter","Clone"],K=["Move"].concat(q,z).map(function(T){return"on"+T}),Q=null,re={options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:function(A){return A}},element:{type:String,default:"div"},tag:{type:String,default:null},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},R={name:"draggable",inheritAttrs:!1,props:re,data:function(){return{transitionMode:!1,noneFunctionalComponentMode:!1}},render:function(A){var H=this.$slots.default;this.transitionMode=W(H);var ee=te(H,this.$slots,this.$scopedSlots),ie=ee.children,ue=ee.headerOffset,be=ee.footerOffset;this.headerOffset=ue,this.footerOffset=be;var Se=X(this.$attrs,this.componentData);return A(this.getTag(),Se,ie)},created:function(){this.list!==null&&this.value!==null&&M.b.error("Value and list props are mutually exclusive! Please set one or another."),this.element!=="div"&&M.b.warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"),this.options!==void 0&&M.b.warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props")},mounted:function(){var A=this;if(this.noneFunctionalComponentMode=this.getTag().toLowerCase()!==this.$el.nodeName.toLowerCase()&&!this.getIsFunctional(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ".concat(this.getTag()));var H={};q.forEach(function(ue){H["on"+ue]=V.call(A,ue)}),z.forEach(function(ue){H["on"+ue]=D.bind(A,ue)});var ee=Object.keys(this.$attrs).reduce(function(ue,be){return ue[Object(M.a)(be)]=A.$attrs[be],ue},{}),ie=Object.assign({},this.options,ee,H,{onMove:function(be,Se){return A.onDragMove(be,Se)}});!("draggable"in ie)&&(ie.draggable=">*"),this._sortable=new P.a(this.rootContainer,ie),this.computeIndexes()},beforeDestroy:function(){this._sortable!==void 0&&this._sortable.destroy()},computed:{rootContainer:function(){return this.transitionMode?this.$el.children[0]:this.$el},realList:function(){return this.list?this.list:this.value}},watch:{options:{handler:function(A){this.updateOptions(A)},deep:!0},$attrs:{handler:function(A){this.updateOptions(A)},deep:!0},realList:function(){this.computeIndexes()}},methods:{getIsFunctional:function(){var A=this._vnode.fnOptions;return A&&A.functional},getTag:function(){return this.tag||this.element},updateOptions:function(A){for(var H in A){var ee=Object(M.a)(H);K.indexOf(ee)===-1&&this._sortable.option(ee,A[H])}},getChildrenNodes:function(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;var A=this.$slots.default;return this.transitionMode?A[0].child.$slots.default:A},computeIndexes:function(){var A=this;this.$nextTick(function(){A.visibleIndexes=$(A.getChildrenNodes(),A.rootContainer.children,A.transitionMode,A.footerOffset)})},getUnderlyingVm:function(A){var H=O(this.getChildrenNodes()||[],A);if(H===-1)return null;var ee=this.realList[H];return{index:H,element:ee}},getUnderlyingPotencialDraggableComponent:function(A){var H=A.__vue__;return!H||!H.$options||!N(H.$options._componentTag)?!("realList"in H)&&H.$children.length===1&&"realList"in H.$children[0]?H.$children[0]:H:H.$parent},emitChanges:function(A){var H=this;this.$nextTick(function(){H.$emit("change",A)})},alterList:function(A){if(this.list){A(this.list);return}var H=v(this.value);A(H),this.$emit("input",H)},spliceList:function(){var A=arguments,H=function(ie){return ie.splice.apply(ie,v(A))};this.alterList(H)},updatePosition:function(A,H){var ee=function(ue){return ue.splice(H,0,ue.splice(A,1)[0])};this.alterList(ee)},getRelatedContextFromMoveEvent:function(A){var H=A.to,ee=A.related,ie=this.getUnderlyingPotencialDraggableComponent(H);if(!ie)return{component:ie};var ue=ie.realList,be={list:ue,component:ie};if(H!==ee&&ue&&ie.getUnderlyingVm){var Se=ie.getUnderlyingVm(ee);if(Se)return Object.assign(Se,be)}return be},getVmIndex:function(A){var H=this.visibleIndexes,ee=H.length;return A>ee-1?ee:H[A]},getComponent:function(){return this.$slots.default[0].componentInstance},resetTransitionData:function(A){if(!(!this.noTransitionOnDrag||!this.transitionMode)){var H=this.getChildrenNodes();H[A].data=null;var ee=this.getComponent();ee.children=[],ee.kept=void 0}},onDragStart:function(A){this.context=this.getUnderlyingVm(A.item),A.item._underlying_vm_=this.clone(this.context.element),Q=A.item},onDragAdd:function(A){var H=A.item._underlying_vm_;if(H!==void 0){Object(M.d)(A.item);var ee=this.getVmIndex(A.newIndex);this.spliceList(ee,0,H),this.computeIndexes();var ie={element:H,newIndex:ee};this.emitChanges({added:ie})}},onDragRemove:function(A){if(Object(M.c)(this.rootContainer,A.item,A.oldIndex),A.pullMode==="clone"){Object(M.d)(A.clone);return}var H=this.context.index;this.spliceList(H,1);var ee={element:this.context.element,oldIndex:H};this.resetTransitionData(H),this.emitChanges({removed:ee})},onDragUpdate:function(A){Object(M.d)(A.item),Object(M.c)(A.from,A.item,A.oldIndex);var H=this.context.index,ee=this.getVmIndex(A.newIndex);this.updatePosition(H,ee);var ie={element:this.context.element,oldIndex:H,newIndex:ee};this.emitChanges({moved:ie})},updateProperty:function(A,H){A.hasOwnProperty(H)&&(A[H]+=this.headerOffset)},computeFutureIndex:function(A,H){if(!A.element)return 0;var ee=v(H.to.children).filter(function(Se){return Se.style.display!=="none"}),ie=ee.indexOf(H.related),ue=A.component.getVmIndex(ie),be=ee.indexOf(Q)!==-1;return be||!H.willInsertAfter?ue:ue+1},onDragMove:function(A,H){var ee=this.move;if(!ee||!this.realList)return!0;var ie=this.getRelatedContextFromMoveEvent(A),ue=this.context,be=this.computeFutureIndex(ie,A);Object.assign(ue,{futureIndex:be});var Se=Object.assign({},A,{relatedContext:ie,draggedContext:ue});return ee(Se,H)},onDragEnd:function(){this.computeIndexes(),Q=null}}};typeof window<"u"&&"Vue"in window&&window.Vue.component("draggable",R);var B=R;i.default=B}}).default})})($b);var jO=$b.exports;const si=en(jO);var xu={};/** + * vue-class-component v6.3.2 + * (c) 2015-present Evan You + * @license MIT + */Object.defineProperty(xu,"__esModule",{value:!0});function IO(s){return s&&typeof s=="object"&&"default"in s?s.default:s}var jm=IO(T$),NO=typeof Reflect<"u"&&Reflect.defineMetadata;function VO(s,e){Bd(s,e),Object.getOwnPropertyNames(e.prototype).forEach(function(t){Bd(s.prototype,e.prototype,t)}),Object.getOwnPropertyNames(e).forEach(function(t){Bd(s,e,t)})}function Bd(s,e,t){var r=t?Reflect.getOwnMetadataKeys(e,t):Reflect.getOwnMetadataKeys(e);r.forEach(function(i){var n=t?Reflect.getOwnMetadata(i,e,t):Reflect.getOwnMetadata(i,e);t?Reflect.defineMetadata(i,n,s,t):Reflect.defineMetadata(i,n,s)})}var BO={__proto__:[]},UO=BO instanceof Array;function WO(s){return function(e,t,r){var i=typeof e=="function"?e:e.constructor;i.__decorators__||(i.__decorators__=[]),typeof r!="number"&&(r=void 0),i.__decorators__.push(function(n){return s(n,t,r)})}}function zO(){for(var s=[],e=0;e-1){e[o]=t[o];return}var l=Object.getOwnPropertyDescriptor(t,o);l.value!==void 0?typeof l.value=="function"?(e.methods||(e.methods={}))[o]=l.value:(e.mixins||(e.mixins=[])).push({data:function(){var u;return u={},u[o]=l.value,u}}):(l.get||l.set)&&((e.computed||(e.computed={}))[o]={get:l.get,set:l.set})}}),(e.mixins||(e.mixins=[])).push({data:function(){return ZO(this,s)}});var r=s.__decorators__;r&&(r.forEach(function(o){return o(e)}),delete s.__decorators__);var i=Object.getPrototypeOf(s.prototype),n=i instanceof jm?i.constructor:jm,a=n.extend(e);return qO(a,s,n),NO&&VO(a,s),a}function qO(s,e,t){Object.getOwnPropertyNames(e).forEach(function(r){if(r!=="prototype"){var i=Object.getOwnPropertyDescriptor(s,r);if(!(i&&!i.configurable)){var n=Object.getOwnPropertyDescriptor(e,r);if(!UO){if(r==="cid")return;var a=Object.getOwnPropertyDescriptor(t,r);if(!GO(n.value)&&a&&a.value===n.value)return}Object.defineProperty(s,r,n)}}})}function Ab(s){return typeof s=="function"?r1(s):function(e){return r1(e,s)}}Ab.registerHooks=function(e){Im.push.apply(Im,e)};xu.default=Ab;var XO=xu.createDecorator=WO;xu.mixins=zO;function Ke(s){return XO(function(e,t){if(!e.methods)throw new Error("This decorator must be used on a vue component method.");var r=typeof s=="number"?s:s.time,i=e.methods[t],n=0,a=function(){n&&(clearTimeout(n),n=0)};e.methods[t]=function(){for(var o=this,l=[],u=0;u{for(var i=r>1?void 0:r?JO(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&YO(e,t,i),i};let Ti=class extends k(L,vt){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=Ue,this.mdiSleep=SS,this.mdiPause=Zp,this.mdiPrinter3dNozzle=Us,this.mdiPlus=qp,this.mdiDragVertical=Wa,this.mdiPalette=_u,this.mdiMagnify=rn,this.rules={required:s=>s!==""||"required",groupUnique:s=>!this.existsGroupName(s)||"Name already exists"},this.boolFormEdit=!1,this.editGroupId="",this.searchMacros=""}get groupColors(){return[{text:this.$t("Settings.MacrosTab.Primary"),value:"primary"},{text:this.$t("Settings.MacrosTab.Secondary"),value:"secondary"},{text:this.$t("Settings.MacrosTab.Success"),value:"success"},{text:this.$t("Settings.MacrosTab.Warning"),value:"warning"},{text:this.$t("Settings.MacrosTab.Error"),value:"error"},{text:this.$t("Settings.MacrosTab.Custom"),value:"custom"}]}get macroColors(){const s=[...this.groupColors],e=s.findIndex(t=>t.value==="custom");return e!==-1&&s.splice(e,1),s.push({text:this.$t("Settings.MacrosTab.Group"),value:"group"}),s}get allMacros(){var e;return((e=this.$store.getters["printer/getMacros"])!=null?e:[]).filter(t=>{var r;return t.name.toLowerCase().includes(this.searchMacros.toLowerCase())||((r=t.description)==null?void 0:r.toLowerCase().includes(this.searchMacros.toLowerCase()))})}get availableMacros(){return this.allMacros.filter(s=>!this.editGroupUsedMacros.includes(s.name))}get groups(){var s;return(s=this.$store.getters["gui/macros/getAllMacrogroups"])!=null?s:[]}get editGroupUsedMacros(){var s,e,t;return(t=(e=(s=this.editGroup)==null?void 0:s.macros)==null?void 0:e.map(r=>r.name))!=null?t:[]}get editGroup(){return this.$store.getters["gui/macros/getMacrogroup"](this.editGroupId)}get editGroupMacros(){var e,t;const s=(t=(e=this.editGroup)==null?void 0:e.macros)!=null?t:[];return s.sort((r,i)=>r.pos-i.pos),s}set editGroupMacros(s){}existsGroupName(s){return this.groups.findIndex(e=>e.name===s&&e.id!=this.editGroupId)>=0}clearColorObject(s){return typeof s=="object"&&"hex"in s&&(s=s.hex),s.length>7&&(s=s.substr(0,7)),s}updateShowGeneral(s){this.$emit("update:showGeneral",s)}async addGroup(){const s={name:"",color:"primary",colorCustom:"#fff",showInStandby:!0,showInPause:!0,showInPrinting:!0};this.editGroupId=await this.$store.dispatch("gui/macros/groupStore",{values:s}),this.boolFormEdit=!0}editMacrogroup(s){this.boolFormEdit=!0,this.editGroupId=s.id}deleteMacrogroup(s){this.$store.dispatch("gui/macros/groupDelete",s)}addMacroToGroup(s){this.$store.dispatch("gui/macros/addMacroToMacrogroup",{id:this.editGroupId,macro:s.name})}updateMacroFromGroup(s,e,t){this.$store.dispatch("gui/macros/updateMacroFromMacrogroup",{id:this.editGroupId,macro:s.name,option:e,value:t})}updateMacroOrder(s){var n,a;const e=(n=s.moved.oldIndex)!=null?n:0,t=(a=s.moved.newIndex)!=null?a:0,r=this.editGroupMacros[e].pos,i=this.editGroupMacros[t].pos;this.updateMacroFromGroup(this.editGroupMacros[e],"pos",i),this.updateMacroFromGroup(this.editGroupMacros[t],"pos",r)}changeColorMacroFromGroup(s){let e=this.macroColors.findIndex(i=>i.value===s.color)+1;const t=this.macroColors.length-1;e>t&&(e=0);const r=this.macroColors[e].value;this.updateMacroFromGroup(s,"color",r)}removeMacroFromGroup(s){this.$store.dispatch("gui/macros/removeMacroFromMacrogroup",{id:this.editGroupId,macro:s.name})}existsMacro(s){return this.allMacros.findIndex(e=>e.name.toLowerCase()===s.toLowerCase())!==-1}getMacroDescription(s){var t;const e=this.allMacros.find(r=>r.name.toLowerCase()===s.toLowerCase());return e?(t=e==null?void 0:e.description)!=null?t:null:this.$t("Settings.MacrosTab.DeletedMacro")}updateMacrogroupOption(s,e){const t={};t[s]=e,this.$store.dispatch("gui/macros/groupUpdate",{id:this.editGroupId,values:t})}updateGroupOptionName(s){this.updateMacrogroupOption("name",s)}updateGroupOptionColor(s){this.updateMacrogroupOption("color",s)}updateGroupOptionColorCustom(s){this.updateMacrogroupOption("colorCustom",this.clearColorObject(s))}updateGroupOptionShowInStandby(s){this.updateMacrogroupOption("showInStandby",s)}updateGroupOptionShowInPause(s){this.updateMacrogroupOption("showInPause",s)}updateGroupOptionShowInPrinting(s){this.updateMacrogroupOption("showInPrinting",s)}updatedBoolFormEdit(s){this.updateShowGeneral(!s)}cancelEditMacrogroup(){this.boolFormEdit=!1,this.$emit("scrollToTop")}};wu([Ke(250)],Ti.prototype,"updateGroupOptionName",1);wu([Ke(250)],Ti.prototype,"updateGroupOptionColorCustom",1);wu([he("boolFormEdit")],Ti.prototype,"updatedBoolFormEdit",1);Ti=wu([S({components:{SettingsRow:j,draggable:si}})],Ti);var KO=function(){var r,i,n,a;var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.boolFormEdit===!1?[t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MacrosTab.Macrogroups")))]),e.groups.length?e._l(e.groups,function(o,l){return t("div",{key:l},[l?t(I,{staticClass:"my-2"}):e._e(),t(j,{attrs:{title:o.name!==""?o.name:"<"+e.$t("Settings.MacrosTab.UnknownGroup")+">","sub-title":e.$tc("Settings.MacrosTab.CountMacros","macros"in o?o.macros.length:0,{count:"macros"in o?o.macros.length:0}),"dynamic-slot-width":!0}},[t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(u){return e.editMacrogroup(o)}}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:function(u){return e.deleteMacrogroup(o.id)}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)],1)],1)}):[t(x,[t(b,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(e._s(e.$t("Settings.MacrosTab.NoGroups")))])])],1)]],2),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:"",color:"primary"},on:{click:e.addGroup}},[e._v(e._s(e.$t("Settings.MacrosTab.AddGroup")))])],1)]:e.boolFormEdit?[t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MacrosTab.EditGroup")))]),t(j,{attrs:{title:e.$t("Settings.MacrosTab.Name")}},[t(se,{attrs:{"hide-details":"auto",rules:[e.rules.required,e.rules.groupUnique],dense:"",outlined:""},on:{change:e.updateGroupOptionName},model:{value:e.editGroup.name,callback:function(o){e.$set(e.editGroup,"name",o)},expression:"editGroup.name"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.MacrosTab.Color")}},[t(ke,{attrs:{items:e.groupColors,outlined:"",dense:"","hide-details":"",attach:""},on:{change:e.updateGroupOptionColor},model:{value:e.editGroup.color,callback:function(o){e.$set(e.editGroup,"color",o)},expression:"editGroup.color"}})],1),((r=e.editGroup)==null?void 0:r.color)==="custom"?[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.MacrosTab.CustomColor")}},[t(ye,{attrs:{bottom:"",left:"","offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:o,attrs:l}){return[t(g,e._g(e._b({staticClass:"minwidth-0 px-5",attrs:{color:e.editGroup.colorCustom,small:""}},"v-btn",l,!1),o))]}}],null,!1,3888687373)},[t(Xt,{attrs:{value:e.editGroup.colorCustom,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":e.updateGroupOptionColorCustom}})],1)],1)]:e._e(),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.MacrosTab.Status")}},[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:o,attrs:l}){var u;return[t(g,e._g(e._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:(u=e.editGroup)!=null&&u.showInStandby?"":"secondary"},on:{click:function(c){var d;return e.updateGroupOptionShowInStandby(!((d=e.editGroup)!=null&&d.showInStandby))}}},"v-btn",l,!1),o),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiSleep))])],1)]}}])},[t("span",[e._v(e._s(e.$t("Settings.MacrosTab.ShowInStateStandby")))])]),t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:o,attrs:l}){var u;return[t(g,e._g(e._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:(u=e.editGroup)!=null&&u.showInPause?"":"secondary"},on:{click:function(c){var d;return e.updateGroupOptionShowInPause(!((d=e.editGroup)!=null&&d.showInPause))}}},"v-btn",l,!1),o),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiPause))])],1)]}}])},[t("span",[e._v(e._s(e.$t("Settings.MacrosTab.ShowInStatePaused")))])]),t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:o,attrs:l}){var u;return[t(g,e._g(e._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:(u=e.editGroup)!=null&&u.showInPrinting?"":"secondary"},on:{click:function(c){var d;return e.updateGroupOptionShowInPrinting(!((d=e.editGroup)!=null&&d.showInPrinting))}}},"v-btn",l,!1),o),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiPrinter3dNozzle))])],1)]}}])},[t("span",[e._v(e._s(e.$t("Settings.MacrosTab.ShowInStatePrinting")))])])],1),t(I,{staticClass:"my-2"}),t("h3",{staticClass:"text-h5 mt-6 mb-3"},[e._v(e._s(e.$t("Settings.MacrosTab.GroupMacros")))]),(i=e.editGroup)!=null&&i.macros&&((a=(n=e.editGroup)==null?void 0:n.macros)!=null&&a.length)?[t("draggable",{attrs:{handle:".handle","ghost-class":"ghost",group:"macros"},on:{change:e.updateMacroOrder},model:{value:e.editGroupMacros,callback:function(o){e.editGroupMacros=o},expression:"editGroupMacros"}},e._l(e.editGroupMacros,function(o,l){return t(x,{key:o.name,staticClass:"my-2 mx-0",style:e.draggableBgStyle},[t(b,{staticClass:"col-auto pr-0 d-flex py-2"},[t(_,{staticClass:"handle"},[e._v(e._s(e.mdiDragVertical))])],1),t(b,{staticClass:"py-2"},[t(j,{key:"groupMacro_macro_"+l,attrs:{title:o.name,"sub-title":e.getMacroDescription(o.name),"dynamic-slot-width":!0}},[e.existsMacro(o.name)?[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:u,attrs:c}){return[t(g,e._g(e._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:o.color},on:{click:function(d){return e.changeColorMacroFromGroup(o)}}},"v-btn",c,!1),u),[t(_,{attrs:{small:"",left:""}},[e._v(e._s(e.mdiPalette))]),e._v(" "+e._s(o.color)+" ")],1)]}}],null,!0)},[t("span",[e._v(e._s(e.$t("Settings.MacrosTab.ChangeMacroColor")))])]),t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:u,attrs:c}){return[t(g,e._g(e._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:o.showInStandby?"":"secondary"},on:{click:function(d){return e.updateMacroFromGroup(o,"showInStandby",!o.showInStandby)}}},"v-btn",c,!1),u),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiSleep))])],1)]}}],null,!0)},[t("span",[e._v(e._s(e.$t("Settings.MacrosTab.ShowInStateStandby")))])]),t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:u,attrs:c}){return[t(g,e._g(e._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:o.showInPause?"":"secondary"},on:{click:function(d){return e.updateMacroFromGroup(o,"showInPause",!o.showInPause)}}},"v-btn",c,!1),u),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiPause))])],1)]}}],null,!0)},[t("span",[e._v(e._s(e.$t("Settings.MacrosTab.ShowInStatePaused")))])]),t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:u,attrs:c}){return[t(g,e._g(e._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:o.showInPrinting?"":"secondary"},on:{click:function(d){return e.updateMacroFromGroup(o,"showInPrinting",!o.showInPrinting)}}},"v-btn",c,!1),u),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiPrinter3dNozzle))])],1)]}}],null,!0)},[t("span",[e._v(e._s(e.$t("Settings.MacrosTab.ShowInStatePrinting")))])])]:e._e(),t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:u,attrs:c}){return[t(g,e._g(e._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:function(d){return e.removeMacroFromGroup(o)}}},"v-btn",c,!1),u),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)]}}],null,!0)},[t("span",[e._v(e._s(e.$t("Settings.MacrosTab.DeleteMacroFromGroup")))])])],2)],1)],1)}),1)]:[t(x,[t(b,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(e._s(e.$t("Settings.MacrosTab.NoMacrosInGroup")))])])],1)],t(x,{staticClass:"mt-6 mb-3 flex-column flex-md-row"},[t(b,{staticClass:"py-0 align-content-center mb-3 mb-md-0"},[t("h3",{staticClass:"text-h5"},[e._v(e._s(e.$t("Settings.MacrosTab.AvailableMacros")))])]),t(b,{staticClass:"py-0"},[t(se,{attrs:{"append-icon":e.mdiMagnify,label:e.$t("Settings.MacrosTab.Search"),"single-line":"",outlined:"",clearable:"","hide-details":"",dense:""},model:{value:e.searchMacros,callback:function(o){e.searchMacros=o},expression:"searchMacros"}})],1)],1),e.availableMacros.length?[e._l(e.availableMacros,function(o,l){return[l?t(I,{key:"availableMacro_deliver_"+l,staticClass:"my-2"}):e._e(),t(j,{key:"availableMacro_macro_"+l,attrs:{title:o.name,"sub-title":o.description,"dynamic-slot-width":!0}},[t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(u){return e.addMacroToGroup(o)}}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPlus))]),e._v(" "+e._s(e.$t("Settings.MacrosTab.Add"))+" ")],1)],1)]})]:[t(x,[t(b,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(e._s(e.$t("Settings.MacrosTab.NoAvailableMacros")))])])],1)]],2),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:e.cancelEditMacrogroup}},[e._v(e._s(e.$t("Settings.Close")))])],1)]:e._e()],2)},QO=[],e4=E(Ti,KO,QO,!1,null,null);const Fb=e4.exports;var t4=Object.getOwnPropertyDescriptor,s4=(s,e,t,r)=>{for(var i=r>1?void 0:r?t4(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Nm=class extends k(L){constructor(){super(...arguments),this.showGeneral=!0}get modes(){return[{text:this.$t("Settings.MacrosTab.Simple"),value:"simple"},{text:this.$t("Settings.MacrosTab.Expert"),value:"expert"}]}get mode(){var e,t,r;return(r=(t=(e=this.$store.state.gui)==null?void 0:e.macros)==null?void 0:t.mode)!=null?r:"simple"}set mode(e){this.$store.dispatch("gui/macros/saveSetting",{name:"mode",value:e})}updateShowGeneral(e){this.showGeneral=e}scrollToTop(){this.$emit("scrollToTop")}};Nm=s4([S({components:{SettingsMacrosTabExpert:Fb,SettingsMacrosTabSimple:Cb,SettingsRow:j}})],Nm);var r4=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{attrs:{flat:""}},[e.showGeneral?t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MacrosTab.General")))]),t(j,{attrs:{title:e.$t("Settings.MacrosTab.Management")}},[t(ke,{attrs:{items:e.modes,outlined:"",dense:"","hide-details":"",attach:""},model:{value:e.mode,callback:function(r){e.mode=r},expression:"mode"}})],1),t(I,{staticClass:"my-2"})],1):e._e(),e.mode==="expert"?[t(Fb,{on:{"update:showGeneral":e.updateShowGeneral,scrollToTop:e.scrollToTop}})]:[t(Cb)]],2)},i4=[],n4=E(Nm,r4,i4,!1,null,null);const a4=n4.exports;var o4=Object.getOwnPropertyDescriptor,l4=(s,e,t,r)=>{for(var i=r>1?void 0:r?o4(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Hl=class extends y{get homing_origin(){var s,e,t;return(t=(e=(s=this.$store.state.printer)==null?void 0:s.gcode_move)==null?void 0:e.homing_origin)!=null?t:[]}get z_gcode_offset(){return this.homing_origin.length>1?Math.round(this.homing_origin[2]*1e3)/1e3:0}get commands(){var s,e;return(e=(s=this.$store.state.printer.gcode)==null?void 0:s.commands)!=null?e:{}}get settings(){var s,e;return(e=(s=this.$store.state.printer.configfile)==null?void 0:s.settings)!=null?e:{}}get kinematics(){var s,e;return(e=(s=this.settings.printer)==null?void 0:s.kinematics)!=null?e:"cartesian"}get stepper_name(){return this.kinematics==="delta"?"stepper_a":"stepper_z"}get endstop_pin(){var s,e,t;return(t=(e=(s=this.settings[this.stepper_name])==null?void 0:s.endstop_pin)==null?void 0:e.trim())!=null?t:null}get zOffset(){var s,e;return(e=(s=this.$store.state.printer)==null?void 0:s.gcode_move)==null?void 0:e.homing_origin[2].toFixed(3)}get isEndstopProbe(){return this.endstop_pin.replaceAll(" ","").search("probe:z_virtual_endstop")!==-1}get existZOffsetApplyProbe(){return"Z_OFFSET_APPLY_PROBE"in this.commands}get existZOffsetApplyEndstop(){return"Z_OFFSET_APPLY_ENDSTOP"in this.commands}get showSaveButton(){return this.z_gcode_offset===0?!1:this.isEndstopProbe&&this.existZOffsetApplyProbe?!0:!this.isEndstopProbe&&this.existZOffsetApplyEndstop}get autoSaveZOffsetOption(){return this.isEndstopProbe&&this.existZOffsetApplyProbe?"Z_OFFSET_APPLY_PROBE":"Z_OFFSET_APPLY_ENDSTOP"}};Hl=l4([S],Hl);var c4=Object.getOwnPropertyDescriptor,u4=(s,e,t,r)=>{for(var i=r>1?void 0:r?c4(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Vm=class extends k(L,Je,Hl){constructor(){super(...arguments),this.mdiGamepad=Up,this.mdiPrinter3dNozzle=Us}get controlStyles(){return[{text:this.$t("Settings.ControlTab.Bars"),value:"bars"},{text:this.$t("Settings.ControlTab.Circle"),value:"circle"},{text:this.$t("Settings.ControlTab.Cross"),value:"cross"}]}get controlStyle(){var e;return(e=this.$store.state.gui.control.style)!=null?e:"bar"}set controlStyle(e){this.$store.dispatch("gui/saveSetting",{name:"control.style",value:e})}get hideDuringPrint(){var e;return(e=this.$store.state.gui.control.hideDuringPrint)!=null?e:!1}set hideDuringPrint(e){this.$store.dispatch("gui/saveSetting",{name:"control.hideDuringPrint",value:e})}get actionOptions(){let e=[{text:this.$t("Settings.ControlTab.MotorsOff",{isDefault:this.defaultActionButton==="m84"?this.$t("Settings.ControlTab.IsDefault"):""}),value:"m84"}];return this.existsQGL&&e.push({text:this.$t("Settings.ControlTab.QuadGantryLevel",{isDefault:this.defaultActionButton==="qgl"?this.$t("Settings.ControlTab.IsDefault"):""}),value:"qgl"}),this.existsZtilt&&e.push({text:this.$t("Settings.ControlTab.ZTiltAdjust",{isDefault:this.defaultActionButton==="ztilt"?this.$t("Settings.ControlTab.IsDefault"):""}),value:"ztilt"}),e}get actionButton(){var e;return(e=this.$store.state.gui.control.actionButton)!=null?e:this.defaultActionButton}set actionButton(e){this.$store.dispatch("gui/saveSetting",{name:"control.actionButton",value:e})}get defaultActionButton(){return this.$store.getters["gui/getDefaultControlActionButton"]}get enableXYHoming(){var e;return(e=this.$store.state.gui.control.enableXYHoming)!=null?e:!1}set enableXYHoming(e){this.$store.dispatch("gui/saveSetting",{name:"control.enableXYHoming",value:e})}get reverseX(){return this.$store.state.gui.control.reverseX}set reverseX(e){this.$store.dispatch("gui/saveSetting",{name:"control.reverseX",value:e})}get reverseY(){return this.$store.state.gui.control.reverseY}set reverseY(e){this.$store.dispatch("gui/saveSetting",{name:"control.reverseY",value:e})}get reverseZ(){return this.$store.state.gui.control.reverseZ}set reverseZ(e){this.$store.dispatch("gui/saveSetting",{name:"control.reverseZ",value:e})}get feedrateXY(){return this.$store.state.gui.control.feedrateXY}set feedrateXY(e){this.$store.dispatch("gui/saveSetting",{name:"control.feedrateXY",value:e})}get feedrateZ(){return this.$store.state.gui.control.feedrateZ}set feedrateZ(e){this.$store.dispatch("gui/saveSetting",{name:"control.feedrateZ",value:e})}get offsetsZ(){return this.$store.state.gui.control.offsetsZ.sort(function(t,r){return t-r})}set offsetsZ(e){const t=new Set;for(const r of e)t.add(Math.abs(r));this.$store.dispatch("gui/saveSetting",{name:"control.offsetsZ",value:Array.from(t)})}get stepsAll(){const e=this.$store.state.gui.control.stepsAll;return(e!=null?e:[]).sort(function(t,r){return r-t})}set stepsAll(e){const t=[];for(const i of e)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.stepsAll",value:r})}get stepsXY(){return this.$store.state.gui.control.stepsXY.sort(function(t,r){return r-t})}set stepsXY(e){const t=[];for(const i of e)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.stepsXY",value:r})}get stepsZ(){return this.$store.state.gui.control.stepsZ.sort(function(t,r){return r-t})}set stepsZ(e){const t=[];for(const i of e)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.stepsZ",value:r})}get stepsCircleXY(){return this.$store.state.gui.control.stepsCircleXY.sort(function(t,r){return r-t})}set stepsCircleXY(e){const t=[];for(const i of e)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.stepsCircleXY",value:r})}get stepsCircleZ(){return this.$store.state.gui.control.stepsCircleZ.sort(function(t,r){return r-t})}set stepsCircleZ(e){const t=[];for(const i of e)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.stepsCircleZ",value:r})}get feedamountsE(){return this.$store.state.gui.control.extruder.feedamounts.sort(function(t,r){return r-t})}set feedamountsE(e){const t=[];for(const i of e)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.extruder.feedamounts",value:r})}get feedratesE(){return this.$store.state.gui.control.extruder.feedrates.sort(function(t,r){return r-t})}set feedratesE(e){const t=[];for(const i of e)t.push(Math.abs(i));const r=t.filter(this.onlyUnique);this.$store.dispatch("gui/saveSetting",{name:"control.extruder.feedrates",value:r})}get showEstimatedExtrusionInfo(){return this.$store.state.gui.control.extruder.showEstimatedExtrusionInfo}set showEstimatedExtrusionInfo(e){this.$store.dispatch("gui/saveSetting",{name:"control.extruder.showEstimatedExtrusionInfo",value:e})}get offsetZSaveOption(){var e;return(e=this.$store.state.gui.control.offsetZSaveOption)!=null?e:null}set offsetZSaveOption(e){this.$store.dispatch("gui/saveSetting",{name:"control.offsetZSaveOption",value:e})}get offsetZSaveOptions(){const e=this.autoSaveZOffsetOption.replace(/Z_OFFSET_APPLY_/g,""),t=[{value:null,text:"Auto (".concat(e,")")}];return this.existZOffsetApplyEndstop&&t.push({value:"Z_OFFSET_APPLY_ENDSTOP",text:"ENDSTOP"}),this.existZOffsetApplyProbe&&t.push({value:"Z_OFFSET_APPLY_PROBE",text:"PROBE"}),t}blurFeedrateXY(){this.feedrateXY>0||(this.feedrateXY=100)}blurFeedrateZ(){this.feedrateZ>0||(this.feedrateZ=25)}onlyUnique(e,t,r){return r.indexOf(e)===t}mounted(){var e;(e=this.$refs.formControlExtruder)==null||e.validate()}};Vm=u4([S({components:{SettingsRow:j}})],Vm);var d4=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{attrs:{flat:""}},[t(Z,[t(or,{ref:"formControlExtruder"},[t("div",{staticClass:"d-flex align-center"},[t(_,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiGamepad))]),t(gt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.Headline"))+" ")]),t(I,{staticClass:"ml-3"})],1),t(j,{attrs:{title:e.$t("Settings.ControlTab.Style")}},[t(ke,{attrs:{items:e.controlStyles,outlined:"",dense:"","hide-details":"",attach:""},model:{value:e.controlStyle,callback:function(r){e.controlStyle=r},expression:"controlStyle"}})],1),t(I,{staticClass:"my-2"}),["circle","cross"].includes(e.controlStyle)&&e.actionOptions.length>1?[t(j,{attrs:{title:e.$t("Settings.ControlTab.OverwriteActionButton")}},[t(ke,{attrs:{items:e.actionOptions,outlined:"",dense:"","hide-details":"",attach:""},model:{value:e.actionButton,callback:function(r){e.actionButton=r},expression:"actionButton"}})],1),t(I,{staticClass:"my-2"})]:e._e(),t(j,{attrs:{title:e.$t("Settings.ControlTab.HideDuringPrint"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideDuringPrint,callback:function(r){e.hideDuringPrint=r},expression:"hideDuringPrint"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.ControlTab.EnableXYHoming"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.enableXYHoming,callback:function(r){e.enableXYHoming=r},expression:"enableXYHoming"}})],1),t(I,{staticClass:"my-2"}),["circle","cross"].includes(e.controlStyle)?[t(j,{attrs:{title:e.$t("Settings.ControlTab.InvertXMovement"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reverseX,callback:function(r){e.reverseX=r},expression:"reverseX"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.ControlTab.InvertYMovement"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reverseY,callback:function(r){e.reverseY=r},expression:"reverseY"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.ControlTab.InvertZMovement"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reverseZ,callback:function(r){e.reverseZ=r},expression:"reverseZ"}})],1),t(I,{staticClass:"my-2"})]:e._e(),t(j,{attrs:{title:e.$t("Settings.ControlTab.SpeedXY")}},[t(se,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",rules:[r=>r>0||e.$t("Settings.ControlTab.ValueGreaterThan",{value:"0"})],outlined:"",dense:"","hide-spin-buttons":""},on:{blur:e.blurFeedrateXY},model:{value:e.feedrateXY,callback:function(r){e.feedrateXY=r},expression:"feedrateXY"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.ControlTab.SpeedZ")}},[t(se,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",rules:[r=>r>0||e.$t("Settings.ControlTab.ValueGreaterThan",{value:"0"})],outlined:"",dense:"","hide-spin-buttons":""},on:{blur:e.blurFeedrateZ},model:{value:e.feedrateZ,callback:function(r){e.feedrateZ=r},expression:"feedrateZ"}})],1),t(I,{staticClass:"my-2"}),e.controlStyle==="cross"?[t(j,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesInMm"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[r=>r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"}),r=>r.length<=9||e.$t("Settings.ControlTab.MaximumValuesVisibility",{maximum:"9"})],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.stepsAll,callback:function(r){e.stepsAll=r},expression:"stepsAll"}})],1),t(I,{staticClass:"my-2"})]:e.controlStyle==="circle"?[t(j,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesXYInMm"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[r=>r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"}),r=>r.length<=4||e.$t("Settings.ControlTab.MaximumValues",{maximum:"4"})],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.stepsCircleXY,callback:function(r){e.stepsCircleXY=r},expression:"stepsCircleXY"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesZInMm"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[r=>r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"}),r=>r.length<=4||e.$t("Settings.ControlTab.MaximumValues",{maximum:"4"})],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.stepsCircleZ,callback:function(r){e.stepsCircleZ=r},expression:"stepsCircleZ"}})],1),t(I,{staticClass:"my-2"})]:[t(j,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesXYInMm"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[r=>r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"}),r=>r.length<=3||e.$t("Settings.ControlTab.MaximumValuesVisibility",{maximum:"3"})],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.stepsXY,callback:function(r){e.stepsXY=r},expression:"stepsXY"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesZInMm"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[r=>r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"}),r=>r.length<=3||e.$t("Settings.ControlTab.MaximumValuesVisibility",{maximum:"3"})],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.stepsZ,callback:function(r){e.stepsZ=r},expression:"stepsZ"}})],1),t(I,{staticClass:"my-2"})],e.klipperReadyForGui&&e.endstop_pin!==null?[t(j,{attrs:{title:e.$t("Settings.ControlTab.ZOffsetSaveOption"),"sub-title":e.$t("Settings.ControlTab.ZOffsetSaveOptionDescription")}},[t(ke,{staticClass:"mt-0",attrs:{items:e.offsetZSaveOptions,"hide-details":"",outlined:"",dense:""},model:{value:e.offsetZSaveOption,callback:function(r){e.offsetZSaveOption=r},expression:"offsetZSaveOption"}})],1),t(I,{staticClass:"my-2"})]:e._e(),t(j,{attrs:{title:e.$t("Settings.ControlTab.ZOffsetIncrements"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[r=>r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"}),r=>r.length<=4||e.$t("Settings.ControlTab.MaximumValuesVisibility",{maximum:"4"})],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.offsetsZ,callback:function(r){e.offsetsZ=r},expression:"offsetsZ"}})],1),t("div",{staticClass:"d-flex align-center"},[t(_,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiPrinter3dNozzle))]),t(gt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Headline"))+" ")]),t(I,{staticClass:"ml-3"})],1),t(j,{attrs:{title:e.$t("Settings.ControlTab.MoveDistancesEInMm"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[r=>r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"}),r=>r.length<=5||e.$t("Settings.ControlTab.MaximumValuesVisibility",{maximum:"5"})],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.feedamountsE,callback:function(r){e.feedamountsE=r},expression:"feedamountsE"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.ControlTab.SpeedEInMms"),"mobile-second-row":!0}},[t(Zs,{attrs:{"hide-selected":"","hide-details":"auto",multiple:"","small-chips":"","deletable-chips":!0,"append-icon":"",type:"number",rules:[r=>r.length>0||e.$t("Settings.ControlTab.MinimumValues",{minimum:"1"}),r=>r.length<=5||e.$t("Settings.ControlTab.MaximumValuesVisibility",{maximum:"5"})],dense:"",outlined:"","hide-spin-buttons":""},model:{value:e.feedratesE,callback:function(r){e.feedratesE=r},expression:"feedratesE"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.ControlTab.EstimatedExtrusionInfo"),"sub-title":e.$t("Settings.ControlTab.EstimatedExtrusionInfoDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.showEstimatedExtrusionInfo,callback:function(r){e.showEstimatedExtrusionInfo=r},expression:"showEstimatedExtrusionInfo"}})],1)],2)],1)],1)},m4=[],h4=E(Vm,d4,m4,!1,null,null);const p4=h4.exports;var f4=Object.defineProperty,g4=Object.getOwnPropertyDescriptor,gf=(s,e,t,r)=>{for(var i=r>1?void 0:r?g4(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&f4(e,t,i),i};let la=class extends k(L){constructor(){super(...arguments),this.mdiFilter=Zw,this.mdiFilterOff=qw,this.mdiPencil=bt,this.mdiDelete=Ue,this.mdiConsoleLine=Ua,this.form={bool:!1,valid:!1,name:"",regex:"",id:null},this.rules={required:e=>e!==""||"required",unique:e=>!this.existsPresetName(e)||"Name already exists"},this.consoleHeightTmp=300}mounted(){this.consoleHeightTmp=this.consoleHeight}get consoleFilters(){var e;return(e=this.$store.getters["gui/console/getConsolefilters"])!=null?e:[]}get availableDirections(){return[{text:this.$t("Settings.ConsoleTab.DirectionTable"),value:"table"},{text:this.$t("Settings.ConsoleTab.DirectionShell"),value:"shell"}]}get consoleDirection(){var e;return(e=this.$store.state.gui.console.direction)!=null?e:"table"}set consoleDirection(e){this.$store.dispatch("gui/console/saveSetting",{name:"direction",value:e})}get availableEntryStyles(){return[{text:this.$t("Settings.ConsoleTab.EntryStyleDefault"),value:"default"},{text:this.$t("Settings.ConsoleTab.EntryStyleCompact"),value:"compact"}]}get entryStyle(){var e;return(e=this.$store.state.gui.console.entryStyle)!=null?e:"default"}set entryStyle(e){this.$store.dispatch("gui/console/saveSetting",{name:"entryStyle",value:e})}get consoleHeight(){var e;return(e=this.$store.state.gui.console.height)!=null?e:300}set consoleHeight(e){this.$store.dispatch("gui/console/saveSetting",{name:"height",value:e})}consoleHeightChanged(e){this.consoleHeightTmp=e}updateConsoleHeight(e){this.consoleHeight=e}get hideWaitTemperatures(){return this.$store.state.gui.console.hideWaitTemperatures}set hideWaitTemperatures(e){this.$store.dispatch("gui/console/saveSetting",{name:"hideWaitTemperatures",value:e})}get hideTimelapse(){return this.$store.state.gui.console.hideTlCommands}set hideTimelapse(e){this.$store.dispatch("gui/console/saveSetting",{name:"hideTlCommands",value:e})}existsPresetName(e){return this.consoleFilters.findIndex(t=>t.name===e&&t.id!==this.form.id)>=0}clearForm(){this.form.bool=!1,this.form.id=null,this.form.name="",this.form.regex=""}toggleFilter(e){const t={name:e.name,bool:!e.bool,regex:e.regex};this.$store.dispatch("gui/console/filterUpdate",{id:e.id,values:t})}createFilter(){this.clearForm(),this.form.bool=!0}editFilter(e){this.form.name=e.name,this.form.id=e.id,this.form.regex=e.regex,this.form.bool=!0}saveFilter(){if(this.form.valid){const e={name:this.form.name,bool:this.form.bool,regex:this.form.regex};this.form.id?this.$store.dispatch("gui/console/filterUpdate",{id:this.form.id,values:e}):this.$store.dispatch("gui/console/filterStore",{values:e}),this.clearForm()}}deleteFilter(e){this.$store.dispatch("gui/console/filterDelete",e)}};gf([he("consoleHeight")],la.prototype,"consoleHeightChanged",1);gf([Ke(500)],la.prototype,"updateConsoleHeight",1);la=gf([S({components:{SettingsRow:j}})],la);var _4=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.form.bool?t(Pe,{attrs:{flat:""}},[t(or,{on:{submit:function(r){return r.preventDefault(),e.saveFilter.apply(null,arguments)}},model:{value:e.form.valid,callback:function(r){e.$set(e.form,"valid",r)},expression:"form.valid"}},[t(gt,[e._v(" "+e._s(e.form.id===null?e.$t("Settings.ConsoleTab.CreateHeadline"):e.$t("Settings.ConsoleTab.EditHeadline"))+" ")]),t(Z,[t(j,{attrs:{title:e.$t("Settings.ConsoleTab.Name").toString()}},[t(se,{attrs:{"hide-details":"auto",rules:[e.rules.required,e.rules.unique],dense:"",outlined:""},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.ConsoleTab.Regex").toString()}},[t(pr,{attrs:{outlined:"","hide-details":"auto"},model:{value:e.form.regex,callback:function(r){e.$set(e.form,"regex",r)},expression:"form.regex"}})],1)],1),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:function(r){e.form.bool=!1}}},[e._v(" "+e._s(e.$t("Settings.Cancel"))+" ")]),t(g,{attrs:{color:"primary",text:"",type:"submit"}},[e._v(" "+e._s(e.form.id===null?e.$t("Settings.ConsoleTab.StoreButton"):e.$t("Settings.ConsoleTab.UpdateButton"))+" ")])],1)],1)],1):t(Pe,{attrs:{flat:""}},[t(Z,[t("div",{staticClass:"d-flex align-center"},[t(_,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiConsoleLine))]),t(gt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Settings.ConsoleTab.Console"))+" ")]),t(I,{staticClass:"ml-3"})],1),t(j,{attrs:{title:e.$t("Settings.ConsoleTab.Direction").toString()}},[t(ke,{attrs:{items:e.availableDirections,"hide-details":"",outlined:"",dense:"",attach:""},model:{value:e.consoleDirection,callback:function(r){e.consoleDirection=r},expression:"consoleDirection"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.ConsoleTab.EntryStyle").toString()}},[t(ke,{attrs:{items:e.availableEntryStyles,"hide-details":"",outlined:"",dense:"",attach:""},model:{value:e.entryStyle,callback:function(r){e.entryStyle=r},expression:"entryStyle"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.ConsoleTab.Height").toString()}},[t(Lr,{attrs:{"hide-details":"",min:200,max:900,step:10,label:e.consoleHeightTmp+"px"},on:{change:e.updateConsoleHeight},model:{value:e.consoleHeightTmp,callback:function(r){e.consoleHeightTmp=r},expression:"consoleHeightTmp"}})],1),t("div",{staticClass:"d-flex align-center"},[t(_,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiFilter))]),t(gt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Settings.ConsoleTab.Filters"))+" ")]),t(I,{staticClass:"ml-3"})],1),t(j,{attrs:{title:e.$t("Settings.ConsoleTab.HideTemperatures").toString(),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideWaitTemperatures,callback:function(r){e.hideWaitTemperatures=r},expression:"hideWaitTemperatures"}})],1),e.moonrakerComponents.includes("timelapse")?[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.ConsoleTab.HideTimelapse").toString(),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideTimelapse,callback:function(r){e.hideTimelapse=r},expression:"hideTimelapse"}})],1)]:e._e(),t(I,{staticClass:"my-2"}),e._l(e.consoleFilters,function(r,i){return t("div",{key:i},[i?t(I,{staticClass:"my-2"}):e._e(),t(j,{attrs:{title:r.name}},[t(g,{staticClass:"minwidth-0 px-2",attrs:{small:"",outlined:"",color:r.bool?"white":"grey"},on:{click:function(n){return e.toggleFilter(r)}}},[t(_,{attrs:{small:""}},[e._v(e._s(r.bool?e.mdiFilter:e.mdiFilterOff))])],1),t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(n){return e.editFilter(r)}}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:function(n){return e.deleteFilter(r.id)}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)],1)],1)})],2),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:"",color:"primary"},on:{click:e.createFilter}},[e._v(e._s(e.$t("Settings.ConsoleTab.AddFilter")))])],1)],1)],1)},v4=[],b4=E(la,_4,v4,!1,null,"57ed801f");const y4=b4.exports;var C4=Object.getOwnPropertyDescriptor,$4=(s,e,t,r)=>{for(var i=r>1?void 0:r?C4(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Bm=class extends k(L){constructor(){super(...arguments),this.mdiPencil=bt}editCooldown(){this.$emit("edit")}};Bm=$4([S({components:{SettingsRow:j}})],Bm);var x4=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(j,{attrs:{title:e.$t("Settings.PresetsTab.Cooldown")}},[t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:e.editCooldown}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1)],1)},w4=[],S4=E(Bm,x4,w4,!1,null,null);const Rb=S4.exports;var P4=Object.defineProperty,D4=Object.getOwnPropertyDescriptor,Hb=(s,e,t,r)=>{for(var i=r>1?void 0:r?D4(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&P4(e,t,i),i};let jl=class extends k(L){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=Ue}get subTitle(){let s=[];return Object.keys(this.preset.values).forEach(e=>{const t=this.preset.values[e];if(t.bool){const r=e.indexOf(" ")?e.slice(e.indexOf(" ")+1):e;s.push(Ye(r)+": "+t.value+"°C")}}),this.preset.gcode&&s.push(this.$t("Settings.PresetsTab.CustomGCode").toString()),s.join(", ")}editPreset(){this.$emit("edit",this.preset)}deletePreset(){this.$store.dispatch("gui/presets/delete",this.preset.id)}};Hb([w({required:!0})],jl.prototype,"preset",2);jl=Hb([S({components:{SettingsRow:j}})],jl);var T4=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(j,{attrs:{title:e.preset.name,"sub-title":e.subTitle}},[t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:e.editPreset}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:e.deletePreset}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)],1)},O4=[],M4=E(jl,T4,O4,!1,null,null);const jb=M4.exports;var k4=Object.defineProperty,E4=Object.getOwnPropertyDescriptor,Ib=(s,e,t,r)=>{for(var i=r>1?void 0:r?E4(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&k4(e,t,i),i};let Il=class extends k(L){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=Ue,this.gcode=""}mounted(){this.gcode=this.inputGcode}closeForm(){this.$emit("close")}saveCooldown(){this.$store.dispatch("gui/presets/saveSetting",{name:"cooldownGcode",value:this.gcode}),this.closeForm()}};Ib([w({required:!0})],Il.prototype,"inputGcode",2);Il=Ib([S({components:{SettingsRow:j}})],Il);var L4=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{attrs:{flat:""}},[t(or,{on:{submit:function(r){return r.preventDefault(),e.saveCooldown.apply(null,arguments)}}},[t(gt,[e._v(e._s(e.$t("Settings.PresetsTab.EditCooldown")))]),t(Z,[t(j,{attrs:{title:e.$t("Settings.PresetsTab.CustomGCode")}},[t(pr,{attrs:{outlined:"","hide-details":""},model:{value:e.gcode,callback:function(r){e.gcode=r},expression:"gcode"}})],1)],1),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:e.closeForm}},[e._v(" "+e._s(e.$t("Settings.Cancel"))+" ")]),t(g,{attrs:{color:"primary",text:"",type:"submit"}},[e._v(" "+e._s(e.$t("Settings.PresetsTab.UpdateCooldown"))+" ")])],1)],1)],1)},A4=[],F4=E(Il,L4,A4,!1,null,null);const R4=F4.exports;var H4=Object.defineProperty,j4=Object.getOwnPropertyDescriptor,Nb=(s,e,t,r)=>{for(var i=r>1?void 0:r?j4(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&H4(e,t,i),i};let Nl=class extends k(L){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=Ue,this.valid=!1,this.boolInvalidMin=!1,this.rules={required:s=>s!==""||this.$t("Settings.PresetsTab.ErrorNameRequired"),unique:s=>!this.existsPresetName(s)||this.$t("Settings.PresetsTab.ErrorNameNotUnique"),invalid:s=>parseFloat(s)>=0||this.$t("Settings.PresetsTab.ErrorInvalidValue")}}get title(){return this.preset.id===null?this.$t("Settings.PresetsTab.CreateHeadline"):this.$t("Settings.PresetsTab.EditHeadline")}get storeButtonText(){return this.preset.id===null?this.$t("Settings.PresetsTab.StoreButton"):this.$t("Settings.PresetsTab.UpdateButton")}get presets(){var s;return(s=this.$store.getters["gui/presets/getPresets"])!=null?s:[]}get available_heaters(){var s,e,t;return((t=(e=(s=this.$store.state.printer)==null?void 0:s.heaters)==null?void 0:e.available_heaters)!=null?t:[]).sort()}get available_temperature_fans(){var s,e,t;return((t=(e=(s=this.$store.state.printer)==null?void 0:s.heaters)==null?void 0:e.available_sensors)!=null?t:[]).filter(r=>r.startsWith("temperature_fan ")).sort()}mounted(){const s=Object.keys(this.preset.values);this.available_heaters.filter(e=>!s.includes(e)).forEach(e=>{this.preset.values[e]={bool:!1,type:"heater",value:0}}),this.available_temperature_fans.filter(e=>!s.includes(e)).forEach(e=>{this.preset.values[e]={bool:!1,type:"temperature_fan",value:0}}),s.filter(e=>!this.available_heaters.includes(e)&&!this.available_temperature_fans.includes(e)).forEach(e=>{delete this.preset.values[e]})}existsPresetName(s){return this.presets.findIndex(e=>e.name===s&&e.id!==this.preset.id)!==-1}converNameObject(s){return Ye(s.replace("temperature_fan ",""))}closeForm(){this.$emit("close")}savePreset(){let s=0;for(const e of Object.keys(this.preset.values))this.preset.values[e].bool&&s++;if(this.preset.gcode.length&&s++,s===0){this.boolInvalidMin=!0;return}if(this.preset.id===null){this.$store.dispatch("gui/presets/store",{values:this.preset}),this.closeForm();return}this.$store.dispatch("gui/presets/update",{id:this.preset.id,values:this.preset}),this.closeForm()}};Nb([w({required:!0})],Nl.prototype,"preset",2);Nl=Nb([S({components:{SettingsRow:j}})],Nl);var I4=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{attrs:{flat:""}},[t(or,{on:{submit:function(r){return r.preventDefault(),e.savePreset.apply(null,arguments)}},model:{value:e.valid,callback:function(r){e.valid=r},expression:"valid"}},[t(gt,[e._v(e._s(e.title))]),t(Z,[e.boolInvalidMin?t(x,{staticClass:"mt-3"},[t(b,{staticClass:"py-0"},[t(it,{attrs:{dense:"",text:"",type:"error"}},[e._v(e._s(e.$t("Settings.PresetsTab.PresetInfo")))])],1)],1):e._e(),t(j,{attrs:{title:e.$t("Settings.PresetsTab.Name")}},[t(se,{attrs:{placeholder:e.$t("Settings.PresetsTab.PresetNamePlaceholder"),"hide-details":"auto",rules:[e.rules.required,e.rules.unique],dense:"",outlined:""},model:{value:e.preset.name,callback:function(r){e.$set(e.preset,"name",r)},expression:"preset.name"}})],1),e._l(e.preset.values,function(r,i){return t("div",{key:i},[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.converNameObject(i)}},[t(ge,{staticClass:"shrink mt-0",attrs:{"hide-details":""},model:{value:r.bool,callback:function(n){e.$set(r,"bool",n)},expression:"value.bool"}}),t(se,{attrs:{"hide-details":"auto",rules:[e.rules.invalid],type:"number",suffix:"°C",dense:"",outlined:"","hide-spin-buttons":""},on:{focus:function(n){return n.target.select()}},model:{value:r.value,callback:function(n){e.$set(r,"value",n)},expression:"value.value"}})],1)],1)}),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.PresetsTab.CustomGCode")}},[t(pr,{attrs:{outlined:"","hide-details":""},model:{value:e.preset.gcode,callback:function(r){e.$set(e.preset,"gcode",r)},expression:"preset.gcode"}})],1)],2),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:e.closeForm}},[e._v(" "+e._s(e.$t("Settings.Cancel"))+" ")]),t(g,{attrs:{color:"primary",text:"",type:"submit",disabled:!e.valid}},[e._v(" "+e._s(e.storeButtonText)+" ")])],1)],1)],1)},N4=[],V4=E(Nl,I4,N4,!1,null,null);const Vb=V4.exports;var B4=Object.getOwnPropertyDescriptor,U4=(s,e,t,r)=>{for(var i=r>1?void 0:r?B4(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Um=class extends k(L){constructor(){super(...arguments),this.mdiPencil=bt,this.mdiDelete=Ue,this.boolForm=!1,this.boolFormCooldown=!1,this.formPreset={}}get presets(){var e;return(e=this.$store.getters["gui/presets/getPresets"])!=null?e:[]}get cooldownGcode(){return this.$store.getters["gui/presets/getCooldownGcode"]}createPreset(){this.formPreset.id=null,this.formPreset.name="",this.formPreset.values={},this.formPreset.gcode="",this.boolForm=!0}edit(e){this.formPreset={...e},this.boolForm=!0}};Um=U4([S({components:{PresetsForm:Vb,PresetsEntryCooldown:Rb,PresetsEntry:jb,SettingsRow:j}})],Um);var W4=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.boolForm?t(Vb,{attrs:{preset:e.formPreset},on:{close:function(r){e.boolForm=!1}}}):e.boolFormCooldown?t(R4,{attrs:{"input-gcode":e.cooldownGcode},on:{close:function(r){e.boolFormCooldown=!1}}}):t(Pe,{attrs:{flat:""}},[t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.PresetsTab.PreheatPresets")))]),e._l(e.presets,function(r,i){return t("div",{key:r.index},[i?t(I,{staticClass:"my-2"}):e._e(),t(jb,{attrs:{preset:r},on:{edit:e.edit}})],1)}),e.presets.length?t(I,{staticClass:"my-2"}):e._e(),t(Rb,{on:{edit:function(r){e.boolFormCooldown=!0}}})],2),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:"",color:"primary"},on:{click:e.createPreset}},[e._v(e._s(e.$t("Settings.PresetsTab.AddPreset")))])],1)],1)],1)},z4=[],G4=E(Um,W4,z4,!1,null,null);const Z4=G4.exports;var q4=Object.getOwnPropertyDescriptor,X4=(s,e,t,r)=>{for(var i=r>1?void 0:r?q4(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Wm=class extends k(L){constructor(){super(...arguments),this.mdiCheckboxMarkedCircle=X_,this.mdiCancel=Z_,this.mdiPencil=bt,this.mdiDelete=Ue,this.mdiAlertOutline=Jn,this.form={bool:!1,hostname:"",port:7125,path:"/",name:"",id:null,namespace:null}}get printers(){var e;return(e=this.$store.getters["gui/remoteprinters/getRemoteprinters"])!=null?e:[]}get canAddPrinters(){return this.$store.state.instancesDB!=="json"}get protocol(){var e;return(e=this.$store.state.socket.protocol)!=null?e:"ws"}formatPrinterName(e){var t;return e.hostname+(e.port!==80?":"+e.port:"")+((t=e.path)!=null?t:"")}createPrinter(){this.form.hostname="",this.form.port=7125,this.form.path="/",this.form.name="",this.form.id=null,this.form.namespace=null,this.form.bool=!0}storePrinter(){const e={hostname:this.form.hostname,port:this.form.port,name:this.form.name,path:this.form.path};this.$store.dispatch("gui/remoteprinters/store",{values:e}),this.form.hostname="",this.form.port=7125,this.form.name="",this.form.id=null,this.form.bool=!1}editPrinter(e){var t,r,i;this.form.id=(t=e.id)!=null?t:null,this.form.hostname=e.hostname,this.form.port=e.port,this.form.path=(r=e.path)!=null?r:"/",this.form.name=(i=e.name)!=null?i:"",this.form.bool=!0}updatePrinter(){const e={hostname:this.form.hostname,port:this.form.port,name:this.form.name,path:this.form.path};this.$store.dispatch("gui/remoteprinters/update",{id:this.form.id,values:e}),this.form.id=null,this.form.hostname="",this.form.port=7125,this.form.path="/",this.form.name="",this.form.bool=!1}delPrinter(e){this.$store.dispatch("gui/remoteprinters/delete",e)}};Wm=X4([S({components:{SettingsRow:j}})],Wm);var Y4=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.form.bool?t(Pe,{attrs:{flat:""}},[t(gt,[e._v(" "+e._s(e.form.id!==null?e.$t("Settings.RemotePrintersTab.EditPrinter"):e.$t("Settings.RemotePrintersTab.AddPrinter"))+" ")]),t(Z,[t(j,{attrs:{title:e.$t("Settings.RemotePrintersTab.Hostname")}},[t(se,{attrs:{rules:[r=>!!r||"Hostname is required",r=>!r.startsWith("http:")||"invalid hostname/IP",r=>!r.startsWith("https:")||"invalid hostname/IP"],"hide-details":"auto",required:"",dense:"",outlined:""},model:{value:e.form.hostname,callback:function(r){e.$set(e.form,"hostname",r)},expression:"form.hostname"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.RemotePrintersTab.Port")}},[t(se,{attrs:{rules:[r=>!!r||"Port is required"],"hide-details":"auto",required:"",dense:"",outlined:""},model:{value:e.form.port,callback:function(r){e.$set(e.form,"port",r)},expression:"form.port"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.RemotePrintersTab.Path")}},[t(se,{attrs:{rules:[r=>!r||r.startsWith("/")||"Path must start with /"],"hide-details":"auto",outlined:"",dense:""},model:{value:e.form.path,callback:function(r){e.$set(e.form,"path",r)},expression:"form.path"}})],1),e.instancesDB!=="moonraker"?[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.RemotePrintersTab.Name"),"sub-title":e.$t("Settings.RemotePrintersTab.NameDescription")}},[t(se,{attrs:{outlined:"","hide-details":"auto",dense:""},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}})],1)]:e._e()],2),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:function(r){e.form.bool=!1}}},[e._v(e._s(e.$t("Settings.Cancel")))]),e.form.id===null?t(g,{attrs:{text:"",color:"primary"},on:{click:e.storePrinter}},[e._v(" "+e._s(e.$t("Settings.RemotePrintersTab.AddPrinter"))+" ")]):t(g,{attrs:{text:"",color:"primary"},on:{click:e.updatePrinter}},[e._v(" "+e._s(e.$t("Settings.RemotePrintersTab.UpdatePrinter"))+" ")])],1)],1):t(Pe,{attrs:{flat:""}},[t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.RemotePrintersTab.RemotePrinters")))]),e.canAddPrinters?e._e():t(it,{attrs:{icon:e.mdiAlertOutline,type:"warning",text:""}},[e._v(" "+e._s(e.$t("Settings.RemotePrintersTab.UseConfigJson"))+" ")]),e._l(e.printers,function(r,i){return t("div",{key:r.id},[i?t(I,{staticClass:"my-2"}):e._e(),t(j,{attrs:{title:e.formatPrinterName(r),loading:r.socket.isConnecting,icon:r.socket.isConnected?e.mdiCheckboxMarkedCircle:e.mdiCancel}},[t(g,{attrs:{small:"",outlined:"",disabled:!e.canAddPrinters},on:{click:function(n){return e.editPrinter(r)}}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error",disabled:!e.canAddPrinters},on:{click:function(n){return e.delPrinter(r.id)}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)],1)],1)})],2),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:"",color:"primary",disabled:!e.canAddPrinters},on:{click:e.createPrinter}},[e._v(" "+e._s(e.$t("Settings.RemotePrintersTab.AddPrinter"))+" ")])],1)],1)],1)},J4=[],K4=E(Wm,Y4,J4,!1,null,null);const Q4=K4.exports;var eM=Object.defineProperty,tM=Object.getOwnPropertyDescriptor,to=(s,e,t,r)=>{for(var i=r>1?void 0:r?tM(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&eM(e,t,i),i};let Ur=class extends k(L,vt){constructor(){super(...arguments),this.mdiRestart=_r,this.mdiTimerOutline=TS,this.defaultBigThumbnailBackground=At}get mode(){return this.$store.state.gui.uiSettings.mode}set mode(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.mode",value:e})}get themeName(){return this.$store.getters["gui/theme"]}set themeName(e){var r,i;const t=Ci.find(n=>n.name===e);this.logoColor===this.defaultLogoColor&&(this.logoColor=(r=t==null?void 0:t.colorLogo)!=null?r:Ir),this.primaryColor===this.defaultPrimaryColor&&(this.primaryColor=(i=t==null?void 0:t.colorPrimary)!=null?i:al),this.$store.dispatch("gui/saveSetting",{name:"uiSettings.theme",value:e})}get modes(){return[{text:this.$t("Settings.UiSettingsTab.ThemeDark"),value:"dark"},{text:this.$t("Settings.UiSettingsTab.ThemeLight"),value:"light"}]}get themes(){return Ci.map(e=>({text:e.displayName,value:e.name}))}get logoColor(){return this.$store.state.gui.uiSettings.logo}set logoColor(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.logo",value:e})}get defaultLogoColor(){var e,t;return(t=(e=this.theme)==null?void 0:e.colorLogo)!=null?t:Ir}get defaultPrimaryColor(){var e,t;return(t=(e=this.theme)==null?void 0:e.colorPrimary)!=null?t:al}get primaryColor(){return this.$store.state.gui.uiSettings.primary}set primaryColor(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.primary",value:e})}get boolBigThumbnail(){return this.$store.state.gui.uiSettings.boolBigThumbnail}set boolBigThumbnail(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.boolBigThumbnail",value:e})}get bigThumbnailBackground(){return this.$store.state.gui.uiSettings.bigThumbnailBackground}set bigThumbnailBackground(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.bigThumbnailBackground",value:e})}get displayCancelPrint(){return this.$store.state.gui.uiSettings.displayCancelPrint}set displayCancelPrint(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.displayCancelPrint",value:e})}get progressAsFavicon(){return this.$store.state.gui.uiSettings.progressAsFavicon}set progressAsFavicon(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.progressAsFavicon",value:e})}get confirmOnEmergencyStop(){return this.$store.state.gui.uiSettings.confirmOnEmergencyStop}set confirmOnEmergencyStop(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.confirmOnEmergencyStop",value:e})}get confirmOnCoolDown(){return this.$store.state.gui.uiSettings.confirmOnCoolDown}set confirmOnCoolDown(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.confirmOnCoolDown",value:e})}get confirmOnPowerDeviceChange(){return this.$store.state.gui.uiSettings.confirmOnPowerDeviceChange}set confirmOnPowerDeviceChange(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.confirmOnPowerDeviceChange",value:e})}get confirmOnCancelJob(){return this.$store.state.gui.uiSettings.confirmOnCancelJob}set confirmOnCancelJob(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.confirmOnCancelJob",value:e})}get lockSliders(){return this.$store.state.gui.uiSettings.lockSlidersOnTouchDevices}set lockSliders(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.lockSlidersOnTouchDevices",value:e})}get lockSlidersDelay(){return this.$store.state.gui.uiSettings.lockSlidersDelay}set lockSlidersDelay(e){e>=0&&this.$store.dispatch("gui/saveSetting",{name:"uiSettings.lockSlidersDelay",value:e})}get boolWideNavDrawer(){var e;return(e=this.$store.state.gui.uiSettings.boolWideNavDrawer)!=null?e:!1}get navigationStyleSetting(){return this.$store.state.gui.uiSettings.navigationStyle}set navigationStyleSetting(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.navigationStyle",value:e})}get navigationStyles(){return[{text:this.$t("Settings.UiSettingsTab.NavigationStyleIconsOnly"),value:"iconsOnly"},{text:this.$t("Settings.UiSettingsTab.NavigationStyleIconsAndText"),value:"iconsAndText"}]}get defaultNavigationStateSetting(){return this.$store.state.gui.uiSettings.defaultNavigationStateSetting}set defaultNavigationStateSetting(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.defaultNavigationStateSetting",value:e})}get defaultNavigationStateSettings(){return[{text:this.$t("Settings.UiSettingsTab.DefaultNavigationStateAlwaysOpen"),value:"alwaysOpen"},{text:this.$t("Settings.UiSettingsTab.DefaultNavigationStateAlwaysClosed"),value:"alwaysClosed"},{text:this.$t("Settings.UiSettingsTab.DefaultNavigationStateLastState"),value:"lastState"}]}get boolHideUploadAndPrintButton(){var e;return(e=this.$store.state.gui.uiSettings.boolHideUploadAndPrintButton)!=null?e:!1}set boolHideUploadAndPrintButton(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.boolHideUploadAndPrintButton",value:e})}get powerDevices(){var e;return(e=this.$store.getters["server/power/getDevices"])!=null?e:[]}get autoPowerDevice(){var e,t;return(t=(e=this.powerDevices.find(r=>r.device.toLowerCase()==="printer"))==null?void 0:e.device)!=null?t:"--"}get powerDeviceName(){var e;return(e=this.$store.state.gui.uiSettings.powerDeviceName)!=null?e:null}set powerDeviceName(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.powerDeviceName",value:e})}get powerDeviceOptions(){const e=[{text:"Auto (".concat(this.autoPowerDevice,")"),value:null}];return this.powerDevices.forEach(t=>{e.push({text:"".concat(t.device," (").concat(t.type,")"),value:t.device.toString()})}),e}get hideSaveConfigForBedMash(){var e;return(e=this.$store.state.gui.uiSettings.hideSaveConfigForBedMash)!=null?e:!1}set hideSaveConfigForBedMash(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.hideSaveConfigForBedMash",value:e})}get disableFanAnimation(){var e;return(e=this.$store.state.gui.uiSettings.disableFanAnimation)!=null?e:!1}set disableFanAnimation(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.disableFanAnimation",value:e})}get boolManualProbeDialog(){var e;return(e=this.$store.state.gui.uiSettings.boolManualProbeDialog)!=null?e:!0}set boolManualProbeDialog(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.boolManualProbeDialog",value:e})}get boolBedScrewsDialog(){var e;return(e=this.$store.state.gui.uiSettings.boolBedScrewsDialog)!=null?e:!0}set boolBedScrewsDialog(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.boolBedScrewsDialog",value:e})}get boolScrewsTiltAdjustDialog(){var e;return(e=this.$store.state.gui.uiSettings.boolScrewsTiltAdjustDialog)!=null?e:!0}set boolScrewsTiltAdjustDialog(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.boolScrewsTiltAdjustDialog",value:e})}get printstatusThumbnailZoom(){var e;return(e=this.$store.state.gui.uiSettings.printstatusThumbnailZoom)!=null?e:!0}set printstatusThumbnailZoom(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.printstatusThumbnailZoom",value:e})}get tempchartHeight(){var e;return(e=this.$store.state.gui.uiSettings.tempchartHeight)!=null?e:250}set tempchartHeight(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.tempchartHeight",value:e})}get hideUpdateWarnings(){var e;return(e=this.$store.state.gui.uiSettings.hideUpdateWarnings)!=null?e:!1}set hideUpdateWarnings(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.hideUpdateWarnings",value:e})}get dashboardFilesLimit(){var e;return(e=this.$store.state.gui.uiSettings.dashboardFilesLimit)!=null?e:5}set dashboardFilesLimit(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.dashboardFilesLimit",value:e})}get dashboardFilesFilter(){var e;return(e=this.$store.state.gui.uiSettings.dashboardFilesFilter)!=null?e:[]}set dashboardFilesFilter(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.dashboardFilesFilter",value:e})}get dashboardFilesFilters(){return[{text:this.$t("Settings.UiSettingsTab.DashboardFilesFilterNew"),value:"new"},{text:this.$t("Settings.UiSettingsTab.DashboardFilesFilterFailed"),value:"failed"},{text:this.$t("Settings.UiSettingsTab.DashboardFilesFilterCompleted"),value:"completed"}]}get dashboardHistoryLimit(){var e;return(e=this.$store.state.gui.uiSettings.dashboardHistoryLimit)!=null?e:5}set dashboardHistoryLimit(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.dashboardHistoryLimit",value:e})}get hideOtherInstances(){var e;return(e=this.$store.state.gui.uiSettings.hideOtherInstances)!=null?e:!1}set hideOtherInstances(e){this.$store.dispatch("gui/saveSetting",{name:"uiSettings.hideOtherInstances",value:e})}clearColorObject(e){return typeof e=="object"&&"hex"in e&&(e=e.hex),e.length>7&&(e=e.substr(0,7)),e}updateLogoColor(e){this.logoColor=this.clearColorObject(e)}updatePrimaryColor(e){this.primaryColor=this.clearColorObject(e)}updateBigThumbnailBackground(e){this.bigThumbnailBackground=this.clearColorObject(e)}onThemeChanged(e){const t=Ci.find(r=>r.name===e);t&&t.colorLogo&&(this.logoColor=t.colorLogo)}};to([Ke(500)],Ur.prototype,"updateLogoColor",1);to([Ke(500)],Ur.prototype,"updatePrimaryColor",1);to([Ke(500)],Ur.prototype,"updateBigThumbnailBackground",1);to([he("theme")],Ur.prototype,"onThemeChanged",1);Ur=to([S({components:{SettingsRow:j}})],Ur);var sM=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(Pe,{attrs:{flat:""}},[t(Z,[t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.Mode"),"sub-title":e.$t("Settings.UiSettingsTab.ModeDescription")}},[t(ke,{staticClass:"mt-0",attrs:{items:e.modes,"hide-details":"",outlined:"",dense:""},model:{value:e.mode,callback:function(r){e.mode=r},expression:"mode"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.Theme"),"sub-title":e.$t("Settings.UiSettingsTab.ThemeDescription")}},[t(ke,{staticClass:"mt-0",attrs:{items:e.themes,"hide-details":"",outlined:"",dense:""},model:{value:e.themeName,callback:function(r){e.themeName=r},expression:"themeName"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.Logo")}},[e.logoColor.toLowerCase()!==e.defaultLogoColor.toLowerCase()?t(g,{staticClass:"minwidth-0",attrs:{small:"",text:""},on:{click:function(r){e.logoColor=e.defaultLogoColor}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiRestart))])],1):e._e(),t(ye,{attrs:{bottom:"",left:"","offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"minwidth-0 px-5",attrs:{color:e.logoColor,small:""}},"v-btn",i,!1),r))]}}])},[t(Xt,{attrs:{value:e.logoColor,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":e.updateLogoColor}})],1)],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.Primary")}},[e.primaryColor.toLowerCase()!==e.defaultPrimaryColor.toLowerCase()?t(g,{staticClass:"minwidth-0",attrs:{small:"",text:""},on:{click:function(r){e.primaryColor=e.defaultPrimaryColor}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiRestart))])],1):e._e(),t(ye,{attrs:{bottom:"",left:"","offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"minwidth-0 px-5",attrs:{color:e.primaryColor,small:""}},"v-btn",i,!1),r))]}}])},[t(Xt,{attrs:{value:e.primaryColor,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":e.updatePrimaryColor}})],1)],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.GcodeThumbnails"),"sub-title":e.$t("Settings.UiSettingsTab.GcodeThumbnailsDescription"),"dynamic-slot-width":!0}},[t(g,{attrs:{outlined:"",small:"",color:"primary",href:"https://docs.mainsail.xyz/overview/features/thumbnails",target:"_blank"}},[e._v(" "+e._s(e.$t("Settings.UiSettingsTab.Guide"))+" ")])],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.BoolBigThumbnail"),"sub-title":e.$t("Settings.UiSettingsTab.BoolBigThumbnailDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolBigThumbnail,callback:function(r){e.boolBigThumbnail=r},expression:"boolBigThumbnail"}})],1),e.boolBigThumbnail?[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.PrintstatusThumbnailZoom"),"sub-title":e.$t("Settings.UiSettingsTab.PrintstatusThumbnailZoomDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.printstatusThumbnailZoom,callback:function(r){e.printstatusThumbnailZoom=r},expression:"printstatusThumbnailZoom"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.BigThumbnailBackground")}},[e.bigThumbnailBackground.toLowerCase()!==e.defaultBigThumbnailBackground.toLowerCase()?t(g,{staticClass:"minwidth-0",attrs:{small:"",text:""},on:{click:function(r){e.bigThumbnailBackground=e.defaultBigThumbnailBackground}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiRestart))])],1):e._e(),t(ye,{attrs:{bottom:"",left:"","offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"minwidth-0 px-5",attrs:{color:e.bigThumbnailBackground,small:""}},"v-btn",i,!1),r))]}}],null,!1,2319691296)},[t(Xt,{attrs:{value:e.bigThumbnailBackground,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":e.updateBigThumbnailBackground}})],1)],1)]:e._e(),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.DisplayCANCEL_PRINT"),"sub-title":e.$t("Settings.UiSettingsTab.DisplayCANCEL_PRINTDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.displayCancelPrint,callback:function(r){e.displayCancelPrint=r},expression:"displayCancelPrint"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.ProgressAsFavicon"),"sub-title":e.$t("Settings.UiSettingsTab.ProgressAsFaviconDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.progressAsFavicon,callback:function(r){e.progressAsFavicon=r},expression:"progressAsFavicon"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.LockSliders"),"sub-title":e.$t("Settings.UiSettingsTab.LockSlidersDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.lockSliders,callback:function(r){e.lockSliders=r},expression:"lockSliders"}})],1),t(I,{staticClass:"my-2"}),t(iu,[t(j,{directives:[{name:"show",rawName:"v-show",value:e.lockSliders,expression:"lockSliders"}],attrs:{title:e.$t("Settings.UiSettingsTab.LockSlidersDelay"),"sub-title":e.$t("Settings.UiSettingsTab.LockSlidersDelayDescription"),"dynamic-slot-width":!0}},[t(se,{staticClass:"mt-0",style:e.isMobile?{"max-width":"140px"}:{},attrs:{"prepend-icon":e.mdiTimerOutline,label:"Timeout",type:"number",rules:[r=>r>=0],min:"0",step:"0.5",suffix:"s","hide-details":"",outlined:"",dense:"","hide-spin-buttons":""},model:{value:e.lockSlidersDelay,callback:function(r){e.lockSlidersDelay=r},expression:"lockSlidersDelay"}})],1)],1),t(I,{directives:[{name:"show",rawName:"v-show",value:e.lockSliders,expression:"lockSliders"}],staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.ConfirmOnEmergencyStop"),"sub-title":e.$t("Settings.UiSettingsTab.ConfirmOnEmergencyStopDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.confirmOnEmergencyStop,callback:function(r){e.confirmOnEmergencyStop=r},expression:"confirmOnEmergencyStop"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.ConfirmOnCoolDown"),"sub-title":e.$t("Settings.UiSettingsTab.ConfirmOnCoolDownDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.confirmOnCoolDown,callback:function(r){e.confirmOnCoolDown=r},expression:"confirmOnCoolDown"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.ConfirmOnPowerDeviceChange"),"sub-title":e.$t("Settings.UiSettingsTab.ConfirmOnPowerDeviceChangeDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.confirmOnPowerDeviceChange,callback:function(r){e.confirmOnPowerDeviceChange=r},expression:"confirmOnPowerDeviceChange"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.ConfirmOnCancelJob"),"sub-title":e.$t("Settings.UiSettingsTab.ConfirmOnCancelJobDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.confirmOnCancelJob,callback:function(r){e.confirmOnCancelJob=r},expression:"confirmOnCancelJob"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.NavigationStyle"),"sub-title":e.$t("Settings.UiSettingsTab.NavigationStyleDescription")}},[t(ke,{staticClass:"mt-0",attrs:{items:e.navigationStyles,"hide-details":"",outlined:"",dense:""},model:{value:e.navigationStyleSetting,callback:function(r){e.navigationStyleSetting=r},expression:"navigationStyleSetting"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.DefaultNavigationState"),"sub-title":e.$t("Settings.UiSettingsTab.DefaultNavigationStateDescription")}},[t(ke,{staticClass:"mt-0",attrs:{items:e.defaultNavigationStateSettings,"hide-details":"",outlined:"",dense:""},model:{value:e.defaultNavigationStateSetting,callback:function(r){e.defaultNavigationStateSetting=r},expression:"defaultNavigationStateSetting"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.BoolHideUploadAndPrintButton"),"sub-title":e.$t("Settings.UiSettingsTab.BoolHideUploadAndPrintButtonDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolHideUploadAndPrintButton,callback:function(r){e.boolHideUploadAndPrintButton=r},expression:"boolHideUploadAndPrintButton"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.PowerDeviceName"),"sub-title":e.$t("Settings.UiSettingsTab.PowerDeviceNameDescription"),"dynamic-slot-width":!0}},[t(ke,{staticClass:"mt-0",attrs:{items:e.powerDeviceOptions,"hide-details":"",outlined:"",dense:""},model:{value:e.powerDeviceName,callback:function(r){e.powerDeviceName=r},expression:"powerDeviceName"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.HideSaveConfigButtonForBedMesh"),"sub-title":e.$t("Settings.UiSettingsTab.HideSaveConfigButtonForBedMeshDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideSaveConfigForBedMash,callback:function(r){e.hideSaveConfigForBedMash=r},expression:"hideSaveConfigForBedMash"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.DisableFanAnimation"),"sub-title":e.$t("Settings.UiSettingsTab.DisableFanAnimationDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.disableFanAnimation,callback:function(r){e.disableFanAnimation=r},expression:"disableFanAnimation"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.ManualProbeDialog"),"sub-title":e.$t("Settings.UiSettingsTab.ManualProbeDialogDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolManualProbeDialog,callback:function(r){e.boolManualProbeDialog=r},expression:"boolManualProbeDialog"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.BedScrewsDialog"),"sub-title":e.$t("Settings.UiSettingsTab.BedScrewsDialogDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolBedScrewsDialog,callback:function(r){e.boolBedScrewsDialog=r},expression:"boolBedScrewsDialog"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.ScrewsTiltAdjustDialog"),"sub-title":e.$t("Settings.UiSettingsTab.ScrewsTiltAdjustDialogDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.boolScrewsTiltAdjustDialog,callback:function(r){e.boolScrewsTiltAdjustDialog=r},expression:"boolScrewsTiltAdjustDialog"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.TempchartHeight"),"sub-title":e.$t("Settings.UiSettingsTab.TempchartHeightDescription")}},[t(Lr,{attrs:{"hide-details":"",min:100,max:500,step:1,label:e.tempchartHeight+"px"},model:{value:e.tempchartHeight,callback:function(r){e.tempchartHeight=r},expression:"tempchartHeight"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.HideUpdateWarnings"),"sub-title":e.$t("Settings.UiSettingsTab.HideUpdateWarningsDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideUpdateWarnings,callback:function(r){e.hideUpdateWarnings=r},expression:"hideUpdateWarnings"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.DashboardFilesLimit"),"sub-title":e.$t("Settings.UiSettingsTab.DashboardFilesLimitDescription")}},[t(Lr,{attrs:{"hide-details":"",min:0,max:10,step:1,label:e.$t("Settings.UiSettingsTab.DashboardFilesLimitLabel",{count:e.dashboardFilesLimit})},model:{value:e.dashboardFilesLimit,callback:function(r){e.dashboardFilesLimit=r},expression:"dashboardFilesLimit"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.DashboardFilesFilter"),"sub-title":e.$t("Settings.UiSettingsTab.DashboardFilesFilterDescription")}},[t(ke,{attrs:{items:e.dashboardFilesFilters,multiple:"","hide-details":"",dense:"",outlined:""},model:{value:e.dashboardFilesFilter,callback:function(r){e.dashboardFilesFilter=r},expression:"dashboardFilesFilter"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.DashboardHistoryLimit"),"sub-title":e.$t("Settings.UiSettingsTab.DashboardHistoryLimitDescription")}},[t(Lr,{attrs:{"hide-details":"",min:0,max:10,step:1,label:e.$t("Settings.UiSettingsTab.DashboardHistoryLimitLabel",{count:e.dashboardHistoryLimit})},model:{value:e.dashboardHistoryLimit,callback:function(r){e.dashboardHistoryLimit=r},expression:"dashboardHistoryLimit"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.UiSettingsTab.HideOtherInstances"),"sub-title":e.$t("Settings.UiSettingsTab.HideOtherInstancesDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.hideOtherInstances,callback:function(r){e.hideOtherInstances=r},expression:"hideOtherInstances"}})],1)],2)],1)],1)},rM=[],iM=E(Ur,sM,rM,!1,null,null);const nM=iM.exports;var aM=Object.getOwnPropertyDescriptor,oM=(s,e,t,r)=>{for(var i=r>1?void 0:r?aM(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Ns=class extends L{get macrogroups(){var s;return(s=this.$store.getters["gui/macros/getAllMacrogroups"])!=null?s:[]}get webcams(){var s;return(s=this.$store.getters["gui/webcams/getWebcams"])!=null?s:[]}getPanelName(s){var e;if(s.startsWith("macrogroup_")){const t=(e=s.split("_")[1])!=null?e:"",r=this.macrogroups.find(i=>i.id===t);return r?r.name:"Macrogroup"}if(s.includes("-")){let t="";return s.split("-").forEach(i=>{t+=lr(i)}),this.$t("Panels.".concat(t,"Panel.Headline"))}return this.$t("Panels.".concat(lr(s),"Panel.Headline"))}convertPanelnameToIcon(s){if(s.startsWith("macrogroup_"))return Qn;switch(s){case"webcam":return on;case"zoffset":return hw;case"toolhead-control":return Up;case"macros":return Qn;case"miscellaneous":return Hp;case"temperature":return Dv;case"miniconsole":return Ua;case"machine-settings":return ev;case"extruder-control":return Us;default:return Ht}}};Ns=oM([S],Ns);var lM=Object.defineProperty,cM=Object.getOwnPropertyDescriptor,_f=(s,e,t,r)=>{for(var i=r>1?void 0:r?cM(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&lM(e,t,i),i};let ca=class extends k(Ns){constructor(){super(...arguments),this.mdiInformation=Ht,this.mdiDragVertical=Wa}get panelname(){return this.getPanelName(this.name)}get icon(){return this.convertPanelnameToIcon(this.name)}get checkboxColor(){return this.visible?"primary":"grey lighten-1"}get checkboxIcon(){return this.visible?Lp:Ep}};_f([w({type:String,required:!0})],ca.prototype,"name",2);_f([w({type:Boolean,required:!0})],ca.prototype,"visible",2);ca=_f([S({components:{draggable:si}})],ca);var uM=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(J,[t(x,[t(b,{staticClass:"col-auto px-0"},[t(_,{staticClass:"handle pr-2"},[e._v(e._s(e.mdiDragVertical))]),t(_,[e._v(e._s(e.icon))])],1),t(b,{staticClass:"pr-0 text-truncate"},[e._v(" "+e._s(e.panelname)+" ")]),t(b,{staticClass:"col-auto pl-2"},[t(_,{attrs:{color:e.checkboxColor},domProps:{innerHTML:e._s(e.checkboxIcon)},on:{click:function(r){return r.stopPropagation(),e.$emit("change-visible",e.name,!e.visible)}}})],1)],1)],1)},dM=[],mM=E(ca,uM,dM,!1,null,"82546576");const hM=mM.exports;var pM=Object.defineProperty,fM=Object.getOwnPropertyDescriptor,vf=(s,e,t,r)=>{for(var i=r>1?void 0:r?fM(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&pM(e,t,i),i};let ua=class extends k(Ns){constructor(){super(...arguments),this.mdiInformation=Ht,this.mdiLock=eS}get layoutname(){return this.column?"".concat(this.viewportName,"Layout").concat(this.column):"".concat(this.viewportName,"Layout")}get groupname(){return"".concat(this.viewportName,"Viewport")}get layout(){return this.$store.getters["gui/getPanels"](this.viewportName,this.column)}set layout(e){e=e.filter(t=>t!==void 0),this.$store.dispatch("gui/saveSetting",{name:"dashboard.".concat(this.layoutname),value:e})}changeVisible(e,t){const r=this.layout.findIndex(i=>i.name===e);r!==-1&&(this.layout[r].visible=t,this.$store.dispatch("gui/saveSetting",{name:"dashboard.".concat(this.layoutname),value:this.layout}))}};vf([w({type:String,required:!0})],ua.prototype,"viewportName",2);vf([w({type:Number,required:!1,default:1})],ua.prototype,"column",2);ua=vf([S({components:{SettingsDashboardSortableItem:hM,draggable:si}})],ua);var gM=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{staticClass:"mx-auto fill-height",attrs:{"max-width":"300",tile:""}},[t(Me,{staticClass:"fill-height",attrs:{dense:""}},[e.column<2?t(J,[t(x,[t(b,{staticClass:"col-auto pr-0 pl-8"},[t(_,[e._v(e._s(e.mdiInformation))])],1),t(b,{staticClass:"pr-0 text-truncate"},[e._v(" "+e._s(e.$t("Panels.StatusPanel.Headline"))+" ")]),t(b,{staticClass:"col-auto pl-0"},[t(_,{attrs:{color:"grey lighten-1"}},[e._v(e._s(e.mdiLock))])],1)],1)],1):e._e(),t("draggable",{staticClass:"v-list-item-group fill-height",attrs:{handle:".handle","ghost-class":"ghost",group:e.groupname},model:{value:e.layout,callback:function(r){e.layout=r},expression:"layout"}},[t("transition-group",e._l(e.layout,function(r){return t("settings-dashboard-sortable-item",{key:"item-".concat(r.name),attrs:{name:r.name,visible:r.visible},on:{"change-visible":e.changeVisible}})}),1)],1)],1)],1)},_M=[],vM=E(ua,gM,_M,!1,null,"084031c4");const Su=vM.exports;var bM=Object.getOwnPropertyDescriptor,yM=(s,e,t,r)=>{for(var i=r>1?void 0:r?bM(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let zm=class extends k(Ns){resetLayout(){this.$store.dispatch("gui/resetLayout","mobileLayout")}};zm=yM([S({components:{SettingsDashboardSortable:Su}})],zm);var CM=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{attrs:{flat:""}},[t(Z,[t(x,[t(b,[t("settings-dashboard-sortable",{attrs:{"viewport-name":"mobile",column:0}})],1)],1),t(x,[t(b,{staticClass:"text-center"},[t(g,{attrs:{color:"error"},on:{click:e.resetLayout}},[e._v(e._s(e.$t("Settings.DashboardTab.ResetLayout")))])],1)],1)],1)],1)},$M=[],xM=E(zm,CM,$M,!1,null,"30a43531");const wM=xM.exports;var SM=Object.getOwnPropertyDescriptor,PM=(s,e,t,r)=>{for(var i=r>1?void 0:r?SM(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Gm=class extends k(Ns){resetLayout(){this.$store.dispatch("gui/resetLayout","tabletLayout1"),this.$store.dispatch("gui/resetLayout","tabletLayout2")}};Gm=PM([S({components:{SettingsDashboardSortable:Su}})],Gm);var DM=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{attrs:{flat:""}},[t(Z,[t(x,[t(b,{staticClass:"col-12 col-md-6"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"tablet",column:1}})],1),t(b,{staticClass:"col-12 col-md-6"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"tablet",column:2}})],1)],1),t(x,[t(b,{staticClass:"text-center"},[t(g,{attrs:{color:"error"},on:{click:e.resetLayout}},[e._v(e._s(e.$t("Settings.DashboardTab.ResetLayout")))])],1)],1)],1)],1)},TM=[],OM=E(Gm,DM,TM,!1,null,"48768826");const MM=OM.exports;var kM=Object.getOwnPropertyDescriptor,EM=(s,e,t,r)=>{for(var i=r>1?void 0:r?kM(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Zm=class extends k(Ns){resetLayout(){this.$store.dispatch("gui/resetLayout","desktopLayout1"),this.$store.dispatch("gui/resetLayout","desktopLayout2")}};Zm=EM([S({components:{SettingsDashboardSortable:Su}})],Zm);var LM=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{attrs:{flat:""}},[t(Z,[t(x,[t(b,{staticClass:"col-12 col-md-6"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"desktop",column:1}})],1),t(b,{staticClass:"col-12 col-md-6"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"desktop",column:2}})],1)],1),t(x,[t(b,{staticClass:"text-center"},[t(g,{attrs:{color:"error"},on:{click:e.resetLayout}},[e._v(e._s(e.$t("Settings.DashboardTab.ResetLayout")))])],1)],1)],1)],1)},AM=[],FM=E(Zm,LM,AM,!1,null,"158aaae3");const RM=FM.exports;var HM=Object.getOwnPropertyDescriptor,jM=(s,e,t,r)=>{for(var i=r>1?void 0:r?HM(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let qm=class extends k(Ns){resetLayout(){this.$store.dispatch("gui/resetLayout","widescreenLayout1"),this.$store.dispatch("gui/resetLayout","widescreenLayout2"),this.$store.dispatch("gui/resetLayout","widescreenLayout3")}};qm=jM([S({components:{SettingsDashboardSortable:Su}})],qm);var IM=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{attrs:{flat:""}},[t(Z,[t(x,[t(b,{staticClass:"col-12 col-md-4"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"widescreen",column:1}})],1),t(b,{staticClass:"col-12 col-md-4"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"widescreen",column:2}})],1),t(b,{staticClass:"col-12 col-md-4"},[t("settings-dashboard-sortable",{attrs:{"viewport-name":"widescreen",column:3}})],1)],1),t(x,[t(b,{staticClass:"text-center"},[t(g,{attrs:{color:"error"},on:{click:e.resetLayout}},[e._v(e._s(e.$t("Settings.DashboardTab.ResetLayout")))])],1)],1)],1)],1)},NM=[],VM=E(qm,IM,NM,!1,null,"c9afa703");const BM=VM.exports;var UM=Object.getOwnPropertyDescriptor,WM=(s,e,t,r)=>{for(var i=r>1?void 0:r?UM(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Xm=class extends k(L){constructor(){super(...arguments),this.mdiCellphone=Cw,this.mdiTablet=DS,this.mdiMonitorDashboard=Gp,this.mdiMonitorScreenshot=aS,this.currentViewport="desktop"}mounted(){this.isMobile?this.currentViewport="mobile":this.isTablet?this.currentViewport="tablet":this.isDesktop?this.currentViewport="desktop":this.isWidescreen?this.currentViewport="widescreen":this.currentViewport="desktop"}get currentTab(){return"settings-dashboard-tab-"+this.currentViewport}};Xm=WM([S({components:{SettingsDashboardTabMobile:wM,SettingsDashboardTabTablet:MM,SettingsDashboardTabDesktop:RM,SettingsDashboardTabWidescreen:BM}})],Xm);var zM=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{attrs:{flat:""}},[t(Z,[t(x,[t(b,{staticClass:"text-center"},[t(Nn,{staticClass:"mx-auto",attrs:{mandatory:""},model:{value:e.currentViewport,callback:function(r){e.currentViewport=r},expression:"currentViewport"}},[t(g,{attrs:{value:"mobile"}},[t("span",{staticClass:"hidden-sm-and-down"},[e._v(e._s(e.$t("Settings.DashboardTab.Mobile")))]),t(_,{staticClass:"hidden-sm-and-down",attrs:{right:""}},[e._v(e._s(e.mdiCellphone))]),t(_,{staticClass:"hidden-md-and-up"},[e._v(e._s(e.mdiCellphone))])],1),t(g,{attrs:{value:"tablet"}},[t("span",{staticClass:"hidden-sm-and-down"},[e._v(e._s(e.$t("Settings.DashboardTab.Tablet")))]),t(_,{staticClass:"hidden-sm-and-down",attrs:{right:""}},[e._v(e._s(e.mdiTablet))]),t(_,{staticClass:"hidden-md-and-up"},[e._v(e._s(e.mdiTablet))])],1),t(g,{attrs:{value:"desktop"}},[t("span",{staticClass:"hidden-sm-and-down"},[e._v(e._s(e.$t("Settings.DashboardTab.Desktop")))]),t(_,{staticClass:"hidden-sm-and-down",attrs:{right:""}},[e._v(e._s(e.mdiMonitorDashboard))]),t(_,{staticClass:"hidden-md-and-up"},[e._v(e._s(e.mdiMonitorDashboard))])],1),t(g,{attrs:{value:"widescreen"}},[t("span",{staticClass:"hidden-sm-and-down"},[e._v(e._s(e.$t("Settings.DashboardTab.Widescreen")))]),t(_,{staticClass:"hidden-sm-and-down",attrs:{right:""}},[e._v(e._s(e.mdiMonitorScreenshot))]),t(_,{staticClass:"hidden-md-and-up"},[e._v(e._s(e.mdiMonitorScreenshot))])],1)],1)],1)],1),t(x,[t(b,{staticClass:"dashboard-rows-container"},[t(e.currentTab,{tag:"component"})],1)],1)],1)],1)},GM=[],ZM=E(Xm,zM,GM,!1,null,"205c16a5");const qM=ZM.exports;var XM=Object.defineProperty,YM=Object.getOwnPropertyDescriptor,bf=(s,e,t,r)=>{for(var i=r>1?void 0:r?YM(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&XM(e,t,i),i};let da=class extends k(L){get showAxes(){return this.$store.state.gui.gcodeViewer.showAxes}set showAxes(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.showAxes",value:e})}get extruderColors(){return this.$store.state.gui.gcodeViewer.extruderColors}colorsUpdated(e,t){let r=this.extruderColors;r[t]=e.hex,this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.extruderColors",value:r})}get backgroundColor(){return this.$store.state.gui.gcodeViewer.backgroundColor}set backgroundColor(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.backgroundColor",value:e})}get gridColor(){return this.$store.state.gui.gcodeViewer.gridColor}set gridColor(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.gridColor",value:e})}get progressColor(){return this.$store.state.gui.gcodeViewer.progressColor}set progressColor(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.progressColor",value:e})}updateColorValue(e,t){y.set(this,e,this.clearColorObject(t))}clearColorObject(e){return typeof e=="object"&&"hex"in e&&(e=e.hex),e.length>7&&(e=e.substr(0,7)),e}get minFeed(){return this.$store.state.gui.gcodeViewer.minFeed}set minFeed(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.minFeed",value:e})}get maxFeed(){return this.$store.state.gui.gcodeViewer.maxFeed}set maxFeed(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.maxFeed",value:e})}get minFeedColor(){return this.$store.state.gui.gcodeViewer.minFeedColor}set minFeedColor(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.minFeedColor",value:e})}get maxFeedColor(){return this.$store.state.gui.gcodeViewer.maxFeedColor}set maxFeedColor(e){this.$store.dispatch("gui/saveSetting",{name:"gcodeViewer.maxFeedColor",value:e})}feedBlur(){this.minFeed<1&&(this.minFeed=1),this.maxFeedr>0||"Minimum speed is 1"],dense:"","hide-details":"auto",outlined:"",suffix:"mm/s",type:"number","hide-spin-buttons":""},on:{blur:e.feedBlur},model:{value:e.minFeed,callback:function(r){e.minFeed=r},expression:"minFeed"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.GCodeViewerTab.MaxFeed")}},[t(ye,{attrs:{"close-on-content-click":!1,bottom:"",left:"","offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"minwidth-0 px-5 mr-3",attrs:{color:e.maxFeedColor,small:""}},"v-btn",i,!1),r))]}}])},[t(Xt,{attrs:{value:e.maxFeedColor,"hide-mode-switch":"",mode:"rgba"},on:{"update:color":function(r){return e.updateColorValue("maxFeedColor",r)}}})],1),t(se,{attrs:{rules:[r=>r>0||"Minimum speed is 1"],dense:"","hide-details":"auto",outlined:"",suffix:"mm/s",type:"number","hide-spin-buttons":""},on:{blur:e.feedBlur},model:{value:e.maxFeed,callback:function(r){e.maxFeed=r},expression:"maxFeed"}})],1)],1)],1)],1)},KM=[],QM=E(da,JM,KM,!1,null,null);const e6=QM.exports;var t6=Object.getOwnPropertyDescriptor,s6=(s,e,t,r)=>{for(var i=r>1?void 0:r?t6(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Ym=class extends k(L){constructor(){super(...arguments),this.klipperRestartMethods=[{text:"FIRMWARE_RESTART",value:"FIRMWARE_RESTART"},{text:"RESTART",value:"RESTART"}]}get tabSizes(){return[2,4,6,8].map(t=>({text:this.$t("Settings.EditorTab.Spaces",{count:t}),value:t}))}get escToClose(){return this.$store.state.gui.editor.escToClose}set escToClose(e){this.$store.dispatch("gui/saveSetting",{name:"editor.escToClose",value:e})}get confirmUnsavedChanges(){return this.$store.state.gui.editor.confirmUnsavedChanges}set confirmUnsavedChanges(e){this.$store.dispatch("gui/saveSetting",{name:"editor.confirmUnsavedChanges",value:e})}get tabSize(){return this.$store.state.gui.editor.tabSize||2}set tabSize(e){this.$store.dispatch("gui/saveSetting",{name:"editor.tabSize",value:e})}get klipperRestartMethod(){return this.$store.state.gui.editor.klipperRestartMethod}set klipperRestartMethod(e){this.$store.dispatch("gui/saveSetting",{name:"editor.klipperRestartMethod",value:e})}};Ym=s6([S({components:{SettingsRow:j}})],Ym);var r6=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(Pe,{attrs:{flat:""}},[t(Z,[t(j,{attrs:{title:e.$t("Settings.EditorTab.UseEscToClose"),"sub-title":e.$t("Settings.EditorTab.UseEscToCloseDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.escToClose,callback:function(r){e.escToClose=r},expression:"escToClose"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.EditorTab.ConfirmUnsavedChanges"),"sub-title":e.$t("Settings.EditorTab.ConfirmUnsavedChangesDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.confirmUnsavedChanges,callback:function(r){e.confirmUnsavedChanges=r},expression:"confirmUnsavedChanges"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.EditorTab.TabSize"),"sub-title":e.$t("Settings.EditorTab.TabSizeDescription"),"dynamic-slot-width":!0}},[t(ke,{attrs:{items:e.tabSizes,"hide-details":"",outlined:"",dense:"",attached:""},model:{value:e.tabSize,callback:function(r){e.tabSize=r},expression:"tabSize"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.EditorTab.KlipperRestartMethod"),"sub-title":e.$t("Settings.EditorTab.KlipperRestartMethodDescription")}},[t(ke,{attrs:{items:e.klipperRestartMethods,"hide-details":"",outlined:"",dense:"",attached:""},model:{value:e.klipperRestartMethod,callback:function(r){e.klipperRestartMethod=r},expression:"klipperRestartMethod"}})],1)],1)],1)],1)},i6=[],n6=E(Ym,r6,i6,!1,null,null);const a6=n6.exports;var o6=Object.getOwnPropertyDescriptor,l6=(s,e,t,r)=>{for(var i=r>1?void 0:r?o6(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Jm=class extends k(L){constructor(){super(...arguments),this.modeOptions=[{text:"layermacro",value:"layermacro"},{text:"hyperlapse",value:"hyperlapse"}],this.parkposOptions=[{text:"center",value:"center"},{text:"front_left",value:"front_left"},{text:"front_right",value:"front_right"},{text:"back_left",value:"back_left"},{text:"back_right",value:"back_right"},{text:"x_only",value:"x_only"},{text:"y_only",value:"y_only"},{text:"custom",value:"custom"}]}get availableSnapshotWebcams(){return this.$store.getters["gui/webcams/getWebcams"].filter(e=>e.snapshot_url!=="")}get cameraOptions(){let e=[];return this.availableSnapshotWebcams.length===0?[{value:null,text:this.$t("Settings.TimelapseTab.NoWebcamFound")}]:(this.availableSnapshotWebcams.forEach(t=>{e.push({text:t.name,value:t.name})}),e=Ft(e,"text"),this.camera===null&&e.unshift({value:null,text:this.$t("Settings.TimelapseTab.SelectWebcam")}),e)}get blockedsettings(){var e;return(e=this.$store.state.server.timelapse.settings.blockedsettings)!=null?e:[]}get enabled(){return this.$store.state.server.timelapse.settings.enabled}set enabled(e){this.$store.dispatch("server/timelapse/saveSetting",{enabled:e})}get mode(){return this.$store.state.server.timelapse.settings.mode}set mode(e){this.$store.dispatch("server/timelapse/saveSetting",{mode:e})}get hyperlapseCycle(){return this.$store.state.server.timelapse.settings.hyperlapse_cycle}set hyperlapseCycle(e){this.$store.dispatch("server/timelapse/saveSetting",{hyperlapse_cycle:e})}get autorender(){return this.$store.state.server.timelapse.settings.autorender}set autorender(e){this.$store.dispatch("server/timelapse/saveSetting",{autorender:e})}get saveframes(){return this.$store.state.server.timelapse.settings.saveframes}set saveframes(e){this.$store.dispatch("server/timelapse/saveSetting",{saveframes:e})}get stream_delay_compensation(){return this.$store.state.server.timelapse.settings.stream_delay_compensation}set stream_delay_compensation(e){e===""&&(e=0),this.$store.dispatch("server/timelapse/saveSetting",{stream_delay_compensation:e})}get previewimage(){return this.$store.state.server.timelapse.settings.previewimage}set previewimage(e){this.$store.dispatch("server/timelapse/saveSetting",{previewimage:e})}get gcode_verbose(){return this.$store.state.server.timelapse.settings.gcode_verbose}set gcode_verbose(e){this.$store.dispatch("server/timelapse/saveSetting",{gcode_verbose:e})}get parkhead(){return this.$store.state.server.timelapse.settings.parkhead}set parkhead(e){this.$store.dispatch("server/timelapse/saveSetting",{parkhead:e})}get parkpos(){return this.$store.state.server.timelapse.settings.parkpos}set parkpos(e){this.$store.dispatch("server/timelapse/saveSetting",{parkpos:e})}get park_custom_pos_x(){return this.$store.state.server.timelapse.settings.park_custom_pos_x}set park_custom_pos_x(e){e===""||ethis.stepperXmax||this.$store.dispatch("server/timelapse/saveSetting",{park_custom_pos_x:e})}get stepperXmin(){var e,t,r,i;return(i=(r=(t=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:t.stepper_x)==null?void 0:r.position_min)!=null?i:0}get stepperXmax(){var e,t,r,i;return(i=(r=(t=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:t.stepper_x)==null?void 0:r.position_max)!=null?i:200}get park_custom_pos_y(){return this.$store.state.server.timelapse.settings.park_custom_pos_y}set park_custom_pos_y(e){e===""||ethis.stepperYmax||this.$store.dispatch("server/timelapse/saveSetting",{park_custom_pos_y:e})}get stepperYmin(){var e,t,r,i;return(i=(r=(t=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:t.stepper_y)==null?void 0:r.position_min)!=null?i:0}get stepperYmax(){var e,t,r,i;return(i=(r=(t=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:t.stepper_y)==null?void 0:r.position_max)!=null?i:200}get park_custom_pos_dz(){return this.$store.state.server.timelapse.settings.park_custom_pos_dz}set park_custom_pos_dz(e){e===""||e<0||this.$store.dispatch("server/timelapse/saveSetting",{park_custom_pos_dz:e})}get park_travel_speed(){return this.$store.state.server.timelapse.settings.park_travel_speed}set park_travel_speed(e){e===""||e<0||this.$store.dispatch("server/timelapse/saveSetting",{park_travel_speed:e})}get park_retract_speed(){return this.$store.state.server.timelapse.settings.park_retract_speed}set park_retract_speed(e){e===""||e<=0||this.$store.dispatch("server/timelapse/saveSetting",{park_retract_speed:e})}get park_extrude_speed(){return this.$store.state.server.timelapse.settings.park_extrude_speed}set park_extrude_speed(e){e===""||e<=0||this.$store.dispatch("server/timelapse/saveSetting",{park_extrude_speed:e})}get park_retract_distance(){return this.$store.state.server.timelapse.settings.park_retract_distance}set park_retract_distance(e){e===""||e<0||this.$store.dispatch("server/timelapse/saveSetting",{park_retract_distance:e})}get park_extrude_distance(){return this.$store.state.server.timelapse.settings.park_extrude_distance}set park_extrude_distance(e){e===""||e<0||this.$store.dispatch("server/timelapse/saveSetting",{park_extrude_distance:e})}get park_time(){return this.$store.state.server.timelapse.settings.park_time}set park_time(e){e===""||e<0||this.$store.dispatch("server/timelapse/saveSetting",{park_time:e})}get fw_retract(){return this.$store.state.server.timelapse.settings.fw_retract}set fw_retract(e){this.$store.dispatch("server/timelapse/saveSetting",{fw_retract:e})}get constant_rate_factor(){return this.$store.state.server.timelapse.settings.constant_rate_factor}set constant_rate_factor(e){e===""||e<=0||this.$store.dispatch("server/timelapse/saveSetting",{constant_rate_factor:e})}get output_framerate(){return this.$store.state.server.timelapse.settings.output_framerate}set output_framerate(e){e===""||e<=0||this.$store.dispatch("server/timelapse/saveSetting",{output_framerate:e})}get pixelformat(){return this.$store.state.server.timelapse.settings.pixelformat}set pixelformat(e){this.$store.dispatch("server/timelapse/saveSetting",{pixelformat:e})}get extraoutputparams(){return this.$store.state.server.timelapse.settings.extraoutputparams}set extraoutputparams(e){this.$store.dispatch("server/timelapse/saveSetting",{extraoutputparams:e})}get variable_fps(){return this.$store.state.server.timelapse.settings.variable_fps}set variable_fps(e){this.$store.dispatch("server/timelapse/saveSetting",{variable_fps:e})}get targetlength(){return this.$store.state.server.timelapse.settings.targetlength}set targetlength(e){e===""||e<=0||this.$store.dispatch("server/timelapse/saveSetting",{targetlength:e})}get variable_fps_min(){return this.$store.state.server.timelapse.settings.variable_fps_min}set variable_fps_min(e){e===""||e<=0||this.$store.dispatch("server/timelapse/saveSetting",{variable_fps_min:e})}get variable_fps_max(){return this.$store.state.server.timelapse.settings.variable_fps_max}set variable_fps_max(e){e===""||e<=this.variable_fps_min||this.$store.dispatch("server/timelapse/saveSetting",{variable_fps_max:e})}get duplicatelastframe(){return this.$store.state.server.timelapse.settings.duplicatelastframe}set duplicatelastframe(e){e===""||e<0||this.$store.dispatch("server/timelapse/saveSetting",{duplicatelastframe:e})}get camera(){var t;const e=(t=this.$store.state.server.timelapse.settings.camera)!=null?t:null;return e===null||this.blockedsettings.includes("snapshoturl")||this.availableSnapshotWebcams.length===0||this.availableSnapshotWebcams.find(r=>r.name===e)===void 0?null:this.$store.state.server.timelapse.settings.camera}set camera(e){this.$store.dispatch("server/timelapse/saveSetting",{camera:e})}get time_format_code(){return this.$store.state.server.timelapse.settings.time_format_code}set time_format_code(e){this.$store.dispatch("server/timelapse/saveSetting",{time_format_code:e})}};Jm=l6([S({components:{SettingsRow:j}})],Jm);var c6=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(Pe,{attrs:{flat:""}},[t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.TimelapseTab.General")))]),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.Enabled"),"sub-title":e.$t("Settings.TimelapseTab.EnabledDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("enabled")},model:{value:e.enabled,callback:function(r){e.enabled=r},expression:"enabled"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.Autorender"),"sub-title":e.$t("Settings.TimelapseTab.AutorenderDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("autorender")},model:{value:e.autorender,callback:function(r){e.autorender=r},expression:"autorender"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.Camera"),"sub-title":e.$t("Settings.TimelapseTab.CameraDescriptionWithSnapshotUrl")}},[e.blockedsettings.includes("snapshoturl")?t(it,{staticClass:"mb-0",attrs:{dense:"",text:"",type:"warning"}},[e._v(" "+e._s(e.$t("Settings.TimelapseTab.CameraWarningAlreadySet"))+" "),t("small",[e._v("("+e._s(e.$t("Settings.TimelapseTab.CameraWarningAlreadySetSmall"))+")")])]):t(ke,{attrs:{items:e.cameraOptions,"hide-details":"",outlined:"",dense:"",disabled:e.blockedsettings.includes("camera")||e.availableSnapshotWebcams.length===0},model:{value:e.camera,callback:function(r){e.camera=r},expression:"camera"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.Mode"),"sub-title":e.$t("Settings.TimelapseTab.ModeDescription")}},[t(ke,{attrs:{items:e.modeOptions,"hide-details":"",outlined:"",dense:"",disabled:e.blockedsettings.includes("modeOptions")},model:{value:e.mode,callback:function(r){e.mode=r},expression:"mode"}})],1),e.mode==="hyperlapse"?[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.HyperlapseCycle"),"sub-title":e.$t("Settings.TimelapseTab.HyperlapseCycleDescription")}},[t(se,{attrs:{type:"number",suffix:"s","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("hyperlapseCycle"),"hide-spin-buttons":""},model:{value:e.hyperlapseCycle,callback:function(r){e.hyperlapseCycle=r},expression:"hyperlapseCycle"}})],1)]:e._e(),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.PreviewImage"),"sub-title":e.$t("Settings.TimelapseTab.PreviewImageDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("previewimage")},model:{value:e.previewimage,callback:function(r){e.previewimage=r},expression:"previewimage"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.SaveFrames"),"sub-title":e.$t("Settings.TimelapseTab.SaveFramesDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("saveframes")},model:{value:e.saveframes,callback:function(r){e.saveframes=r},expression:"saveframes"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.StreamDelayCompensation"),"sub-title":e.$t("Settings.TimelapseTab.StreamDelayCompensationDescription")}},[t(se,{attrs:{type:"number",suffix:"s",step:"0.01","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")],disabled:e.blockedsettings.includes("stream_delay_compensation")},model:{value:e.stream_delay_compensation,callback:function(r){e.stream_delay_compensation=r},expression:"stream_delay_compensation"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.GcodeVerbose"),"sub-title":e.$t("Settings.TimelapseTab.GcodeVerboseDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("gcode_verbose")},model:{value:e.gcode_verbose,callback:function(r){e.gcode_verbose=r},expression:"gcode_verbose"}})],1),t(I,{staticClass:"my-2"}),t("h3",{staticClass:"text-h5 mt-6 mb-3"},[e._v(e._s(e.$t("Settings.TimelapseTab.Parkhead")))]),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.Parkhead"),"sub-title":e.$t("Settings.TimelapseTab.ParkheadDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("parkhead")},model:{value:e.parkhead,callback:function(r){e.parkhead=r},expression:"parkhead"}})],1),e.parkhead?[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.Parkpos"),"sub-title":e.$t("Settings.TimelapseTab.ParkposDescription")}},[t(ke,{attrs:{items:e.parkposOptions,"hide-details":"",outlined:"",dense:"",disabled:e.blockedsettings.includes("parkposOptions")},model:{value:e.parkpos,callback:function(r){e.parkpos=r},expression:"parkpos"}})],1),["x_only","custom"].includes(e.parkpos)?[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.PosX"),"sub-title":e.$t("Settings.TimelapseTab.PosXDescription")}},[t(se,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>=e.stepperXmin&&r<=e.stepperXmax||e.$t("Settings.TimelapseTab.RulesBetweenMinMax",{min:e.stepperXmin,max:e.stepperXmax})],disabled:e.blockedsettings.includes("park_custom_pos_x"),"hide-spin-buttons":""},model:{value:e.park_custom_pos_x,callback:function(r){e.park_custom_pos_x=r},expression:"park_custom_pos_x"}})],1)]:e._e(),["y_only","custom"].includes(e.parkpos)?[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.PosY"),"sub-title":e.$t("Settings.TimelapseTab.PosYDescription")}},[t(se,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>=e.stepperYmin&&r<=e.stepperYmax||e.$t("Settings.TimelapseTab.RulesBetweenMinMax",{min:e.stepperYmin,max:e.stepperYmax})],disabled:e.blockedsettings.includes("park_custom_pos_y"),"hide-spin-buttons":""},model:{value:e.park_custom_pos_y,callback:function(r){e.park_custom_pos_y=r},expression:"park_custom_pos_y"}})],1)]:e._e(),["x_only","y_only","custom"].includes(e.parkpos)?[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.PosDZ"),"sub-title":e.$t("Settings.TimelapseTab.PosDZDescription")}},[t(se,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")],disabled:e.blockedsettings.includes("park_custom_pos_dz"),"hide-spin-buttons":""},model:{value:e.park_custom_pos_dz,callback:function(r){e.park_custom_pos_dz=r},expression:"park_custom_pos_dz"}})],1)]:e._e(),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.TravelSpeed"),"sub-title":e.$t("Settings.TimelapseTab.TravelSpeedDescription")}},[t(se,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")],disabled:e.blockedsettings.includes("park_travel_speed"),"hide-spin-buttons":""},model:{value:e.park_travel_speed,callback:function(r){e.park_travel_speed=r},expression:"park_travel_speed"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.FwRetract"),"sub-title":e.$t("Settings.TimelapseTab.FwRetractDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("fw_retract")},model:{value:e.fw_retract,callback:function(r){e.fw_retract=r},expression:"fw_retract"}})],1),e.fw_retract?e._e():[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.RetractSpeed"),"sub-title":e.$t("Settings.TimelapseTab.RetractSpeedDescription")}},[t(se,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>0||e.$t("Settings.TimelapseTab.RulesPositive")],disabled:e.blockedsettings.includes("park_retract_speed"),"hide-spin-buttons":""},model:{value:e.park_retract_speed,callback:function(r){e.park_retract_speed=r},expression:"park_retract_speed"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.RetractDistance"),"sub-title":e.$t("Settings.TimelapseTab.RetractDistanceDescription")}},[t(se,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")],disabled:e.blockedsettings.includes("park_retract_distance"),"hide-spin-buttons":""},model:{value:e.park_retract_distance,callback:function(r){e.park_retract_distance=r},expression:"park_retract_distance"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.UnretractSpeed"),"sub-title":e.$t("Settings.TimelapseTab.UnretractSpeedDescription")}},[t(se,{attrs:{type:"number",suffix:"mm/s","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>0||e.$t("Settings.TimelapseTab.RulesPositive")],disabled:e.blockedsettings.includes("park_extrude_speed"),"hide-spin-buttons":""},model:{value:e.park_extrude_speed,callback:function(r){e.park_extrude_speed=r},expression:"park_extrude_speed"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.UnretractDistance"),"sub-title":e.$t("Settings.TimelapseTab.UnretractDistanceDescription")}},[t(se,{attrs:{type:"number",suffix:"mm","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")],disabled:e.blockedsettings.includes("park_extrude_distance"),"hide-spin-buttons":""},model:{value:e.park_extrude_distance,callback:function(r){e.park_extrude_distance=r},expression:"park_extrude_distance"}})],1)],t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.ParkTime"),"sub-title":e.$t("Settings.TimelapseTab.ParkTimeDescription")}},[t(se,{attrs:{type:"number",suffix:"s","hide-details":"auto",step:"0.1",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")],disabled:e.blockedsettings.includes("park_time")},model:{value:e.park_time,callback:function(r){e.park_time=r},expression:"park_time"}})],1)]:e._e(),t(I,{staticClass:"my-2"}),t("h3",{staticClass:"text-h5 mt-6 mb-3"},[e._v(e._s(e.$t("Settings.TimelapseTab.RenderingOptions")))]),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.VariableFps"),"sub-title":e.$t("Settings.TimelapseTab.VariableFpsDescription"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":"",disabled:e.blockedsettings.includes("variable_fps")},model:{value:e.variable_fps,callback:function(r){e.variable_fps=r},expression:"variable_fps"}})],1),e.variable_fps?[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.Targetlength"),"sub-title":e.$t("Settings.TimelapseTab.TargetlengthDescription")}},[t(se,{attrs:{type:"number",suffix:"s","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>0||e.$t("Settings.TimelapseTab.RulesPositive")],disabled:e.blockedsettings.includes("targetlength"),"hide-spin-buttons":""},model:{value:e.targetlength,callback:function(r){e.targetlength=r},expression:"targetlength"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.VariableFpsMin"),"sub-title":e.$t("Settings.TimelapseTab.VariableFpsMinDescription")}},[t(se,{attrs:{type:"number",suffix:"frames","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>0||e.$t("Settings.TimelapseTab.RulesPositive")],disabled:e.blockedsettings.includes("variable_fps_min"),"hide-spin-buttons":""},model:{value:e.variable_fps_min,callback:function(r){e.variable_fps_min=r},expression:"variable_fps_min"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.VariableFpsMax"),"sub-title":e.$t("Settings.TimelapseTab.VariableFpsMaxDescription")}},[t(se,{attrs:{type:"number",suffix:"frames","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>e.variable_fps_min||e.$t("Settings.TimelapseTab.RulesMin")],disabled:e.blockedsettings.includes("variable_fps_max"),"hide-spin-buttons":""},model:{value:e.variable_fps_max,callback:function(r){e.variable_fps_max=r},expression:"variable_fps_max"}})],1)]:[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.OutputFramerate"),"sub-title":e.$t("Settings.TimelapseTab.OutputFramerateDescription")}},[t(se,{attrs:{type:"number",suffix:"frames","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>0||e.$t("Settings.TimelapseTab.RulesPositive")],disabled:e.blockedsettings.includes("output_framerate"),"hide-spin-buttons":""},model:{value:e.output_framerate,callback:function(r){e.output_framerate=r},expression:"output_framerate"}})],1)],t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.duplicatelastframe"),"sub-title":e.$t("Settings.TimelapseTab.duplicatelastframeDescription")}},[t(se,{attrs:{type:"number","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>=0||e.$t("Settings.TimelapseTab.RulesZeroAndPositive")],disabled:e.blockedsettings.includes("duplicatelastframe"),"hide-spin-buttons":""},model:{value:e.duplicatelastframe,callback:function(r){e.duplicatelastframe=r},expression:"duplicatelastframe"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.ConstantRateFactor"),"sub-title":e.$t("Settings.TimelapseTab.ConstantRateFactorDescription")}},[t(se,{attrs:{type:"number","hide-details":"auto",outlined:"",dense:"",rules:[r=>!!r||e.$t("Settings.TimelapseTab.RulesRequired"),r=>r>0||e.$t("Settings.TimelapseTab.RulesPositive")],disabled:e.blockedsettings.includes("constant_rate_factor"),"hide-spin-buttons":""},model:{value:e.constant_rate_factor,callback:function(r){e.constant_rate_factor=r},expression:"constant_rate_factor"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.Pixelformat"),"sub-title":e.$t("Settings.TimelapseTab.PixelformatDescription")}},[t(se,{attrs:{type:"text","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("pixelformat")},model:{value:e.pixelformat,callback:function(r){e.pixelformat=r},expression:"pixelformat"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.TimeFormatCode"),"sub-title":e.$t("Settings.TimelapseTab.TimeFormatCodeDescription")}},[t(se,{attrs:{type:"text","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("time_format_code")},model:{value:e.time_format_code,callback:function(r){e.time_format_code=r},expression:"time_format_code"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.TimelapseTab.Extraoutputparams"),"sub-title":e.$t("Settings.TimelapseTab.ExtraoutputparamsDescription")}},[t(se,{attrs:{type:"text","hide-details":"auto",outlined:"",dense:"",disabled:e.blockedsettings.includes("extraoutputparams")},model:{value:e.extraoutputparams,callback:function(r){e.extraoutputparams=r},expression:"extraoutputparams"}})],1)],2)],1)],1)},u6=[],d6=E(Jm,c6,u6,!1,null,null);const m6=d6.exports;var h6=Object.defineProperty,p6=Object.getOwnPropertyDescriptor,Bb=(s,e,t,r)=>{for(var i=r>1?void 0:r?p6(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&h6(e,t,i),i};let Vl=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiStopCircleOutline=PS}cancelJob(){this.$emit("cancel-job")}closePrompt(){this.$emit("close")}};Bb([w({type:Boolean,default:!1})],Vl.prototype,"showDialog",2);Vl=Bb([S({components:{Panel:U}})],Vl);var f6=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.showDialog,width:"400",persistent:""}},[t(U,{attrs:{title:e.$t("CancelJobDialog.CancelJob"),"toolbar-color":"normal","card-class":"cancel-job-dialog",icon:e.mdiStopCircleOutline,"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closePrompt}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[e._v(e._s(e.$t("CancelJobDialog.AreYouSure")))]),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.closePrompt}},[e._v(e._s(e.$t("CancelJobDialog.No")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.cancelJob}},[e._v(e._s(e.$t("CancelJobDialog.Yes")))])],1)],1)],1)},g6=[],_6=E(Vl,f6,g6,!1,null,"a6fd90b2");const Ub=_6.exports;var v6=Object.getOwnPropertyDescriptor,b6=(s,e,t,r)=>{for(var i=r>1?void 0:r?v6(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Km=class extends k(L){constructor(){super(...arguments),this.mdiPrinter3d=qa,this.mdiRestart=_r,this.mdiDownload=K_,this.mdiPower=_v}get klippy_message(){var s;return(s=this.$store.state.server.klippy_message)!=null?s:null}get messageType(){switch(this.klipperState){case"startup":return{color:"info",icon:yS};case"shutdown":return{color:"warning",icon:Jn};case"error":return{color:"error",icon:Jn};case"disconnected":return{color:"",icon:Ap};default:return{color:"",icon:sS}}}get buttonClasses(){return[this.messageType.color+"--text","my-1","w-100"]}get serviceReportsKlipper(){return"".concat(this.$t("Panels.KlippyStatePanel.ServiceReports",{service:"Klipper"}),": ").concat(this.klipperState.toUpperCase())}get serviceReportsMoonraker(){return"".concat(this.$t("Panels.KlippyStatePanel.ServiceReports",{service:"Moonraker"}),": ").concat(this.klipperState.toUpperCase())}restart(){this.$socket.emit("printer.restart",{},{loading:"restart"})}firmwareRestart(){this.$socket.emit("printer.firmware_restart",{},{loading:"firmwareRestart"})}downloadLog(s){s.preventDefault();let e="";"href"in s.target.attributes&&(e=s.target.attributes.href.value),"href"in s.target.parentElement.attributes&&(e=s.target.parentElement.attributes.href.value),window.open(e)}powerOn(){this.$socket.emit("machine.device_power.post_device",{device:this.printerPowerDevice,action:"on"},{action:"server/power/responseToggle"})}};Km=b6([S({components:{Panel:U,ConnectionStatus:lu}})],Km);var y6=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.klipperState!=="ready"&&e.socketIsConnected?t("div",[e.klippyIsConnected?t(it,{staticClass:"mb-0 mb-6",attrs:{color:e.messageType.color,dense:"",text:"",border:"left"}},[t("p",{staticClass:"font-weight-medium d-flex align-center"},[t(_,{staticClass:"pr-2",attrs:{color:e.messageType.color}},[e._v(e._s(e.messageType.icon))]),e._v(" "+e._s(e.serviceReportsKlipper)+" ")],1),e.klippy_message!==null?t("div",[t("pre",{staticStyle:{"white-space":"pre-wrap"}},[e._v(e._s(e.klippy_message.trim()))]),t(I,{staticClass:"mt-2 pb-3"}),t(x,[t(b,[t(g,{class:e.buttonClasses,attrs:{small:"",outlined:"",text:""},on:{click:e.restart}},[t(_,{staticClass:"mr-sm-2"},[e._v(e._s(e.mdiRestart))]),e._v(" "+e._s(e.$t("Panels.KlippyStatePanel.Restart"))+" ")],1),t(g,{class:e.buttonClasses,attrs:{small:"",outlined:"",text:""},on:{click:e.firmwareRestart}},[t(_,{staticClass:"mr-sm-2"},[e._v(e._s(e.mdiRestart))]),e._v(" "+e._s(e.$t("Panels.KlippyStatePanel.FirmwareRestart"))+" ")],1)],1),t(b,[t(g,{class:e.buttonClasses,attrs:{href:e.apiUrl+"/server/files/klippy.log",small:"",outlined:"",text:""},on:{click:e.downloadLog}},[t(_,{staticClass:"mr-2"},[e._v(e._s(e.mdiDownload))]),e._v(" "+e._s(e.$t("Panels.KlippyStatePanel.KlipperLog"))+" ")],1),t(g,{class:e.buttonClasses,attrs:{href:e.apiUrl+"/server/files/moonraker.log",small:"",outlined:"",text:""},on:{click:e.downloadLog}},[t(_,{staticClass:"mr-2"},[e._v(e._s(e.mdiDownload))]),e._v(" "+e._s(e.$t("Panels.KlippyStatePanel.MoonrakerLog"))+" ")],1)],1)],1)],1):t(Z,{staticClass:"text-center py-3"},[t(ot,{attrs:{indeterminate:"",color:e.messageType.color}})],1)],1):e.isPrinterPowerOff?t(it,{staticClass:"mb-6",attrs:{dense:"",text:"",border:"left"}},[t("p",{staticClass:"font-weight-medium d-flex align-center"},[t(_,{staticClass:"pr-2"},[e._v(e._s(e.messageType.icon))]),e._v(" "+e._s(e.$t("Panels.KlippyStatePanel.PrinterSwitchedOff"))+" ")],1),t("p",[e._v(e._s(e.$t("Panels.KlippyStatePanel.PrinterSwitchedOffDescription")))]),t(x,[t(b,{staticClass:"text-center"},[t(g,{class:"".concat(e.messageType.color,"--text my-1"),attrs:{small:"",outlined:"",text:""},on:{click:e.powerOn}},[t(_,{staticClass:"mr-sm-2"},[e._v(e._s(e.mdiPower))]),e._v(" "+e._s(e.$t("Panels.KlippyStatePanel.PowerOn"))+" ")],1)],1)],1)],1):e.klipperState==="disconnected"?t(it,{staticClass:"mb-6",attrs:{dense:"",text:"",border:"left"}},[t("p",{staticClass:"font-weight-medium d-flex align-center"},[t(_,{staticClass:"pr-2"},[e._v(e._s(e.messageType.icon))]),e._v(" "+e._s(e.serviceReportsMoonraker)+" ")],1),t(lu,{attrs:{moonraker:!0,klipper:!1}}),t("p",{staticClass:"mt-2 mb-0 text-center"},[e._v(e._s(e.$t("Panels.KlippyStatePanel.MoonrakerCannotConnect")))]),t("p",{staticClass:"mb-0 text-center"},[e._v(e._s(e.$t("Panels.KlippyStatePanel.CheckKlippyAndUdsAddress")))])],1):e._e()],1):e._e()},C6=[],$6=E(Km,y6,C6,!1,null,null);const so=$6.exports;var x6=Object.getOwnPropertyDescriptor,w6=(s,e,t,r)=>{for(var i=r>1?void 0:r?x6(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Qm=class extends k(L){constructor(){super(...arguments),this.mdiAlertCircle=U_,this.mdiInformation=Ht}get existsPrinterConfig(){var e;return(e=this.$store.getters["printer/existPrinterConfig"])!=null?e:!1}get missingConfigs(){var e;return(e=this.$store.getters["printer/checkNecessaryConfig"])!=null?e:[]}get mainsailCfgExists(){var e;return(e=this.$store.getters["files/checkConfigFile"]("mainsail.cfg"))!=null?e:!1}};Qm=w6([S({components:{Panel:U}})],Qm);var S6=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.klipperState==="ready"&&e.existsPrinterConfig&&e.missingConfigs.length?t(U,{attrs:{icon:e.mdiAlertCircle,title:e.$t("Panels.MinSettingsPanel.MissingConfiguration"),collapsible:!0,"card-class":"min-settings-panel","toolbar-color":"orange darken-2"}},[t(Z,[t(x,[t(b,[t("ul",{},e._l(e.missingConfigs,function(r){return t("li",{key:r,staticClass:"orange--text"},[t("code",[e._v(e._s(r))]),e._v(" "+e._s(e.$t("Panels.MinSettingsPanel.IsNotDefinedInConfig"))+" ")])}),0)])],1)],1),e.mainsailCfgExists?[t(I),t(Z,[t(x,[t(b,[t("p",{staticClass:"orange--text mb-0"},[e._v(e._s(e.$t("Panels.MinSettingsPanel.IncludeMainsailCfg")))])])],1)],1),t(I,{staticClass:"mb-2"})]:e._e(),t(oe,{staticClass:"justify-center pb-3"},[t(g,{attrs:{small:"",href:"https://docs.mainsail.xyz/setup/configuration",target:"_blank"}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiInformation))]),e._v(" "+e._s(e.$t("Panels.MinSettingsPanel.MoreInformation"))+" ")],1)],1)],2):e._e()},P6=[],D6=E(Qm,S6,P6,!1,null,"d51d0178");const yf=D6.exports;var T6=Object.defineProperty,O6=Object.getOwnPropertyDescriptor,Wb=(s,e,t,r)=>{for(var i=r>1?void 0:r?O6(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&T6(e,t,i),i};let Bl=class extends k(L){constructor(){super(...arguments),this.mdiFileMultiple=Ww}get sums(){const s={filamentLength:0,filamentWeight:0,estimatedTime:0};return this.jobs.forEach(e=>{var r,i,n,a,o,l,u,c;const t=((i=(r=e.combinedIds)==null?void 0:r.length)!=null?i:0)+1;s.filamentLength+=((a=(n=e.metadata)==null?void 0:n.filament_total)!=null?a:0)*t,s.filamentWeight+=((l=(o=e.metadata)==null?void 0:o.filament_weight_total)!=null?l:0)*t,s.estimatedTime+=((c=(u=e.metadata)==null?void 0:u.estimated_time)!=null?c:0)*t}),s}get count(){let s=0;return this.jobs.forEach(e=>{var t,r;s+=((r=(t=e.combinedIds)==null?void 0:t.length)!=null?r:0)+1}),s}get headline(){return this.$tc("Panels.StatusPanel.JobqueueMoreFiles",this.count,{count:this.count})}get description(){const s=[];let e="--";this.filamentLength&&s.push(this.filamentLength),this.filamentWeight&&s.push(this.filamentWeight),s.length&&(e=s.join(" / "));let t="--";return this.estimatedTime&&(t=this.estimatedTime),"".concat(this.$t("Panels.StatusPanel.Filament"),": ").concat(e,", ").concat(this.$t("Panels.StatusPanel.PrintTime"),": ").concat(t)}get filamentLength(){const s=this.sums.filamentLength;return s===0?null:s>=1e3?(s/1e3).toFixed(1)+" m":s.toFixed(0)+" mm"}get filamentWeight(){const s=this.sums.filamentWeight;return s===0?null:s>=1e3?(s/1e3).toFixed(1)+" kg":s.toFixed(0)+" g"}get estimatedTime(){let s=this.sums.estimatedTime;if(s==0)return"--";const e=[],t=Math.floor(s/(3600*24));t&&(s%=3600*24,e.push(t+"d"));const r=Math.floor(s/3600);s%=3600,r&&e.push(r+"h");const i=Math.floor(s/60);if(i&&e.push(i+"m"),r>0)return e.join(" ");const n=s%60;return n&&e.push(n.toFixed(0)+"s"),e.join(" ")}};Wb([w({type:Array,required:!0})],Bl.prototype,"jobs",2);Bl=Wb([S],Bl);var M6=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,{staticClass:"d-flex flex-row flex-nowrap"},[t(b,{staticClass:"col-auto d-flex flex-column justify-center pr-0 py-0"},[t(_,{staticStyle:{width:"32px"}},[e._v(e._s(e.mdiFileMultiple))])],1),t(b,{staticClass:"py-2",staticStyle:{"min-width":"0","font-size":"0.875em"}},[t("div",{staticClass:"text-truncate"},[e._v(e._s(e.headline))]),t("small",{staticClass:"text-truncate"},[e._v(e._s(e.description))])])],1)},k6=[],E6=E(Bl,M6,k6,!1,null,null);const L6=E6.exports;var A6=Object.defineProperty,F6=Object.getOwnPropertyDescriptor,Pu=(s,e,t,r)=>{for(var i=r>1?void 0:r?F6(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&A6(e,t,i),i};let Oi=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiChevronUp=du,this.mdiChevronDown=fr,this.mdiCounter=Y_,this.count=1,this.countInputRules=[s=>!!s||this.$t("JobQueue.InvalidCountEmpty"),s=>parseInt(s)>0||this.$t("JobQueue.InvalidCountGreaterZero")]}update(){this.$store.dispatch("server/jobQueue/changeCount",{job_id:this.job.job_id,count:this.count}),this.closeDialog()}closeDialog(){this.$emit("close")}showChanged(s){var e,t;s&&(this.count=((t=(e=this.job.combinedIds)==null?void 0:e.length)!=null?t:0)+1)}};Pu([w({type:Boolean,required:!0})],Oi.prototype,"show",2);Pu([w({type:Object,required:!0})],Oi.prototype,"job",2);Pu([he("show")],Oi.prototype,"showChanged",1);Oi=Pu([S({components:{Panel:U}})],Oi);var R6=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.show,"max-width":"400"}},[t(U,{attrs:{title:e.$t("JobQueue.ChangeCount"),icon:e.mdiCounter,"card-class":"jobqueue-change-count-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputFieldAddToQueueCount",attrs:{label:e.$t("JobQueue.Count"),required:"",rules:e.countInputRules,"hide-spin-buttons":"",type:"number"},on:{keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.update.apply(null,arguments)}},scopedSlots:e._u([{key:"append-outer",fn:function(){return[t("div",{staticClass:"_spin_button_group"},[t(g,{staticClass:"mt-n3",attrs:{icon:"",plain:"",small:""},on:{click:function(r){e.count++}}},[t(_,[e._v(e._s(e.mdiChevronUp))])],1),t(g,{staticClass:"mb-n3",attrs:{disabled:e.count<=1,icon:"",plain:"",small:""},on:{click:function(r){e.count--}}},[t(_,[e._v(e._s(e.mdiChevronDown))])],1)],1)]},proxy:!0}]),model:{value:e.count,callback:function(r){e.count=r},expression:"count"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("JobQueue.Cancel")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.update}},[e._v(e._s(e.$t("JobQueue.ChangeCount")))])],1)],1)],1)},H6=[],j6=E(Oi,R6,H6,!1,null,null);const I6=j6.exports;var N6=Object.defineProperty,V6=Object.getOwnPropertyDescriptor,Du=(s,e,t,r)=>{for(var i=r>1?void 0:r?V6(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&N6(e,t,i),i};let Mi=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiCounter=Y_,this.mdiDragVertical=Wa,this.mdiFile=Bs,this.mdiPlay=nn,this.mdiPlaylistRemove=dS,this.showContextMenu=!1,this.contextMenuX=0,this.contextMenuY=0,this.showChangeCountDialog=!1}get smallThumbnail(){return this.$store.getters["server/jobQueue/getSmallThumbnail"](this.job)}get bigThumbnail(){return this.$store.getters["server/jobQueue/getBigThumbnail"](this.job)}get description(){var r,i;if(!((i=(r=this.job)==null?void 0:r.metadata)!=null&&i.metadataPulled))return!1;const s=[];let e="--";this.filamentLength&&s.push(this.filamentLength),this.filamentWeight&&s.push(this.filamentWeight),s.length&&(e=s.join(" / "));let t="--";return this.estimatedTime&&(t=this.estimatedTime),"".concat(this.$t("Panels.StatusPanel.Filament"),": ").concat(e,", ").concat(this.$t("Panels.StatusPanel.PrintTime"),": ").concat(t)}get filamentLength(){var e,t;const s=(t=(e=this.job.metadata)==null?void 0:e.filament_total)!=null?t:0;return s===0?null:s>=1e3?(s/1e3).toFixed(1)+" m":s.toFixed(0)+" mm"}get filamentWeight(){var e,t;const s=(t=(e=this.job.metadata)==null?void 0:e.filament_weight_total)!=null?t:0;return s===0?null:s>=1e3?(length/1e3).toFixed(1)+" kg":s.toFixed(0)+" g"}get estimatedTime(){var a,o;let s=(o=(a=this.job.metadata)==null?void 0:a.estimated_time)!=null?o:0;if(s==0)return"--";const e=[],t=Math.floor(s/(3600*24));t&&(s%=3600*24,e.push(t+"d"));const r=Math.floor(s/3600);s%=3600,r&&e.push(r+"h");const i=Math.floor(s/60);if(i&&e.push(i+"m"),r>0)return e.join(" ");const n=s%60;return n&&e.push(n.toFixed(0)+"s"),e.join(" ")}get bigThumbnailBackground(){var s;return(s=this.$store.state.gui.uiSettings.bigThumbnailBackground)!=null?s:At}get bigThumbnailTooltipColor(){if(At.toLowerCase()!==this.bigThumbnailBackground.toLowerCase())return this.bigThumbnailBackground}openContextMenu(s){if(s==null||s.preventDefault(),this.showContextMenu){this.showContextMenu=!1;return}this.showContextMenu=!0,this.contextMenuX=(s==null?void 0:s.clientX)||(s==null?void 0:s.pageX)||window.screenX/2,this.contextMenuY=(s==null?void 0:s.clientY)||(s==null?void 0:s.pageY)||window.screenY/2}printJob(){this.$store.dispatch("server/jobQueue/startByJobId",this.job.job_id)}startJobqueue(){this.$store.dispatch("server/jobQueue/start")}removeFromJobqueue(){var e;const s=[...(e=this.job.combinedIds)!=null?e:[],this.job.job_id];this.$store.dispatch("server/jobQueue/deleteFromQueue",s)}};Du([w({type:Object,required:!0})],Mi.prototype,"job",2);Du([w({type:Boolean,default:!1})],Mi.prototype,"showPrintButton",2);Du([w({type:Boolean,default:!1})],Mi.prototype,"showHandle",2);Mi=Du([S],Mi);var B6=function(){var r;var e=this,t=e._self._c;return e._self._setupProxy,t(x,{directives:[{name:"longpress",rawName:"v-longpress:600",value:i=>e.openContextMenu(i),expression:"(e) => openContextMenu(e)",arg:"600"}],staticClass:"jobqueue-list-entry d-flex flex-row flex-nowrap cursor-pointer",on:{contextmenu:function(i){return e.openContextMenu(i)}}},[e.showHandle?t(b,{staticClass:"col-auto d-flex flex-column justify-center pr-0 py-0"},[t(_,{staticClass:"handle"},[e._v(e._s(e.mdiDragVertical))])],1):e._e(),t(b,{staticClass:"col-auto d-flex flex-column justify-center pr-0 py-0"},[e.smallThumbnail?t(de,{attrs:{top:"",disabled:!e.bigThumbnail,"content-class":"tooltip__content-opacity1",color:e.bigThumbnailTooltipColor},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:n}){return[t("vue-load-image",[t("img",e._g(e._b({attrs:{slot:"image",src:e.smallThumbnail,width:32,height:32,alt:e.job.filename},slot:"image"},"img",n,!1),i)),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(ot,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(_,[e._v(e._s(e.mdiFile))])],1)])]}}],null,!1,2738555475)},[t("span",[t("img",{attrs:{src:e.bigThumbnail,width:250,alt:e.job.filename}})])]):t(_,[e._v(e._s(e.mdiFile))])],1),t(b,{staticClass:"py-1",staticStyle:{"min-width":"0","font-size":"0.875em"}},[t("div",{staticClass:"text-truncate"},[(r=e.job.combinedIds)!=null&&r.length?t("strong",[e._v(e._s(e.job.combinedIds.length+1)+"x")]):e._e(),e._v(" "+e._s(e.job.filename)+" ")]),e.description?t("small",{staticClass:"text-truncate"},[e._v(e._s(e.description))]):e._e()]),e.showPrintButton&&!e.printerIsPrinting?t(b,{staticClass:"col-auto d-flex flex-column justify-center pa-0 pr-1"},[t(g,{staticClass:"minwidth-0",attrs:{icon:"",color:"success"},on:{click:e.startJobqueue}},[t(_,[e._v(e._s(e.mdiPlay))])],1)],1):e._e(),t(ye,{attrs:{"position-x":e.contextMenuX,"position-y":e.contextMenuY,absolute:"","offset-y":""},model:{value:e.showContextMenu,callback:function(i){e.showContextMenu=i},expression:"showContextMenu"}},[t(Me,[t(J,{on:{click:e.printJob}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlay))]),e._v(" "+e._s(e.$t("JobQueue.StartPrint"))+" ")],1),t(J,{on:{click:function(i){e.showChangeCountDialog=!0}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiCounter))]),e._v(" "+e._s(e.$t("JobQueue.ChangeCount"))+" ")],1),t(J,{on:{click:e.removeFromJobqueue}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistRemove))]),e._v(" "+e._s(e.$t("JobQueue.RemoveFromQueue"))+" ")],1)],1)],1),t(I6,{attrs:{show:e.showChangeCountDialog,job:e.job},on:{close:function(i){e.showChangeCountDialog=!1}}})],1)},U6=[],W6=E(Mi,B6,U6,!1,null,null);const Tu=W6.exports;var z6=Object.getOwnPropertyDescriptor,G6=(s,e,t,r)=>{for(var i=r>1?void 0:r?z6(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let eh=class extends k(L){get jobs(){var e;return(e=this.$store.getters["server/jobQueue/getJobs"])!=null?e:[]}get maxLength(){return this.jobs.length>5?4:5}get jobsTable(){return this.jobs.slice(0,this.maxLength)}get jobsRest(){return this.jobs.slice(this.maxLength)}startJobqueue(){this.$store.dispatch("server/jobQueue/start")}};eh=G6([S({components:{JobqueueEntry:Tu}})],eh);var Z6=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{staticClass:"filesJobqueue",attrs:{flat:""}},[e.jobs.length?[t(x,{staticClass:"mx-0 mt-0 pb-3"},[t(b,{staticClass:"jobqueue-list"},[e._l(e.jobsTable,function(r,i){return t(Tu,{key:r.job_id,attrs:{job:r,"show-handle":!1,"show-print-button":i===0}})}),e.jobsRest.length?t(L6,{attrs:{jobs:e.jobsRest}}):e._e()],2)],1)]:t("div",[t("p",{staticClass:"body-2 my-3 text-center text--disabled"},[e._v(e._s(e.$t("Panels.StatusPanel.EmptyJobqueue")))])])],2)},q6=[],X6=E(eh,Z6,q6,!1,null,"0b5b1a36");const zb=X6.exports;var Y6=Object.defineProperty,J6=Object.getOwnPropertyDescriptor,ro=(s,e,t,r)=>{for(var i=r>1?void 0:r?J6(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&Y6(e,t,i),i};let Wr=class extends k(L){constructor(){super(...arguments),this.mdiChevronDown=fr,this.mdiChevronUp=du,this.mdiPlaylistPlus=Za,this.mdiCloseThick=pe,this.isValid=!1,this.input="1",this.rules={count:[s=>!!s||this.$t("JobQueue.InvalidCountEmpty"),s=>parseInt(s,10)>0||this.$t("JobQueue.InvalidCountGreaterZero")]}}async addBatchToQueueAction(){const s=Array(parseInt(this.input)).fill(this.filename);await this.$store.dispatch("server/jobQueue/addToQueue",s),this.showToast&&this.$toast.info(this.$t("History.AddToQueueSuccessful",{filename:this.filename}).toString()),this.closeDialog()}closeDialog(){this.$emit("close")}resetFormState(){this.input="1"}isVisibleChanged(s){s&&this.resetFormState()}};ro([w({type:Boolean,default:!1})],Wr.prototype,"isVisible",2);ro([w({type:Boolean,default:!1})],Wr.prototype,"showToast",2);ro([w({type:String,required:!0})],Wr.prototype,"filename",2);ro([he("isVisible")],Wr.prototype,"isVisibleChanged",1);Wr=ro([S],Wr);var K6=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.isVisible,"max-width":400},on:{"click:outside":e.closeDialog,keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[t(U,{attrs:{title:e.$t("Files.AddToQueue"),"card-class":"gcode-files-add-to-queue-dialog",icon:e.mdiPlaylistPlus,"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(or,{on:{submit:function(r){return r.preventDefault(),e.addBatchToQueueAction.apply(null,arguments)}},model:{value:e.isValid,callback:function(r){e.isValid=r},expression:"isValid"}},[t(Z,[t(se,{ref:"inputFieldAddToQueueCount",attrs:{label:e.$t("Files.Count"),required:"","hide-spin-buttons":"",type:"number",rules:e.rules.count},scopedSlots:e._u([{key:"append-outer",fn:function(){return[t("div",{staticClass:"_spin_button_group"},[t(g,{staticClass:"mt-n3",attrs:{icon:"",plain:"",small:""},on:{click:function(r){e.input++}}},[t(_,[e._v(e._s(e.mdiChevronUp))])],1),t(g,{staticClass:"mb-n3",attrs:{disabled:e.input<=1,icon:"",plain:"",small:""},on:{click:function(r){e.input--}}},[t(_,[e._v(e._s(e.mdiChevronDown))])],1)],1)]},proxy:!0}]),model:{value:e.input,callback:function(r){e.input=r},expression:"input"}})],1),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{color:"primary",text:"",type:"submit",disabled:!e.isValid}},[e._v(" "+e._s(e.$t("Files.AddToQueue"))+" ")])],1)],1)],1)],1)},Q6=[],ek=E(Wr,K6,Q6,!1,null,"85d0eee1");const ri=ek.exports;var tk=Object.defineProperty,sk=Object.getOwnPropertyDescriptor,Gb=(s,e,t,r)=>{for(var i=r>1?void 0:r?sk(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&tk(e,t,i),i};let Ul=class extends k(L){get styleCircle1(){return{fill:this.color}}get styleCircle2(){return{fill:"#bebebe"}}get styleCircle3(){return{fill:"#343434"}}clickSpool(){this.$emit("click-spool")}};Gb([w({required:!1,default:"#ff0"})],Ul.prototype,"color",2);Ul=Gb([S({})],Ul);var rk=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("svg",{staticClass:"cursor-pointer",attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 487.04 487.04","xml:space":"preserve"},on:{click:e.clickSpool}},[t("g",[t("circle",{style:e.styleCircle1,attrs:{cx:"243.52",cy:"243.52",r:"232.97"}}),t("circle",{style:e.styleCircle2,attrs:{cx:"243.52",cy:"243.52",r:"112.5"}}),t("path",{style:e.styleCircle3,attrs:{d:"M0,243.52c0,134.42,109.1,243.52,243.52,243.52,134.42,0,243.52-109.1,243.52-243.52S377.95,0,243.52,0C109.1,0,0,109.1,0,243.52Zm115.73,181.78c-52.4-39.5-86.52-98.59-94.52-163.72v-.09c-.68-5.43,1-10.89,4.6-15,3.6-4.12,8.79-6.51,14.26-6.57l118.36-1.33c18.99-.21,36.63,9.83,46.12,26.29,9.5,16.45,9.38,36.74-.3,53.09l-60.29,101.76c-2.8,4.73-7.48,8.03-12.87,9.1-5.39,1.06-10.98-.22-15.36-3.52ZM450.22,238.8c5.49,.06,10.7,2.46,14.31,6.59,3.62,4.13,5.3,9.61,4.63,15.06-8.01,65.13-42.12,124.22-94.52,163.72l-.07,.05c-4.37,3.29-9.93,4.57-15.3,3.51-5.37-1.06-10.03-4.36-12.82-9.06l-60.33-101.84c-9.68-16.34-9.8-36.64-.3-53.09,9.5-16.45,27.13-26.5,46.12-26.29l118.27,1.33ZM338.12,40.02c5.04,2.14,8.92,6.32,10.69,11.49,1.77,5.18,1.24,10.86-1.44,15.63l-58.03,103.17c-9.31,16.56-26.83,26.8-45.83,26.8-19,0-36.51-10.25-45.83-26.8l-57.99-103.09c-2.69-4.79-3.22-10.49-1.45-15.69,1.77-5.2,5.68-9.4,10.73-11.54,60.41-25.63,128.64-25.63,189.05,0l.08,.04Z"}})])])},ik=[],nk=E(Ul,rk,ik,!1,null,null);const Zb=nk.exports;var ak=Object.defineProperty,ok=Object.getOwnPropertyDescriptor,Cf=(s,e,t,r)=>{for(var i=r>1?void 0:r?ok(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&ak(e,t,i),i};let ma=class extends k(L){get color(){var e,t;const s=(t=(e=this.spool.filament)==null?void 0:e.color_hex)!=null?t:"000";return"#".concat(s)}get id(){let s=this.spool.id.toString();for(;s.length{for(var i=r>1?void 0:r?mk(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&dk(e,t,i),i};let ki=class extends k(L){constructor(){super(...arguments),this.mdiAdjust=tn,this.mdiCloseThick=pe,this.mdiDatabase=Fw,this.mdiMagnify=rn,this.mdiRefresh=an,this.search=""}get spools(){var s;return(s=this.$store.state.server.spoolman.spools)!=null?s:[]}get max_spool_id_digits(){return this.$store.state.server.spoolman.spools.reduce((e,t)=>Math.max(e,t.id),0).toString().length}get headers(){return[{text:" ",align:"start",sortable:!1},{text:this.$t("Panels.SpoolmanPanel.Filament"),align:"start",value:"filament.name",sortable:!1},{text:this.$t("Panels.SpoolmanPanel.Material"),align:"center",value:"filament.material"},{text:this.$t("Panels.SpoolmanPanel.LastUsed"),align:"end",value:"last_used"},{text:this.$t("Panels.SpoolmanPanel.Weight"),align:"end",value:"remaining_weight"}]}get spoolManagerUrl(){var s,e,t;return(t=(e=(s=this.$store.state.server.config.config)==null?void 0:s.spoolman)==null?void 0:e.server)!=null?t:null}get existsSaveVariables(){var e,t;return"save_variables"in((t=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)!=null?t:{})}openSpoolManager(){window.open(this.spoolManagerUrl,"_blank")}mounted(){this.refresh()}refresh(){this.$store.dispatch("server/spoolman/refreshSpools")}close(){this.$emit("close")}refreshSpools(){this.$store.dispatch("server/spoolman/refreshSpools")}customFilter(s,e,t){var n;if(e.trim().startsWith("web+spoolman:s-")){const a=parseInt((n=e.split("-")[1])!=null?n:-1);return t.id===a}const r=e.toLowerCase().split(" "),i=[t.id.toString(),t.comment,t.filament.name,t.filament.vendor.name,t.filament.material,t.location];for(const a of r)if(!i.some(l=>l==null?void 0:l.toLowerCase().includes(a)))return!1;return!0}setSpool(s){if(this.$store.dispatch("server/spoolman/setActiveSpool",s.id),!this.tool){this.close();return}const e="SET_GCODE_VARIABLE MACRO=".concat(this.tool," VARIABLE=spool_id VALUE=").concat(s.id);if(this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e}),!this.existsSaveVariables){this.close();return}const t="SAVE_VARIABLE VARIABLE=".concat(this.tool.toLowerCase(),"__spool_id VALUE=").concat(s.id);this.$store.dispatch("server/addEvent",{message:t,type:"command"}),this.$socket.emit("printer.gcode.script",{script:t}),this.close()}onShowDialogChanged(s){s&&(this.search="")}};Ou([w({required:!0})],ki.prototype,"showDialog",2);Ou([w({required:!1,default:null})],ki.prototype,"tool",2);Ou([he("showDialog")],ki.prototype,"onShowDialogChanged",1);ki=Ou([S({components:{SpoolmanChangeSpoolDialogRow:qb,Panel:U}})],ki);var hk=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(le,{attrs:{width:"800",persistent:"",fullscreen:e.isMobile},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(U,{attrs:{title:e.$t("Panels.SpoolmanPanel.ChangeSpool"),icon:e.mdiAdjust,"card-class":"spoolman-change-spool-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.close}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(gt,[t(se,{staticStyle:{"max-width":"300px"},attrs:{"append-icon":e.mdiMagnify,label:e.$t("Panels.SpoolmanPanel.Search"),outlined:"",dense:"","hide-details":""},model:{value:e.search,callback:function(r){e.search=r},expression:"search"}}),t(ae),t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Panels.SpoolmanPanel.Refresh"),loading:e.loadings.includes("refreshSpools")},on:{click:e.refreshSpools}},[t(_,[e._v(e._s(e.mdiRefresh))])],1),t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Panels.SpoolmanPanel.OpenSpoolManager")},on:{click:e.openSpoolManager}},[t(_,[e._v(e._s(e.mdiDatabase))])],1)],1),t(Z,{staticClass:"px-0 pb-0"},[t(Qr,{attrs:{headers:e.headers,items:e.spools,"item-key":"id",search:e.search,"sort-by":"last_used","sort-desc":!0,"custom-filter":e.customFilter},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("Panels.SpoolmanPanel.NoSpools")))])]},proxy:!0},{key:"no-results",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("Panels.SpoolmanPanel.NoResults")))])]},proxy:!0},{key:"item",fn:function({item:r}){return[t(qb,{key:r.id,attrs:{spool:r,max_id_digits:e.max_spool_id_digits},on:{"set-spool":e.setSpool}})]}}])})],1)],1)],1)],1)},pk=[],fk=E(ki,hk,pk,!1,null,null);const cn=fk.exports;var gk=Object.defineProperty,_k=Object.getOwnPropertyDescriptor,Xb=(s,e,t,r)=>{for(var i=r>1?void 0:r?_k(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&gk(e,t,i),i};let Wl=class extends k(L){constructor(){super(...arguments),this.mdiEject=Q_,this.mdiCloseThick=pe}close(){this.$emit("close")}removeSpool(){this.$store.dispatch("server/spoolman/setActiveSpool",null),this.close()}};Xb([w({required:!0})],Wl.prototype,"showDialog",2);Wl=Xb([S({components:{Panel:U}})],Wl);var vk=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{width:"400",persistent:"",fullscreen:e.isMobile},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(U,{attrs:{title:e.$t("Panels.SpoolmanPanel.EjectSpool"),icon:e.mdiEject,"card-class":"spoolman-eject-spool-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.close}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(x,[t(b,[t("p",{staticClass:"body-2"},[e._v(e._s(e.$t("Panels.SpoolmanPanel.EjectSpoolQuestion")))])])],1)],1),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.close}},[e._v(e._s(e.$t("Panels.SpoolmanPanel.Cancel")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.removeSpool}},[e._v(" "+e._s(e.$t("Panels.SpoolmanPanel.EjectSpool"))+" ")])],1)],1)],1)},bk=[],yk=E(Wl,vk,bk,!1,null,null);const $f=yk.exports;var Ck=Object.defineProperty,$k=Object.getOwnPropertyDescriptor,Yb=(s,e,t,r)=>{for(var i=r>1?void 0:r?$k(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&Ck(e,t,i),i};let zl=class extends k(L){get listItemContentClass(){return this.small?"my-0":""}get overlineClass(){const s=["text-overline","mb-1"];return this.small&&s.push("line-height-auto"),s}get listItemTitleClass(){return this.small?["text-h6","mb-1"]:["text-h5","mb-1"]}get avatarSize(){return this.small?60:80}get active_spool(){var s;return(s=this.$store.state.server.spoolman.active_spool)!=null?s:null}get color(){var e,t;const s=(t=(e=this.active_spool)==null?void 0:e.filament.color_hex)!=null?t:null;return s===null?"#000":"#".concat(s)}get id(){var s,e;return(e=(s=this.active_spool)==null?void 0:s.id)!=null?e:"XX"}get vendor(){var s,e,t,r;return(r=(t=(e=(s=this.active_spool)==null?void 0:s.filament)==null?void 0:e.vendor)==null?void 0:t.name)!=null?r:"Unknown"}get name(){var s,e;return(e=(s=this.active_spool)==null?void 0:s.filament.name)!=null?e:"Unknown"}get materialOutput(){var e,t;const s=(t=(e=this.active_spool)==null?void 0:e.filament.material)!=null?t:null;return s===null?null:s}get weightOutput(){var i,n,a,o;let s=(n=(i=this.active_spool)==null?void 0:i.remaining_weight)!=null?n:null,e=(o=(a=this.active_spool)==null?void 0:a.filament.weight)!=null?o:null,t="g";if(s===null||e===null)return null;s=Math.round(s);let r=Math.floor(e/1e3);return e>=1e3?(r!==e/1e3&&(r=Math.round(e/100)/10),"".concat(s,"g / ").concat(r,"kg")):"".concat(s," / ").concat(e).concat(t)}get lengthOutput(){var e,t;let s=(t=(e=this.active_spool)==null?void 0:e.remaining_length)!=null?t:null;return s===null?null:(s=Math.round(s/1e3),"".concat(s,"m"))}get subtitle(){return[this.materialOutput,this.weightOutput,this.lengthOutput].filter(s=>s!==null).join(" | ")}clickSpool(){this.$emit("change-spool")}};Yb([w({required:!1,default:!1})],zl.prototype,"small",2);zl=Yb([S({components:{Panel:U,SpoolmanChangeSpoolDialog:cn,SpoolmanEjectSpoolDialog:$f}})],zl);var xk=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(J,{attrs:{"three-line":""}},[t(_t,{class:e.listItemContentClass},[t("div",{class:e.overlineClass},[e._v("#"+e._s(e.id)+" | "+e._s(e.vendor))]),t(Ze,{class:e.listItemTitleClass},[t("span",{staticClass:"cursor-pointer",on:{click:e.clickSpool}},[e._v(e._s(e.name))])]),t(Va,[e._v(e._s(e.subtitle))])],1),t(O$,{attrs:{tile:"",size:e.avatarSize}},[t(Zb,{attrs:{color:e.color},on:{"click-spool":e.clickSpool}})],1)],1)},wk=[],Sk=E(zl,xk,wk,!1,null,"5b0a993e");const Mu=Sk.exports;var Pk=Object.defineProperty,Dk=Object.getOwnPropertyDescriptor,Jb=(s,e,t,r)=>{for(var i=r>1?void 0:r?Dk(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&Pk(e,t,i),i};let Gl=class extends k(L){constructor(){super(...arguments),this.showChangeSpoolDialog=!1}get activeSpoolId(){var e,t;let s=(t=(e=this.$store.state.server.spoolman)==null?void 0:e.active_spool_id)!=null?t:null;return s===0&&(s=null),s}get activeSpool(){var s,e;return(e=(s=this.$store.state.server.spoolman)==null?void 0:s.active_spool)!=null?e:null}get classSecondDivider(){const s=["mt-4"];return s.push(this.moonrakerComponents.includes("timelapse")?"mb-2":"mb-0"),s}get buttonText(){return this.activeSpoolId===null?this.$t("Panels.SpoolmanPanel.SelectSpool"):this.$t("Panels.SpoolmanPanel.ChangeSpool")}get alerts(){var i,n,a,o,l,u,c,d,m;let s=[];if(this.activeSpoolId===null)return s.push({text:this.$t("Panels.SpoolmanPanel.NoSpoolSelected"),color:"orange"}),s;let e=(i=this.file.filament_type)!=null?i:"";e.includes(";")&&(e=e.split(";")[0]),e!==""&&((o=(a=(n=this.activeSpool)==null?void 0:n.filament)==null?void 0:a.material)==null?void 0:o.toLowerCase())!==e.toLowerCase()&&s.push({text:this.$t("Panels.SpoolmanPanel.FilamentTypeMismatch",{fileType:e,spoolType:(u=(l=this.activeSpool)==null?void 0:l.filament)==null?void 0:u.material}),color:"warning"});const t=Math.round((c=this.file.filament_weight_total)!=null?c:0),r=Math.round((m=(d=this.activeSpool)==null?void 0:d.remaining_weight)!=null?m:0);return r{for(var i=r>1?void 0:r?Lk(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&Ek(e,t,i),i};let Ei=class extends k(L){constructor(){super(...arguments),this.mdiPrinter3d=qa}get timelapseEnabled(){var s,e,t;return(t=(e=(s=this.$store.state.server.timelapse)==null?void 0:s.settings)==null?void 0:e.enabled)!=null?t:!1}set timelapseEnabled(s){this.$socket.emit("machine.timelapse.post_settings",{enabled:s},{action:"server/timelapse/initSettings"})}get bigThumbnailBackground(){var s;return(s=this.$store.state.gui.uiSettings.bigThumbnailBackground)!=null?s:At}get bigThumbnailStyle(){return At.toLowerCase()===this.bigThumbnailBackground.toLowerCase()?{}:{backgroundColor:this.bigThumbnailBackground}}get active_spool(){var s;return(s=this.$store.state.server.spoolman.active_spool)!=null?s:null}get filamentVendor(){var s,e,t,r;return(r=(t=(e=(s=this.active_spool)==null?void 0:s.filament)==null?void 0:e.vendor)==null?void 0:t.name)!=null?r:"Unknown"}get filamentName(){var s,e;return(e=(s=this.active_spool)==null?void 0:s.filament.name)!=null?e:"Unknown"}get filament(){return"".concat(this.filamentVendor," - ").concat(this.filamentName)}get question(){var s,e,t,r;return this.active_spool?this.$t("Dialogs.StartPrint.DoYouWantToStartFilenameFilament",{filename:(e=(s=this.file)==null?void 0:s.filename)!=null?e:"unknown"}):this.$t("Dialogs.StartPrint.DoYouWantToStartFilename",{filename:(r=(t=this.file)==null?void 0:t.filename)!=null?r:"unknown"})}get maxThumbnailWidth(){var s,e;return(e=(s=this.file)==null?void 0:s.big_thumbnail_width)!=null?e:400}startPrint(s=""){s=(this.currentPath+"/"+s).substring(1),this.closeDialog(),this.$socket.emit("printer.print.start",{filename:s},{action:"switchToDashboard"})}closeDialog(){this.$emit("closeDialog")}};ku([w({required:!0,default:!1})],Ei.prototype,"bool",2);ku([w({required:!0,default:""})],Ei.prototype,"currentPath",2);ku([w({required:!0})],Ei.prototype,"file",2);Ei=ku([S({components:{SettingsRow:j}})],Ei);var Ak=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{"max-width":400,"content-class":"overflow-x-hidden"},on:{"click:outside":e.closeDialog,keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}},model:{value:e.bool,callback:function(r){e.bool=r},expression:"bool"}},[t(Pe,[e.file.big_thumbnail?t("div",{staticClass:"d-flex align-center justify-center",staticStyle:{"min-height":"200px"}},[t(nu,{staticClass:"d-inline-block",style:e.bigThumbnailStyle,attrs:{src:e.file.big_thumbnail,"max-width":e.maxThumbnailWidth}})],1):e._e(),t(gt,{staticClass:"text-h5"},[e._v(e._s(e.$t("Dialogs.StartPrint.Headline")))]),t(Z,{staticClass:"pb-0"},[t("p",{staticClass:"body-2"},[e._v(" "+e._s(e.question)+" ")])]),e.moonrakerComponents.includes("spoolman")?t(kk,{attrs:{file:e.file}}):e._e(),e.moonrakerComponents.includes("timelapse")?[e.moonrakerComponents.includes("spoolman")?e._e():t(I,{staticClass:"mt-3 mb-2"}),t(Z,{staticClass:"py-0"},[t(j,{attrs:{title:e.$t("Dialogs.StartPrint.Timelapse")}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.timelapseEnabled,callback:function(r){e.timelapseEnabled=r},expression:"timelapseEnabled"}})],1)],1),t(I,{staticClass:"mt-2 mb-0"})]:e._e(),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Dialogs.StartPrint.Cancel")))]),t(g,{attrs:{color:"primary",text:"",disabled:e.printerIsPrinting||!e.klipperReadyForGui},on:{click:function(r){return e.startPrint(e.file.filename)}}},[e._v(" "+e._s(e.$t("Dialogs.StartPrint.Print"))+" ")])],1)],2)],1)},Fk=[],Rk=E(Ei,Ak,Fk,!1,null,null);const Eu=Rk.exports;var Hk=Object.defineProperty,jk=Object.getOwnPropertyDescriptor,xf=(s,e,t,r)=>{for(var i=r>1?void 0:r?jk(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&Hk(e,t,i),i};let ha=class extends k(L,Je){constructor(){super(...arguments),this.mdiFile=Bs,this.mdiPlay=nn,this.mdiPlaylistPlus=Za,this.mdiFire=sn,this.mdiVideo3d=yu,this.mdiCloudDownload=Kn,this.mdiFileDocumentEditOutline=za,this.mdiRenameBox=vu,this.mdiDelete=Ue,this.mdiCloseThick=pe,this.currentPath="",this.contextMenuShow=!1,this.contextMenuX=0,this.contextMenuY=0,this.showPrintDialog=!1,this.showAddBatchToQueueDialog=!1,this.showRenameFileDialog=!1,this.renameFileNewName="",this.showDeleteDialog=!1}get styleContentTdWidth(){return"width: ".concat(this.contentTdWidth,"px;")}get bigThumbnailBackground(){var e;return(e=this.$store.state.gui.uiSettings.bigThumbnailBackground)!=null?e:At}get bigThumbnailTooltipColor(){if(At.toLowerCase()!==this.bigThumbnailBackground.toLowerCase())return this.bigThumbnailBackground}get existsMetadata(){var e,t;return(t=(e=this.item)==null?void 0:e.metadataPulled)!=null?t:!1}get description(){const e=[];let t="--";(this.item.filament_total||this.item.filament_weight_total)&&(t="",this.item.filament_total&&this.item.filament_total>1e3?t+="".concat((this.item.filament_total/1e3).toFixed(2)," m"):this.item.filament_total&&(t+="".concat(this.item.filament_total.toFixed(0)," mm")),this.item.filament_total&&this.item.filament_weight_total&&(t+=" / "),this.item.filament_weight_total&&(t+=this.item.filament_weight_total.toFixed(0)+" g")),e.push("".concat(this.$t("Panels.StatusPanel.Filament"),": ").concat(t));const r=this.item.estimated_time?Is(this.item.estimated_time):"--";return e.push("".concat(this.$t("Panels.StatusPanel.PrintTime"),": ").concat(r)),e.join(", ")}get statusIcon(){return this.$store.getters["server/history/getPrintStatusIcon"](this.item.last_status)}get statusColor(){return this.$store.getters["server/history/getPrintStatusIconColor"](this.item.last_status)}get pathOfFile(){return this.item.filename.lastIndexOf("/")>=0?"/"+this.item.filename.slice(0,this.item.filename.lastIndexOf("/")):""}get filename(){return this.item.filename.slice(this.item.filename.lastIndexOf("/")+1)}showContextMenu(e){this.contextMenuShow||(e==null||e.preventDefault(),this.contextMenuX=(e==null?void 0:e.clientX)||(e==null?void 0:e.pageX)||window.screenX/2,this.contextMenuY=(e==null?void 0:e.clientY)||(e==null?void 0:e.pageY)||window.screenY/2,this.$nextTick(()=>{this.contextMenuShow=!0}))}addToQueue(){this.$store.dispatch("server/jobQueue/addToQueue",[this.item.filename])}view3D(){this.$router.push({path:"/viewer",query:{filename:"gcodes/"+this.item.filename}})}downloadFile(){const e=this.apiUrl+"/server/files/gcodes/"+Ie(this.item.filename);window.open(e)}renameFile(){this.showRenameFileDialog=!1,this.$socket.emit("server.files.move",{source:"gcodes/"+this.item.filename,dest:"gcodes/"+this.pathOfFile+this.renameFileNewName},{action:"files/getMove"})}editFile(){const e=this.item.filename.lastIndexOf("/"),t=e>0?this.item.filename.slice(0,e+1):"",r=e>0?this.item.filename.slice(e+1):this.item.filename;this.$store.dispatch("editor/openFile",{root:"gcodes",path:t,filename:r,size:this.item.size,permissions:this.item.permissions})}removeFile(){this.$socket.emit("server.files.delete_file",{path:"gcodes/"+this.item.filename},{action:"files/getDeleteFile"}),this.showDeleteDialog=!1}mounted(){this.renameFileNewName=this.filename}};xf([w({type:Object,required:!0})],ha.prototype,"item",2);xf([w({type:Number,required:!0})],ha.prototype,"contentTdWidth",2);ha=xf([S({components:{Panel:U,StartPrintDialog:Eu,AddBatchToQueueDialog:ri}})],ha);var Ik=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:r=>e.showContextMenu(r),expression:"(e) => showContextMenu(e)",arg:"600"}],staticClass:"cursor-pointer",on:{contextmenu:function(r){return e.showContextMenu(r)},click:function(r){e.showPrintDialog=!0}}},[t("td",{staticClass:"pr-0 text-center",staticStyle:{width:"32px"}},[e.item.small_thumbnail?[t(de,{attrs:{top:"","content-class":"tooltip__content-opacity1",disabled:!e.item.big_thumbnail,color:e.bigThumbnailTooltipColor},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("vue-load-image",{staticClass:"d-flex"},[t("img",e._g(e._b({attrs:{slot:"image",src:e.item.small_thumbnail,alt:e.item.filename,width:"32",height:"32"},slot:"image"},"img",i,!1),r)),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(ot,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(_,[e._v(e._s(e.mdiFile))])],1)])]}}],null,!1,2095430365)},[t("span",[t("img",{attrs:{src:e.item.big_thumbnail,alt:e.item.filename,width:"250"}})])])]:[t(_,[e._v(e._s(e.mdiFile))])]],2),t("td",{staticClass:"pr-2"},[t("div",{staticClass:"d-block text-truncate",style:e.styleContentTdWidth},[e._v(e._s(e.item.filename))]),e.existsMetadata?t("small",[e._v(e._s(e.description))]):e._e()]),t("td",[e.item.last_status?t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("span",e._g(e._b({},"span",i,!1),r),[t(_,{attrs:{small:"",color:e.statusColor}},[e._v(e._s(e.statusIcon))])],1)]}}],null,!1,4217021254)},[t("span",[e._v(e._s(e.item.last_status.replace(/_/g," ")))])]):e._e()],1),t(ye,{attrs:{"position-x":e.contextMenuX,"position-y":e.contextMenuY,absolute:"","offset-y":""},model:{value:e.contextMenuShow,callback:function(r){e.contextMenuShow=r},expression:"contextMenuShow"}},[t(Me,[t(J,{attrs:{disabled:e.printerIsPrinting||!e.klipperReadyForGui},on:{click:function(r){e.showPrintDialog=!0}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlay))]),e._v(" "+e._s(e.$t("Files.PrintStart"))+" ")],1),e.moonrakerComponents.includes("job_queue")?t(J,{on:{click:e.addToQueue}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddToQueue"))+" ")],1):e._e(),e.moonrakerComponents.includes("job_queue")?t(J,{on:{click:function(r){e.showAddBatchToQueueDialog=!0}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddBatchToQueue"))+" ")],1):e._e(),e.item.preheat_gcode!==null?t(J,{attrs:{disabled:["error","printing","paused"].includes(e.printer_state)},on:{click:function(r){return e.doSend(e.item.preheat_gcode)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiFire))]),e._v(" "+e._s(e.$t("Files.Preheat"))+" ")],1):e._e(),t(J,{on:{click:e.view3D}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiVideo3d))]),e._v(" "+e._s(e.$t("Files.View3D"))+" ")],1),t(J,{on:{click:e.downloadFile}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiCloudDownload))]),e._v(" "+e._s(e.$t("Files.Download"))+" ")],1),t(J,{on:{click:e.editFile}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiFileDocumentEditOutline))]),e._v(" "+e._s(e.$t("Files.EditFile"))+" ")],1),t(J,{on:{click:function(r){e.showRenameFileDialog=!0}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiRenameBox))]),e._v(" "+e._s(e.$t("Files.Rename"))+" ")],1),t(J,{staticClass:"red--text",on:{click:function(r){e.showDeleteDialog=!0}}},[t(_,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("Files.Delete"))+" ")],1)],1)],1),t(Eu,{attrs:{bool:e.showPrintDialog,file:e.item,"current-path":""},on:{closeDialog:function(r){e.showPrintDialog=!1}}}),t(ri,{attrs:{"is-visible":e.showAddBatchToQueueDialog,filename:e.filename},on:{close:function(r){e.showAddBatchToQueueDialog=!1}}}),t(le,{attrs:{"max-width":400},model:{value:e.showRenameFileDialog,callback:function(r){e.showRenameFileDialog=r},expression:"showRenameFileDialog"}},[t(U,{attrs:{title:e.$t("Files.RenameFile"),"card-class":"dashboard-files-rename-file-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.showRenameFileDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputFieldRenameFile",attrs:{label:e.$t("Files.Name"),required:""},on:{keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.renameFile.apply(null,arguments)}},model:{value:e.renameFileNewName,callback:function(r){e.renameFileNewName=r},expression:"renameFileNewName"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.showRenameFileDialog=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.renameFile}},[e._v(e._s(e.$t("Files.Rename")))])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.showDeleteDialog,callback:function(r){e.showDeleteDialog=r},expression:"showDeleteDialog"}},[t(U,{attrs:{title:e.$t("Files.Delete"),"card-class":"gcode-files-delete-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.showDeleteDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Files.DeleteSingleFileQuestion",{name:e.filename})))])]),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.showDeleteDialog=!1}}},[e._v(" "+e._s(e.$t("Files.Cancel"))+" ")]),t(g,{attrs:{color:"error",text:""},on:{click:e.removeFile}},[e._v(" "+e._s(e.$t("Files.Delete"))+" ")])],1)],1)],1)],1)},Nk=[],Vk=E(ha,Ik,Nk,!1,null,"64231dfc");const Bk=Vk.exports;var Uk=Object.getOwnPropertyDescriptor,Wk=(s,e,t,r)=>{for(var i=r>1?void 0:r?Uk(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let th=class extends k(L,Je){constructor(){super(...arguments),this.contentTdWidth=100}get filesLimit(){var e;return(e=this.$store.state.gui.uiSettings.dashboardFilesLimit)!=null?e:5}get filesFilter(){var e;return(e=this.$store.state.gui.uiSettings.dashboardFilesFilter)!=null?e:[]}get gcodeFiles(){var r;let e=(r=this.$store.getters["files/getAllGcodes"])!=null?r:[];this.filesFilter.length>0&&this.filesFilter.length<3&&(e=e.filter(i=>!!(this.filesFilter.includes("new")&&i.last_status===null||this.filesFilter.includes("completed")&&i.last_status==="completed"||this.filesFilter.includes("failed")&&i.last_status!==null&&i.last_status!=="completed"))),e=e.sort((i,n)=>n.modified.getTime()-i.modified.getTime()).slice(0,this.filesLimit);const t=e.filter(i=>!i.metadataRequested&&!i.metadataPulled);return this.$store.dispatch("files/requestMetadata",t.map(i=>({filename:"gcodes/"+i.filename}))),e}mounted(){setTimeout(()=>{this.calcContentTdWidth()},200)}calcContentTdWidth(){this.contentTdWidth=this.$refs.filesGcodeCard.$el.clientWidth-48-48-32}handleResize(){this.$nextTick(()=>{this.calcContentTdWidth()})}};th=Wk([S({components:{Panel:U,StatusPanelGcodefilesEntry:Bk}})],th);var zk=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{ref:"filesGcodeCard",staticClass:"filesGcodeCard",attrs:{flat:""}},[t(Qr,{staticClass:"dashboard-gcodes-table",attrs:{items:e.gcodeFiles,"hide-default-footer":"","sort-by":"time_added","mobile-breakpoint":"0"},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("Panels.StatusPanel.EmptyGcodes")))])]},proxy:!0},{key:"item",fn:function({item:r}){return[t("status-panel-gcodefiles-entry",{key:r.filename,attrs:{"content-td-width":e.contentTdWidth,item:r}})]}}])}),t("resize-observer",{on:{notify:e.handleResize}})],1)},Gk=[],Zk=E(th,zk,Gk,!1,null,"113058c5");const Kb=Zk.exports;var qk=Object.getOwnPropertyDescriptor,Xk=(s,e,t,r)=>{for(var i=r>1?void 0:r?qk(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let sh=class extends k(L){constructor(){super(...arguments),this.maxFlow=0}get current_file(){var e;return(e=this.$store.state.printer.current_file)!=null?e:{}}get live_velocity(){var e,t,r;return(r=Math.abs((t=(e=this.$store.state.printer.motion_report)==null?void 0:e.live_velocity)==null?void 0:t.toFixed(0)))!=null?r:null}get live_extruder_velocity(){var t,r;const e=(r=(t=this.$store.state.printer.motion_report)==null?void 0:t.live_extruder_velocity)!=null?r:null;return e===null?null:e>0?e:0}get live_flow(){if(this.live_extruder_velocity===null)return null;const t=Math.pow(this.filament_diameter/2,2)*Math.PI*this.live_extruder_velocity;return t&&this.maxFlowr?r:i.toFixed(0)}get max_layers(){var e;return(e=this.$store.getters["printer/getPrintMaxLayers"])!=null?e:0}get current_layer(){var e;return(e=this.$store.getters["printer/getPrintCurrentLayer"])!=null?e:0}get estimated_time_file(){return this.$store.getters["printer/getEstimatedTimeFile"]}get estimated_time_filament(){return this.$store.getters["printer/getEstimatedTimeFilament"]}get estimated_time_slicer(){return this.$store.getters["printer/getEstimatedTimeSlicer"]}get estimated_time_avg(){return this.$store.getters["printer/getEstimatedTimeAvg"]}get eta(){return this.$store.getters["printer/getEstimatedTimeETAFormat"]}get filament_diameter(){var e,t,r,i;return(i=(r=(t=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:t.extruder)==null?void 0:r.filament_diameter)!=null?i:1.75}get print_time(){var e,t;return(t=(e=this.$store.state.printer.print_stats)==null?void 0:e.print_duration)!=null?t:0}get print_time_total(){var e,t;return(t=(e=this.$store.state.printer.print_stats)==null?void 0:e.total_duration)!=null?t:0}get filament_used(){var e,t;return(t=(e=this.$store.state.printer.print_stats)==null?void 0:e.filament_used)!=null?t:0}get outputFilamentUsed(){return this.filament_used>=1e3?(this.filament_used/1e3).toFixed(2)+" m":this.filament_used.toFixed(2)+" mm"}formatDuration(e){const t=e<0?"-":"";let r=Math.abs(e);const i=Math.floor(r/3600);r%=3600;const n=("0"+Math.floor(r/60)).slice(-2),a=("0"+Math.floor(r%60)).slice(-2);return t+i+":"+n+":"+a}};sh=Xk([S({components:{StatusPanelFilesJobqueue:zb,StatusPanelFilesGcodes:Kb}})],sh);var Yk=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Z,{staticClass:"pa-0"},[t(Ee,{staticClass:"py-0"},[t(x,{staticClass:"text-center py-5",attrs:{align:"center"}},[t(b,{staticClass:"col-3 pa-0"},[e.live_velocity!==null?[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("div",e._g(e._b({},"div",i,!1),r),[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Speed")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(e._s(e.live_velocity)+" mm/s")])])]}}],null,!1,1141285171)},[t("span",[e._v(e._s(e.$t("Panels.StatusPanel.Requested"))+": "+e._s(e.requested_speed+" mm/s"))])])]:[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Speed")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(e._s(e.requested_speed)+" mm/s")])]],2),t(b,{staticClass:"col-3 pa-0"},[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("div",e._g(e._b({},"div",i,!1),r),[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Flow")))]),t("br"),t("span",{staticClass:"d-block text-center text-no-wrap"},[e._v(" "+e._s(e.live_flow+" mm³/s")+" ")])])]}}])},[t("span",[e._v(e._s(e.$t("Panels.StatusPanel.Max"))+": "+e._s(e.outputMaxFlow))])])],1),t(b,{staticClass:"col-3 pa-0"},[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("div",e._g(e._b({},"div",i,!1),r),[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Filament")))]),t("br"),t("span",{staticClass:"d-block text-center text-no-wrap"},[e._v(" "+e._s(e.outputFilamentUsed)+" ")])])]}}])},["filament_total"in e.current_file?t("span",[e._v(" "+e._s((e.filament_used/1e3).toFixed(2))+" / "+e._s((e.current_file.filament_total/1e3).toFixed(2))+" m = "+e._s((100/e.current_file.filament_total*e.filament_used).toFixed(0))+" % ")]):e._e()])],1),t(b,{staticClass:"col-3 pa-0 text-center"},[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("div",e._g(e._b({staticClass:"text-center"},"div",i,!1),r),[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Layer")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(e._s(e.current_layer)+" of "+e._s(e.max_layers))])])]}}])},["object_height"in e.current_file&&e.current_file.object_height>0?t("span",[e._v(" "+e._s(e.$t("Panels.StatusPanel.ObjectHeight"))+": "+e._s(e.current_file.object_height)+" mm ")]):e._e()])],1)],1)],1),t(I,{staticClass:"my-0"}),t(Ee,{staticClass:"py-0"},[t(x,{staticClass:"text-center pt-5 pb-2 mb-0",attrs:{align:"center"}},[t(b,{staticClass:"col-3 pa-0"},[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("div",e._g(e._b({staticClass:"text-center"},"div",i,!1),r),[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Estimate")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.estimated_time_avg?e.formatDuration(e.estimated_time_avg):"--")+" ")])])]}}])},[t("div",{staticClass:"text-right"},[e._v(" "+e._s(e.$t("Panels.StatusPanel.File"))+": "+e._s(e.estimated_time_file?e.formatDuration(e.estimated_time_file):"--")+" "),t("br"),e._v(" "+e._s(e.$t("Panels.StatusPanel.Filament"))+": "+e._s(e.estimated_time_filament?e.formatDuration(e.estimated_time_filament):"--")+" ")])])],1),t(b,{staticClass:"col-3 pa-0"},[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Slicer")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.estimated_time_slicer?e.formatDuration(e.estimated_time_slicer):"--")+" ")])]),t(b,{staticClass:"col-3 pa-0"},[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("div",e._g(e._b({staticClass:"text-center"},"div",i,!1),r),[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Total")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.print_time_total?e.formatDuration(e.print_time_total):"--")+" ")])])]}}])},[t("div",{staticClass:"text-right"},[e._v(" "+e._s(e.$t("Panels.StatusPanel.Print"))+": "+e._s(e.print_time?e.formatDuration(e.print_time):"--")+" "),t("br"),e._v(" "+e._s(e.$t("Panels.StatusPanel.Difference"))+": "+e._s(e.print_time&&e.print_time_total?e.formatDuration(e.print_time_total-e.print_time):"--")+" ")])])],1),t(b,{staticClass:"col-3 pa-0"},[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.ETA")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(e._s(e.eta))])])],1)],1)],1)},Jk=[],Kk=E(sh,Yk,Jk,!1,null,"ab7492ce");const Qk=Kk.exports;var eE=Object.getOwnPropertyDescriptor,tE=(s,e,t,r)=>{for(var i=r>1?void 0:r?eE(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let rh=class extends k(L){get current_file(){var e;return(e=this.$store.state.printer.current_file)!=null?e:{}}get filament_used(){var e,t;return(t=(e=this.$store.state.printer.print_stats)==null?void 0:e.filament_used)!=null?t:0}get outputFilamentUsed(){return this.filament_used>=1e3?(this.filament_used/1e3).toFixed(2)+" m":this.filament_used.toFixed(2)+" mm"}get print_time(){var e,t;return(t=(e=this.$store.state.printer.print_stats)==null?void 0:e.print_duration)!=null?t:0}get print_time_total(){var e,t;return(t=(e=this.$store.state.printer.print_stats)==null?void 0:e.total_duration)!=null?t:0}formatTime(e){let t=Math.floor(e/3600);e%=3600;let r=("0"+Math.floor(e/60)).slice(-2),i=("0"+(e%60).toFixed(0)).slice(-2);return t+":"+r+":"+i}};rh=tE([S({components:{}})],rh);var sE=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Z,{staticClass:"pa-0"},[t(Ee,{staticClass:"py-0"},[t(x,{staticClass:"text-center pt-5 pb-2 mb-0",attrs:{align:"center"}},[t(b,{staticClass:"col-3 pa-0"},[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Filament")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.outputFilamentUsed)+" ")])]),t(b,{staticClass:"col-3 pa-0"},[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Slicer")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s("estimated_time"in e.current_file?e.formatTime(e.current_file.estimated_time):"--")+" ")])]),t(b,{staticClass:"col-3 pa-0"},[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Print")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(e._s(e.print_time?e.formatTime(e.print_time):"--"))])]),t(b,{staticClass:"col-3 pa-0"},[t("strong",[e._v(e._s(e.$t("Panels.StatusPanel.Total")))]),t("br"),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.print_time_total?e.formatTime(e.print_time_total):"--")+" ")])])],1)],1)],1)},rE=[],iE=E(rh,sE,rE,!1,null,"75863c9f");const nE=iE.exports;var aE=Object.getOwnPropertyDescriptor,oE=(s,e,t,r)=>{for(var i=r>1?void 0:r?aE(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let ih=class extends k(L){};ih=oE([S({components:{StatusPanelPrintstatusPrinting:Qk,StatusPanelPrintstatusComplete:nE}})],ih);var lE=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[["printing","paused","error","cancelled"].includes(e.printer_state)?[t("status-panel-printstatus-printing")]:e._e(),["complete"].includes(e.printer_state)?[t("status-panel-printstatus-complete")]:e._e()],2)},cE=[],uE=E(ih,lE,cE,!1,null,"61a1ffca");const dE=uE.exports;var mE=Object.defineProperty,hE=Object.getOwnPropertyDescriptor,Qb=(s,e,t,r)=>{for(var i=r>1?void 0:r?hE(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&mE(e,t,i),i};let Zl=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiDelete=Ue,this.mdiFile=Bs,this.mdiPlaylistPlus=Za,this.mdiPrinter=Xp,this.showContextMenu=!1,this.contextMenuX=0,this.contextMenuY=0,this.addBatchToQueueDialogBool=!1}get smallThumbnail(){var t,r,i,n,a;if(((i=(r=(t=this.job.metadata)==null?void 0:t.thumbnails)==null?void 0:r.length)!=null?i:0)<1)return!1;const e=(a=(n=this.job.metadata)==null?void 0:n.thumbnails)==null?void 0:a.find(o=>o.width>=Yt&&o.width<=Jt&&o.height>=Yt&&o.height<=Jt);return e?this.createThumbnailUrl(e):!1}get bigThumbnail(){var t,r,i,n,a;if(((i=(r=(t=this.job.metadata)==null?void 0:t.thumbnails)==null?void 0:r.length)!=null?i:0)<1)return!1;const e=(a=(n=this.job.metadata)==null?void 0:n.thumbnails)==null?void 0:a.find(o=>o.width>=Ls);return e?this.createThumbnailUrl(e):!1}get statusIcon(){return this.$store.getters["server/history/getPrintStatusIcon"](this.job.status)}get statusColor(){return this.$store.getters["server/history/getPrintStatusIconColor"](this.job.status)}get statusName(){return this.$t("History.StatusValues.".concat(this.job.status),"en")?this.$t("History.StatusValues.".concat(this.job.status)):this.job.status.replace(/_/g," ")}get description(){const e=[],t=[];let r="--";return this.filamentLength&&t.push(this.filamentLength),this.filamentWeight&&t.push(this.filamentWeight),t.length&&(r=t.join(" / ")),e.push("".concat(this.$t("Panels.StatusPanel.Filament"),": ").concat(r)),this.estimatedTime!=="--"?e.push("".concat(this.$t("Panels.StatusPanel.PrintTime"),": ").concat(this.estimatedTime)):this.totalTime&&e.push("".concat(this.$t("Panels.StatusPanel.TotalTime"),": ").concat(this.totalTime)),e.join(", ")}get filamentLength(){const e=this.job.filament_used;return e===0?null:e>=1e3?(e/1e3).toFixed(1)+" m":e.toFixed(0)+" mm"}get filamentWeight(){var n,a,o,l;const e=(a=(n=this.job.metadata)==null?void 0:n.filament_total)!=null?a:0,t=(l=(o=this.job.metadata)==null?void 0:o.filament_weight_total)!=null?l:0;if(e===0||t===0)return null;const r=t/e,i=this.job.filament_used*r;return i===0?null:i>=1e3?(length/1e3).toFixed(1)+" kg":i.toFixed(0)+" g"}get estimatedTime(){var t;let e=(t=this.job.print_duration)!=null?t:0;return e==0?"--":Is(e)}get totalTime(){var t;let e=(t=this.job.total_duration)!=null?t:0;return e===0?null:Is(e)}get bigThumbnailBackground(){var e;return(e=this.$store.state.gui.uiSettings.bigThumbnailBackground)!=null?e:At}get bigThumbnailTooltipColor(){if(At.toLowerCase()!==this.bigThumbnailBackground.toLowerCase())return this.bigThumbnailBackground}get isJobQueueAvailable(){return this.moonrakerComponents.includes("job_queue")}openContextMenu(e){if(e==null||e.preventDefault(),this.showContextMenu){this.showContextMenu=!1;return}this.showContextMenu=!0,this.contextMenuX=(e==null?void 0:e.clientX)||(e==null?void 0:e.pageX)||window.screenX/2,this.contextMenuY=(e==null?void 0:e.clientY)||(e==null?void 0:e.pageY)||window.screenY/2}startPrint(){this.job.exists&&this.$socket.emit("printer.print.start",{filename:this.job.filename})}addToQueue(){this.$store.dispatch("server/jobQueue/addToQueue",[this.job.filename]),this.$toast.info(this.$t("History.AddToQueueSuccessful",{filename:this.job.filename}).toString())}deleteJob(){this.$socket.emit("server.history.delete_job",{uid:this.job.job_id},{action:"server/history/getDeletedJobs"})}createThumbnailUrl(e){let t="";return this.job.filename.lastIndexOf("/")!==-1&&(t=this.job.filename.substring(0,this.job.filename.lastIndexOf("/")+1)),"".concat(this.apiUrl,"/server/files/gcodes/").concat(Ie(t+e.relative_path),"?timestamp=").concat(this.job.metadata.modified)}};Qb([w({type:Object,required:!0})],Zl.prototype,"job",2);Zl=Qb([S],Zl);var pE=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,{directives:[{name:"longpress",rawName:"v-longpress:600",value:r=>e.openContextMenu(r),expression:"(e) => openContextMenu(e)",arg:"600"}],staticClass:"history-list-entry d-flex flex-row flex-nowrap cursor-pointer",on:{contextmenu:function(r){return e.openContextMenu(r)}}},[t(b,{staticClass:"col-auto d-flex flex-column justify-center pr-0 py-0"},[e.smallThumbnail?t(de,{attrs:{top:"",disabled:!e.bigThumbnail,"content-class":"tooltip__content-opacity1",color:e.bigThumbnailTooltipColor},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("vue-load-image",{staticClass:"text-center width-32"},[t("img",e._g(e._b({attrs:{slot:"image",src:e.smallThumbnail,width:32,height:32,alt:e.job.filename},slot:"image"},"img",i,!1),r)),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(ot,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(_,[e._v(e._s(e.mdiFile))])],1)])]}}],null,!1,3004314596)},[t("span",[t("img",{attrs:{src:e.bigThumbnail,width:250,alt:e.job.filename}})])]):t(_,[e._v(e._s(e.mdiFile))])],1),t(b,{staticClass:"py-1",staticStyle:{"min-width":"0","font-size":"0.875em"}},[t("div",{staticClass:"text-truncate"},[e.job.count>1?t("strong",[e._v(e._s(e.job.count)+"x")]):e._e(),e._v(" "+e._s(e.job.filename)+" ")]),e.description?t("small",{staticClass:"text-truncate"},[e._v(e._s(e.description))]):e._e()]),t(b,{staticClass:"col-auto d-flex flex-column justify-center pa-0 pr-3"},[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("span",e._g(e._b({},"span",i,!1),r),[t(_,{attrs:{small:"",color:e.statusColor,disabled:!e.job.exists}},[e._v(" "+e._s(e.statusIcon)+" ")])],1)]}}])},[t("span",[e._v(e._s(e.statusName))])])],1),t(ye,{attrs:{"position-x":e.contextMenuX,"position-y":e.contextMenuY,absolute:"","offset-y":""},model:{value:e.showContextMenu,callback:function(r){e.showContextMenu=r},expression:"showContextMenu"}},[t(Me,[e.job.exists?t(J,{attrs:{disabled:e.printerIsPrinting||!e.klipperReadyForGui},on:{click:e.startPrint}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPrinter))]),e._v(" "+e._s(e.$t("History.Reprint"))+" ")],1):e._e(),e.job.exists&&e.isJobQueueAvailable?t(J,{on:{click:e.addToQueue}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddToQueue"))+" ")],1):e._e(),e.job.exists&&e.isJobQueueAvailable?t(J,{on:{click:function(r){e.addBatchToQueueDialogBool=!0}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddBatchToQueue"))+" ")],1):e._e(),t(J,{staticClass:"red--text",on:{click:e.deleteJob}},[t(_,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("History.Delete"))+" ")],1)],1)],1),t(ri,{attrs:{"is-visible":e.addBatchToQueueDialogBool,"show-toast":!0,filename:e.job.filename},on:{close:function(r){e.addBatchToQueueDialogBool=!1}}})],1)},fE=[],gE=E(Zl,pE,fE,!1,null,"e7f9a117");const _E=gE.exports;var vE=Object.getOwnPropertyDescriptor,bE=(s,e,t,r)=>{for(var i=r>1?void 0:r?vE(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let nh=class extends k(L){get jobs(){var e;return(e=this.$store.state.server.history.jobs)!=null?e:[]}get maxLength(){var e;return(e=this.$store.state.gui.uiSettings.dashboardHistoryLimit)!=null?e:5}get jobsCombined(){var t,r;const e=[];for(const i of this.jobs){if(e.length===0){e.push({...i,count:1});continue}const n=e[e.length-1],a=(t=n.metadata.uuid)!=null?t:null,o=(r=i.metadata.uuid)!=null?r:null;if(a===o&&n.status===i.status){n.filament_used+=i.filament_used,n.print_duration+=i.print_duration,n.total_duration+=i.total_duration,n.count+=1;continue}if(e.length>=this.maxLength)break;e.push({...i,count:1})}return e}startJobqueue(){this.$store.dispatch("server/jobQueue/start")}};nh=bE([S({components:{StatusPanelHistoryEntry:_E}})],nh);var yE=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Pe,{staticClass:"history",attrs:{flat:""}},[e.jobsCombined.length?[t(x,{staticClass:"mx-0 mt-0 pb-3"},[t(b,{staticClass:"history-list"},e._l(e.jobsCombined,function(r){return t("status-panel-history-entry",{key:r.job_id,attrs:{job:r}})}),1)],1)]:t("div",[t("p",{staticClass:"body-2 my-3 text-center text--disabled"},[e._v(e._s(e.$t("Panels.StatusPanel.EmptyHistory")))])])],2)},CE=[],$E=E(nh,yE,CE,!1,null,"6af64ef2");const xE=$E.exports;var wE=Object.defineProperty,SE=Object.getOwnPropertyDescriptor,e0=(s,e,t,r)=>{for(var i=r>1?void 0:r?SE(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&wE(e,t,i),i};let ql=class extends k(L){constructor(){super(...arguments),this.coordinationCrossColor="#888",this.stripesOffset=50}get printing_objects(){var s,e;return((e=(s=this.$store.state.printer.exclude_object)==null?void 0:s.objects)!=null?e:[]).map(t=>{let r=0;if("polygon"in t)for(let i=0;ir.size-t.size)}get printing_objects_with_polygons(){return this.printing_objects.filter(s=>"polygon"in s)}get current_object(){var s,e;return(e=(s=this.$store.state.printer.exclude_object)==null?void 0:s.current_object)!=null?e:null}get excluded_objects(){var s,e;return(e=(s=this.$store.state.printer.exclude_object)==null?void 0:s.excluded_objects)!=null?e:[]}get viewBox(){return this.convertX(this.stepperXmin)+" "+this.convertY(this.stepperYmax)+" "+this.absoluteX+" "+this.absoluteY}get toolhead(){var s;return(s=this.$store.state.printer.toolhead)!=null?s:{}}get axis_minimum(){var s;return(s=this.toolhead.axis_minimum)!=null?s:[]}get axis_maximum(){var s;return(s=this.toolhead.axis_maximum)!=null?s:[]}get stepperXmin(){var s;return(s=this.axis_minimum[0])!=null?s:0}get stepperXmax(){var s;return(s=this.axis_maximum[0])!=null?s:200}get stepperYmin(){var s;return(s=this.axis_minimum[1])!=null?s:0}get stepperYmax(){var s;return(s=this.axis_maximum[1])!=null?s:200}get absoluteX(){return Math.abs(this.stepperXmin)+Math.abs(this.stepperXmax)}get absoluteY(){return Math.abs(this.stepperYmin)+Math.abs(this.stepperYmax)}get xStripes(){const s=[],e=Math.floor(this.stepperXmin/this.stripesOffset)*this.stripesOffset,t=Math.floor(this.stepperXmax/this.stripesOffset)*this.stripesOffset;for(let r=e;r<=t;r=r+this.stripesOffset)s.push(r);return s}get yStripes(){const s=[],e=Math.floor(this.stepperYmin/this.stripesOffset)*this.stripesOffset,t=Math.floor(this.stepperYmax/this.stripesOffset)*this.stripesOffset;for(let r=e;r<=t;r=r+this.stripesOffset)s.push(r);return s}get primaryColor(){var s,e;return(e=(s=this.$store.state.gui.theme)==null?void 0:s.primary)!=null?e:al}convertX(s){return s}convertY(s){return s*-1}showObjectTooltip(s){this.$refs.tooltipObjectMap&&(this.$refs.tooltipObjectMap.innerHTML=s,this.$refs.tooltipObjectMap.style.display="block",window.addEventListener("mousemove",this.moveTooltip))}hideObjectTooltip(){this.$refs.tooltipObjectMap&&(this.$refs.tooltipObjectMap.style.display="none",window.removeEventListener("mousemove",this.moveTooltip))}moveTooltip(s){if(!this.$refs.tooltipObjectMap)return;const e=s.offsetY-this.$refs.tooltipObjectMap.clientHeight-15;this.$refs.tooltipObjectMap.style.left="".concat(s.offsetX-20,"px"),this.$refs.tooltipObjectMap.style.top="".concat(e,"px")}openExcludeObjectDialog(s){this.$emit("update:name",s),this.$emit("update:bool",!0)}};e0([w({required:!1,default:""})],ql.prototype,"hoverName",2);ql=e0([S],ql);var PE=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticStyle:{position:"relative"}},[t("div",{ref:"tooltipObjectMap",attrs:{id:"tooltipObjectMap"}}),t("svg",{attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:e.viewBox,"xml:space":"preserve"}},[t("defs",[t("marker",{attrs:{id:"arrowhead",markerWidth:"5",markerHeight:"4",refX:"2",refY:"2",orient:"auto"}},[t("polygon",{attrs:{points:"0 0, 5 2, 0 4",fill:e.coordinationCrossColor}})])]),t("line",{attrs:{x1:e.convertX(0),y1:e.convertY(1),x2:e.convertX(e.stepperXmax/4),y2:e.convertY(1),stroke:e.coordinationCrossColor,"stroke-width":"2","marker-end":"url(#arrowhead)"}}),t("line",{attrs:{x1:e.convertX(1),y1:e.convertY(0),x2:e.convertX(1),y2:e.convertY(e.stepperYmax/4),stroke:e.coordinationCrossColor,"stroke-width":"2","marker-end":"url(#arrowhead)"}}),t("g",[e._l(e.xStripes,function(r){return t("line",{key:"xLines"+r,attrs:{x1:e.convertX(r),x2:e.convertX(r),y1:e.convertY(e.stepperYmin),y2:e.convertY(e.stepperYmax),stroke:e.coordinationCrossColor,"stroke-opacity":.25,"stroke-width":"1"}})}),e._l(e.yStripes,function(r){return t("line",{key:"yLines"+r,attrs:{x1:e.convertX(e.stepperXmin),x2:e.convertX(e.stepperXmax),y1:e.convertY(r),y2:e.convertY(r),stroke:e.coordinationCrossColor,"stroke-opacity":.25,"stroke-width":"1"}})})],2),e._l(e.printing_objects_with_polygons,function(r,i){return t("g",{key:i},[t("polygon",{staticStyle:{cursor:"pointer"},attrs:{points:r.polygon.map(n=>e.convertX(n[0])+","+e.convertY(n[1])).join(" "),stroke:e.current_object===r.name?e.primaryColor:"#666","stroke-width":"2","fill-rule":"evenodd",fill:e.hoverName===r.name?e.primaryColor:e.excluded_objects.includes(r.name)?"#6668":"#bbb"},on:{mouseover:function(n){return e.showObjectTooltip(r.name)},mouseout:e.hideObjectTooltip,click:function(n){return e.openExcludeObjectDialog(r.name)}}})])})],2)])},DE=[],TE=E(ql,PE,DE,!1,null,"908c0af1");const t0=TE.exports;var OE=Object.defineProperty,ME=Object.getOwnPropertyDescriptor,s0=(s,e,t,r)=>{for(var i=r>1?void 0:r?ME(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&OE(e,t,i),i};let Xl=class extends k(L){constructor(){super(...arguments),this.mdiCloseCircle=ol}get printing_objects(){var s,e;return(e=(s=this.$store.state.printer.exclude_object)==null?void 0:s.objects)!=null?e:[]}get current_object(){var s,e;return(e=(s=this.$store.state.printer.exclude_object)==null?void 0:s.current_object)!=null?e:null}get excluded_objects(){var s,e;return(e=(s=this.$store.state.printer.exclude_object)==null?void 0:s.excluded_objects)!=null?e:[]}openExcludeObjectDialog(s){this.$emit("update:name",s),this.$emit("update:bool",!0)}mouseOverObject(s){this.$emit("update:hoverName",s)}};s0([w({required:!1,default:""})],Xl.prototype,"hoverName",2);Xl=s0([S],Xl);var kE=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e._l(e.printing_objects,function(r){return[t(x,{key:"div_"+r.name,staticClass:"py-3 d-flex",on:{click:function(i){return e.mouseOverObject(r.name)},mouseover:function(i){return e.mouseOverObject(r.name)},mouseleave:function(i){return e.mouseOverObject("")}}},[t(b,{class:"py-2 subtitle-2 text-truncate "+(e.hoverName===r.name?"text--white":"text--disabled")},[e._v(" "+e._s(r.name)+" ")]),t(b,{staticClass:"col-auto py-2"},[e.excluded_objects.includes(r.name)?t($s,{staticClass:"text--disabled",attrs:{pill:"",small:""}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.Excluded"))+" ")]):t(_,{staticClass:"text--disabled cursor-pointer",attrs:{small:""},on:{click:function(i){return e.openExcludeObjectDialog(r.name)}}},[e._v(" "+e._s(e.mdiCloseCircle)+" ")])],1)],1),t(I,{key:"divider_"+r.name})]})],2)},EE=[],LE=E(Xl,kE,EE,!1,null,"c8da0728");const r0=LE.exports;var AE=Object.defineProperty,FE=Object.getOwnPropertyDescriptor,Lu=(s,e,t,r)=>{for(var i=r>1?void 0:r?FE(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&AE(e,t,i),i};let Li=class extends k(L){constructor(){super(...arguments),this.hoverName="",this.mdiSelectionRemove=cl,this.mdiCloseThick=pe}hideDialog(){this.$emit("update:showDialog",!1)}get passName(){return this.excludeObjectDialogName}set passName(e){this.$emit("update:name",e)}updateExcludeObjectDialogBool(e){this.$emit("update:bool",e)}updateExcludeObjectDialogName(e){this.$emit("update:name",e)}updateHoverObjectDialogName(e){this.hoverName=e}};Lu([w({required:!0})],Li.prototype,"showDialog",2);Lu([w({required:!0})],Li.prototype,"excludeObjectDialogBool",2);Lu([w({required:!0})],Li.prototype,"excludeObjectDialogName",2);Li=Lu([S({components:{Panel:U,StatusPanelExcludeObjectDialogList:r0,StatusPanelExcludeObjectDialogMap:t0}})],Li);var RE=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(le,{attrs:{width:"900",persistent:"",fullscreen:e.isMobile},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(U,{attrs:{title:e.$t("Panels.StatusPanel.ExcludeObject.ExcludeObject"),icon:e.mdiSelectionRemove,"card-class":"exclude-object-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.hideDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Ee,[t(x,[t(b,{staticClass:"col-12 col-sm-6 pb-0 pb-sm-3"},[t("status-panel-exclude-object-dialog-map",{attrs:{"hover-name":e.hoverName},on:{"update:name":e.updateExcludeObjectDialogName,"update:bool":e.updateExcludeObjectDialogBool}})],1),t(b,{staticClass:"col-12 col-sm-6 pt-0 pt-sm-3"},[t("status-panel-exclude-object-dialog-list",{attrs:{"exclude-object-dialog-name":e.excludeObjectDialogName,"exclude-object-dialog-bool":e.excludeObjectDialogBool,"hover-name":e.hoverName},on:{"update:excludeObjectDialogName":function(r){e.excludeObjectDialogName=r},"update:exclude-object-dialog-name":function(r){e.excludeObjectDialogName=r},"update:excludeObjectDialogBool":function(r){e.excludeObjectDialogBool=r},"update:exclude-object-dialog-bool":function(r){e.excludeObjectDialogBool=r},"update:name":e.updateExcludeObjectDialogName,"update:hoverName":e.updateHoverObjectDialogName,"update:bool":e.updateExcludeObjectDialogBool}})],1)],1)],1)],1)],1)],1)},HE=[],jE=E(Li,RE,HE,!1,null,"9253cf61");const IE=jE.exports;var NE=Object.defineProperty,VE=Object.getOwnPropertyDescriptor,i0=(s,e,t,r)=>{for(var i=r>1?void 0:r?VE(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&NE(e,t,i),i};let Yl=class extends k(L){constructor(){super(...arguments),this.mdiPrinter3dNozzle=Us,this.mdiSelectionRemove=cl,this.boolShowExcludeObjectDialog=!1,this.excludeObjectDialogName=""}get showDialogPass(){return this.showDialog}set showDialogPass(e){this.$emit("update:showDialog",e)}get printing_objects(){var e,t;return(t=(e=this.$store.state.printer.exclude_object)==null?void 0:e.objects)!=null?t:[]}get current_object(){var e,t;return(t=(e=this.$store.state.printer.exclude_object)==null?void 0:e.current_object)!=null?t:null}get excluded_objects(){var e,t;return(t=(e=this.$store.state.printer.exclude_object)==null?void 0:e.excluded_objects)!=null?t:[]}updateExcludeObjectDialogName(e){this.excludeObjectDialogName=e}updateExcludeObjectDialogBool(e){this.boolShowExcludeObjectDialog=e}openCancelObjectDialog(e){this.excludeObjectDialogName=e,this.boolShowExcludeObjectDialog=!0}cancelObject(){this.$socket.emit("printer.gcode.script",{script:"EXCLUDE_OBJECT NAME="+this.excludeObjectDialogName}),this.boolShowExcludeObjectDialog=!1}};i0([w({required:!0})],Yl.prototype,"showDialog",2);Yl=i0([S({components:{StatusPanelExcludeObjectDialog:IE}})],Yl);var BE=function(){var e=this,t=e._self._c;return e._self._setupProxy,["printing","paused"].includes(e.printer_state)&&e.printing_objects.length?t("div",[t(Ee,{staticClass:"py-0"},[t("div",{staticClass:"d-flex flex-row flex-nowrap justify-space-between"},[t("div",{staticClass:"py-2",staticStyle:{width:"calc(100% - 25px)"}},[t("span",{staticClass:"subtitle-2 d-block px-0 text--disabled text-truncate"},[t(_,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiPrinter3dNozzle))]),e._v(" "+e._s(e.current_object!==null?e.current_object:"--")+" ")],1)]),t("div",{staticClass:"py-2 pl-0"},[e.current_object!==null?t(_,{staticClass:"text--disabled cursor-pointer",attrs:{small:""},on:{click:function(r){return e.openCancelObjectDialog(e.current_object)}}},[e._v(" "+e._s(e.mdiSelectionRemove)+" ")]):e._e()],1)])]),t(I,{staticClass:"mt-0 mb-0"}),t(le,{attrs:{"max-width":"400"},model:{value:e.boolShowExcludeObjectDialog,callback:function(r){e.boolShowExcludeObjectDialog=r},expression:"boolShowExcludeObjectDialog"}},[t(Pe,[t(Op,{attrs:{flat:"",dense:""}},[t(ru,[t("span",{staticClass:"subheading"},[t(_,{attrs:{left:""}},[e._v(e._s(e.mdiSelectionRemove))]),e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.ExcludeObjectHeadline"))+" ")],1)])],1),t(Z,{staticClass:"mt-3"},[e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.ExcludeObjectText",{name:e.excludeObjectDialogName}))+" ")]),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:function(r){e.boolShowExcludeObjectDialog=!1}}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.Cancel"))+" ")]),t(g,{attrs:{color:"primary",text:""},on:{click:e.cancelObject}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.ExcludeObject.ExcludeObject"))+" ")])],1)],1)],1),t("status-panel-exclude-object-dialog",{attrs:{"show-dialog":e.showDialogPass,"exclude-object-dialog-name":e.excludeObjectDialogName,"exclude-object-dialog-bool":e.boolShowExcludeObjectDialog},on:{"update:showDialog":function(r){e.showDialogPass=r},"update:show-dialog":function(r){e.showDialogPass=r},"update:excludeObjectDialogName":function(r){e.excludeObjectDialogName=r},"update:exclude-object-dialog-name":function(r){e.excludeObjectDialogName=r},"update:excludeObjectDialogBool":function(r){e.boolShowExcludeObjectDialog=r},"update:exclude-object-dialog-bool":function(r){e.boolShowExcludeObjectDialog=r},"update:name":e.updateExcludeObjectDialogName,"update:bool":e.updateExcludeObjectDialogBool}})],1):e._e()},UE=[],WE=E(Yl,BE,UE,!1,null,"fc6f7b3c");const zE=WE.exports;var GE=Object.defineProperty,ZE=Object.getOwnPropertyDescriptor,n0=(s,e,t,r)=>{for(var i=r>1?void 0:r?ZE(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&GE(e,t,i),i};let Jl=class extends k(L){constructor(){super(...arguments),this.mdiFileOutline=tv,this.mdiFile=Bs,this.focus=!1,this.thumbnailFactor=0}get current_filename(){var e,t;return(t=(e=this.$store.state.printer.print_stats)==null?void 0:e.filename)!=null?t:""}get current_file(){var e;return(e=this.$store.state.printer.current_file)!=null?e:{}}get thumbnailBig(){if("thumbnails"in this.current_file&&this.current_file.thumbnails.length){const e=this.current_file.thumbnails.find(t=>t.width>=Ls);if(e&&"relative_path"in e){let t="";if(this.current_file.filename.lastIndexOf("/")!==-1&&(t=this.current_file.filename.substr(0,this.current_file.filename.lastIndexOf("/")+1)),e&&"relative_path"in e)return"".concat(this.apiUrl,"/server/files/gcodes/").concat(Ie(t+e.relative_path),"?timestamp=").concat(this.current_file.modified)}}return""}get thumbnailBigHeight(){if("thumbnails"in this.current_file&&this.current_file.thumbnails.length){const e=this.current_file.thumbnails.find(t=>t.width>=Ls);if(e&&"height"in e)return e.height}return 200}get thumbnailBigWidth(){if("thumbnails"in this.current_file&&this.current_file.thumbnails.length){const e=this.current_file.thumbnails.find(t=>t.width>=Ls);if(e&&"width"in e)return e.width}return 300}get thumbnailSmall(){if("thumbnails"in this.current_file&&this.current_file.thumbnails.length){const e=this.current_file.thumbnails.find(t=>t.width>=Yt&&t.width<=Jt&&t.height>=Yt&&t.height<=Jt);if(e&&"relative_path"in e){let t="";if(this.current_file.filename.lastIndexOf("/")!==-1&&(t=this.current_file.filename.substr(0,this.current_file.filename.lastIndexOf("/")+1)),e&&"relative_path"in e)return"".concat(this.apiUrl,"/server/files/gcodes/").concat(Ie(t+e.relative_path),"?timestamp=").concat(this.current_file.modified)}}return""}get boolBigThumbnail(){var t;const e=(t=this.$store.state.gui.uiSettings.boolBigThumbnail)!=null?t:!0;return this.current_filename&&e&&this.thumbnailBig}get bigThumbnailBackground(){var e;return(e=this.$store.state.gui.uiSettings.bigThumbnailBackground)!=null?e:At}get thumbnailStyle(){let e={height:"200px"};return this.printstatusThumbnailZoom?this.focus&&this.thumbnailBlurHeight>0&&(e.height="".concat(this.thumbnailBlurHeight,"px")):e.height="100%",At.toLowerCase()!==this.bigThumbnailBackground.toLowerCase()&&(e.backgroundColor=this.bigThumbnailBackground),e}get styleThumbnailOverlay(){const e={backgroundColor:"rgba(0, 0, 0, 0.3)",backdropFilter:"blur(3px)"};return this.$vuetify.theme.dark||(e.backgroundColor="rgba(255, 255, 255, 0.3)"),e}get thumbnailBlurHeight(){return this.thumbnailFactor===0?0:(this.thumbnailBigHeight*this.thumbnailFactor).toFixed()}get printstatusThumbnailZoom(){var e;return(e=this.$store.state.gui.uiSettings.printstatusThumbnailZoom)!=null?e:!0}calcThumbnailFactor(){var t,r;const e=(r=(t=this.$refs.bigThumbnail)==null?void 0:t.$el.clientWidth)!=null?r:0;return(!e||!this.thumbnailBigWidth)&&(this.thumbnailFactor=0),this.thumbnailFactor=e/this.thumbnailBigWidth}handleResize(){this.$nextTick(()=>{this.calcThumbnailFactor()})}};n0([Ke(200)],Jl.prototype,"handleResize",1);Jl=n0([S({})],Jl);var qE=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.current_filename?t("div",{staticClass:"statusPanel-printstatus-thumbnail"},[e.boolBigThumbnail?t(nu,{ref:"bigThumbnail",staticClass:"d-flex align-end statusPanel-big-thumbnail",style:e.thumbnailStyle,attrs:{src:e.thumbnailBig,tabindex:"-1",height:"200"},on:{focus:function(r){e.focus=!0},blur:function(r){e.focus=!1}}},[t(gt,{staticClass:"white--text py-2 px-2",style:e.styleThumbnailOverlay},[t(x,[t(b,[t("span",{staticClass:"subtitle-2 text-truncate px-0 text--disabled d-block"},[t(_,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiFileOutline))]),e._v(" "+e._s(e.current_filename)+" ")],1)])],1)],1)],1):[t(Ee,[t(x,[t(b,{class:e.thumbnailSmall?"py-3":"py-2",style:e.thumbnailSmall?"width: calc(100% - 40px);":""},[t("span",{staticClass:"subtitle-2 text-truncate d-block px-0 text--disabled"},[t(_,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiFileOutline))]),e._v(" "+e._s(e.current_filename)+" ")],1)]),e.thumbnailSmall?t(b,{staticClass:"pa-2 pl-0 col-auto"},[e.thumbnailSmall&&e.thumbnailBig?[t(de,{attrs:{top:"","content-class":"tooltip__content-opacity1"},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("vue-load-image",{staticClass:"d-flex"},[t("img",e._g(e._b({attrs:{slot:"image",src:e.thumbnailSmall,width:"32",height:"32",alt:e.current_filename},slot:"image"},"img",i,!1),r)),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(ot,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(_,[e._v(e._s(e.mdiFile))])],1)])]}}],null,!1,4119397588)},[t("span",[t("img",{attrs:{src:e.thumbnailBig,width:"250",alt:e.current_filename}})])])]:e.thumbnailSmall?[t("vue-load-image",[t("img",{attrs:{slot:"image",src:e.thumbnailSmall,width:"32",height:"32",alt:e.current_filename},slot:"image"}),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(ot,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(_,[e._v(e._s(e.mdiFile))])],1)])]:e._e()],2):e._e()],1)],1)],t("resize-observer",{on:{notify:e.handleResize}})],2):e._e()},XE=[],YE=E(Jl,qE,XE,!1,null,"2a5f7305");const JE=YE.exports;var KE=Object.defineProperty,QE=Object.getOwnPropertyDescriptor,Au=(s,e,t,r)=>{for(var i=r>1?void 0:r?QE(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&KE(e,t,i),i};let Ai=class extends k(L){constructor(){super(...arguments),this.mdiLayersPlus=hm,this.mdiCloseThick=pe,this.type="atLayer",this.layer=0,this.call="PAUSE"}hideDialog(){this.$emit("update:showDialog",!1)}get items(){return[{text:this.$t("Panels.StatusPanel.PauseAtLayer.AtLayer"),value:"atLayer",status:this.existsSetPauseAtLayer},{text:this.$t("Panels.StatusPanel.PauseAtLayer.NextLayer"),value:"nextLayer",status:this.existsSetPauseNextLayer}]}get itemsFiltered(){return this.items.filter(e=>e.status)}get itemsCall(){return[{text:"PAUSE",value:"PAUSE"},{text:"M600",value:"M600"}]}get current_layer(){var e,t,r;return(r=(t=(e=this.$store.state.printer.print_stats)==null?void 0:e.info)==null?void 0:t.current_layer)!=null?r:0}get total_layer(){var e,t,r;return(r=(t=(e=this.$store.state.printer.print_stats)==null?void 0:e.info)==null?void 0:t.total_layer)!=null?r:0}get macros(){var e;return(e=this.$store.getters["printer/getMacros"])!=null?e:[]}get existsSetPauseAtLayer(){return this.macros.findIndex(e=>e.name==="SET_PAUSE_AT_LAYER")!==-1}get existsSetPauseNextLayer(){return this.macros.findIndex(e=>e.name==="SET_PAUSE_NEXT_LAYER")!==-1}get macroSetPrintStatsInfo(){var e;return(e=this.$store.state.printer["gcode_macro SET_PRINT_STATS_INFO"])!=null?e:{}}get macroSettingsPauseAtLayer(){var e;return(e=this.macroSetPrintStatsInfo.pause_at_layer)!=null?e:{}}get macroSettingsPauseAtLayerEnable(){var e;return(e=this.macroSettingsPauseAtLayer.enable)!=null?e:!1}get macroSettingsPauseAtLayerCall(){var e;return(e=this.macroSettingsPauseAtLayer.call)!=null?e:"PAUSE"}get macroSettingsPauseAtLayerLayer(){var e;return(e=this.macroSettingsPauseAtLayer.layer)!=null?e:0}get macroSettingsPauseNextLayer(){var e;return(e=this.macroSetPrintStatsInfo.pause_next_layer)!=null?e:{}}get macroSettingsPauseNextLayerEnable(){var e;return(e=this.macroSettingsPauseNextLayer.enable)!=null?e:!1}get macroSettingsPauseNextLayerCall(){var e;return(e=this.macroSettingsPauseNextLayer.call)!=null?e:"PAUSE"}sendCommand(){if(this.type==="atLayer"){this.doSend("SET_PAUSE_AT_LAYER ENABLE=1 LAYER=".concat(this.layer," MACRO=").concat(this.call)),this.hideDialog();return}this.doSend("SET_PAUSE_NEXT_LAYER ENABLE=1 MACRO=".concat(this.call)),this.hideDialog()}doSend(e){this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e})}showDialogChanged(e){e&&(this.layer=this.current_layer+1,this.type="atLayer",this.existsSetPauseAtLayer||(this.type="nextLayer"))}typeChanged(e){e==="atLayer"?this.call=this.macroSettingsPauseAtLayerCall:e==="nextLayer"&&(this.call=this.macroSettingsPauseNextLayerCall)}};Au([w({required:!0})],Ai.prototype,"showDialog",2);Au([he("showDialog")],Ai.prototype,"showDialogChanged",1);Au([he("type")],Ai.prototype,"typeChanged",1);Ai=Au([S({components:{Panel:U,StatusPanelExcludeObjectDialogList:r0,StatusPanelExcludeObjectDialogMap:t0}})],Ai);var e9=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(le,{attrs:{width:"400",persistent:"",fullscreen:e.isMobile},model:{value:e.showDialog,callback:function(r){e.showDialog=r},expression:"showDialog"}},[t(U,{attrs:{title:e.$t("Panels.StatusPanel.PauseAtLayer.PauseAtLayer").toString(),icon:e.mdiLayersPlus,"card-class":"pause-at-layer-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.hideDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[e.type==="atLayer"&&e.macroSettingsPauseAtLayerEnable?t(x,[t(b,[t(it,{attrs:{text:"",type:"warning",border:"left"}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.PauseAtLayer.DescriptionPauseAtLayerActive",{layer:e.macroSettingsPauseAtLayerLayer,call:e.macroSettingsPauseAtLayerCall}))+" ")])],1)],1):e._e(),e.type==="nextLayer"&&e.macroSettingsPauseNextLayerEnable?t(x,[t(b,[t(it,{attrs:{text:"",type:"warning",border:"left"}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.PauseAtLayer.DescriptionPauseNextLayerActive",{call:e.macroSettingsPauseAtLayerCall}))+" ")])],1)],1):e._e(),t(x,[t(b,[t(ke,{attrs:{items:e.itemsFiltered,label:e.$t("Panels.StatusPanel.PauseAtLayer.Type"),outlined:"","hide-details":""},model:{value:e.type,callback:function(r){e.type=r},expression:"type"}})],1),e.type==="atLayer"?t(b,[t(se,{attrs:{label:e.$t("Panels.StatusPanel.PauseAtLayer.Layer"),outlined:"","hide-details":""},model:{value:e.layer,callback:function(r){e.layer=r},expression:"layer"}})],1):e._e()],1),t(x,{staticClass:"mt-0"},[t(b,[t(ke,{attrs:{items:e.itemsCall,label:e.$t("Panels.StatusPanel.PauseAtLayer.Call"),outlined:"","hide-details":""},model:{value:e.call,callback:function(r){e.call=r},expression:"call"}})],1)],1)],1),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.hideDialog}},[e._v(e._s(e.$t("Panels.StatusPanel.PauseAtLayer.Abort")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.sendCommand}},[e._v(" "+e._s(e.$t("Panels.StatusPanel.PauseAtLayer.Accept"))+" ")])],1)],1)],1)],1)},t9=[],s9=E(Ai,e9,t9,!1,null,"52377d67");const r9=s9.exports;var i9=Object.defineProperty,n9=Object.getOwnPropertyDescriptor,a0=(s,e,t,r)=>{for(var i=r>1?void 0:r?n9(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&i9(e,t,i),i};let Kl=class extends k(L){constructor(){super(...arguments),this.mdiAlertOutline=Jn,this.mdiCloseCircle=ol,this.mdiDotsVertical=mu,this.mdiFileDocumentMultipleOutline=Ga,this.mdiInformation=Ht,this.mdiHistory=nv,this.mdiMessageProcessingOutline=rS,this.mdiSpeedometer=Cv,this.mdiTrayFull=kv,this.showCancelJobDialog=!1,this.boolShowObjects=!1,this.boolShowPauseAtLayer=!1,this.activeTab="files",this.lastFilename=""}get jobs(){return this.$store.getters["server/jobQueue/getJobs"]}get jobsCount(){return this.$store.getters["server/jobQueue/getJobsCount"]}get jobQueueBadgeColor(){return this.jobsCount>0?"primary darken-2":"grey darken-2"}get current_filename(){var s,e;return(e=(s=this.$store.state.printer.print_stats)==null?void 0:s.filename)!=null?e:""}get current_file(){var s;return(s=this.$store.state.printer.current_file)!=null?s:{}}get printPercent(){return Math.floor(this.$store.getters["printer/getPrintPercent"]*100)}get printerStateOutput(){var s;if(this.printer_state!==""){const e=(s=this.$store.state.printer.idle_timeout)==null?void 0:s.state;return this.printer_state==="standby"&&e==="Printing"?"Busy":this.printer_state!==""&&["paused","printing"].includes(this.printer_state)?this.printPercent+"% "+this.printer_state.charAt(0).toUpperCase()+this.printer_state.slice(1):this.printer_state.charAt(0).toUpperCase()+this.printer_state.slice(1)}return this.$t("Panels.StatusPanel.Unknown")}get toolbarButtons(){return[{text:this.$t("Panels.StatusPanel.PausePrint"),color:"warning",icon:Zp,loadingName:"statusPrintPause",status:()=>["printing"].includes(this.printer_state),click:this.btnPauseJob},{text:this.$t("Panels.StatusPanel.ResumePrint"),color:"success",icon:nn,loadingName:"statusPrintResume",status:()=>["paused"].includes(this.printer_state),click:this.btnResumeJob},{text:this.$t("Panels.StatusPanel.CancelPrint"),color:"error",icon:$v,loadingName:"statusPrintCancel",status:()=>this.$store.state.gui.uiSettings.displayCancelPrint?["paused","printing"].includes(this.printer_state):["paused"].includes(this.printer_state),click:this.btnCancelJob},{text:this.$t("Panels.StatusPanel.ExcludeObject.ExcludeObject"),color:"warning",icon:cl,loadingName:"excludeObjectButton",status:()=>this.multiFunctionButton||this.printing_objects.length<2?!1:["paused","printing"].includes(this.printer_state),click:this.btnExcludeObject},{text:this.$t("Panels.StatusPanel.PauseAtLayer.PauseAtLayer"),color:"warning",icon:hm,loadingName:"pauseAtLayer",status:()=>this.multiFunctionButton||!this.displayPauseAtLayerButton?!1:["paused","printing"].includes(this.printer_state),click:this.btnPauseAtLayer},{text:this.$t("Panels.StatusPanel.ClearPrintStats"),color:"primary",icon:G_,loadingName:"statusPrintClear",status:()=>["error","complete","cancelled"].includes(this.printer_state),click:this.btnClearJob},{text:this.$t("Panels.StatusPanel.ReprintJob"),color:"primary",icon:Xp,loadingName:"statusPrintReprint",status:()=>["error","complete","cancelled"].includes(this.printer_state),click:this.btnReprintJob}]}get filteredToolbarButtons(){return this.toolbarButtons.filter(s=>s.status())}get printing_objects(){var s,e;return(e=(s=this.$store.state.printer.exclude_object)==null?void 0:s.objects)!=null?e:[]}get display_message(){var s,e;return(e=(s=this.$store.state.printer.display_status)==null?void 0:s.message)!=null?e:null}get print_stats_message(){var s,e;return(e=(s=this.$store.state.printer.print_stats)==null?void 0:s.message)!=null?e:null}get layer_count(){var s,e,t;return(t=(e=(s=this.$store.state.printer.print_stats)==null?void 0:s.info)==null?void 0:e.total_layer)!=null?t:null}get multiFunctionMenuButtons(){return[{text:this.$t("Panels.StatusPanel.ExcludeObject.ExcludeObject"),loadingName:"excludeObjectButton",icon:cl,status:()=>this.printing_objects.length>1,disabled:()=>["paused","printing"].includes(this.printer_state),click:this.btnExcludeObject},{text:this.$t("Panels.StatusPanel.PauseAtLayer.PauseAtLayer"),loadingName:"pauseAtLayer",icon:hm,status:()=>this.displayPauseAtLayerButton,disabled:()=>["paused","printing"].includes(this.printer_state),click:this.btnPauseAtLayer}]}get multiFunctionMenuButtonsFiltered(){return this.multiFunctionMenuButtons.filter(s=>s.status())}get multiFunctionButton(){return["paused","printing"].includes(this.printer_state)?this.multiFunctionMenuButtonsFiltered.length>1:!1}get macros(){var s;return(s=this.$store.getters["printer/getMacros"])!=null?s:[]}get existsSetPauseAtLayer(){return this.macros.findIndex(s=>s.name==="SET_PAUSE_AT_LAYER")!==-1}get existsSetPauseNextLayer(){return this.macros.findIndex(s=>s.name==="SET_PAUSE_NEXT_LAYER")!==-1}get displayPauseAtLayerButton(){return this.layer_count!==null&&(this.existsSetPauseAtLayer||this.existsSetPauseNextLayer)}get displayFilesTab(){var e;return((e=this.$store.state.gui.uiSettings.dashboardFilesLimit)!=null?e:5)>0}get displayHistoryTab(){var e;return((e=this.$store.state.gui.uiSettings.dashboardHistoryLimit)!=null?e:5)>0}mounted(){this.current_filename!==""&&(this.activeTab="status"),this.displayFilesTab||(this.activeTab="history"),this.displayHistoryTab||(this.activeTab="jobqueue")}current_filenameChanged(s){s===""?this.activeTab="files":this.lastFilename!==s&&(this.activeTab="status"),this.lastFilename=s}clearDisplayMessage(){this.$socket.emit("printer.gcode.script",{script:"M117"})}updateShowDialog(s){this.boolShowObjects=s}btnPauseJob(){this.$socket.emit("printer.print.pause",{},{loading:"statusPrintPause"})}btnResumeJob(){this.$socket.emit("printer.print.resume",{},{loading:"statusPrintResume"})}btnExcludeObject(){this.boolShowObjects=!0}btnPauseAtLayer(){this.boolShowPauseAtLayer=!0}btnCancelJob(){if(this.$store.state.gui.uiSettings.confirmOnCancelJob){this.showCancelJobDialog=!0;return}this.cancelJob()}cancelJob(){this.showCancelJobDialog=!1,this.$socket.emit("printer.print.cancel",{},{loading:"statusPrintCancel"})}btnClearJob(){this.$socket.emit("printer.gcode.script",{script:"SDCARD_RESET_FILE"},{loading:"statusPrintClear"})}btnReprintJob(){this.$socket.emit("printer.print.start",{filename:this.current_filename},{loading:"statusPrintReprint"})}};a0([he("current_filename")],Kl.prototype,"current_filenameChanged",1);Kl=a0([S({components:{CancelJobDialog:Ub,KlippyStatePanel:so,MinSettingsPanel:yf,Panel:U,StatusPanelExcludeObject:zE,StatusPanelGcodefiles:Kb,StatusPanelHistory:xE,StatusPanelJobqueue:zb,StatusPanelPrintstatus:dE,StatusPanelPrintstatusThumbnail:JE,StatusPanelPauseAtLayerDialog:r9}})],Kl);var a9=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(yf),t(so),e.klipperReadyForGui?t(U,{attrs:{icon:e.mdiInformation,title:e.printerStateOutput,collapsible:!0,"card-class":"status-panel"},scopedSlots:e._u([{key:"icon",fn:function(){return[["paused","printing"].includes(e.printer_state)?t(ot,{staticClass:"mr-3",attrs:{rotate:-90,size:30,width:5,value:e.printPercent,color:"primary"}}):e._e()]},proxy:!0},{key:"buttons",fn:function(){return[e._l(e.filteredToolbarButtons,function(r){return t(g,{key:r.loadingName,attrs:{color:r.color,loading:e.loadings.includes(r.loadingName),icon:"",tile:""},on:{click:r.click}},[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:n}){return[t(_,e._g(e._b({},"v-icon",n,!1),i),[e._v(e._s(r.icon))])]}}],null,!0)},[t("span",[e._v(e._s(r.text))])])],1)}),e.multiFunctionButton?t(ye,{staticClass:"pa-0",attrs:{left:"","offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiDotsVertical))])],1)]}}],null,!1,2883138713)},[t(Me,{attrs:{dense:""}},e._l(e.multiFunctionMenuButtonsFiltered,function(r,i){return t(J,{key:"multiFunction_"+i},[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(n){return r.click()}}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(r.icon))]),e._v(" "+e._s(r.text)+" ")],1)],1)}),1)],1):e._e()]},proxy:!0}],null,!1,3390704979)},[t("status-panel-printstatus-thumbnail"),t("status-panel-exclude-object",{attrs:{"show-dialog":e.boolShowObjects},on:{"update:showDialog":[function(r){e.boolShowObjects=r},e.updateShowDialog],"update:show-dialog":function(r){e.boolShowObjects=r}}}),t("status-panel-pause-at-layer-dialog",{attrs:{"show-dialog":e.boolShowPauseAtLayer},on:{"update:showDialog":function(r){e.boolShowPauseAtLayer=r},"update:show-dialog":function(r){e.boolShowPauseAtLayer=r}}}),e.print_stats_message?[t(Ee,[t(x,[t(b,{staticClass:"py-2"},[t("span",{staticClass:"subtitle-2 px-0 text--disabled"},[t(_,{staticClass:"mr-2 mt-1 float-left",attrs:{color:"warning",small:""}},[e._v(" "+e._s(e.mdiAlertOutline)+" ")]),e._v(" "+e._s(e.print_stats_message)+" ")],1)])],1)],1),t(I,{staticClass:"mt-0 mb-0"})]:e._e(),e.display_message?[t(Ee,[t(x,{staticClass:"flex-nowrap"},[t(b,{staticClass:"py-2",staticStyle:{"min-width":"0"}},[t("span",{staticClass:"subtitle-2 px-0 text--disabled"},[t(_,{staticClass:"mr-2 mt-1 float-left",attrs:{small:""}},[e._v(e._s(e.mdiMessageProcessingOutline))]),e._v(" "+e._s(e.display_message)+" ")],1)]),t(b,{staticClass:"col-auto py-2"},[t(_,{staticClass:"text--disabled cursor-pointer",attrs:{small:""},on:{click:e.clearDisplayMessage}},[e._v(" "+e._s(e.mdiCloseCircle)+" ")])],1)],1)],1),t(I,{staticClass:"mt-0 mb-0"})]:e._e(),t(rl,{attrs:{"fixed-tabs":""},model:{value:e.activeTab,callback:function(r){e.activeTab=r},expression:"activeTab"}},[e.current_filename?t(Dr,{attrs:{href:"#status"}},[t(_,[e._v(e._s(e.mdiSpeedometer))])],1):e._e(),e.displayFilesTab?t(Dr,{attrs:{href:"#files"}},[t(_,[e._v(e._s(e.mdiFileDocumentMultipleOutline))])],1):e._e(),e.displayHistoryTab?t(Dr,{attrs:{href:"#history"}},[t(_,[e._v(e._s(e.mdiHistory))])],1):e._e(),t(Dr,{attrs:{href:"#jobqueue"}},[t(O_,{attrs:{color:e.jobQueueBadgeColor,content:e.jobsCount.toString(),inline:!0}},[t(_,{attrs:{color:"disabled"}},[e._v(e._s(e.mdiTrayFull))])],1)],1)],1),t(I,{staticClass:"my-0"}),t(T_,{staticClass:"_border-radius",model:{value:e.activeTab,callback:function(r){e.activeTab=r},expression:"activeTab"}},[e.current_filename?t(Ys,{attrs:{value:"status"}},[t("status-panel-printstatus")],1):e._e(),e.displayFilesTab?t(Ys,{attrs:{value:"files"}},[t("status-panel-gcodefiles")],1):e._e(),e.displayHistoryTab?t(Ys,{attrs:{value:"history"}},[t("status-panel-history")],1):e._e(),t(Ys,{attrs:{value:"jobqueue"}},[t("status-panel-jobqueue")],1)],1)],2):e._e(),t(Ub,{attrs:{"show-dialog":e.showCancelJobDialog},on:{"cancel-job":e.cancelJob,close:function(r){e.showCancelJobDialog=!1}}})],1)},o9=[],l9=E(Kl,a9,o9,!1,null,"4d139ef7");const jn=l9.exports;var c9=Object.getOwnPropertyDescriptor,u9=(s,e,t,r)=>{for(var i=r>1?void 0:r?c9(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Fi=class extends y{get extruders(){return this.$store.getters["printer/getExtruders"]}get activeExtruder(){var s;return(s=this.$store.state.printer.toolhead)==null?void 0:s.extruder}get activeExtruderSettings(){var s,e;return(e=(s=this.$store.state.printer.configfile)==null?void 0:s.settings)==null?void 0:e[this.activeExtruder]}get filamentDiameter(){var s,e;return(e=(s=this.activeExtruderSettings)==null?void 0:s.filament_diameter)!=null?e:1.75}get nozzleDiameter(){var s,e;return(e=(s=this.activeExtruderSettings)==null?void 0:s.nozzle_diameter)!=null?e:.4}get feedamount(){return parseFloat(this.$store.state.gui.control.extruder.feedamount)}get feedrate(){return parseFloat(this.$store.state.gui.control.extruder.feedrate)}get extrudeFactor(){var s,e,t;return(t=(e=(s=this.$store.state.printer)==null?void 0:s.gcode_move)==null?void 0:e.extrude_factor)!=null?t:1}get extrudePossible(){return this.$store.getters["printer/getExtrudePossible"]}get minExtrudeTemp(){var s,e;return(e=(s=this.activeExtruderSettings)==null?void 0:s.min_extrude_temp)!=null?e:170}};Fi=u9([S],Fi);var d9=Object.getOwnPropertyDescriptor,m9=(s,e,t,r)=>{for(var i=r>1?void 0:r?d9(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let ah=class extends k(L,Fi){constructor(){super(...arguments),this.mdiDiameterVariant=Hw,this.mdiInformationOutline=ov}get showEstimatedExtrusion(){var e;return(e=this.$store.state.gui.control.extruder.showEstimatedExtrusionInfo)!=null?e:!0}get extrudedLength(){return Math.round(this.feedamount*this.extrudeFactor*(Math.pow(this.filamentDiameter,2)/Math.pow(this.nozzleDiameter,2)))}get speed_factor(){var e,t;return(t=(e=this.$store.state.printer.gcode_move)==null?void 0:e.speed_factor)!=null?t:1}get volumetricFlow(){return Math.round(Math.pow(this.filamentDiameter/2,2)*Math.PI*this.feedrate*this.speed_factor*10)/10}get showTooltip(){return this.speed_factor!==1||this.extrudeFactor!==1}get speedFactorOutput(){return(this.speed_factor*100).toFixed(0)}get extrudeFactorOutput(){return(this.extrudeFactor*100).toFixed(0)}};ah=m9([S({})],ah);var h9=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.showEstimatedExtrusion?t(Ee,{staticClass:"pa-0 ma-0 pb-2"},[t("div",{staticClass:"text--disabled text-caption font-weight-light d-flex justify-center",staticStyle:{"font-size":"0.8em"}},[t("span",[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.EstimatedExtrusion"))+" ~ "+e._s(e.extrudedLength)+" mm @ "+e._s(e.volumetricFlow)+" mm³/s - "),t(_,{staticStyle:{opacity:"0.4","margin-top":"-2px"},attrs:{"x-small":""}},[e._v(" "+e._s(e.mdiDiameterVariant)+" ")]),e._v(" "+e._s(e.nozzleDiameter)+" mm "),e.showTooltip?t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(_,e._g(e._b({attrs:{small:"",color:"warning"}},"v-icon",i,!1),r),[e._v(" "+e._s(e.mdiInformationOutline)+" ")])]}}],null,!1,3195294278)},[t("span",[e.speed_factor!==1?t("div",[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.SpeedFactor"))+": "+e._s(e.speedFactorOutput)+" % ")]):e._e(),e.extrudeFactor!==1?t("div",[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtrusionFactor"))+": "+e._s(e.extrudeFactorOutput)+" % ")]):e._e()])]):e._e()],1)])]):e._e()},p9=[],f9=E(ah,h9,p9,!1,null,null);const g9=f9.exports;var _9=Object.defineProperty,v9=Object.getOwnPropertyDescriptor,xt=(s,e,t,r)=>{for(var i=r>1?void 0:r?v9(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&_9(e,t,i),i};let dt=class extends k(L){constructor(){super(...arguments),this.mdiRestart=_r,this.mdiChevronUp=du,this.mdiChevronDown=fr,this.value="0",this.error=!1,this.invalidChars=["e","E","+"]}created(){this.value=this.target.toString()}updateTarget(){this.value=this.target.toString()}incrementValue(){this.inputValue+this.step*this.spinnerFactorthis.min?this.value=(Math.round((this.inputValue-this.step*this.spinnerFactor)*10**this.dec)/10**this.dec).toString():this.value=this.min.toString(),this.submit()}resetToDefault(){this.value=this.defaultValue.toString(),this.submit()}submit(){this.invalidInput||this.$emit("submit",{name:this.param,value:this.inputValue})}checkInvalidChars(s){this.min>=0&&this.invalidChars.push("-"),this.invalidChars.includes(s.key)&&s.preventDefault()}get inputValue(){return this.value.toString()===""?0:parseFloat(this.value.replace(",","."))}get invalidInput(){return this.inputErrors.length>0}get inputErrors(){if(!this.outputErrorMsg)return[];const s=[];return this.max===null&&this.inputValuethis.max||this.inputValue=e.max&&e.max!==null||e.error||e.disabled,icon:"",plain:"",small:""},on:{click:e.incrementValue}},[t(_,[e._v(e._s(e.mdiChevronUp))])],1),t(g,{staticClass:"mb-n3",attrs:{disabled:e.value<=e.min||e.error||e.disabled,icon:"",plain:"",small:""},on:{click:e.decrementValue}},[t(_,[e._v(e._s(e.mdiChevronDown))])],1)],1)]},proxy:!0}:null],null,!0),model:{value:e.value,callback:function(r){e.value=r},expression:"value"}})],1)},y9=[],C9=E(dt,b9,y9,!1,null,"bfe880f2");const He=C9.exports;var $9=Object.defineProperty,x9=Object.getOwnPropertyDescriptor,st=(s,e,t,r)=>{for(var i=r>1?void 0:r?x9(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&$9(e,t,i),i};let qe=class extends k(L){constructor(){super(...arguments),this.mdiRestart=_r,this.mdiLockOutline=fu,this.mdiLockOpenVariantOutline=uv,this.mdiMinus=mv,this.mdiPlus=qp,this.isLocked=!1,this.invalidChars=["e","E","+"],this.value=0,this.numInput=0,this.startValue=0,this.processedMax=100,this.dynamicStep=50}created(){this.value=this.target*this.multi,this.numInput=this.value,this.startValue=this.target*this.multi,this.dynamicStep=Math.floor(this.max/2),this.value>=this.processedMax&&(this.processedMax=(Math.ceil(this.value/this.dynamicStep)+1)*this.dynamicStep)}lockSlidersChanged(){this.isLocked=this.lockSliders&&this.isTouchDevice}startLockTimer(){let s=this.lockSlidersDelay;!this.isTouchDevice||!this.lockSliders||s<=0||(this.timeout=setTimeout(()=>this.isLocked=!0,s*1e3))}resetLockTimer(){clearTimeout(this.timeout)}get lockSliders(){return this.$store.state.gui.uiSettings.lockSlidersOnTouchDevices}get lockSlidersDelay(){return this.$store.state.gui.uiSettings.lockSlidersDelay}get colorBar(){return this.max=this.processedMax&&(this.processedMax=this.value+this.dynamicStep)}valueChanged(s){this.numInput=s}targetChanged(s){this.value=Math.round(s*this.multi),this.dynamicRange&&this.value>=this.processedMax&&(this.processedMax=this.value+this.dynamicStep)}maxChanged(s){this.processedMax=s>this.value?s:Math.ceil(this.value/this.dynamicStep)*this.dynamicStep}checkInvalidChars(s){this.min>=0&&this.invalidChars.push("-"),this.invalidChars.includes(s.key)&&s.preventDefault()}errors(){const s=[];return this.numInput.toString()===""&&s.push(this.$t("App.NumberInput.NoEmptyAllowedError")),this.numInputthis.max||this.numInput0||(!this.dynamicRange&&this.numInput>this.max?this.value=this.max:this.value=this.numInput,this.sendCmd())}resetSlider(){this.value=this.defaultValue,this.numInput=this.defaultValue,this.processedMax=this.max,this.value>=this.processedMax&&(this.processedMax=(Math.ceil(this.value/this.dynamicStep)+1)*this.dynamicStep),this.sendCmd()}sendCmd(){const s=(Math.max(1,this.value)*this.attributeScale).toFixed(0),e="".concat(this.command," ").concat(this.attributeName).concat(s);this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e}),this.startLockTimer()}decrement(){this.value=this.value>this.min?Math.round(this.value-this.step):this.min,this.sendCmd()}increment(){this.value=this.value0,suffix:e.unit,type:"number","hide-spin-buttons":"","hide-details":"",outlined:"",dense:""},on:{blur:function(r){e.numInput=e.value},focus:function(r){return r.target.select()},keydown:e.checkInvalidChars},scopedSlots:e._u([e.value!==e.defaultValue||e.value!==e.numInput?{key:"append",fn:function(){return[t(_,{attrs:{small:""},on:{click:e.resetSlider}},[e._v(e._s(e.mdiRestart))])]},proxy:!0}:null],null,!0),model:{value:e.numInput,callback:function(r){e.numInput=r},expression:"numInput"}}):e._e()],1)],1),t("transition",{attrs:{name:"fade"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.errors().length>0,expression:"errors().length > 0"}],staticClass:"_error-msg d-flex justify-end"},[e._v(" "+e._s(e.errors()[0])+" ")])]),t(Z,{staticClass:"pa-0 d-flex align-center"},[e.lockSliders&&e.isTouchDevice?t(g,{staticClass:"_lock-button",attrs:{plain:"",small:"",icon:""},on:{click:function(r){e.isLocked=!e.isLocked}}},[t(_,{attrs:{small:"",color:e.isLocked?"red":""}},[e._v(" "+e._s(e.isLocked?e.mdiLockOutline:e.mdiLockOpenVariantOutline)+" ")])],1):e._e(),t(Lr,{directives:[{name:"touch",rawName:"v-touch",value:{start:e.resetLockTimer},expression:"{ start: resetLockTimer }"}],attrs:{disabled:e.isLocked,min:e.min,max:e.processedMax,color:e.colorBar,"hide-details":""},on:{change:e.changeSlider},scopedSlots:e._u([{key:"prepend",fn:function(){return[t(_,{attrs:{disabled:e.isLocked||e.value<=e.min},on:{click:e.decrement}},[e._v(e._s(e.mdiMinus))])]},proxy:!0},{key:"append",fn:function(){return[t(_,{attrs:{disabled:e.isLocked||e.value>=e.max&&!e.dynamicRange},on:{click:e.increment}},[e._v(" "+e._s(e.mdiPlus)+" ")])]},proxy:!0}]),model:{value:e.value,callback:function(r){e.value=r},expression:"value"}})],1)],1)],1)},S9=[],P9=E(qe,w9,S9,!1,null,"0e034f01");const Fu=P9.exports;var D9=Object.defineProperty,T9=Object.getOwnPropertyDescriptor,o0=(s,e,t,r)=>{for(var i=r>1?void 0:r?T9(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&D9(e,t,i),i};let Ql=class extends k(L,Fi){constructor(){super(...arguments),this.mdiArrowDownBold=pw,this.mdiArrowUpBold=gw,this.mdiPrinter3dNozzle=Us}get feedamounts(){var e,t;return(t=(e=this.$store.state.gui.control.extruder)==null?void 0:e.feedamounts)!=null?t:[]}get feedrates(){var e,t;return(t=(e=this.$store.state.gui.control.extruder)==null?void 0:e.feedrates)!=null?t:[]}get feedamountsSorted(){return[...this.feedamounts].sort((e,t)=>t-e)}get feedratesSorted(){return[...this.feedrates].sort((e,t)=>t-e)}setFeedamount(e){this.$store.dispatch("gui/saveSetting",{name:"control.extruder.feedamount",value:e.value})}setFeedrate(e){this.$store.dispatch("gui/saveSetting",{name:"control.extruder.feedrate",value:e.value})}get maxExtrudeOnlyDistance(){var e,t;return(t=(e=this.activeExtruderSettings)==null?void 0:e.max_extrude_only_distance)!=null?t:50}get tooLargeExtrusion(){return this.feedamount*this.extrudeFactor>this.maxExtrudeOnlyDistance}get existsClientLinearMoveMacro(){var t,r,i;return"_CLIENT_LINEAR_MOVE"in((i=(r=(t=this.$store.state.printer)==null?void 0:t.gcode)==null?void 0:r.commands)!=null?i:{})}onMaxExtrudeOnlyDistanceChange(){this.feedamount>this.maxExtrudeOnlyDistance&&this.setFeedamount({value:this.maxExtrudeOnlyDistance})}sendRetract(){this.sendCommand(this.feedamount*-1,"btnRetract")}sendExtrude(){this.sendCommand(this.feedamount,"btnExtrude")}sendCommand(e,t){let r="SAVE_GCODE_STATE NAME=_ui_extrude\nM83\nG1 E".concat(e," F").concat(this.feedrate*60,"\nRESTORE_GCODE_STATE NAME=_ui_extrude");this.existsClientLinearMoveMacro&&(r="_CLIENT_LINEAR_MOVE E=".concat(e," F=").concat(this.feedrate*60)),this.$store.dispatch("server/addEvent",{message:r,type:"command"}),this.$socket.emit("printer.gcode.script",{script:r},{loading:t})}};o0([he("maxExtrudeOnlyDistance",{immediate:!0})],Ql.prototype,"onMaxExtrudeOnlyDistanceChange",1);Ql=o0([S({components:{NumberInput:He,Responsive:tt,ToolSlider:Fu}})],Ql);var O9=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(tt,{attrs:{breakpoints:{large:r=>r.width>=640}},scopedSlots:e._u([{key:"default",fn:function({el:r}){return[t(Ee,[t(x,[t(b,[t(He,{attrs:{label:e.$t("Panels.ExtruderControlPanel.FilamentLength"),param:"feedamount",target:e.feedamount,disabled:e.printerIsPrintingOnly,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":100,step:.01,min:.01,max:e.maxExtrudeOnlyDistance,dec:2,unit:"mm","submit-on-blur":!0},on:{submit:e.setFeedamount}}),t(Wt,{staticClass:"_btn-group pt-3"},e._l(e.feedamountsSorted,function(i){return t(g,{key:i,staticClass:"_btn-qs flex-grow-1 px-0",attrs:{disabled:e.printerIsPrintingOnly,dense:""},on:{click:function(n){return e.setFeedamount({value:i})}}},[e._v(" "+e._s(i)+" ")])}),1)],1),t(b,[t(He,{attrs:{label:e.$t("Panels.ExtruderControlPanel.ExtrusionFeedrate"),param:"feedrate",target:e.feedrate,disabled:e.printerIsPrintingOnly,"has-spinner":!0,"output-error-msg":!0,"spinner-factor":100,step:.01,min:.01,max:null,dec:2,type:"number",unit:"mm/s"},on:{submit:e.setFeedrate}}),t(Wt,{staticClass:"_btn-group pt-3"},e._l(e.feedratesSorted,function(i){return t(g,{key:i,staticClass:"_btn-qs flex-grow-1 px-0",attrs:{disabled:e.printerIsPrintingOnly,dense:""},on:{click:function(n){return e.setFeedrate({value:i})}}},[e._v(" "+e._s(i)+" ")])}),1)],1),r.is.large?t(b,{staticClass:"col-3 d-flex align-center flex-column justify-center"},[t(de,{attrs:{left:"",disabled:e.extrudePossible&&!e.tooLargeExtrusion,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function({on:i}){return[t("div",e._g({staticClass:"mb-4"},i),[t(g,{staticClass:"_btn-extruder-cmd",attrs:{loading:e.loadings.includes("btnRetract"),disabled:!e.extrudePossible||e.tooLargeExtrusion||e.printerIsPrintingOnly,small:""},on:{click:function(n){return e.sendRetract()}}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiArrowUpBold))]),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Retract"))+" ")],1)],1)]}}],null,!0)},[t("span",{directives:[{name:"show",rawName:"v-show",value:!e.extrudePossible,expression:"!extrudePossible"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")]),t("span",{directives:[{name:"show",rawName:"v-show",value:e.tooLargeExtrusion,expression:"tooLargeExtrusion"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.TooLargeExtrusion"))+" "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Requested"))+": "+e._s(e.feedamount*e.extrudeFactor)+" mm "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Allowed"))+": "+e._s(e.maxExtrudeOnlyDistance)+" mm ")])]),t(de,{attrs:{left:"",disabled:e.extrudePossible&&!e.tooLargeExtrusion,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function({on:i}){return[t("div",e._g({},i),[t(g,{staticClass:"_btn-extruder-cmd",attrs:{loading:e.loadings.includes("btnExtrude"),disabled:!e.extrudePossible||e.tooLargeExtrusion||e.printerIsPrintingOnly,small:""},on:{click:function(n){return e.sendExtrude()}}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiArrowDownBold))]),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Extrude"))+" ")],1)],1)]}}],null,!0)},[t("span",{directives:[{name:"show",rawName:"v-show",value:!e.extrudePossible,expression:"!extrudePossible"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")]),t("span",{directives:[{name:"show",rawName:"v-show",value:e.tooLargeExtrusion,expression:"tooLargeExtrusion"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.TooLargeExtrusion"))+" "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Requested"))+": "+e._s(e.feedamount*e.extrudeFactor)+" mm "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Allowed"))+": "+e._s(e.maxExtrudeOnlyDistance)+" mm ")])])],1):e._e()],1),r.is.large?e._e():t(x,[t(b,{staticClass:"pa-0"},[t("div",{staticClass:"d-flex justify-space-around"},[t("div",{staticClass:"d-flex align-center"},[t(de,{attrs:{top:"",disabled:e.extrudePossible&&!e.tooLargeExtrusion,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function({on:i}){return[t("div",e._g({staticClass:"pt-1 pb-2 px-3"},i),[t(g,{staticClass:"_btn-extruder-cmd",attrs:{loading:e.loadings.includes("btnRetract"),disabled:!e.extrudePossible||e.tooLargeExtrusion||e.printerIsPrintingOnly,small:""},on:{click:function(n){return e.sendRetract()}}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiArrowUpBold))]),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Retract"))+" ")],1)],1)]}}],null,!0)},[t("span",{directives:[{name:"show",rawName:"v-show",value:!e.extrudePossible,expression:"!extrudePossible"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")]),t("span",{directives:[{name:"show",rawName:"v-show",value:e.tooLargeExtrusion,expression:"tooLargeExtrusion"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.TooLargeExtrusion"))+" "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Requested"))+": "+e._s(e.feedamount*e.extrudeFactor)+" mm "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Allowed"))+": "+e._s(e.maxExtrudeOnlyDistance)+" mm ")])]),t(de,{attrs:{top:"",disabled:e.extrudePossible&&!e.tooLargeExtrusion,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function({on:i}){return[t("div",e._g({staticClass:"pt-1 pb-2 px-3"},i),[t(g,{staticClass:"_btn-extruder-cmd",attrs:{loading:e.loadings.includes("btnExtrude"),disabled:!e.extrudePossible||e.tooLargeExtrusion||e.printerIsPrintingOnly,small:""},on:{click:function(n){return e.sendExtrude()}}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiArrowDownBold))]),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Extrude"))+" ")],1)],1)]}}],null,!0)},[t("span",{directives:[{name:"show",rawName:"v-show",value:!e.extrudePossible,expression:"!extrudePossible"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")]),t("span",{directives:[{name:"show",rawName:"v-show",value:e.tooLargeExtrusion,expression:"tooLargeExtrusion"}]},[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.TooLargeExtrusion"))+" "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Requested"))+": "+e._s(e.feedamount*e.extrudeFactor)+" mm "),t("br"),e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.Allowed"))+": "+e._s(e.maxExtrudeOnlyDistance)+" mm ")])])],1)])])],1)],1),t(g9)]}}])})},M9=[],k9=E(Ql,O9,M9,!1,null,"1b2327b2");const E9=k9.exports;var L9=Object.defineProperty,A9=Object.getOwnPropertyDescriptor,l0=(s,e,t,r)=>{for(var i=r>1?void 0:r?A9(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&L9(e,t,i),i};let ec=class extends k(L,Je){get retractLength(){var s,e,t;return Math.floor(((t=(e=(s=this.$store.state.printer)==null?void 0:s.firmware_retraction)==null?void 0:e.retract_length)!=null?t:0)*100)/100}get retractSpeed(){var s,e,t;return Math.trunc((t=(e=(s=this.$store.state.printer)==null?void 0:s.firmware_retraction)==null?void 0:e.retract_speed)!=null?t:20)}get unretractExtraLength(){var s,e,t;return Math.floor(((t=(e=(s=this.$store.state.printer)==null?void 0:s.firmware_retraction)==null?void 0:e.unretract_extra_length)!=null?t:0)*100)/100}get unretractSpeed(){var s,e,t;return Math.trunc((t=(e=(s=this.$store.state.printer)==null?void 0:s.firmware_retraction)==null?void 0:e.unretract_speed)!=null?t:10)}get defaultRetractLength(){var s,e,t,r,i;return Math.floor(((i=(r=(t=(e=(s=this.$store.state.printer)==null?void 0:s.configfile)==null?void 0:e.settings)==null?void 0:t.firmware_retraction)==null?void 0:r.retract_length)!=null?i:0)*100)/100}get defaultRetractSpeed(){var s,e,t,r,i;return Math.trunc((i=(r=(t=(e=(s=this.$store.state.printer)==null?void 0:s.configfile)==null?void 0:e.settings)==null?void 0:t.firmware_retraction)==null?void 0:r.retract_speed)!=null?i:20)}get defaultUnretractExtraLength(){var s,e,t,r,i;return Math.floor(((i=(r=(t=(e=(s=this.$store.state.printer)==null?void 0:s.configfile)==null?void 0:e.settings)==null?void 0:t.firmware_retraction)==null?void 0:r.unretract_extra_length)!=null?i:0)*100)/100}get defaultUnretractSpeed(){var s,e,t,r,i;return Math.trunc((i=(r=(t=(e=(s=this.$store.state.printer)==null?void 0:s.configfile)==null?void 0:e.settings)==null?void 0:t.firmware_retraction)==null?void 0:r.unretract_speed)!=null?i:0)}sendCmd(s){const e="SET_RETRACTION ".concat(s.name,"=").concat(s.value);this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e})}};l0([Ke(500)],ec.prototype,"sendCmd",1);ec=l0([S({components:{Panel:U,NumberInput:He,Responsive:tt}})],ec);var F9=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.existsFirmwareRetraction?t("div",[t(Ee,[t(tt,{attrs:{breakpoints:{small:r=>r.width<=350}},scopedSlots:e._u([{key:"default",fn:function({el:r}){return[t(x,[t(b,{class:{"col-12":r.is.small}},[t(He,{attrs:{label:e.$t("Panels.ExtruderControlPanel.FirmwareRetractionSettings.RetractLength"),param:"RETRACT_LENGTH",target:e.retractLength,"default-value":e.defaultRetractLength,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":10,step:.01,min:0,max:null,dec:2,unit:"mm"},on:{submit:e.sendCmd}})],1),t(b,{class:{"col-12":r.is.small}},[t(He,{attrs:{label:e.$t("Panels.ExtruderControlPanel.FirmwareRetractionSettings.RetractSpeed"),param:"RETRACT_SPEED",target:e.retractSpeed,"default-value":e.defaultRetractSpeed,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":5,step:1,min:1,max:null,dec:0,unit:"mm/s"},on:{submit:e.sendCmd}})],1)],1),t(x,[t(b,{class:{"col-12":r.is.small}},[t(He,{attrs:{label:e.$t("Panels.ExtruderControlPanel.FirmwareRetractionSettings.UnretractExtraLength"),param:"UNRETRACT_EXTRA_LENGTH",target:e.unretractExtraLength,"default-value":e.defaultUnretractExtraLength,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":10,step:.01,min:0,max:null,dec:2,unit:"mm"},on:{submit:e.sendCmd}})],1),t(b,{class:{"col-12":r.is.small}},[t(He,{attrs:{label:e.$t("Panels.ExtruderControlPanel.FirmwareRetractionSettings.UnretractSpeed"),param:"UNRETRACT_SPEED",target:e.unretractSpeed,"default-value":e.defaultUnretractSpeed,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":5,step:1,min:1,max:null,dec:0,unit:"mm/s"},on:{submit:e.sendCmd}})],1)],1)]}}],null,!1,259554286)})],1)],1):e._e()},R9=[],H9=E(ec,F9,R9,!1,null,null);const j9=H9.exports;var I9=Object.defineProperty,N9=Object.getOwnPropertyDescriptor,c0=(s,e,t,r)=>{for(var i=r>1?void 0:r?N9(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&I9(e,t,i),i};let tc=class extends k(L){constructor(){super(...arguments),this.mdiRestart=_r,this.extruders=[],this.selectedExtruder=""}resetToActiveExtruder(){var e;this.selectedExtruder=(e=this.$store.state.printer.toolhead)==null?void 0:e.extruder}get allExtruders(){return Object.keys(this.$store.state.printer).forEach(e=>{e.startsWith("extruder")&&!this.extruders.includes(e)&&this.extruders.push(e)}),this.extruders.length===1&&this.resetToActiveExtruder(),this.extruders}get activeExtruder(){var e;return this.resetToActiveExtruder(),(e=this.$store.state.printer.toolhead)==null?void 0:e.extruder}get pressureAdvance(){var e,t,r;return Math.floor(((r=(t=(e=this.$store.state.printer)==null?void 0:e[this.selectedExtruder])==null?void 0:t.pressure_advance)!=null?r:0)*1e3)/1e3}get smoothTime(){var e,t,r;return Math.floor(((r=(t=(e=this.$store.state.printer)==null?void 0:e[this.selectedExtruder])==null?void 0:t.smooth_time)!=null?r:.04)*1e3)/1e3}get defaultPressureAdvance(){var e,t,r,i;return Math.floor(((i=(r=(t=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:t[this.selectedExtruder])==null?void 0:r.pressure_advance)!=null?i:0)*1e3)/1e3}get defaultSmoothTime(){var e,t,r,i;return Math.floor(((i=(r=(t=(e=this.$store.state.printer.configfile)==null?void 0:e.settings)==null?void 0:t[this.selectedExtruder])==null?void 0:r.pressure_advance_smooth_time)!=null?i:.04)*1e3)/1e3}sendCmd(e){const t="SET_PRESSURE_ADVANCE EXTRUDER=".concat(this.selectedExtruder," ").concat(e.name,"=").concat(e.value);this.$store.dispatch("server/addEvent",{message:t,type:"command"}),this.$socket.emit("printer.gcode.script",{script:t})}};c0([Ke(500)],tc.prototype,"sendCmd",1);tc=c0([S({components:{NumberInput:He,Panel:U,Responsive:tt}})],tc);var V9=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(tt,{attrs:{breakpoints:{small:r=>r.width<=350,medium:r=>r.width>350&&r.width<=500}},scopedSlots:e._u([{key:"default",fn:function({el:r}){return[t(Ee,[t(x,[e.allExtruders.length>1?t(b,{class:{"col-12":r.is.small||r.is.medium}},[t("div",{staticClass:"d-flex align-center"},[e.selectedExtruder!==e.activeExtruder?t(g,{attrs:{icon:"",plain:""},on:{click:e.resetToActiveExtruder}},[t(_,[e._v(e._s(e.mdiRestart))])],1):e._e(),t(ke,{attrs:{label:e.$t("Panels.ExtruderControlPanel.PressureAdvanceSettings.Extruder"),items:e.allExtruders,value:e.activeExtruder,"hide-details":"",outlined:"",dense:""},model:{value:e.selectedExtruder,callback:function(i){e.selectedExtruder=i},expression:"selectedExtruder"}})],1)]):e._e(),t(b,{class:{"col-12":r.is.small}},[t(He,{attrs:{label:e.$t("Panels.ExtruderControlPanel.PressureAdvanceSettings.Advance"),param:"ADVANCE",target:e.pressureAdvance,"default-value":e.defaultPressureAdvance,extruder:e.selectedExtruder,"output-error-msg":!0,"has-spinner":!0,min:0,max:null,step:.001,dec:3,unit:"s"},on:{submit:e.sendCmd}})],1),t(b,{class:{"col-12":r.is.small}},[t(He,{attrs:{label:e.$t("Panels.ExtruderControlPanel.PressureAdvanceSettings.SmoothTime"),param:"SMOOTH_TIME",target:e.smoothTime,"default-value":e.defaultSmoothTime,extruder:e.selectedExtruder,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":10,min:0,max:.2,step:.001,dec:3,unit:"s"},on:{submit:e.sendCmd}})],1)],1)],1)]}}])})},B9=[],U9=E(tc,V9,B9,!1,null,null);const W9=U9.exports;var z9=Object.getOwnPropertyDescriptor,G9=(s,e,t,r)=>{for(var i=r>1?void 0:r?z9(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let oh=class extends k(L,Fi){constructor(){super(...arguments),this.mdiPrinter3dNozzleOutline=pS}};oh=G9([S({})],oh);var Z9=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Ee,[t(Fu,{attrs:{label:e.$t("Panels.ExtruderControlPanel.ExtrusionFactor"),icon:e.mdiPrinter3dNozzleOutline,target:e.extrudeFactor,min:1,max:200,multi:100,step:1,"has-input-field":!0,command:"M221","attribute-name":"S"}})],1)},q9=[],X9=E(oh,Z9,q9,!1,null,null);const Y9=X9.exports;var J9=Object.defineProperty,K9=Object.getOwnPropertyDescriptor,u0=(s,e,t,r)=>{for(var i=r>1?void 0:r?K9(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&J9(e,t,i),i};let sc=class extends k(L,Je){get macro(){var t;const e=Object.keys(this.$store.state.printer).find(r=>{var i;return r.toLowerCase()==="gcode_macro ".concat((i=this.name)==null?void 0:i.toLowerCase())});if(e)return(t=this.$store.state.printer[e])!=null?t:{}}get active(){var e,t;return(t=(e=this.macro)==null?void 0:e.active)!=null?t:!1}get color(){var t,r,i,n,a,o;if(this.spool)return(r=(t=this.spool.filament)==null?void 0:t.color_hex)!=null?r:"000000";const e=(o=(a=(i=this.macro)==null?void 0:i.color)!=null?a:(n=this.macro)==null?void 0:n.colour)!=null?o:null;return e===""||e==="undefined"?null:e}get spoolId(){var e,t;return(t=(e=this.macro)==null?void 0:e.spool_id)!=null?t:null}get spool(){var t,r;return(r=((t=this.$store.state.server.spoolman.spools)!=null?t:[]).find(i=>i.id===this.spoolId))!=null?r:null}get primaryColor(){return this.$store.state.gui.uiSettings.primary}get primaryTextColor(){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(this.primaryColor);if(e){const t=parseInt(e[1],16)*.2126,r=parseInt(e[2],16)*.7152,i=parseInt(e[3],16)*.0722;return(t+r+i)/255>.7?"#222":"#fff"}return"#ffffff"}get warningColor(){var e,t,r,i,n;return(n=(i=(r=(t=(e=this.$vuetify)==null?void 0:e.theme)==null?void 0:t.currentTheme)==null?void 0:r.warning)==null?void 0:i.toString())!=null?n:"#ff8300"}get buttonStyle(){let e="";return this.active&&(e=this.homedAxes.includes("xyz")?this.primaryColor:this.warningColor),{color:this.active?this.primaryTextColor:"","background-color":e}}get dotStyle(){return{"border-color":this.active?this.primaryTextColor:"","background-color":"#"+this.color}}changeTool(){this.doSend(this.name.toUpperCase())}};u0([w({type:String})],sc.prototype,"name",2);sc=u0([S({components:{}})],sc);var Q9=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(g,{staticClass:"flex-grow-1 px-0",style:e.buttonStyle,attrs:{disabled:e.printerIsPrintingOnly,dense:""},on:{click:e.changeTool}},[e.color!=null?t("span",{staticClass:"_extruderColorState mr-1",style:e.dotStyle}):e._e(),e._v(" "+e._s(e.name.toUpperCase())+" ")])},e7=[],t7=E(sc,Q9,e7,!1,null,"81ee7357");const s7=t7.exports;var r7=Object.getOwnPropertyDescriptor,i7=(s,e,t,r)=>{for(var i=r>1?void 0:r?r7(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let lh=class extends k(L,Je){constructor(){super(...arguments),this.mdiPrinter3dNozzle=Us}get rows(){const e=this.toolchangeMacros.length,t=Math.ceil(e/Math.ceil(e/6));let r=[];for(let i=0;i{for(var i=r>1?void 0:r?c7(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let ch=class extends k(L,Je){constructor(){super(...arguments),this.mdiCog=ss}get showTools(){var s;return(s=this.$store.state.gui.view.extruder.showTools)!=null?s:!0}set showTools(s){this.$store.dispatch("gui/saveSetting",{name:"view.extruder.showTools",value:s})}get showExtrusionFactor(){var s;return(s=this.$store.state.gui.view.extruder.showExtrusionFactor)!=null?s:!0}set showExtrusionFactor(s){this.$store.dispatch("gui/saveSetting",{name:"view.extruder.showExtrusionFactor",value:s})}get existsPressureAdvance(){return!(this.$store.getters["printer/getExtruderSteppers"].length>0)}get showPressureAdvance(){var s;return(s=this.$store.state.gui.view.extruder.showPressureAdvance)!=null?s:!0}set showPressureAdvance(s){this.$store.dispatch("gui/saveSetting",{name:"view.extruder.showPressureAdvance",value:s})}get showFirmwareRetraction(){var s;return(s=this.$store.state.gui.view.extruder.showFirmwareRetraction)!=null?s:!0}set showFirmwareRetraction(s){this.$store.dispatch("gui/saveSetting",{name:"view.extruder.showFirmwareRetraction",value:s})}get showExtruderControl(){var s;return(s=this.$store.state.gui.view.extruder.showExtruderControl)!=null?s:!0}set showExtruderControl(s){this.$store.dispatch("gui/saveSetting",{name:"view.extruder.showExtruderControl",value:s})}};ch=u7([S],ch);var d7=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(ye,{attrs:{"offset-y":!0,left:!0,"close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",i,!1),r),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Me,[e.toolchangeMacros.length?t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ExtruderControlPanel.Tools")},model:{value:e.showTools,callback:function(r){e.showTools=r},expression:"showTools"}})],1):e._e(),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ExtruderControlPanel.ExtrusionFactor")},model:{value:e.showExtrusionFactor,callback:function(r){e.showExtrusionFactor=r},expression:"showExtrusionFactor"}})],1),e.existsPressureAdvance?t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ExtruderControlPanel.PressureAdvance")},model:{value:e.showPressureAdvance,callback:function(r){e.showPressureAdvance=r},expression:"showPressureAdvance"}})],1):e._e(),e.existsFirmwareRetraction?t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ExtruderControlPanel.FirmwareRetraction")},model:{value:e.showFirmwareRetraction,callback:function(r){e.showFirmwareRetraction=r},expression:"showFirmwareRetraction"}})],1):e._e(),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ExtruderControlPanel.ExtruderControl")},model:{value:e.showExtruderControl,callback:function(r){e.showExtruderControl=r},expression:"showExtruderControl"}})],1)],1)],1)},m7=[],h7=E(ch,d7,m7,!1,null,null);const p7=h7.exports;var f7=Object.defineProperty,g7=Object.getOwnPropertyDescriptor,un=(s,e,t,r)=>{for(var i=r>1?void 0:r?g7(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&f7(e,t,i),i};let mr=class extends k(L){constructor(){super(...arguments),this.DEFAULT_DESC="G-Code macro",this.mdiCloseThick=pe,this.mdiMenuDown=gr,this.mdiRefresh=an,this.paramArray=[],this.params={},this.paramsDialog=!1}get klipperMacro(){return this.$store.getters["printer/getMacro"](this.macro.name)}get isGcodeStyle(){return this.macro.name.match(/[G|M]\d{1,3}/gm)}get paramCols(){if(this.isMobile)return 1;const s=Math.ceil(this.paramArray.length/5);return s>4?4:s}get paramCssCols(){return 12/this.paramCols}get paramsOverlayWidth(){return 200*this.paramCols}get hasDescription(){return this.klipperMacro.description&&this.klipperMacro.description!==this.DEFAULT_DESC}klipperMacroChange(){this.refreshParams()}refreshParams(){var s;this.paramArray.splice(0,this.paramArray.length),this.params={},((s=this.klipperMacro)==null?void 0:s.params)!==null&&Object.keys(this.klipperMacro.params).forEach(e=>{e.startsWith("_")||(this.paramArray.push(e),this.params[e]={type:this.klipperMacro.params[e].type,default:this.klipperMacro.params[e].default,value:""})})}doSendMacro(s){this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s},{loading:"macro_"+s})}sendWithParams(){let s=[];this.paramArray.forEach(t=>{var i;let r=(i=this.params[t].value)==null?void 0:i.toString().trim();if(this.params[t].value!==null&&r!==""){let n=t;r!=null&&r.includes(" ")&&(r='"'.concat(r,'"')),n+=this.isGcodeStyle?r:"=".concat(r),s.push(n)}});const e=this.macro.name+" "+s.join(" ");this.doSendMacro(e)}mounted(){this.refreshParams()}};un([w({required:!0})],mr.prototype,"macro",2);un([w({default:"primary"})],mr.prototype,"color",2);un([w({default:null})],mr.prototype,"alias",2);un([w({default:!1})],mr.prototype,"disabled",2);un([he("klipperMacro")],mr.prototype,"klipperMacroChange",1);mr=un([S({components:{Panel:U}})],mr);var _7=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Wt,{staticClass:"d-inline-block"},[t(de,{attrs:{disabled:!e.hasDescription,top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({class:e.paramArray.length?"macroWithParameters":"",attrs:{small:"",color:e.color,loading:e.loadings.includes("macro_"+e.macro.name),disabled:e.disabled},on:{click:function(n){return e.doSendMacro(e.macro.name)}}},"v-btn",i,!1),r),[e._v(" "+e._s(e.alias?e.alias:e.macro.name.replace(/_/g," "))+" ")])]}}])},[t("span",[e._v(e._s(e.klipperMacro.description))])]),e.paramArray.length?[e.isMobile?[t(g,{staticClass:"minwidth-0 px-1 btnMacroMenu",attrs:{disabled:e.disabled,color:e.color,small:""},on:{click:function(r){e.paramsDialog=!0}}},[t(_,[e._v(e._s(e.mdiMenuDown))])],1),t(le,{model:{value:e.paramsDialog,callback:function(r){e.paramsDialog=r},expression:"paramsDialog"}},[t(U,{attrs:{title:e.macro.name,"card-class":"macro-params-mobile-".concat(e.macro.name),"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.paramsDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}],null,!1,2576054633)},[t(Z,[t(x,e._l(e.paramArray,function(r,i){return t(b,{key:"param_mobile_"+i,attrs:{cols:6}},[t(se,{attrs:{label:r,placeholder:e.params[r].default,"persistent-placeholder":!0,"hide-details":"",outlined:"",dense:"",clearable:"","clear-icon":e.mdiRefresh},on:{keyup:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.sendWithParams.apply(null,arguments)}},model:{value:e.params[r].value,callback:function(n){e.$set(e.params[r],"value",n)},expression:"params[name].value"}})],1)}),1)],1),t(oe,{staticClass:"px-4 pb-4"},[t(g,{staticClass:"text-uppercase",attrs:{color:"primary",block:""},on:{click:e.sendWithParams}},[e._v(" "+e._s(e.$t("Panels.MacrosPanel.Send"))+" ")])],1)],1)],1)]:t(ye,{attrs:{"offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"minwidth-0 px-1 btnMacroMenu",attrs:{disabled:e.disabled,color:e.color,small:""}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiMenuDown))])],1)]}}],null,!1,3313662284)},[t(Pe,{attrs:{"max-width":e.paramsOverlayWidth}},[t(Z,{staticClass:"py-2"},[t(x,{staticClass:"my-2"},e._l(e.paramArray,function(r,i){return t(b,{key:"param_"+i,attrs:{cols:e.paramCssCols}},[t(se,{attrs:{label:r,placeholder:e.params[r].default,"persistent-placeholder":!0,"hide-details":"",outlined:"",dense:"",clearable:"","clear-icon":e.mdiRefresh},on:{keyup:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.sendWithParams.apply(null,arguments)}},model:{value:e.params[r].value,callback:function(n){e.$set(e.params[r],"value",n)},expression:"params[name].value"}})],1)}),1),t(x,{staticClass:"my-2"},[t(b,{staticClass:"py-0"},[t(g,{staticClass:"text-uppercase",attrs:{color:"primary",block:""},on:{click:e.sendWithParams}},[e._v(" "+e._s(e.$t("Panels.MacrosPanel.Send"))+" ")])],1)],1)],1)],1)],1)]:e._e()],2)},v7=[],b7=E(mr,_7,v7,!1,null,"a84fe633");const Ks=b7.exports;var y7=Object.getOwnPropertyDescriptor,C7=(s,e,t,r)=>{for(var i=r>1?void 0:r?y7(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let uh=class extends k(L,Je,Fi){constructor(){super(...arguments),this.mdiPrinter3dNozzle=Us,this.mdiDotsVertical=mu,this.heatWaitGcodes=["printer.extruder.can_extrude","TEMPERATURE_WAIT","M109"]}get showPanel(){return this.klipperReadyForGui&&this.extruders.length>0}get macros(){return this.$store.getters["printer/getMacros"]}get loadFilamentMacro(){const e=["LOAD_FILAMENT","FILAMENT_LOAD"];return this.macros.find(t=>e.includes(t.name.toUpperCase()))}get unloadFilamentMacro(){const e=["UNLOAD_FILAMENT","FILAMENT_UNLOAD"];return this.macros.find(t=>e.includes(t.name.toUpperCase()))}get purgeFilamentMacro(){const e=["PURGE_FILAMENT","FILAMENT_PURGE"];return this.macros.find(t=>e.includes(t.name.toUpperCase()))}get cleanNozzleMacro(){const e=["CLEAN_NOZZLE","NOZZLE_CLEAN","WIPE_NOZZLE","NOZZLE_WIPE"];return this.macros.find(t=>e.includes(t.name.toUpperCase()))}get canExecuteLoadMacro(){return this.extrudePossible?!0:this.heatWaitGcodes.some(e=>{var t;return(t=this.loadFilamentMacro)==null?void 0:t.prop.gcode.includes(e)})}get canExecuteUnloadMacro(){return this.extrudePossible?!0:this.heatWaitGcodes.some(e=>{var t;return(t=this.unloadFilamentMacro)==null?void 0:t.prop.gcode.includes(e)})}get canExecutePurgeMacro(){return this.extrudePossible?!0:this.heatWaitGcodes.some(e=>{var t;return(t=this.purgeFilamentMacro)==null?void 0:t.prop.gcode.includes(e)})}get showFilamentMacros(){return this.loadFilamentMacro!==void 0||this.unloadFilamentMacro!==void 0||this.purgeFilamentMacro!==void 0||this.cleanNozzleMacro!==void 0}get showTools(){var e;return this.toolchangeMacros.length<1?!1:(e=this.$store.state.gui.view.extruder.showTools)!=null?e:!0}get showExtrusionFactor(){var e;return(e=this.$store.state.gui.view.extruder.showExtrusionFactor)!=null?e:!0}get existsPressureAdvance(){return!(this.$store.getters["printer/getExtruderSteppers"].length>0)}get showPressureAdvance(){var e;return this.existsPressureAdvance?(e=this.$store.state.gui.view.extruder.showPressureAdvance)!=null?e:!0:!1}get showFirmwareRetraction(){var e;return this.existsFirmwareRetraction?(e=this.$store.state.gui.view.extruder.showFirmwareRetraction)!=null?e:!0:!1}get showExtruderControl(){var e;return(e=this.$store.state.gui.view.extruder.showExtruderControl)!=null?e:!0}};uh=C7([S({components:{Panel:U}})],uh);var $7=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.showPanel?t(U,{attrs:{icon:e.mdiPrinter3dNozzle,title:e.$t("Panels.ExtruderControlPanel.Headline"),collapsible:!0,"card-class":"extruder-control-panel"},scopedSlots:e._u([{key:"buttons",fn:function(){return[e.showFilamentMacros?t(ye,{attrs:{"offset-y":!0,"close-on-content-click":!1,left:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiDotsVertical))])],1)]}}],null,!1,2883138713)},[t(Me,{attrs:{dense:""}},[e.unloadFilamentMacro?t(J,[t(de,{attrs:{top:"",disabled:e.canExecuteUnloadMacro,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function({on:r}){return[t("div",e._g({},r),[t(Ks,{attrs:{macro:e.unloadFilamentMacro,alias:e.$t("Panels.ExtruderControlPanel.UnloadFilament"),disabled:!e.canExecuteUnloadMacro||e.printerIsPrintingOnly,color:"#272727"}})],1)]}}],null,!1,3835858943)},[t("span",[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")])])],1):e._e(),e.loadFilamentMacro?t(J,[t(de,{attrs:{top:"",disabled:e.canExecuteLoadMacro,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function({on:r}){return[t("div",e._g({},r),[t(Ks,{attrs:{macro:e.loadFilamentMacro,alias:e.$t("Panels.ExtruderControlPanel.LoadFilament"),disabled:!e.canExecuteLoadMacro||e.printerIsPrintingOnly,color:"#272727"}})],1)]}}],null,!1,1294394980)},[t("span",[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")])])],1):e._e(),e.purgeFilamentMacro?t(J,[t(de,{attrs:{top:"",disabled:e.canExecutePurgeMacro,color:"secondary"},scopedSlots:e._u([{key:"activator",fn:function({on:r}){return[t("div",e._g({},r),[t(Ks,{attrs:{macro:e.purgeFilamentMacro,alias:e.$t("Panels.ExtruderControlPanel.PurgeFilament"),disabled:!e.canExecutePurgeMacro||e.printerIsPrintingOnly,color:"#272727"}})],1)]}}],null,!1,2789275863)},[t("span",[e._v(" "+e._s(e.$t("Panels.ExtruderControlPanel.ExtruderTempTooLow"))+" "+e._s(e.minExtrudeTemp)+" °C ")])])],1):e._e(),e.cleanNozzleMacro?t(J,[t(Ks,{attrs:{macro:e.cleanNozzleMacro,alias:e.$t("Panels.ExtruderControlPanel.CleanNozzle"),disabled:e.printerIsPrintingOnly,color:"#272727"}})],1):e._e()],1)],1):e._e(),t(p7)]},proxy:!0}],null,!1,40833120)},[e.showTools&&e.toolchangeMacros.length?t(l7):e._e(),e.showExtrusionFactor?[e.showTools?t(I):e._e(),t(Y9)]:e._e(),e.showPressureAdvance?[e.showTools||e.showExtrusionFactor?t(I):e._e(),t(W9)]:e._e(),e.showFirmwareRetraction?[e.showTools||e.showExtrusionFactor||e.showPressureAdvance?t(I):e._e(),t(j9)]:e._e(),e.showExtruderControl?[e.showTools||e.showExtrusionFactor||e.showPressureAdvance||e.showFirmwareRetraction?t(I):e._e(),t(E9)]:e._e()],2):e._e()},x7=[],w7=E(uh,$7,x7,!1,null,null);const S7=w7.exports;var P7=Object.defineProperty,D7=Object.getOwnPropertyDescriptor,d0=(s,e,t,r)=>{for(var i=r>1?void 0:r?D7(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&P7(e,t,i),i};let rc=class extends k(L){constructor(){super(...arguments),this.mdiEngine=ev}get toolhead(){var e,t;return(t=(e=this.$store.state.printer)==null?void 0:e.toolhead)!=null?t:{}}get configPrinter(){var e,t,r,i;return(i=(r=(t=(e=this.$store.state.printer)==null?void 0:e.configfile)==null?void 0:t.settings)==null?void 0:r.printer)!=null?i:{}}get velocity(){var e;return Math.trunc((e=this.toolhead.max_velocity)!=null?e:300)}get accel(){var e;return Math.trunc((e=this.toolhead.max_accel)!=null?e:3e3)}get accelToDecel(){var e;return Math.trunc((e=this.toolhead.max_accel_to_decel)!=null?e:this.accel/2)}get minimumCruiseRatio(){var t;const e=(t=this.toolhead.minimum_cruise_ratio)!=null?t:null;return e===null?null:Math.round(e*100)}get squareCornerVelocity(){var e;return Math.floor(((e=this.toolhead.square_corner_velocity)!=null?e:8)*10)/10}get defaultVelocity(){var e;return Math.trunc((e=this.configPrinter.max_velocity)!=null?e:300)}get defaultAccel(){var e;return Math.trunc((e=this.configPrinter.max_accel)!=null?e:3e3)}get defaultAccelToDecel(){var e;return Math.trunc((e=this.configPrinter.max_accel_to_decel)!=null?e:1500)}get defaultMinimumCruiseRatio(){var t;const e=(t=this.configPrinter.minimum_cruise_ratio)!=null?t:.5;return Math.round(e*100)}get defaultSquareCornerVelocity(){var t;const e=(t=this.configPrinter.square_corner_velocity)!=null?t:8;return Math.floor(e*10)/10}sendCruiseRatioCmd(e){e.value=e.value/100,this.sendCmd(e)}sendCmd(e){const t="SET_VELOCITY_LIMIT ".concat(e.name,"=").concat(e.value);this.$store.dispatch("server/addEvent",{message:t,type:"command"}),this.$socket.emit("printer.gcode.script",{script:t})}};d0([Ke(500)],rc.prototype,"sendCmd",1);rc=d0([S({components:{NumberInput:He,Panel:U,Responsive:tt}})],rc);var T7=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.klipperReadyForGui?t(U,{attrs:{icon:e.mdiEngine,title:e.$t("Panels.MachineSettingsPanel.Headline"),collapsible:!0,"card-class":"machine-settings-panel"}},[t(tt,{attrs:{breakpoints:{small:r=>r.width<375,medium:r=>r.width>=375}},scopedSlots:e._u([{key:"default",fn:function({el:r}){return[t(Z,{staticClass:"pt-5"},[t(x,[t(b,{class:{"col-12":r.is.small,"col-6":r.is.medium}},[t(He,{attrs:{label:e.$t("Panels.MachineSettingsPanel.MotionSettings.Velocity"),param:"VELOCITY",target:e.velocity,"default-value":e.defaultVelocity,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":5,step:1,min:1,max:null,dec:0,unit:"mm/s"},on:{submit:e.sendCmd}})],1),t(b,{class:{"col-12":r.is.small,"col-6":r.is.medium}},[t(He,{attrs:{label:e.$t("Panels.MachineSettingsPanel.MotionSettings.SquareCornerVelocity"),param:"SQUARE_CORNER_VELOCITY",target:e.squareCornerVelocity,"default-value":e.defaultSquareCornerVelocity,"output-error-msg":!0,"has-spinner":!0,step:.1,min:.1,max:null,dec:1,unit:"mm/s"},on:{submit:e.sendCmd}})],1)],1),t(x,[t(b,{class:{"col-12":r.is.small,"col-6":r.is.medium}},[t(He,{attrs:{label:e.$t("Panels.MachineSettingsPanel.MotionSettings.Acceleration"),param:"ACCEL",target:e.accel,"default-value":e.defaultAccel,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":100,step:1,min:1,max:null,dec:0,unit:"mm/s²"},on:{submit:e.sendCmd}})],1),t(b,{class:{"col-12":r.is.small,"col-6":r.is.medium}},[e.minimumCruiseRatio===null?t(He,{attrs:{label:e.$t("Panels.MachineSettingsPanel.MotionSettings.MaxAccelToDecel"),param:"ACCEL_TO_DECEL",target:e.accelToDecel,"default-value":e.defaultAccelToDecel,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":100,step:1,min:1,max:null,dec:0,unit:"mm/s²"},on:{submit:e.sendCmd}}):t(He,{attrs:{label:e.$t("Panels.MachineSettingsPanel.MotionSettings.MinimumCruiseRatio"),param:"MINIMUM_CRUISE_RATIO",target:e.minimumCruiseRatio,"default-value":e.defaultMinimumCruiseRatio,"output-error-msg":!0,"has-spinner":!0,"spinner-factor":5,step:1,min:0,max:99,dec:0,unit:"%"},on:{submit:e.sendCruiseRatioCmd}})],1)],1)],1)]}}],null,!1,1115546932)})],1):e._e()},O7=[],M7=E(rc,T7,O7,!1,null,null);const k7=M7.exports;var E7=Object.defineProperty,L7=Object.getOwnPropertyDescriptor,m0=(s,e,t,r)=>{for(var i=r>1?void 0:r?L7(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&E7(e,t,i),i};let ic=class extends k(L){constructor(){super(...arguments),this.mdiCodeTags=Qn}get macrogroup(){return this.$store.getters["gui/macros/getMacrogroup"](this.panelId)}get allMacros(){var e;return(e=this.$store.getters["printer/getMacros"])!=null?e:[]}get macros(){var t,r;let e=(r=(t=this.macrogroup)==null?void 0:t.macros)!=null?r:[];return e=e.filter(i=>this.allMacros.find(n=>n.name.toLowerCase()===i.name.toLowerCase())?i.showInStandby&&["standby","cancelled","complete","error"].includes(this.printer_state)||i.showInPause&&this.printer_state==="paused"||i.showInPrinting&&this.printer_state==="printing":!1),e.sort((i,n)=>i.pos-n.pos)}get macrogroupStatus(){return this.macrogroup.showInStandby&&["standby","cancelled","complete","error"].includes(this.printer_state)||this.macrogroup.showInPause&&this.printer_state==="paused"||this.macrogroup.showInPrinting&&this.printer_state==="printing"}getColor(e){return e.color==="group"?this.macrogroup.color==="custom"?this.macrogroup.colorCustom:this.macrogroup.color:e.color}};m0([w({required:!0})],ic.prototype,"panelId",2);ic=m0([S({components:{MacroButton:Ks,Panel:U}})],ic);var A7=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.klipperReadyForGui&&e.macros.length>0&&e.macrogroupStatus?t(U,{attrs:{icon:e.mdiCodeTags,title:e.macrogroup.name,collapsible:!0,"card-class":"macrogroup_"+e.panelId+"_panel"}},[t(Z,{staticClass:"py-2"},[t(x,[t(b,{staticClass:"text-center"},e._l(e.macros,function(r,i){return t(Ks,{key:"macroparam_"+i,staticClass:"mx-1 my-1",attrs:{macro:r,color:e.getColor(r)}})}),1)],1)],1)],1):e._e()},F7=[],R7=E(ic,A7,F7,!1,null,"c11dd985");const H7=R7.exports;var j7=Object.getOwnPropertyDescriptor,I7=(s,e,t,r)=>{for(var i=r>1?void 0:r?j7(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let dh=class extends k(L){constructor(){super(...arguments),this.mdiCodeTags=Qn}get hiddenMacros(){var e,t,r;return((r=(t=(e=this.$store.state.gui)==null?void 0:e.macros)==null?void 0:t.hiddenMacros)!=null?r:[]).map(i=>i.toLowerCase())}get macros(){return this.$store.getters["printer/getMacros"].filter(t=>!this.hiddenMacros.includes(t.name.toLowerCase()))}};dh=I7([S({components:{MacroButton:Ks,Panel:U}})],dh);var N7=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.klipperReadyForGui&&e.macros.length>0?t(U,{attrs:{icon:e.mdiCodeTags,title:e.$t("Panels.MacrosPanel.Headline"),collapsible:!0,"card-class":"macros-panel"}},[t(Z,{staticClass:"py-2"},[t(x,[t(b,{staticClass:"text-center"},e._l(e.macros,function(r,i){return t(Ks,{key:"macro_"+i,staticClass:"mx-1 my-1",attrs:{macro:r,color:"primary"}})}),1)],1)],1)],1):e._e()},V7=[],B7=E(dh,N7,V7,!1,null,null);const U7=B7.exports;var W7=Object.defineProperty,z7=Object.getOwnPropertyDescriptor,h0=(s,e,t,r)=>{for(var i=r>1?void 0:r?z7(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&W7(e,t,i),i};let nc=class extends k(L){get entryStyle(){var e;const s=["ma-0","flex-nowrap"];return s.push((e=this.$store.state.gui.console.entryStyle)!=null?e:"default"),["action","debug"].includes(this.event.type)&&s.push("text--disabled"),s}get entryFormatTime(){return this.formatTime(this.event.date.getTime(),!0)}get messageClass(){const s=["console-message"];return["action","debug"].includes(this.event.type)?s.push("text--disabled"):this.event.message.startsWith("!! ")?s.push("error--text"):s.push("text--primary"),s}get rawOutput(){var s;return(s=this.$store.state.gui.console.rawOutput)!=null?s:!1}commandClick(s){const e=s.target;if(e.localName==="a"&&e.className.indexOf("command")!==-1){const t=e.innerHTML.replace(/
/g,"\n");this.$emit("command-click",t)}}};h0([w({required:!0})],nc.prototype,"event",2);nc=h0([S],nc);var G7=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,{class:e.entryStyle},[t(b,{staticClass:"col-auto pr-0 text--disabled console-time"},[e._v(e._s(e.entryFormatTime))]),e.rawOutput?t(b,{class:e.messageClass,staticStyle:{"min-width":"0"},domProps:{textContent:e._s(e.event.message)},on:{"!click":function(r){return e.commandClick.apply(null,arguments)}}}):t(b,{class:e.messageClass,staticStyle:{"min-width":"0"},domProps:{innerHTML:e._s(e.event.formatMessage)},on:{"!click":function(r){return e.commandClick.apply(null,arguments)}}})],1)},Z7=[],q7=E(nc,G7,Z7,!1,null,"d7ebc5ec");const p0=q7.exports;var X7=Object.defineProperty,Y7=Object.getOwnPropertyDescriptor,wf=(s,e,t,r)=>{for(var i=r>1?void 0:r?Y7(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&X7(e,t,i),i};let pa=class extends y{commandClick(s){this.$emit("command-click",s)}};wf([w({required:!0})],pa.prototype,"events",2);wf([w({required:!1,default:!1})],pa.prototype,"isMini",2);pa=wf([S({components:{ConsoleTableEntry:p0}})],pa);var J7=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{class:"consoleTable "+(e.isMini?"mini":"")},[e.events.length===0?[t(x,{staticClass:"pa-0 ma-0"},[t(b,{staticClass:"text-center py-3"},[e._v(e._s(e.$t("Console.Empty")))])],1)]:e._l(e.events,function(r,i){return t(p0,{key:i,staticClass:"consoleTableRow",attrs:{event:r},on:{"command-click":e.commandClick}})})],2)},K7=[],Q7=E(pa,J7,K7,!1,null,"87e97010");const Ru=Q7.exports;var eL=Object.getOwnPropertyDescriptor,tL=(s,e,t,r)=>{for(var i=r>1?void 0:r?eL(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let fa=class extends y{get helplist(){var t,r,i;const s=(r=(t=this.$store.state.printer.gcode)==null?void 0:t.commands)!=null?r:{},e=[];for(const[n,a]of Object.entries(s))e.push({command:n,help:(i=a.help)!=null?i:""});return e}get consoleDirection(){var s;return(s=this.$store.state.gui.console.direction)!=null?s:"table"}get hideWaitTemperatures(){return this.$store.state.gui.console.hideWaitTemperatures}set hideWaitTemperatures(s){this.$store.dispatch("gui/saveSetting",{name:"console.hideWaitTemperatures",value:s})}get hideTlCommands(){return this.$store.state.gui.console.hideTlCommands}set hideTlCommands(s){this.$store.dispatch("gui/saveSetting",{name:"console.hideTlCommands",value:s})}get customFilters(){var s;return(s=this.$store.state.gui.console.consolefilters)!=null?s:{}}get autoscroll(){var s;return(s=this.$store.state.gui.console.autoscroll)!=null?s:!0}set autoscroll(s){this.$store.dispatch("gui/saveSetting",{name:"console.autoscroll",value:s})}get rawOutput(){var s;return(s=this.$store.state.gui.console.rawOutput)!=null?s:!1}set rawOutput(s){this.$store.dispatch("gui/saveSetting",{name:"console.rawOutput",value:s})}get lastCommands(){var s;return(s=this.$store.state.gui.gcodehistory.entries)!=null?s:[]}toggleFilter(s,e){this.$store.dispatch("gui/console/filterUpdate",{id:s,values:e})}clearConsole(){this.$store.dispatch("gui/console/clear")}};fa=tL([S],fa);var sL=Object.defineProperty,rL=Object.getOwnPropertyDescriptor,f0=(s,e,t,r)=>{for(var i=r>1?void 0:r?rL(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&sL(e,t,i),i};let ac=class extends k(L,fa){constructor(){super(...arguments),this.mdiSend=wS,this.mdiChevronDoubleRight=ww,this.gcode="",this.lastCommandNumber=null,this.items=[]}get rows(){var s,e;return(e=(s=this.gcode)==null?void 0:s.split("\n").length)!=null?e:1}getCurrentLine(){const s=this.gcodeCommandField.$refs.input;return s.value.substring(0,s.selectionStart).split("\n").length}setGcode(s){this.gcode=s,this.$nextTick(()=>{this.gcodeCommandField.focus()})}onKeyUp(s){const e=this.getCurrentLine();this.rows>1&&e>1||(s.preventDefault(),this.lastCommandNumber===null&&this.lastCommands.length?(this.lastCommandNumber=this.lastCommands.length-1,this.gcode=this.lastCommands[this.lastCommandNumber]):this.lastCommandNumber&&this.lastCommandNumber>0&&(this.lastCommandNumber--,this.gcode=this.lastCommands[this.lastCommandNumber]))}onKeyDown(s){const e=this.getCurrentLine();this.rows>e||(s.preventDefault(),this.lastCommandNumber!==null&&(this.lastCommandNumberc.command.startsWith(a));if(o.length===0)return;if((o==null?void 0:o.length)===1){this.updateGcode(o[0].command,i,t);return}const l=o.reduce((c,d)=>M3(c,d.command),o[0].command);let u="";o.forEach(c=>u+='
'.concat(c.command,": ").concat(c.help,"
")),this.$store.dispatch("server/addEvent",{message:u,type:"autocomplete"}),this.updateGcode(l,i,t)}updateGcode(s,e,t){this.gcode=this.gcode.substring(0,e+1)+s+this.gcode.substring(t)}};f0([Ts()],ac.prototype,"gcodeCommandField",2);ac=f0([S],ac);var iL=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(pr,{ref:"gcodeCommandField",staticClass:"gcode-command-field",attrs:{items:e.items,label:e.$t("Panels.MiniconsolePanel.SendCode"),solo:"",autocomplete:"off","no-resize":"","auto-grow":"",rows:e.rows,"hide-details":"",outlined:"",dense:"","prepend-icon":e.isTouchDevice?e.mdiChevronDoubleRight:"","append-icon":e.mdiSend},on:{keydown:[function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:(r.preventDefault(),r.stopPropagation(),e.doSend.apply(null,arguments))},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"up",38,r.key,["Up","ArrowUp"])?null:e.onKeyUp.apply(null,arguments)},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"down",40,r.key,["Down","ArrowDown"])?null:e.onKeyDown.apply(null,arguments)},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"tab",9,r.key,"Tab")?null:e.onAutocomplete.apply(null,arguments)}],"click:prepend":e.onAutocomplete,"click:append":e.doSend},model:{value:e.gcode,callback:function(r){e.gcode=r},expression:"gcode"}})},nL=[],aL=E(ac,iL,nL,!1,null,"6fc1f5a7");const g0=aL.exports;var oL=Object.defineProperty,lL=Object.getOwnPropertyDescriptor,_0=(s,e,t,r)=>{for(var i=r>1?void 0:r?lL(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&oL(e,t,i),i};let oc=class extends k(L){get commands(){var s,e;return(e=(s=this.$store.state.printer.gcode)==null?void 0:s.commands)!=null?e:{}}get commandObject(){var s;return(s=this.commands[this.command])!=null?s:{}}get description(){var s;return(s=this.commandObject.help)!=null?s:null}get twoLine(){return this.description!==null}onCommand(){this.$emit("click-on-command",this.command)}};_0([w({required:!0,type:String})],oc.prototype,"command",2);oc=_0([S],oc);var cL=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(J,{staticClass:"px-0",attrs:{"two-line":e.twoLine}},[t(_t,{staticClass:"px-0"},[t(Ze,{staticClass:"primary--text font-weight-bold cursor-pointer",on:{click:e.onCommand}},[e._v(" "+e._s(e.command)+" ")]),e.description?t(Va,{staticClass:"text-wrap"},[e._v(e._s(e.description))]):e._e()],1)],1)},uL=[],dL=E(oc,cL,uL,!1,null,null);const v0=dL.exports;var mL=Object.defineProperty,hL=Object.getOwnPropertyDescriptor,Hu=(s,e,t,r)=>{for(var i=r>1?void 0:r?hL(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&mL(e,t,i),i};let Ri=class extends k(L){constructor(){super(...arguments),this.cmdListSearch="",this.isOpen=!1,this.mdiHelp=Wp,this.mdiCloseThick=pe}get helplist(){var s,e;return Object.keys((e=(s=this.$store.state.printer.gcode)==null?void 0:s.commands)!=null?e:{})}get helplistFiltered(){return this.helplist.filter(s=>s.includes(this.cmdListSearch.toUpperCase())).sort((s,e)=>s.localeCompare(e))}onCommand(s){this.$emit("onCommand",s),this.isOpen=!1}onIsOpen(s){s||(this.cmdListSearch="")}};Hu([w({required:!1,default:!1})],Ri.prototype,"isMini",2);Hu([w({required:!1,default:!1})],Ri.prototype,"inToolbar",2);Hu([he("isOpen")],Ri.prototype,"onIsOpen",1);Ri=Hu([S({components:{CommandHelpModalEntry:v0,Panel:U}})],Ri);var pL=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{transition:"dialog-bottom-transition","max-width":"600",fullscreen:e.isMobile},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[e.inToolbar?[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",i,!1),r),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiHelp))])],1)]:[t(g,e._g(e._b({staticClass:"gcode-command-btn px-2 minwidth-0",attrs:{color:"lightgray",small:e.isMini}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiHelp))])],1)]]}},{key:"default",fn:function(){return[t(U,{attrs:{title:e.$t("Console.CommandList"),icon:e.mdiHelp,"card-class":"command-help-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.isOpen=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(gt,[t(x,[t(b,[t(se,{attrs:{label:e.$t("Console.Search"),outlined:"","hide-details":"",clearable:"",dense:""},model:{value:e.cmdListSearch,callback:function(r){e.cmdListSearch=r},expression:"cmdListSearch"}})],1)],1)],1),t(I),t("overlay-scrollbars",{staticClass:"command-help-content",class:e.isMobile?"mobileHeight":"height300"},[t(Z,{staticClass:"pt-0"},[t(Me,e._l(e.helplistFiltered,function(r){return t(v0,{key:r,attrs:{command:r},on:{"click-on-command":e.onCommand}})}),1)],1)],1)],1)]},proxy:!0}]),model:{value:e.isOpen,callback:function(r){e.isOpen=r},expression:"isOpen"}})},fL=[],gL=E(Ri,pL,fL,!1,null,"44dffa8a");const ju=gL.exports;var _L=Object.defineProperty,vL=Object.getOwnPropertyDescriptor,io=(s,e,t,r)=>{for(var i=r>1?void 0:r?vL(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&_L(e,t,i),i};let zr=class extends k(L,fa){constructor(){super(...arguments),this.mdiTrashCan=Mv,this.mdiConsoleLine=Ua,this.mdiCog=ss}get consoleHeight(){var e;return(e=this.$store.state.gui.console.height)!=null?e:300}get events(){return this.$store.getters["server/getConsoleEvents"](this.consoleDirection==="table",250)}eventsChanged(){this.consoleDirection==="shell"&&this.autoscroll&&setTimeout(()=>{this.scrollToBottom()},50)}autoscrollChanged(e){e&&this.scrollToBottom()}commandClick(e){this.gcodeCommandField.setGcode(e)}mounted(){this.consoleDirection==="shell"&&this.scrollToBottom()}scrollToBottom(){this.$nextTick(()=>{this.scrollTo(100)})}scrollToTop(){this.$nextTick(()=>{this.scrollTo(0)})}scrollTo(e){if(!this.miniConsoleScroll)return;const t=this.miniConsoleScroll.osInstance();t==null||t.scroll({y:"".concat(e,"%")})}};io([Ts()],zr.prototype,"miniConsoleScroll",2);io([Ts()],zr.prototype,"gcodeCommandField",2);io([he("events")],zr.prototype,"eventsChanged",1);io([he("autoscroll")],zr.prototype,"autoscrollChanged",1);zr=io([S({components:{Panel:U,ConsoleTable:Ru,CommandHelpModal:ju}})],zr);var bL=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.socketIsConnected&&e.klipperState!=="disconnected"?t(U,{attrs:{icon:e.mdiConsoleLine,title:e.$t("Panels.MiniconsolePanel.Headline"),collapsible:!0,"card-class":"miniconsole-panel","hide-buttons-on-collapse":!0},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.clearConsole}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiTrashCan))])],1),t(ju,{attrs:{"in-toolbar":!0},on:{onCommand:function(r){return e.commandClick(r)}}}),t(ye,{attrs:{"offset-y":!0,"close-on-content-click":!1,title:e.$t("Panels.MiniconsolePanel.SetupConsole")},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",i,!1),r),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiCog))])],1)]}}],null,!1,3210076863)},[t(Me,[e.consoleDirection==="shell"?t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.MiniconsolePanel.Autoscroll")},model:{value:e.autoscroll,callback:function(r){e.autoscroll=r},expression:"autoscroll"}})],1):e._e(),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.MiniconsolePanel.HideTemperatures")},model:{value:e.hideWaitTemperatures,callback:function(r){e.hideWaitTemperatures=r},expression:"hideWaitTemperatures"}})],1),e.moonrakerComponents.includes("timelapse")?t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.MiniconsolePanel.HideTimelapse")},model:{value:e.hideTlCommands,callback:function(r){e.hideTlCommands=r},expression:"hideTlCommands"}})],1):e._e(),e._l(e.customFilters,function(r,i){return t(J,{key:i,staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:r.name},on:{change:function(n){return e.toggleFilter(i,r)}},model:{value:r.bool,callback:function(n){e.$set(r,"bool",n)},expression:"filter.bool"}})],1)}),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.MiniconsolePanel.RawOutput")},model:{value:e.rawOutput,callback:function(r){e.rawOutput=r},expression:"rawOutput"}})],1)],2)],1)]},proxy:!0}],null,!1,4082619026)},[t("div",{staticClass:"d-flex flex-column"},[t(Z,{class:e.consoleDirection==="table"?"order-1":"order-2"},[t(g0,{ref:"gcodeCommandField"})],1),t(Z,{class:(e.consoleDirection==="table"?"order-2":"order-1")+" pa-0"},[t(x,[t(b,[t("overlay-scrollbars",{ref:"miniConsoleScroll",style:"height: "+e.consoleHeight+"px;",attrs:{options:{}}},[t(Ru,{ref:"console",attrs:{events:e.events,"is-mini":!0},on:{"command-click":e.commandClick}}),t(I)],1)],1)],1)],1)],1)]):e._e()},yL=[],CL=E(zr,bL,yL,!1,null,"d438c597");const $L=CL.exports;var xL=Object.defineProperty,wL=Object.getOwnPropertyDescriptor,Sf=(s,e,t,r)=>{for(var i=r>1?void 0:r?wL(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&xL(e,t,i),i};let ga=class extends k(L){constructor(){super(...arguments),this.convertName=Ye,this.unitToSymbol=Xv}get sensorData(){const s=this.$store.state.server.sensor.sensors;return this.sensor in s?s[this.sensor].values:{}}get sensorConfig(){var t,r;const s="sensor ".concat(this.sensor),e=(r=(t=this.$store.state.server.config)==null?void 0:t.config)!=null?r:{};return s in e?e[s]:{}}get parameterConfig(){const s="parameter_".concat(this.valueName);return s in this.sensorConfig?this.sensorConfig[s]:{}}get unit(){return"units"in this.parameterConfig?this.parameterConfig.units:null}get value(){return this.valueName in this.sensorData?Math.round(this.sensorData[this.valueName]*1e3)/1e3:"--"}get output(){return this.unit===null?this.value:"".concat(this.value," ").concat(this.unit)}get name(){return this.convertName(this.valueName)}};Sf([w({type:String,required:!0})],ga.prototype,"sensor",2);Sf([w({type:String,required:!0})],ga.prototype,"valueName",2);ga=Sf([S],ga);var SL=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"d-flex w-100 flex-row align-center"},[t(_,{attrs:{small:"",left:""}},[e._v(e._s(e.unitToSymbol(e.unit)))]),t("span",{staticClass:"flex-grow-1"},[e._v(e._s(e.name)+":")]),t("span",[e._v(e._s(e.output))])],1)},PL=[],DL=E(ga,SL,PL,!1,null,null);const b0=DL.exports;var TL=Object.defineProperty,OL=Object.getOwnPropertyDescriptor,y0=(s,e,t,r)=>{for(var i=r>1?void 0:r?OL(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&TL(e,t,i),i};let lc=class extends k(L){constructor(){super(...arguments),this.convertName=Ye}get valueNames(){const s=this.$store.state.server.sensor.sensors;return this.name in s?Object.keys(s[this.name].values):[]}};y0([w({type:String,required:!0})],lc.prototype,"name",2);lc=y0([S({components:{MoonrakerSensorValue:b0}})],lc);var ML=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Ee,{staticClass:"px-0 py-2"},[t(x,[t(b,{staticClass:"pb-3"},[t(cs,{staticClass:"mb-1 d-block _moonraker-sensor-subheader"},[e._v(" "+e._s(e.convertName(e.name))+" ")]),t(cs,{staticClass:"d-block _moonraker-sensor-subheader"},e._l(e.valueNames,function(r,i){return t(b0,{key:"moonraker_sensor_value_"+i,attrs:{sensor:e.name,"value-name":r}})}),1)],1)],1)],1)},kL=[],EL=E(lc,ML,kL,!1,null,"e21d748d");const C0=EL.exports;var LL=Object.defineProperty,AL=Object.getOwnPropertyDescriptor,Iu=(s,e,t,r)=>{for(var i=r>1?void 0:r?AL(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&LL(e,t,i),i};let Hi=class extends k(L){constructor(){super(...arguments),this.convertName=Ye,this.unitToSymbol=Xv}get output(){const s=isNaN(this.value)?"--":this.value;return this.unit===null?this.value:"".concat(s," ").concat(this.unit)}};Iu([w({type:String,required:!0})],Hi.prototype,"name",2);Iu([w({type:Number,required:!0})],Hi.prototype,"value",2);Iu([w({type:String,required:!1})],Hi.prototype,"unit",2);Hi=Iu([S()],Hi);var FL=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Ee,{staticClass:"px-0 py-2"},[t(x,[t(b,{staticClass:"pb-3"},[t(cs,{staticClass:"_miscellaneous-sensor-subheader"},[t(_,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.unitToSymbol(e.unit)))]),t("span",[e._v(e._s(e.convertName(e.name)))]),t(ae),t("span",[e._v(e._s(e.output))])],1)],1)],1)],1)},RL=[],HL=E(Hi,FL,RL,!1,null,"0d332281");const $0=HL.exports;var jL=Object.defineProperty,IL=Object.getOwnPropertyDescriptor,dn=(s,e,t,r)=>{for(var i=r>1?void 0:r?IL(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&jL(e,t,i),i};let hr=class extends k(L){constructor(){super(...arguments),this.mdiToggleSwitch=Yp,this.mdiToggleSwitchOffOutline=Ov,this.mdiPrinter3dNozzleAlert=vv,this.convertName=Ye}get statusColor(){if(this.enabled){if(this.filament_detected)return"success"}else return"gray";return"warning"}get statusText(){return this.filament_diameter!==void 0&&this.filament_detected?this.filament_diameter.toPrecision(3)+"mm":this.filament_detected?this.$t("Panels.MiscellaneousPanel.RunoutSensor.Detected"):this.$t("Panels.MiscellaneousPanel.RunoutSensor.Empty")}changeSensor(){let s=["SET_FILAMENT_SENSOR SENSOR="+this.name+" ENABLE="+(this.enabled?0:1)];this.type=="hall_filament_width_sensor"&&s.push((this.enabled?"DIS":"EN")+"ABLE_FILAMENT_WIDTH_SENSOR");for(const e of s)this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e})}};dn([w({type:String,required:!0})],hr.prototype,"type",2);dn([w({type:String,required:!0})],hr.prototype,"name",2);dn([w({type:Boolean,required:!0})],hr.prototype,"enabled",2);dn([w({type:Boolean,required:!0})],hr.prototype,"filament_detected",2);dn([w({type:Number})],hr.prototype,"filament_diameter",2);hr=dn([S],hr);var NL=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Ee,{staticClass:"px-0 py-2"},[t(x,[t(b,{staticClass:"pb-3"},[t(cs,{staticClass:"_filamentRunout-subheader"},[t(_,{staticClass:"mr-2",attrs:{small:""}},[e._v(e._s(e.mdiPrinter3dNozzleAlert))]),t("span",[e._v(e._s(e.convertName(e.name)))]),t(ae),t("small",{class:"mr-3 "+e.statusColor+"--text"},[e._v(e._s(e.statusText))]),t(_,{on:{click:e.changeSensor}},[e._v(" "+e._s(e.enabled?e.mdiToggleSwitch:e.mdiToggleSwitchOffOutline)+" ")])],1)],1)],1)],1)},VL=[],BL=E(hr,NL,VL,!1,null,"36204c70");const x0=BL.exports;/*! + * iro.js v5.5.2 + * 2016-2021 James Daniel + * Licensed under MPL 2.0 + * github.com/jaames/iro.js + */var Be,cc,w0,mh,S0,sr={},Pf=[],UL=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i;function Qs(s,e){for(var t in e)s[t]=e[t];return s}function P0(s){var e=s.parentNode;e&&e.removeChild(s)}function Fe(s,e,t){var r,i,n,a,o=arguments;if(e=Qs({},e),arguments.length>3)for(t=[t],r=3;r-1,r=parseFloat(s);return t?e/100*r:r}function Ot(s){return parseInt(s,16)}function xr(s){return s.toString(16).padStart(2,"0")}var vi=function(){function s(t,r){this.$={h:0,s:0,v:0,a:1},t&&this.set(t),this.onChange=r,this.initialValue=Mt({},this.$)}var e=s.prototype;return e.set=function(r){if(typeof r=="string")/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(r)?this.hexString=r:/^rgba?/.test(r)?this.rgbString=r:/^hsla?/.test(r)&&(this.hslString=r);else if(typeof r=="object")r instanceof s?this.hsva=r.hsva:"r"in r&&"g"in r&&"b"in r?this.rgb=r:"h"in r&&"s"in r&&"v"in r?this.hsv=r:"h"in r&&"s"in r&&"l"in r?this.hsl=r:"kelvin"in r&&(this.kelvin=r.kelvin);else throw new Error("Invalid color value")},e.setChannel=function(r,i,n){var a;this[r]=Mt({},this[r],(a={},a[i]=n,a))},e.reset=function(){this.hsva=this.initialValue},e.clone=function(){return new s(this)},e.unbind=function(){this.onChange=void 0},s.hsvToRgb=function(r){var i=r.h/60,n=r.s/100,a=r.v/100,o=Sn(i),l=i-o,u=a*(1-n),c=a*(1-l*n),d=a*(1-(1-l)*n),m=o%6,h=[a,c,u,u,d,a][m],f=[d,a,a,c,u,u][m],p=[u,u,d,a,a,c][m];return{r:qt(h*255,0,255),g:qt(f*255,0,255),b:qt(p*255,0,255)}},s.rgbToHsv=function(r){var i=r.r/255,n=r.g/255,a=r.b/255,o=Math.max(i,n,a),l=Math.min(i,n,a),u=o-l,c=0,d=o,m=o===0?0:u/o;switch(o){case l:c=0;break;case i:c=(n-a)/u+(na;){u=(l+o)*.5;var c=s.kelvinToRgb(u);c.b/c.r>=n/i?l=u:o=u}return u},JL(s,[{key:"hsv",get:function(){var r=this.$;return{h:r.h,s:r.s,v:r.v}},set:function(r){var i=this.$;if(r=Mt({},i,r),this.onChange){var n={h:!1,v:!1,s:!1,a:!1};for(var a in i)n[a]=r[a]!=i[a];this.$=r,(n.h||n.s||n.v||n.a)&&this.onChange(this,n)}else this.$=r}},{key:"hsva",get:function(){return Mt({},this.$)},set:function(r){this.hsv=r}},{key:"hue",get:function(){return this.$.h},set:function(r){this.hsv={h:r}}},{key:"saturation",get:function(){return this.$.s},set:function(r){this.hsv={s:r}}},{key:"value",get:function(){return this.$.v},set:function(r){this.hsv={v:r}}},{key:"alpha",get:function(){return this.$.a},set:function(r){this.hsv=Mt({},this.hsv,{a:r})}},{key:"kelvin",get:function(){return s.rgbToKelvin(this.rgb)},set:function(r){this.rgb=s.kelvinToRgb(r)}},{key:"red",get:function(){var r=this.rgb;return r.r},set:function(r){this.rgb=Mt({},this.rgb,{r})}},{key:"green",get:function(){var r=this.rgb;return r.g},set:function(r){this.rgb=Mt({},this.rgb,{g:r})}},{key:"blue",get:function(){var r=this.rgb;return r.b},set:function(r){this.rgb=Mt({},this.rgb,{b:r})}},{key:"rgb",get:function(){var r=s.hsvToRgb(this.$),i=r.r,n=r.g,a=r.b;return{r:ui(i),g:ui(n),b:ui(a)}},set:function(r){this.hsv=Mt({},s.rgbToHsv(r),{a:r.a===void 0?1:r.a})}},{key:"rgba",get:function(){return Mt({},this.rgb,{a:this.alpha})},set:function(r){this.rgb=r}},{key:"hsl",get:function(){var r=s.hsvToHsl(this.$),i=r.h,n=r.s,a=r.l;return{h:ui(i),s:ui(n),l:ui(a)}},set:function(r){this.hsv=Mt({},s.hslToHsv(r),{a:r.a===void 0?1:r.a})}},{key:"hsla",get:function(){return Mt({},this.hsl,{a:this.alpha})},set:function(r){this.hsl=r}},{key:"rgbString",get:function(){var r=this.rgb;return"rgb("+r.r+", "+r.g+", "+r.b+")"},set:function(r){var i,n,a,o,l=1;if((i=e8.exec(r))?(n=Tt(i[1],255),a=Tt(i[2],255),o=Tt(i[3],255)):(i=t8.exec(r))&&(n=Tt(i[1],255),a=Tt(i[2],255),o=Tt(i[3],255),l=Tt(i[4],1)),i)this.rgb={r:n,g:a,b:o,a:l};else throw new Error("Invalid rgb string")}},{key:"rgbaString",get:function(){var r=this.rgba;return"rgba("+r.r+", "+r.g+", "+r.b+", "+r.a+")"},set:function(r){this.rgbString=r}},{key:"hexString",get:function(){var r=this.rgb;return"#"+xr(r.r)+xr(r.g)+xr(r.b)},set:function(r){var i,n,a,o,l=255;if((i=i8.exec(r))?(n=Ot(i[1])*17,a=Ot(i[2])*17,o=Ot(i[3])*17):(i=n8.exec(r))?(n=Ot(i[1])*17,a=Ot(i[2])*17,o=Ot(i[3])*17,l=Ot(i[4])*17):(i=a8.exec(r))?(n=Ot(i[1]),a=Ot(i[2]),o=Ot(i[3])):(i=o8.exec(r))&&(n=Ot(i[1]),a=Ot(i[2]),o=Ot(i[3]),l=Ot(i[4])),i)this.rgb={r:n,g:a,b:o,a:l/255};else throw new Error("Invalid hex string")}},{key:"hex8String",get:function(){var r=this.rgba;return"#"+xr(r.r)+xr(r.g)+xr(r.b)+xr(Sn(r.a*255))},set:function(r){this.hexString=r}},{key:"hslString",get:function(){var r=this.hsl;return"hsl("+r.h+", "+r.s+"%, "+r.l+"%)"},set:function(r){var i,n,a,o,l=1;if((i=s8.exec(r))?(n=Tt(i[1],360),a=Tt(i[2],100),o=Tt(i[3],100)):(i=r8.exec(r))&&(n=Tt(i[1],360),a=Tt(i[2],100),o=Tt(i[3],100),l=Tt(i[4],1)),i)this.hsl={h:n,s:a,l:o,a:l};else throw new Error("Invalid hsl string")}},{key:"hslaString",get:function(){var r=this.hsla;return"hsla("+r.h+", "+r.s+"%, "+r.l+"%, "+r.a+")"},set:function(r){this.hslString=r}}]),s}(),u8={sliderShape:"bar",sliderType:"value",minTemperature:2200,maxTemperature:11e3};function Of(s){var e,t=s.width,r=s.sliderSize,i=s.borderWidth,n=s.handleRadius,a=s.padding,o=s.sliderShape,l=s.layoutDirection==="horizontal";return r=(e=r)!=null?e:a*2+n*2,o==="circle"?{handleStart:s.padding+s.handleRadius,handleRange:t-a*2-n*2,width:t,height:t,cx:t/2,cy:t/2,radius:t/2-i/2}:{handleStart:r/2,handleRange:t-r,radius:r/2,x:0,y:0,width:l?r:t,height:l?t:r}}function d8(s,e){var t=e.hsva,r=e.rgb;switch(s.sliderType){case"red":return r.r/2.55;case"green":return r.g/2.55;case"blue":return r.b/2.55;case"alpha":return t.a*100;case"kelvin":var i=s.minTemperature,n=s.maxTemperature,a=n-i,o=(e.kelvin-i)/a*100;return Math.max(0,Math.min(o,100));case"hue":return t.h/=3.6;case"saturation":return t.s;case"value":default:return t.v}}function m8(s,e,t){var r=Of(s),i=r.handleRange,n=r.handleStart,a;s.layoutDirection==="horizontal"?a=-1*t+i+n:a=e-n,a=Math.max(Math.min(a,i),0);var o=Math.round(100/i*a);switch(s.sliderType){case"kelvin":var l=s.minTemperature,u=s.maxTemperature,c=u-l;return l+c*(o/100);case"alpha":return o/100;case"hue":return o*3.6;case"red":case"blue":case"green":return o*2.55;default:return o}}function h8(s,e){var t=Of(s),r=t.width,i=t.height,n=t.handleRange,a=t.handleStart,o=s.layoutDirection==="horizontal",l=d8(s,e),u=o?r/2:i/2,c=a+l/100*n;return o&&(c=-1*c+n+a*2),{x:o?u:c,y:o?c:u}}function p8(s,e){var t=e.hsv,r=e.rgb;switch(s.sliderType){case"red":return[[0,"rgb(0,"+r.g+","+r.b+")"],[100,"rgb(255,"+r.g+","+r.b+")"]];case"green":return[[0,"rgb("+r.r+",0,"+r.b+")"],[100,"rgb("+r.r+",255,"+r.b+")"]];case"blue":return[[0,"rgb("+r.r+","+r.g+",0)"],[100,"rgb("+r.r+","+r.g+",255)"]];case"alpha":return[[0,"rgba("+r.r+","+r.g+","+r.b+",0)"],[100,"rgb("+r.r+","+r.g+","+r.b+")"]];case"kelvin":for(var i=[],n=s.minTemperature,a=s.maxTemperature,o=8,l=a-n,u=n,c=0;u0?i.protocol+"//"+i.host+i.pathname+i.search+s:s}function j0(s,e,t,r){for(var i=0;i0&&(l[a?"marginLeft":"marginTop"]=o),Fe(Nu,null,r.children(this.uid,n,l))},e.prototype.handleEvent=function(r){var i=this,n=this.props.onInput,a=this.base.getBoundingClientRect();r.preventDefault();var o=r.touches?r.changedTouches[0]:r,l=o.clientX-a.left,u=o.clientY-a.top;switch(r.type){case"mousedown":case"touchstart":var c=n(l,u,0);c!==!1&&c1.forEach(function(d){document.addEventListener(d,i,{passive:!1})});break;case"mousemove":case"touchmove":n(l,u,1);break;case"mouseup":case"touchend":n(l,u,2),c1.forEach(function(d){document.removeEventListener(d,i,{passive:!1})});break}},e}($i);function Gr(s){var e=s.r,t=s.url,r=e,i=e;return Fe("svg",{className:"IroHandle IroHandle--"+s.index+" "+(s.isActive?"IroHandle--isActive":""),style:{"-webkit-tap-highlight-color":"rgba(0, 0, 0, 0);",transform:"translate("+$t(s.x)+", "+$t(s.y)+")",willChange:"transform",top:$t(-e),left:$t(-e),width:$t(e*2),height:$t(e*2),position:"absolute",overflow:"visible"}},t&&Fe("use",Object.assign({xlinkHref:y8(t)},s.props)),!t&&Fe("circle",{cx:r,cy:i,r:e,fill:"none","stroke-width":2,stroke:"#000"}),!t&&Fe("circle",{cx:r,cy:i,r:e-2,fill:s.fill,"stroke-width":2,stroke:"#fff"}))}Gr.defaultProps={fill:"none",x:0,y:0,r:8,url:null,props:{x:0,y:0}};function dc(s){var e=s.activeIndex,t=e!==void 0&&e0?t.colors:[t.color];i.forEach(function(n){return r.addColor(n)}),this.setActiveColor(0),this.state=Object.assign({},t,{color:this.color,colors:this.colors,layout:t.layout})}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.addColor=function(r,i){i===void 0&&(i=this.colors.length);var n=new vi(r,this.onColorChange.bind(this));this.colors.splice(i,0,n),this.colors.forEach(function(a,o){return a.index=o}),this.state&&this.setState({colors:this.colors}),this.deferredEmit("color:init",n)},e.prototype.removeColor=function(r){var i=this.colors.splice(r,1)[0];i.unbind(),this.colors.forEach(function(n,a){return n.index=a}),this.state&&this.setState({colors:this.colors}),i.index===this.color.index&&this.setActiveColor(0),this.emit("color:remove",i)},e.prototype.setActiveColor=function(r){this.color=this.colors[r],this.state&&this.setState({color:this.color}),this.emit("color:setActive",this.color)},e.prototype.setColors=function(r,i){var n=this;i===void 0&&(i=0),this.colors.forEach(function(a){return a.unbind()}),this.colors=[],r.forEach(function(a){return n.addColor(a)}),this.setActiveColor(i),this.emit("color:setAll",this.colors)},e.prototype.on=function(r,i){var n=this,a=this.events;(Array.isArray(r)?r:[r]).forEach(function(o){(a[o]||(a[o]=[])).push(i),n.deferredEvents[o]&&(n.deferredEvents[o].forEach(function(l){i.apply(null,l)}),n.deferredEvents[o]=[])})},e.prototype.off=function(r,i){var n=this;(Array.isArray(r)?r:[r]).forEach(function(a){var o=n.events[a];o&&o.splice(o.indexOf(i),1)})},e.prototype.emit=function(r){for(var i=this,n=[],a=arguments.length-1;a-- >0;)n[a]=arguments[a+1];var o=this.activeEvents,l=o.hasOwnProperty(r)?o[r]:!1;if(!l){o[r]=!0;var u=this.events[r]||[];u.forEach(function(c){return c.apply(i,n)}),o[r]=!1}},e.prototype.deferredEmit=function(r){for(var i,n=[],a=arguments.length-1;a-- >0;)n[a]=arguments[a+1];var o=this.deferredEvents;(i=this).emit.apply(i,[r].concat(n)),(o[r]||(o[r]=[])).push(n)},e.prototype.setOptions=function(r){this.setState(r)},e.prototype.resize=function(r){this.setOptions({width:r})},e.prototype.reset=function(){this.colors.forEach(function(r){return r.reset()}),this.setState({colors:this.colors})},e.prototype.onMount=function(r){this.el=r,this.deferredEmit("mount",this)},e.prototype.onColorChange=function(r,i){this.setState({color:this.color}),this.inputActive&&(this.inputActive=!1,this.emit("input:change",r,i)),this.emit("color:change",r,i)},e.prototype.emitInputEvent=function(r,i){r===0?this.emit("input:start",this.color,i):r===1?this.emit("input:move",this.color,i):r===2&&this.emit("input:end",this.color,i)},e.prototype.render=function(r,i){var n=this,a=i.layout;if(!Array.isArray(a)){switch(a){default:a=[{component:I0},{component:dc}]}i.transparency&&a.push({component:dc,options:{sliderType:"alpha"}})}return Fe("div",{class:"IroColorPicker",id:i.id,style:{display:i.display}},a.map(function(o,l){var u=o.component,c=o.options;return Fe(u,Object.assign({},i,c,{ref:void 0,onInput:n.emitInputEvent.bind(n),parent:n,index:l}))}))},e}($i);N0.defaultProps=Object.assign({},C8,{colors:[],display:"block",id:null,layout:"default",margin:null});var P8=S8(N0),fh;(function(s){s.version="5.5.2",s.Color=vi,s.ColorPicker=P8,function(e){e.h=Fe,e.ComponentBase=Uu,e.Handle=Gr,e.Slider=dc,e.Wheel=I0,e.Box=$8}(s.ui||(s.ui={}))})(fh||(fh={}));var Ut=fh,D8=Object.defineProperty,T8=Object.getOwnPropertyDescriptor,no=(s,e,t,r)=>{for(var i=r>1?void 0:r?T8(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&D8(e,t,i),i};let Zr=class extends k(L){constructor(){super(...arguments),this.colorPicker=null}colorChanged(s){this.colorPicker&&this.colorPicker.color.rgbString!==s&&(this.colorPicker.color.rgbString=s)}get internalOptions(){return{...this.options,color:this.color,borderWidth:2,sliderSize:16}}emitColorChange(s){this.$emit("change",s),this.$emit("update:color",s)}onColorChange(s){this.emitColorChange(s)}mounted(){this.colorPicker=Ut.ColorPicker(this.picker,this.internalOptions),this.colorPicker.on("color:change",this.onColorChange)}beforeDestroy(){var s;(s=this.colorPicker)==null||s.off("color:change",this.onColorChange)}};no([Ts("picker")],Zr.prototype,"picker",2);no([w({type:[Object,String],default:"#ffffff"})],Zr.prototype,"color",2);no([w({type:Object,default:()=>({})})],Zr.prototype,"options",2);no([he("color",{deep:!0})],Zr.prototype,"colorChanged",1);Zr=no([S],Zr);var O8=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t("div",{ref:"picker"})])},M8=[],k8=E(Zr,O8,M8,!1,null,"133d9be7");const _a=k8.exports;var E8=Object.defineProperty,L8=Object.getOwnPropertyDescriptor,ii=(s,e,t,r)=>{for(var i=r>1?void 0:r?L8(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&E8(e,t,i),i};let Vs=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiLightbulbOutline=zp,this.mdiLightbulbOnOutline=lv,this.boolDialog=!1,this.inputValue=0}get name(){return this.group?Ye(this.group.name):Ye(this.object.name)}get colorPickerOptions(){let s={width:200,margin:15,layout:[]};return this.existRed&&(s==null||s.layout.push({component:Ut.ui.Slider,options:{sliderType:"red"}})),this.existGreen&&(s==null||s.layout.push({component:Ut.ui.Slider,options:{sliderType:"green"}})),this.existBlue&&(s==null||s.layout.push({component:Ut.ui.Slider,options:{sliderType:"blue"}})),this.existRed&&this.existGreen&&this.existBlue&&(s.layout=[{component:Ut.ui.Wheel},{component:Ut.ui.Slider,options:{sliderType:"value"}}]),s}get colorPickerWhiteOptions(){return{width:200,margin:15,layout:[{component:Ut.ui.Slider,options:{sliderType:"alpha"}}]}}get optionsColors(){let s=[];return this.presets.forEach(e=>{s.push("rgb(".concat(e.red,"%, ").concat(e.green,"%, ").concat(e.blue,"%)"))}),s}get current(){var t,r;const s={red:0,green:0,blue:0,white:null};if(this.existWhite&&(s.white=0),this.object.colorData.length===0)return s;const e=this.object.colorData[((r=(t=this.group)==null?void 0:t.start)!=null?r:1)-1];return s.red=e[0]*255,s.green=e[1]*255,s.blue=e[2]*255,this.object.colorOrder.indexOf("W")!==-1&&(s.white=e[3]*255),s}get isOn(){var s,e,t,r,i;return((s=this.current.red)!=null?s:0)+((t=(e=this.current)==null?void 0:e.green)!=null?t:0)+((r=this.current.blue)!=null?r:0)+((i=this.current.white)!=null?i:0)>0}get existRed(){return this.object.colorOrder.indexOf("R")!==-1}get existGreen(){return this.object.colorOrder.indexOf("G")!==-1}get existBlue(){return this.object.colorOrder.indexOf("B")!==-1}get existWhite(){return this.object.colorOrder.indexOf("W")!==-1}get currentStateStyle(){let s=this.colorRGB;return this.current.white!==null&&this.current.red==0&&this.current.green==0&&this.current.blue==0&&(s="rgb(".concat(this.current.white*255,", ").concat(this.current.white*255,", ").concat(this.current.white*255,")")),{"background-color":s}}get colorRGB(){var s,e,t;return"rgb(".concat(Math.round((s=this.current.red)!=null?s:0),", ").concat(Math.round((e=this.current.green)!=null?e:0),", ").concat(Math.round((t=this.current.blue)!=null?t:0),")")}get colorRGBW(){var s;return"rgba(255, 255, 255, ".concat(((s=this.current.white)!=null?s:0)/255,")")}get redInt(){var s;return Math.round((s=this.current.red)!=null?s:0)}get greenInt(){var s;return Math.round((s=this.current.green)!=null?s:0)}get blueInt(){var s;return Math.round((s=this.current.blue)!=null?s:0)}get whiteInt(){var s;return Math.round((s=this.current.white)!=null?s:0)}get groups(){var s;return this.root?(s=this.$store.getters["gui/miscellaneous/getEntryLightgroups"]({type:this.object.type,name:this.object.name}))!=null?s:[]:[]}get presets(){var s;return(s=this.$store.getters["gui/miscellaneous/getEntryPresets"]({type:this.object.type,name:this.object.name}))!=null?s:[]}get containerClass(){let s=["px-0"];return s.push(this.root?"py-2":"pt-2 pb-0"),s}colorChanged(s){var a,o,l,u,c,d,m,h,f,p,v,C;if(Math.round((a=s.red)!=null?a:0)===Math.round((o=this.current.red)!=null?o:0)&&Math.round((l=s.green)!=null?l:0)===Math.round((u=this.current.green)!=null?u:0)&&Math.round((c=s.blue)!=null?c:0)===Math.round((d=this.current.blue)!=null?d:0)&&Math.round((m=s.white)!=null?m:0)===Math.round((h=this.current.white)!=null?h:0))return;const e=Math.round(((f=s.red)!=null?f:0)/255*1e4)/1e4,t=Math.round(((p=s.green)!=null?p:0)/255*1e4)/1e4,r=Math.round(((v=s.blue)!=null?v:0)/255*1e4)/1e4,i=Math.round(((C=s.white)!=null?C:0)/255*1e4)/1e4;let n='SET_LED LED="'.concat(this.object.name,'" RED=').concat(e," GREEN=").concat(t," BLUE=").concat(r);if(this.existWhite&&(n+=" WHITE=".concat(i)),n+=" SYNC=0",this.group){const P=n;for(let M=this.group.start;M<=this.group.end;M++){if(M===this.group.start){n+=" INDEX=".concat(M);continue}n+="\n".concat(P," INDEX=").concat(M)}}n+=" TRANSMIT=1",this.$store.dispatch("server/addEvent",{message:n,type:"command"}),this.$socket.emit("printer.gcode.script",{script:n})}onColorRGBChanged(s){const e={red:s.red,green:s.green,blue:s.blue,white:this.current.white};this.colorChanged(e)}onColorWhiteChanged(s){const e={red:this.current.red,green:this.current.green,blue:this.current.blue,white:this.current.white};e.white=s.alpha*255,this.colorChanged(e)}onColorInput(s){const e={red:this.current.red,green:this.current.green,blue:this.current.blue,white:this.current.white};e[s.name]=s.value,this.colorChanged(e)}off(){const s={red:0,green:0,blue:0,white:0};this.colorChanged(s)}on(){const s={red:255,green:255,blue:255,white:255};this.colorChanged(s)}presetStyle(s){var e,t,r,i;return((e=s==null?void 0:s.red)!=null?e:0)+((t=s==null?void 0:s.green)!=null?t:0)+((r=s==null?void 0:s.blue)!=null?r:0)===0&&((i=s==null?void 0:s.white)!=null?i:0)>0?{backgroundColor:"rgb(".concat(s.white,"%, ").concat(s.white,"%, ").concat(s.white,"%)")}:{backgroundColor:"rgb(".concat(s.red,"%, ").concat(s.green,"%, ").concat(s.blue,"%)")}}usePreset(s){const e={...s};this.colorChanged(e)}};ii([w({type:Object,required:!0})],Vs.prototype,"object",2);ii([w({type:Boolean,default:!1})],Vs.prototype,"root",2);ii([w(Object)],Vs.prototype,"group",2);ii([Ke({time:500})],Vs.prototype,"onColorRGBChanged",1);ii([Ke({time:500})],Vs.prototype,"onColorWhiteChanged",1);ii([Ke({time:500})],Vs.prototype,"onColorInput",1);Vs=ii([S({components:{ColorPicker:_a}})],Vs);var A8=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Ee,{class:e.containerClass},[t(x,[t(b,{staticClass:"pb-3"},[t(cs,{staticClass:"_light-subheader"},[(!e.root||e.groups.length===0)&&e.isOn?t(_,{attrs:{small:"",left:""},on:{click:e.off}},[e._v(" "+e._s(e.mdiLightbulbOnOutline)+" ")]):!e.root||e.groups.length===0?t(_,{attrs:{small:"",left:""},on:{click:e.on}},[e._v(" "+e._s(e.mdiLightbulbOutline)+" ")]):e._e(),t("span",[e._v(e._s(e.name))]),t(ae),!e.root||e.groups.length===0?t("span",{staticClass:"_currentState",style:e.currentStateStyle,on:{click:function(r){e.boolDialog=!0}}}):e._e()],1)],1)],1),e._l(e.groups,function(r){return t("miscellaneous-light",{key:r.id,attrs:{object:e.object,group:r}})}),t(le,{attrs:{persistent:"",width:400},model:{value:e.boolDialog,callback:function(r){e.boolDialog=r},expression:"boolDialog"}},[t(U,{attrs:{title:e.name,icon:e.mdiLightbulbOutline,"card-class":"temperature-edit-heater-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.boolDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"pt-6"},[e.presets.length?[t(x,[t(b,{staticClass:"light-presets-container pt-0 d-flex flex-wrap flex-row justify-center"},e._l(e.presets,function(r){return t(de,{key:r.id,attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:n}){return[t("div",e._g(e._b({style:e.presetStyle(r),on:{click:function(a){return e.usePreset(r)}}},"div",n,!1),i))]}}],null,!0)},[t("span",[e._v(e._s(r.name))])])}),1)],1),t(I,{staticClass:"my-3"})]:e._e(),t(x,[t(b,{staticClass:"text-center"},[t(_a,{attrs:{color:e.colorRGB,options:e.colorPickerOptions},on:{"update:color":e.onColorRGBChanged}}),e.existWhite?t(_a,{staticClass:"mt-3",attrs:{color:e.colorRGBW,options:e.colorPickerWhiteOptions},on:{"update:color":e.onColorWhiteChanged}}):e._e()],1),t(b,[e.existRed?t(x,[t(b,[t(He,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.Red"),param:"red",target:e.redInt,"default-value":Math.round(e.object.initialRed*255),min:0,max:255,dec:1,step:1,"output-error-msg":!0,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e(),e.existGreen?t(x,[t(b,[t(He,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.Green"),param:"green",target:e.greenInt,"default-value":Math.round(e.object.initialGreen*255),min:0,max:255,dec:1,step:1,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e(),e.existBlue?t(x,[t(b,[t(He,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.Blue"),param:"blue",target:e.blueInt,"default-value":Math.round(e.object.initialBlue*255),min:0,max:255,dec:1,step:1,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e(),e.existWhite?t(x,[t(b,[t(He,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.White"),param:"white",target:e.whiteInt,"default-value":Math.round(e.object.initialWhite*255),min:0,max:255,dec:1,step:1,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e()],1)],1)],2)],1)],1)],2)},F8=[],R8=E(Vs,A8,F8,!1,null,"422e078f");const V0=R8.exports;var H8=Object.defineProperty,j8=Object.getOwnPropertyDescriptor,wt=(s,e,t,r)=>{for(var i=r>1?void 0:r?j8(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&H8(e,t,i),i};let mt=class extends k(L){constructor(){super(...arguments),this.mdiFan=Ip,this.mdiToggleSwitch=Yp,this.mdiToggleSwitchOffOutline=Ov,this.mdiLockOutline=fu,this.mdiLockOpenVariantOutline=uv,this.mdiMinus=mv,this.mdiPlus=qp,this.mdiLightbulbOutline=zp,this.mdiLightbulbOnOutline=lv,this.convertName=Ye,this.isLocked=!1,this.invalidChars=["e","E","+"],this.min=0,this.inputValue=0,this.sliderValue=0}get value(){return Math.round(this.target/this.max*100)/100}lockSlidersChanged(){this.isLocked=this.lockSliders&&this.isTouchDevice}startLockTimer(){let s=this.lockSlidersDelay;!this.isTouchDevice||!this.lockSliders||s<=0||(this.timeout=setTimeout(()=>this.isLocked=!0,s*1e3))}resetLockTimer(){clearTimeout(this.timeout)}get lockSliders(){return this.$store.state.gui.uiSettings.lockSlidersOnTouchDevices}get lockSlidersDelay(){return this.$store.state.gui.uiSettings.lockSlidersDelay}changeSliderValue(){this.value!==this.sliderValue&&(this.sliderValuethis.value&&this.sliderValue0?Math.round((this.value-.01)*100)/100:0;this.value=0&&this.invalidChars.push("-"),this.invalidChars.includes(s.key)&&s.preventDefault()}get errors(){const s=[],e=this.inputValue/100;return this.inputValue.toString()===""&&s.push(this.$t("App.NumberInput.NoEmptyAllowedError")),e=this.off_below&&this.value>0&&s.push("icon-rotate"),s}get rpmClasses(){const s=[];return this.controllable?s.push(["mt-2"]):s.push(["mr-3","mt-1"]),this.rpm===0&&this.value>0&&s.push("red--text"),s}get ledChannelName(){return this.colorOrder==="R"?"RED":this.colorOrder==="G"?"GREEN":this.colorOrder==="B"?"BLUE":"WHITE"}submitInput(){if(this.errors.length>0)return;let s=this.inputValue/100;this.value===0&&s=this.off_below&&s0?t(_,{staticClass:"mr-2",attrs:{small:"","retain-focus-on-click":!0},on:{click:e.ledOff}},[e._v(" "+e._s(e.mdiLightbulbOnOutline)+" ")]):e.type==="led"?t(_,{staticClass:"mr-2",attrs:{small:"","retain-focus-on-click":!0},on:{click:e.ledOn}},[e._v(" "+e._s(e.mdiLightbulbOutline)+" ")]):e.type.includes("fan")?t(_,{class:e.fanClasses,attrs:{small:""}},[e._v(e._s(e.mdiFan))]):e._e(),t("span",[e._v(e._s(e.convertName(e.name)))]),t(ae),e.rpm!==null?t("small",{class:e.rpmClasses},[e._v(e._s(Math.round((r=e.rpm)!=null?r:0))+" RPM")]):e._e(),e.controllable?e._e():t("span",{staticClass:"font-weight-bold"},[e._v(" "+e._s(Math.round(parseFloat(e.value)*100))+" % ")]),e.controllable&&!e.pwm?t(_,{on:{click:e.switchOutputPin}},[e._v(" "+e._s(e.value?e.mdiToggleSwitch:e.mdiToggleSwitchOffOutline)+" ")]):e._e(),t("form",{on:{submit:function(n){return n.preventDefault(),e.submitInput.apply(null,arguments)}}},[e.controllable&&e.pwm?t(se,{staticClass:"_slider-input pt-1",attrs:{error:e.errors.length>0,suffix:"%",type:"number","hide-spin-buttons":"","hide-details":"",outlined:"",dense:""},on:{blur:function(n){e.inputValue=Math.round(parseFloat(e.sliderValue)*100)},focus:function(n){return n.target.select()},keydown:e.checkInvalidChars},model:{value:e.inputValue,callback:function(n){e.inputValue=n},expression:"inputValue"}}):e._e()],1)],1),e.controllable&&e.pwm?t("transition",{attrs:{name:"fade"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.errors.length>0,expression:"errors.length > 0"}],staticClass:"_error-msg d-flex justify-end"},[e._v(" "+e._s((i=e.errors[0])!=null?i:"")+" ")])]):e._e(),e.controllable&&e.pwm?t(Z,{staticClass:"py-0 pb-2 d-flex align-center"},[e.lockSliders&&e.isTouchDevice&&e.pwm?t(g,{staticClass:"_lock-button",attrs:{plain:"",small:"",icon:""},on:{click:function(n){e.isLocked=!e.isLocked}}},[t(_,{attrs:{small:"",color:e.isLocked?"red":""}},[e._v(" "+e._s(e.isLocked?e.mdiLockOutline:e.mdiLockOpenVariantOutline)+" ")])],1):e._e(),t(Lr,{directives:[{name:"touch",rawName:"v-touch",value:{start:e.resetLockTimer},expression:"{ start: resetLockTimer }"}],attrs:{disabled:e.isLocked,min:0,max:1,step:.01,color:e.sliderValue0?"red":void 0,"hide-details":""},on:{change:e.changeSliderValue},scopedSlots:e._u([{key:"prepend",fn:function(){return[t(_,{attrs:{disabled:e.isLocked||e.sliderValue<=e.min},on:{click:e.decrement}},[e._v(" "+e._s(e.mdiMinus)+" ")])]},proxy:!0},{key:"append",fn:function(){return[t(_,{attrs:{disabled:e.isLocked||e.sliderValue>=1},on:{click:e.increment}},[e._v(e._s(e.mdiPlus))])]},proxy:!0}],null,!1,3774030646),model:{value:e.sliderValue,callback:function(n){e.sliderValue=n},expression:"sliderValue"}})],1):e._e()],1)],1)],1)},N8=[],V8=E(mt,I8,N8,!1,null,"31338421");const gh=V8.exports;var B8=Object.getOwnPropertyDescriptor,U8=(s,e,t,r)=>{for(var i=r>1?void 0:r?B8(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let _h=class extends k(L){constructor(){super(...arguments),this.mdiDipSwitch=Hp}get filamentSensors(){var e;return(e=this.$store.getters["printer/getFilamentSensors"])!=null?e:[]}get miscellaneous(){var e;return(e=this.$store.getters["printer/getMiscellaneous"])!=null?e:[]}get lights(){var e;return(e=this.$store.getters["printer/getLights"])!=null?e:[]}get miscellaneousSensors(){var e;return(e=this.$store.getters["printer/getMiscellaneousSensors"])!=null?e:[]}get moonrakerSensors(){var e;return(e=this.$store.getters["server/sensor/getSensors"])!=null?e:[]}get showMiscellaneousPanel(){return this.klipperReadyForGui&&(this.miscellaneous.length||this.filamentSensors.length||this.lights.length)}};_h=U8([S({components:{Panel:U,FilamentSensor:x0,MiscellaneousSlider:gh,MiscellaneousLight:V0,MiscellaneousSensor:$0,MoonrakerSensor:C0}})],_h);var W8=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.showMiscellaneousPanel?t(U,{attrs:{icon:e.mdiDipSwitch,title:e.$t("Panels.MiscellaneousPanel.Headline"),collapsible:!0,"card-class":"miscellaneous-panel"}},[e._l(e.miscellaneous,function(r,i){return t("div",{key:i},[i?t(I):e._e(),t(gh,{attrs:{name:r.name,type:r.type,target:r.power,rpm:r.rpm,controllable:r.controllable,pwm:r.pwm,off_below:r.off_below,max:r.max_power,multi:parseInt(r.scale)}})],1)}),e._l(e.lights,function(r,i){return t("div",{key:"light_"+r.name},[i||e.miscellaneous.length?t(I):e._e(),r.type==="led"&&r.colorOrder.length===1?t(gh,{attrs:{name:r.name,type:"led",rpm:null,controllable:!0,pwm:!0,target:r.singleChannelTarget,"color-order":r.colorOrder}}):t(V0,{attrs:{object:r,root:!0}})],1)}),e._l(e.filamentSensors,function(r,i){return t("div",{key:"sensor_"+i},[i||e.miscellaneous.length||e.lights.length?t(I):e._e(),t(x0,{attrs:{type:r.type,name:r.name,enabled:r.enabled,filament_detected:r.filament_detected,filament_diameter:r.filament_diameter}})],1)}),e._l(e.miscellaneousSensors,function(r,i){return t("div",{key:"miscellaneous_sensor_"+i},[i||e.miscellaneous.length||e.lights.length||e.filamentSensors.length?t(I):e._e(),t($0,{attrs:{name:r.name,value:r.value,unit:r.unit}})],1)}),e._l(e.moonrakerSensors,function(r,i){return t("div",{key:"moonraker_sensor_"+i},[i||e.miscellaneous.length||e.lights.length||e.filamentSensors.length||e.miscellaneousSensors.length?t(I):e._e(),t(C0,{attrs:{name:r}})],1)})],2):e._e()},z8=[],G8=E(_h,W8,z8,!1,null,"16616b01");const Z8=G8.exports;var q8=Object.defineProperty,X8=Object.getOwnPropertyDescriptor,B0=(s,e,t,r)=>{for(var i=r>1?void 0:r?X8(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&q8(e,t,i),i};let mc=class extends k(L){constructor(){super(...arguments),this.showChangeSpoolDialog=!1}get name(){var s;return((s=this.objectName.split(" ")[1])!=null?s:"Unknown").toUpperCase()}get color(){var s,e,t;return(t=(e=(s=this.spool)==null?void 0:s.filament)==null?void 0:e.color_hex)!=null?t:"000000"}get dotStyle(){return{"background-color":"#"+this.color}}get spoolId(){var e,t;return(t=((e=this.$store.state.printer[this.objectName])!=null?e:{}).spool_id)!=null?t:null}get spool(){var s;return(s=this.spools.find(e=>e.id===this.spoolId))!=null?s:null}get spools(){var s;return(s=this.$store.state.server.spoolman.spools)!=null?s:[]}};B0([w({required:!1,default:!1})],mc.prototype,"objectName",2);mc=B0([S({components:{}})],mc);var Y8=function(){var r,i,n;var e=this,t=e._self._c;return e._self._setupProxy,t(J,[t(g,{attrs:{small:""},on:{click:function(a){e.showChangeSpoolDialog=!0}}},[e.color!=null?t("span",{staticClass:"_extruderColorState mr-2",style:e.dotStyle}):e._e(),e._v(" "+e._s(e.name)+" "),e.spoolId===null?t("span",{staticClass:"font-italic ml-1"},[e._v("("+e._s(e.$t("Panels.SpoolmanPanel.NoSpool"))+")")]):t("span",{staticClass:"ml-1"},[e._v("("+e._s((n=(i=(r=e.spool)==null?void 0:r.filament)==null?void 0:i.name)!=null?n:"--")+")")])]),t(cn,{attrs:{"show-dialog":e.showChangeSpoolDialog,tool:e.name},on:{close:function(a){e.showChangeSpoolDialog=!1}}})],1)},J8=[],K8=E(mc,Y8,J8,!1,null,"262bd3e3");const U0=K8.exports;var Q8=Object.defineProperty,eA=Object.getOwnPropertyDescriptor,W0=(s,e,t,r)=>{for(var i=r>1?void 0:r?eA(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&Q8(e,t,i),i};let hc=class extends k(L){constructor(){super(...arguments),this.mdiSwapVertical=xv,this.showChangeSpoolDialog=!1}};W0([w({required:!1,default:!1})],hc.prototype,"tools",2);hc=W0([S({components:{SpoolmanToolsDropdownItem:U0}})],hc);var tA=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(ye,{attrs:{"offset-y":!0,"close-on-content-click":!1,left:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiSwapVertical))])],1)]}}])},[t(Me,{attrs:{dense:""}},[t(J,[t(g,{attrs:{small:""},on:{click:function(r){e.showChangeSpoolDialog=!0}}},[t(_,{attrs:{left:""}},[e._v(e._s(e.mdiSwapVertical))]),e._v(" "+e._s(e.$t("Panels.SpoolmanPanel.ActiveSpool"))+" ")],1)],1),e._l(e.tools,function(r){return t(U0,{key:r,attrs:{"object-name":r}})})],2),t(cn,{attrs:{"show-dialog":e.showChangeSpoolDialog},on:{close:function(r){e.showChangeSpoolDialog=!1}}})],1)},sA=[],rA=E(hc,tA,sA,!1,null,null);const iA=rA.exports;var nA=Object.getOwnPropertyDescriptor,aA=(s,e,t,r)=>{for(var i=r>1?void 0:r?nA(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let vh=class extends k(L){constructor(){super(...arguments),this.mdiAdjust=tn,this.mdiDotsVertical=mu,this.mdiEject=Q_,this.mdiOpenInNew=gv,this.mdiSwapVertical=xv,this.showChangeSpoolDialog=!1,this.showEjectSpoolDialog=!1}get health(){var e;return(e=this.$store.state.server.spoolman.health)!=null?e:""}get title(){const e=this.$t("Panels.SpoolmanPanel.Headline");return this.health===""||this.health==="healthy"?e:"".concat(e," (").concat(this.health,")")}get changeSpoolTooltip(){return this.active_spool===null?this.$t("Panels.SpoolmanPanel.SelectSpool"):this.$t("Panels.SpoolmanPanel.ChangeSpool")}get active_spool(){var e;return(e=this.$store.state.server.spoolman.active_spool)!=null?e:null}get spoolManagerUrl(){var e,t,r;return(r=(t=(e=this.$store.state.server.config.config)==null?void 0:e.spoolman)==null?void 0:t.server)!=null?r:null}get toolsWithSpoolId(){return Object.keys(this.$store.state.printer).filter(e=>/^gcode_macro T\d+$/i.test(e.toLowerCase())).filter(e=>{var r;const t=(r=this.$store.state.printer[e])!=null?r:{};return Object.keys(t).some(i=>i.toLowerCase()==="spool_id")})}openSpoolManager(){window.open(this.spoolManagerUrl,"_blank")}};vh=aA([S({components:{SpoolmanPanelActiveSpool:Mu,Panel:U,SpoolmanChangeSpoolDialog:cn,SpoolmanEjectSpoolDialog:$f}})],vh);var oA=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(U,{attrs:{icon:e.mdiAdjust,title:e.title,"card-class":"spoolman-panel",collapsible:!0},scopedSlots:e._u([{key:"buttons",fn:function(){return[e.toolsWithSpoolId.length>0?t(iA,{attrs:{tools:e.toolsWithSpoolId}}):t(g,{attrs:{icon:"",tile:"",title:e.changeSpoolTooltip},on:{click:function(r){e.showChangeSpoolDialog=!0}}},[t(_,[e._v(e._s(e.mdiSwapVertical))])],1),t(ye,{attrs:{"offset-y":!0,"close-on-content-click":!1,left:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiDotsVertical))])],1)]}}])},[t(Me,{attrs:{dense:""}},[t(J,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){e.showEjectSpoolDialog=!0}}},[t(_,{attrs:{left:""}},[e._v(e._s(e.mdiEject))]),e._v(" "+e._s(e.$t("Panels.SpoolmanPanel.EjectSpool"))+" ")],1)],1),t(J,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:e.openSpoolManager}},[t(_,{attrs:{left:""}},[e._v(e._s(e.mdiOpenInNew))]),e._v(" "+e._s(e.$t("Panels.SpoolmanPanel.OpenSpoolManager"))+" ")],1)],1)],1)],1)]},proxy:!0}])},[e.active_spool===null?t(Z,[t(x,[t(b,{staticClass:"text-center"},[t("p",{staticClass:"text--disabled"},[e._v(e._s(e.$t("Panels.SpoolmanPanel.NoActiveSpool")))]),t(g,{attrs:{small:"",color:"primary"},on:{click:function(r){e.showChangeSpoolDialog=!0}}},[e._v(" "+e._s(e.$t("Panels.SpoolmanPanel.SelectSpool"))+" ")])],1)],1)],1):t(Mu,{on:{"change-spool":function(r){e.showChangeSpoolDialog=!0}}})],1),t(cn,{attrs:{"show-dialog":e.showChangeSpoolDialog},on:{close:function(r){e.showChangeSpoolDialog=!1}}}),t($f,{attrs:{"show-dialog":e.showEjectSpoolDialog},on:{close:function(r){e.showEjectSpoolDialog=!1}}})],1)},lA=[],cA=E(vh,oA,lA,!1,null,"a5e75b8b");const uA=cA.exports;var dA=Object.getOwnPropertyDescriptor,mA=(s,e,t,r)=>{for(var i=r>1?void 0:r?dA(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let bh=class extends k(L,Hl){constructor(){super(...arguments),this.mdiBroom=G_,this.mdiContentSave=Rp,this.mdiArrowCollapseDown=cu,this.mdiInformation=Ht,this.mdiArrowExpandUp=z_,this.mdiLayersOutline=Qw,this.saveOffsetDialog=!1}get offsetsZ(){return this.$store.state.gui.control.offsetsZ}get homed_axis(){var s,e;return(e=(s=this.$store.state.printer.toolhead)==null?void 0:s.homed_axes)!=null?e:""}get offsetZSaveOption(){var s;return(s=this.$store.state.gui.control.offsetZSaveOption)!=null?s:null}sendBabyStepDown(s){const e="SET_GCODE_OFFSET Z_ADJUST=-".concat(s," ").concat(this.homed_axis==="xyz"?"MOVE=1":"");this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"babyStepDown"})}sendBabyStepUp(s){const e="SET_GCODE_OFFSET Z_ADJUST=+".concat(s," ").concat(this.homed_axis==="xyz"?"MOVE=1":"");this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e},{loading:"babyStepUp"})}clearZOffset(){const s="SET_GCODE_OFFSET Z=0"+(this.homed_axis==="xyz"?" MOVE=1":"");this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s},{loading:"babySteppingClear"})}saveZOffset(){let s=this.offsetZSaveOption;s===null&&(s=this.autoSaveZOffsetOption),this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s}),this.saveOffsetDialog=!0}saveConfig(){const s="SAVE_CONFIG";this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s},{loading:"topbarSaveConfig"}),this.saveOffsetDialog=!1}};bh=mA([S({components:{Panel:U,Responsive:tt}})],bh);var hA=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(tt,{attrs:{breakpoints:{xsmall:r=>r.width<=285,medium:r=>r.width<=510}},scopedSlots:e._u([{key:"default",fn:function({el:r}){return[t(Ee,{staticClass:"pa-0"},[t(x,[t(b,{staticClass:"v-subheader text--secondary pr-0"},[t(_,{staticClass:"mr-2",attrs:{small:""}},[e._v(" "+e._s(e.mdiLayersOutline)+" ")]),t("span",[e._v(e._s(e.$t("Panels.ZoffsetPanel.Headline"))+": "+e._s(e.zOffset))])],1),t(b,{staticClass:"v-subheader justify-end pl-0"},[t("div",{staticClass:"d-flex align-center"},[e.z_gcode_offset!==0?t(g,{staticClass:"px-2 mr-1",attrs:{loading:e.loadings.includes("babySteppingClear"),text:"",small:"",plain:""},on:{click:function(i){return e.clearZOffset()}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiBroom))]),r.is.xsmall?e._e():t("span",{staticClass:"ml-1"},[e._v(e._s(e.$t("Panels.ZoffsetPanel.Clear")))])],1):e._e(),e.showSaveButton?t(g,{staticClass:"px-2",attrs:{color:"primary",text:"",small:"",plain:""},on:{click:e.saveZOffset}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiContentSave))]),r.is.xsmall?e._e():t("span",{staticClass:"ml-1"},[e._v(e._s(e.$t("Panels.ZoffsetPanel.Save")))])],1):e._e()],1)])],1),t(x,{attrs:{dense:""}},[t(b,{class:r.is.medium?"col-12":"order-1 col-6"},[t("div",{staticClass:"d-flex align-center"},[t(Wt,{staticClass:"_btn-group"},e._l(e.offsetsZ,function(i,n){return t(g,{key:"offsetsUp-".concat(n),staticClass:"_btn-qs flex-grow-1 px-1",attrs:{small:""},on:{click:function(a){return e.sendBabyStepUp(i)}}},[n===0&&!r.is.xsmall?t(_,{staticClass:"mr-1 ml-n1",attrs:{left:"",small:""}},[e._v(" "+e._s(e.mdiArrowExpandUp)+" ")]):e._e(),t("span",[e._v("+"+e._s(i))])],1)}),1)],1)]),t(b,{class:r.is.medium?"col-12":"order-0 col-6"},[r.is.medium?t(Wt,{staticClass:"_btn-group"},e._l(e.offsetsZ,function(i,n){return t(g,{key:"offsetsDown-".concat(n),staticClass:"_btn-qs flex-grow-1 px-1",attrs:{small:""},on:{click:function(a){return e.sendBabyStepDown(i)}}},[n===0&&!r.is.xsmall?t(_,{staticClass:"mr-1 ml-n1",attrs:{left:"",small:""}},[e._v(" "+e._s(e.mdiArrowCollapseDown)+" ")]):e._e(),t("span",[e._v("−"+e._s(i))])],1)}),1):t(Wt,{staticClass:"_btn-group"},e._l(e.offsetsZ.slice().reverse(),function(i,n){return t(g,{key:"offsetsDown-".concat(n),staticClass:"_btn-qs flex-grow-1 px-1",attrs:{small:""},on:{click:function(a){return e.sendBabyStepDown(i)}}},[t("span",[e._v("−"+e._s(i))]),n===e.offsetsZ.length-1&&!r.is.xsmall?t(_,{staticClass:"mr-n1 ml-1",attrs:{left:"",small:""}},[e._v(" "+e._s(e.mdiArrowCollapseDown)+" ")]):e._e()],1)}),1)],1)],1),t(le,{attrs:{"max-width":"290"},model:{value:e.saveOffsetDialog,callback:function(i){e.saveOffsetDialog=i},expression:"saveOffsetDialog"}},[t(U,{attrs:{title:e.$t("Panels.ZoffsetPanel.SaveInfoHeadline"),icon:e.mdiInformation,"card-class":"zoffset-saveinfo-dialog","margin-bottom":!1}},[e.printerIsPrinting?t(Z,{staticClass:"mt-3"},[e._v(" "+e._s(e.$t("Panels.ZoffsetPanel.SaveInfoDescriptionPrint"))+" ")]):t(Z,{staticClass:"mt-3"},[e._v(" "+e._s(e.$t("Panels.ZoffsetPanel.SaveInfoDescription"))+" ")]),e.printerIsPrinting?t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:function(i){e.saveOffsetDialog=!1}}},[e._v(e._s(e.$t("Panels.ZoffsetPanel.Ok")))])],1):t(oe,[t(ae),t(g,{attrs:{color:"primary",text:""},on:{click:e.saveConfig}},[e._v(" "+e._s(e.$t("Panels.ZoffsetPanel.SaveConfig"))+" ")]),t(g,{attrs:{text:""},on:{click:function(i){e.saveOffsetDialog=!1}}},[e._v(e._s(e.$t("Panels.ZoffsetPanel.Later")))])],1)],1)],1)],1)]}}])})},pA=[],fA=E(bh,hA,pA,!1,null,"9ea80ab7");const z0=fA.exports;var gA=Object.defineProperty,_A=Object.getOwnPropertyDescriptor,vr=(s,e,t,r)=>{for(var i=r>1?void 0:r?_A(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&gA(e,t,i),i};let Ps=class extends k(L){onBlur(){this.position!==this.currentPos&&(this.position=this.currentPos)}submit(){this.$emit("submit")}};vr([Ix({type:String})],Ps.prototype,"position",2);vr([w({type:String,required:!0})],Ps.prototype,"currentPos",2);vr([w({type:String,required:!1})],Ps.prototype,"label",2);vr([w({type:String,required:!1})],Ps.prototype,"suffix",2);vr([w({type:Number,required:!1,default:1})],Ps.prototype,"step",2);vr([w({type:Boolean,required:!1})],Ps.prototype,"disabled",2);vr([w({type:Boolean,required:!1})],Ps.prototype,"readonly",2);Ps=vr([S({components:{}})],Ps);var vA=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("form",{on:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}}},[t(se,{attrs:{label:"[ ".concat(e.label," ]"),suffix:e.suffix,disabled:e.disabled,step:e.step,readonly:e.readonly,"hide-details":"auto",type:"number","hide-spin-buttons":"",outlined:"",reverse:"",dense:""},on:{blur:e.onBlur,focus:function(r){e.readonly||r.target.select()}},model:{value:e.position,callback:function(r){e.position=r},expression:"position"}})],1)},bA=[],yA=E(Ps,vA,bA,!1,null,null);const zo=yA.exports;var CA=Object.defineProperty,$A=Object.getOwnPropertyDescriptor,Wu=(s,e,t,r)=>{for(var i=r>1?void 0:r?$A(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&CA(e,t,i),i};let ji=class extends k(L,Je){constructor(){super(...arguments),this.mdiCrosshairsGps=Aw,this.mdiGrid=hu,this.input={x:{pos:"",valid:!0},y:{pos:"",valid:!0},z:{pos:"",valid:!0}}}updatePositionX(s){this.input.x.pos=s}updatePositionY(s){this.input.y.pos=s}updatePositionZ(s){this.input.z.pos=s}get displayPositionAbsolute(){return this.positionAbsolute?this.$t("Panels.ToolheadControlPanel.Absolute"):this.$t("Panels.ToolheadControlPanel.Relative")}get positionAbsolute(){var s,e;return(e=(s=this.$store.state.printer.gcode_move)==null?void 0:s.absolute_coordinates)!=null?e:!0}get livePositions(){var e,t,r,i,n,a,o,l;const s=(t=(e=this.$store.state.printer.motion_report)==null?void 0:e.live_position)!=null?t:[0,0,0];return{x:(i=(r=s[0])==null?void 0:r.toFixed(2))!=null?i:"--",y:(a=(n=s[1])==null?void 0:n.toFixed(2))!=null?a:"--",z:(l=(o=s[2])==null?void 0:o.toFixed(3))!=null?l:"--"}}get gcodePositions(){var e,t,r,i,n,a,o,l;const s=(t=(e=this.$store.state.printer.gcode_move)==null?void 0:e.gcode_position)!=null?t:[0,0,0];return{x:(i=(r=s[0])==null?void 0:r.toFixed(2))!=null?i:"--",y:(a=(n=s[1])==null?void 0:n.toFixed(2))!=null?a:"--",z:(l=(o=s[2])==null?void 0:o.toFixed(3))!=null?l:"--"}}get bed_mesh(){var s;return(s=this.$store.state.printer.bed_mesh)!=null?s:null}get currentProfileName(){var s,e;return(e=(s=this.bed_mesh)==null?void 0:s.profile_name)!=null?e:""}get showPosition(){var s;return(s=this.$store.state.gui.view.toolhead.showPosition)!=null?s:!0}get showCoordinates(){var s;return(s=this.$store.state.gui.view.toolhead.showCoordinates)!=null?s:!0}get showControl(){var s;return(s=this.$store.state.gui.view.toolhead.showControl)!=null?s:!0}get containerClass(){return this.showControl?"pb-0":""}sendCmd(){let s=[];if(this.existsClientLinearMoveMacro||(s.push("SAVE_GCODE_STATE NAME=_ui_movement"),s.push("G90")),this.input.z.pos!==this.gcodePositions.z&&(this.existsClientLinearMoveMacro?s.push("_CLIENT_LINEAR_MOVE Z=".concat(this.input.z.pos," F=").concat(this.feedrateZ*60," ABSOLUTE=1")):s.push("G1 Z".concat(this.input.z.pos," F").concat(this.feedrateZ*60))),this.input.x.pos!==this.gcodePositions.x||this.input.y.pos!==this.gcodePositions.y){let t="",r="";this.existsClientLinearMoveMacro?(this.input.x.pos!==this.gcodePositions.x&&(t=" X=".concat(this.input.x.pos)),this.input.y.pos!==this.gcodePositions.y&&(r=" Y=".concat(this.input.y.pos)),s.push("_CLIENT_LINEAR_MOVE".concat(t).concat(r," F=").concat(this.feedrateXY*60," ABSOLUTE=1"))):(this.input.x.pos!==this.gcodePositions.x&&(t=" X".concat(this.input.x.pos)),this.input.y.pos!==this.gcodePositions.y&&(r=" Y".concat(this.input.y.pos)),s.push("G1".concat(t).concat(r," F").concat(this.feedrateXY*60)))}this.existsClientLinearMoveMacro||s.push("RESTORE_GCODE_STATE NAME=_ui_movement");const e=s.join("\n");this.input.x.valid&&this.input.y.valid&&this.input.z.valid&&(this.$store.dispatch("server/addEvent",{message:e,type:"command"}),this.$socket.emit("printer.gcode.script",{script:e}))}};Wu([he("gcodePositions.x",{immediate:!0})],ji.prototype,"updatePositionX",1);Wu([he("gcodePositions.y",{immediate:!0})],ji.prototype,"updatePositionY",1);Wu([he("gcodePositions.z",{immediate:!0})],ji.prototype,"updatePositionZ",1);ji=Wu([S({components:{MoveToInput:zo,Responsive:tt}})],ji);var xA=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.showCoordinates||e.showPosition?t(Ee,{class:e.containerClass},[t(tt,{attrs:{breakpoints:{xsmall:r=>r.width<=320,small:r=>r.width>320&&r.width<=460,medium:r=>r.width>460&&r.width<=560,large:r=>r.width>560}},scopedSlots:e._u([{key:"default",fn:function({el:r}){return[e.showPosition?t(x,{staticClass:"flex-nowrap pb-1"},[t(b,{staticClass:"v-subheader text--secondary mr-2",class:{"col-5":r.is.small,"col-4":r.is.xsmall||r.is.medium,"col-3":r.is.large}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiCrosshairsGps))]),r.is.xsmall?e._e():t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.Position"))+":  ")]),t("span",{staticClass:"text-no-wrap"},[e._v(e._s(e.displayPositionAbsolute))])],1),e.currentProfileName?t(b,{staticClass:"v-subheader text--secondary pl-2 justify-end text-no-wrap text-truncate"},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiGrid))]),t("span",{staticClass:"text-no-wrap text-truncate"},[e._v(e._s(e.currentProfileName))])],1):e._e()],1):e._e(),e.showCoordinates?t(x,{attrs:{dense:""}},[t(b,{class:r.is.xsmall?"col-12":"col-4"},[t(zo,{attrs:{label:e.livePositions.x,suffix:"X",step:.01,"current-pos":e.gcodePositions.x,readonly:["printing"].includes(e.printer_state),disabled:!e.xAxisHomed},on:{submit:e.sendCmd},model:{value:e.input.x.pos,callback:function(i){e.$set(e.input.x,"pos",i)},expression:"input.x.pos"}})],1),t(b,{class:r.is.xsmall?"col-12":"col-4"},[t(zo,{attrs:{label:e.livePositions.y,suffix:"Y",step:.01,"current-pos":e.gcodePositions.y,readonly:["printing"].includes(e.printer_state),disabled:!e.yAxisHomed},on:{submit:e.sendCmd},model:{value:e.input.y.pos,callback:function(i){e.$set(e.input.y,"pos",i)},expression:"input.y.pos"}})],1),t(b,{class:r.is.xsmall?"col-12":"col-4"},[t(zo,{attrs:{label:e.livePositions.z,suffix:"Z",step:.001,"current-pos":e.gcodePositions.z,readonly:["printing"].includes(e.printer_state),disabled:!e.zAxisHomed},on:{submit:e.sendCmd},model:{value:e.input.z.pos,callback:function(i){e.$set(e.input.z,"pos",i)},expression:"input.z.pos"}})],1)],1):e._e()]}}],null,!1,3225060219)})],1):e._e()},wA=[],SA=E(ji,xA,wA,!1,null,null);const G0=SA.exports;var PA=Object.getOwnPropertyDescriptor,DA=(s,e,t,r)=>{for(var i=r>1?void 0:r?PA(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let yh=class extends k(L){constructor(){super(...arguments),this.mdiCog=ss}get showPosition(){var s;return(s=this.$store.state.gui.view.toolhead.showPosition)!=null?s:!0}set showPosition(s){this.$store.dispatch("gui/saveSetting",{name:"view.toolhead.showPosition",value:s})}get showCoordinates(){var s;return(s=this.$store.state.gui.view.toolhead.showCoordinates)!=null?s:!0}set showCoordinates(s){this.$store.dispatch("gui/saveSetting",{name:"view.toolhead.showCoordinates",value:s})}get showControl(){var s;return(s=this.$store.state.gui.view.toolhead.showControl)!=null?s:!0}set showControl(s){this.$store.dispatch("gui/saveSetting",{name:"view.toolhead.showControl",value:s})}get showZOffset(){var s;return(s=this.$store.state.gui.view.toolhead.showZOffset)!=null?s:!0}set showZOffset(s){this.$store.dispatch("gui/saveSetting",{name:"view.toolhead.showZOffset",value:s})}get showSpeedFactor(){var s;return(s=this.$store.state.gui.view.toolhead.showSpeedFactor)!=null?s:!0}set showSpeedFactor(s){this.$store.dispatch("gui/saveSetting",{name:"view.toolhead.showSpeedFactor",value:s})}};yh=DA([S],yh);var TA=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(ye,{attrs:{"offset-y":!0,left:!0,"close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",i,!1),r),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Me,[t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ToolheadControlPanel.PositionOutput")},model:{value:e.showPosition,callback:function(r){e.showPosition=r},expression:"showPosition"}})],1),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ToolheadControlPanel.CoordinateFields")},model:{value:e.showCoordinates,callback:function(r){e.showCoordinates=r},expression:"showCoordinates"}})],1),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ToolheadControlPanel.ControlButtons")},model:{value:e.showControl,callback:function(r){e.showControl=r},expression:"showControl"}})],1),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ToolheadControlPanel.ZOffset")},model:{value:e.showZOffset,callback:function(r){e.showZOffset=r},expression:"showZOffset"}})],1),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.ToolheadControlPanel.SpeedFactor")},model:{value:e.showSpeedFactor,callback:function(r){e.showSpeedFactor=r},expression:"showSpeedFactor"}})],1)],1)],1)},OA=[],MA=E(yh,TA,OA,!1,null,null);const kA=MA.exports;var EA=Object.getOwnPropertyDescriptor,LA=(s,e,t,r)=>{for(var i=r>1?void 0:r?EA(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Ch=class extends k(L,Je){constructor(){super(...arguments),this.mdiEngineOff=jp,this.mdiHome=av}get enableXYHoming(){return this.$store.state.gui.control.enableXYHoming}get stepsXYsorted(){return[...this.$store.state.gui.control.stepsXY].sort(function(e,t){return t-e})}get stepsXYsortedReverse(){return[...this.$store.state.gui.control.stepsXY].sort(function(e,t){return e-t})}get stepsZsorted(){return[...this.$store.state.gui.control.stepsZ].sort(function(e,t){return t-e})}get stepsZsortedReverse(){return[...this.$store.state.gui.control.stepsZ].sort(function(e,t){return e-t})}};Ch=LA([S],Ch);var AA=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(x,{attrs:{"no-gutters":""}},[t(b,{staticClass:"col-12 pb-0 text-center"},[t(g,{attrs:{small:"",disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeAll"),color:e.homedAxes.includes("xyz")?"primary":"warning"},on:{click:e.doHome}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiHome))]),e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.ALL"))+" ")],1),e.enableXYHoming?t(g,{staticClass:"ml-2",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeAll"),color:e.homedAxes.includes("xy")?"primary":"warning",small:""},on:{click:e.doHomeXY}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiHome))]),e._v(" XY ")],1):e._e(),e.existsQGL?t(g,{staticClass:"ml-2",attrs:{disabled:["printing"].includes(e.printer_state),small:"",loading:e.loadings.includes("qgl"),color:e.colorQuadGantryLevel},on:{click:e.doQGL}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.QGL"))+" ")]):e._e(),e.existsZtilt?t(g,{staticClass:"ml-2",attrs:{disabled:["printing"].includes(e.printer_state),small:"",loading:e.loadings.includes("zTilt"),color:e.colorZTilt},on:{click:e.doZtilt}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.ZTilt"))+" ")]):e._e(),t(g,{staticClass:"ml-2",attrs:{small:"",disabled:["printing"].includes(e.printer_state),color:e.homedAxes!==""?"primary":"warning"},on:{click:function(r){return e.doSend("M84")}}},[t(_,[e._v(e._s(e.mdiEngineOff))])],1)],1)],1),t(x,{attrs:{dense:""}},[t(b,{staticClass:"text-center"},[t(Wt,{staticClass:"_btn-group row no-gutters"},[e._l(e.stepsXYsorted,function(r){return t(g,{key:"x-"+r,staticClass:"btnMinWidthAuto col btnGroup",attrs:{disabled:["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("X-"+r,e.feedrateXY)}}},[t("span",{staticClass:"body-2"},[e._v("–"+e._s(r))])])}),t(g,{staticClass:"font-weight-bold btnHomeAxis btnGroup",attrs:{disabled:["printing"].includes(e.printer_state),color:e.homedAxes.includes("x")?"primary":"warning",loading:e.loadings.includes("homeX")},on:{click:e.doHomeX}},[e._v(" X ")]),e._l(e.stepsXYsortedReverse,function(r){return t(g,{key:"x+"+r,staticClass:"btnMinWidthAuto col btnGroup",attrs:{disabled:["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("X+"+r,e.feedrateXY)}}},[t("span",{staticClass:"body-2"},[e._v("+"+e._s(r))])])})],2)],1)],1),t(x,{attrs:{dense:""}},[t(b,{staticClass:"text-center"},[t(Wt,{staticClass:"_btn-group row no-gutters"},[e._l(e.stepsXYsorted,function(r){return t(g,{key:"y-"+r,staticClass:"btnMinWidthAuto col btnGroup",attrs:{disabled:["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("Y-"+r,e.feedrateXY)}}},[t("span",{staticClass:"body-2"},[e._v("–"+e._s(r))])])}),t(g,{staticClass:"font-weight-bold btnHomeAxis btnGroup",attrs:{disabled:["printing"].includes(e.printer_state),color:e.homedAxes.includes("y")?"primary":"warning",loading:e.loadings.includes("homeY")},on:{click:e.doHomeY}},[e._v(" Y ")]),e._l(e.stepsXYsortedReverse,function(r){return t(g,{key:"y+"+r,staticClass:"btnMinWidthAuto col btnGroup",attrs:{disabled:["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("Y+"+r,e.feedrateXY)}}},[t("span",{staticClass:"body-2"},[e._v("+"+e._s(r))])])})],2)],1)],1),t(x,{attrs:{dense:""}},[t(b,{staticClass:"text-center"},[t(Wt,{staticClass:"_btn-group row no-gutters"},[e._l(e.stepsZsorted,function(r){return t(g,{key:"z-"+r,staticClass:"btnMinWidthAuto col btnGroup",attrs:{disabled:["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("Z-"+r,e.feedrateZ)}}},[t("span",{staticClass:"body-2"},[e._v("–"+e._s(r))])])}),t(g,{staticClass:"font-weight-bold btnHomeAxis btnGroup",attrs:{disabled:["printing"].includes(e.printer_state),color:e.homedAxes.includes("z")?"primary":"warning",loading:e.loadings.includes("homeZ")},on:{click:e.doHomeZ}},[e._v(" Z ")]),e._l(e.stepsZsortedReverse,function(r){return t(g,{key:"z+"+r,staticClass:"btnMinWidthAuto col btnGroup",attrs:{disabled:["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("Z+"+r,e.feedrateZ)}}},[t("span",{staticClass:"body-2"},[e._v("+"+e._s(r))])])})],2)],1)],1)],1)},FA=[],RA=E(Ch,AA,FA,!1,null,"1465edd3");const HA=RA.exports;var jA=Object.getOwnPropertyDescriptor,IA=(s,e,t,r)=>{for(var i=r>1?void 0:r?jA(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let $h=class extends k(L,Je){constructor(){super(...arguments),this.homeIcon="M10,20L10,14L14,14L14,20L19,20L19,12L22,12L12,3L2,12L5,12L5,20L10,20Z",this.pathHomeButtonTop="M9.188,-0C9.634,0.001 10.028,0.291 10.162,0.717C10.295,1.142 10.136,1.605 9.77,1.86C6.722,4.035 4.05,6.701 1.869,9.743C1.614,10.11 1.151,10.269 0.724,10.135C0.298,10.002 0.008,9.607 0.008,9.16C0,6.418 0,2.781 0,1.029C-0,0.756 0.108,0.495 0.302,0.302C0.495,0.108 0.756,-0 1.029,0L9.188,-0Z",this.pathHomeButtonBottom="M9.188,0C9.634,0.001 10.028,0.291 10.162,0.717C10.295,1.142 10.136,1.605 9.77,1.86C6.722,4.035 4.05,6.701 1.869,9.743C1.614,10.11 1.151,10.269 0.724,10.135C0.298,10.002 0.008,9.607 0.008,9.16C0,6.418 0,2.781 0,1.029C-0,0.756 0.108,0.495 0.302,0.302C0.495,0.108 0.756,-0 1.029,0L9.188,0Z",this.xyStepOuter="M43.181,8.535C43.262,8.453 43.373,8.409 43.488,8.412C43.602,8.415 43.711,8.466 43.787,8.551C47.661,12.933 50,18.695 50,25C50,31.291 47.672,37.042 43.811,41.42C43.735,41.505 43.627,41.556 43.512,41.559C43.398,41.562 43.287,41.518 43.206,41.437C42.343,40.575 39.981,38.213 39.981,38.213C43.11,34.7 45,30.069 45,25C45,19.918 43.1,15.276 39.956,11.759C39.956,11.759 42.319,9.397 43.181,8.535Z",this.xyStepOuterMid="M47.418,4.777C57.663,18.688 57.829,31.029 47.304,45.072L39.308,37.098C42.081,33.838 43.75,29.612 43.75,25C43.75,20.371 42.069,16.132 39.277,12.868L47.418,4.777Z",this.xyStepInnerMid="M54.897,-1.964C68.991,16.277 68.542,32.764 54.738,51.763L44.077,41.131L38.115,35.169C40.361,32.389 41.667,28.846 41.667,25C41.667,21.132 40.346,17.57 38.076,14.784L54.897,-1.964Z",this.xyStepInner="M36.096,19.243C35.88,18.839 35.954,18.342 36.278,18.019C40.686,13.619 69.84,-15.445 69.84,-15.445C90.891,13.786 89.845,38.467 69.564,65.144C69.564,65.144 40.684,36.265 36.318,31.899C35.996,31.576 35.922,31.081 36.134,30.678C37.008,28.975 37.5,27.044 37.5,25C37.5,22.925 36.993,20.967 36.096,19.243Z",this.zStepOuter="M66.037,2.5C66.037,1.672 66.709,1 67.537,1L74.537,1C75.365,1 76.037,1.672 76.037,2.5L76.037,7.521C74.428,7.179 72.759,7 71.048,7C69.33,7 67.654,7.181 66.037,7.525L66.037,2.5Z",this.zStepOuterMid="M66.037,7.221C69.367,6.597 72.7,6.583 76.037,7.192L76.037,13.702C74.453,13.245 72.778,13 71.048,13C69.309,13 67.627,13.247 66.037,13.708L66.037,7.221Z",this.zStepInnerMid="M66.037,13.244C69.353,12.66 72.687,12.7 76.037,13.355L76.037,20.099C74.523,19.39 72.831,19 71.048,19C69.256,19 67.556,19.393 66.037,20.109L66.037,13.244Z",this.zStepInner="M66.037,19.186C69.409,18.542 72.742,18.52 76.037,19.102L76.037,23.682C76.037,23.815 75.984,23.942 75.891,24.036C75.564,24.362 74.774,25.153 74.359,25.567C74.204,25.722 73.967,25.757 73.773,25.656C72.955,25.236 72.029,25 71.048,25C70.051,25 69.112,25.243 68.284,25.674C68.09,25.777 67.852,25.742 67.697,25.586C67.283,25.175 66.506,24.395 66.183,24.071C66.09,23.977 66.037,23.85 66.037,23.718C66.037,22.806 66.037,19.186 66.037,19.186Z",this.zTiltIcon1="M74.189,31.503L67.751,30.009L67.638,30.496L74.076,31.99L74.189,31.503Z",this.zTiltIcon2="M74.361,32.85L74.034,32.676L74.939,32.188L75.039,33.211L74.745,33.055C74.386,33.724 73.858,34.288 73.213,34.69L72.983,34.321C73.563,33.959 74.038,33.452 74.361,32.85ZM67.193,28.75C67.586,28.1 68.142,27.564 68.807,27.196L69.018,27.576C68.42,27.907 67.919,28.389 67.565,28.974L67.883,29.165L66.954,29.605L66.907,28.578L67.193,28.75Z",this.engineOffIcon="M3.78 2.5L21.5 20.22l-1.27 1.28L18 19.27V20h-8l-2-2H5v-3H3v3H1v-8h2v3h2v-3l1.87-1.86L2.5 3.77L3.78 2.5M20 9v3h-2V8h-6V6h3V4H7.82l15 15H23V9h-3Z"}get enableXYHoming(){return this.$store.state.gui.control.enableXYHoming}get reverseX(){return this.$store.state.gui.control.reverseX}get reverseY(){return this.$store.state.gui.control.reverseY}get reverseZ(){return this.$store.state.gui.control.reverseZ}get stepsXY(){var t,r;const e=(r=(t=this.$store.state.gui.control)==null?void 0:t.stepsCircleXY)!=null?r:[];return Array.from(new Set([...e!=null?e:[]])).sort((i,n)=>i-n)}get stepsZ(){var t,r;const e=(r=(t=this.$store.state.gui.control)==null?void 0:t.stepsCircleZ)!=null?r:[];return Array.from(new Set([...e!=null?e:[]])).sort((i,n)=>i-n)}get isPrinting(){return["printing"].includes(this.printer_state)}get stepTextClass(){return!this.homedAxes.includes("xy")||this.isPrinting?["disabled"]:[]}get xStepClass(){return!this.homedAxes.includes("x")||this.isPrinting?["disabled"]:[]}get yStepClass(){return!this.homedAxes.includes("y")||this.isPrinting?["disabled"]:[]}get zStepClass(){return!this.homedAxes.includes("z")||this.isPrinting?["disabled"]:[]}get xHomeClass(){let e=[];return this.homedAxes.includes("x")&&e.push("homed"),this.isPrinting&&e.push("disabled"),e}get yHomeClass(){let e=[];return this.homedAxes.includes("y")&&e.push("homed"),this.isPrinting&&e.push("disabled"),e}get xyHomeClass(){let e=[];return this.homedAxes.includes("xy")&&e.push("homed"),this.isPrinting&&e.push("disabled"),e}get xyzHomeClass(){let e=[];return this.homedAxes.includes("xyz")&&e.push("homed"),this.isPrinting&&e.push("disabled"),e}get zHomeClass(){let e=[];return this.homedAxes.includes("z")&&e.push("homed"),this.isPrinting&&e.push("disabled"),e}get colorSpecialButton(){let e=[];return this.isPrinting&&e.push("disabled"),this.existsQGL?e.push(this.colorQuadGantryLevel):this.existsZtilt&&e.push(this.colorZTilt),e}get motorsOffClass(){let e=[];return e.push(this.homedAxes!==""?"primary":"warning"),this.isPrinting&&e.push("disabled"),e}clickSpecialButton(){if(this.existsQGL)this.doQGL();else if(this.existsZtilt)return this.doZtilt()}};$h=IA([S],$h);var NA=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(x,[t(b,{staticClass:"pa-0 mt-1"},[t("svg",{staticStyle:{"fill-rule":"evenodd","clip-rule":"evenodd","stroke-linejoin":"round","stroke-miterlimit":"2"},attrs:{width:"100%",height:"100%",viewBox:"0 0 78 62",xmlns:"http://www.w3.org/2000/svg","xml:space":"preserve"}},[t("g",{attrs:{id:"ArtBoard1",transform:"matrix(1.24239,0,0,1,0,0)"}},[t("rect",{staticStyle:{fill:"none"},attrs:{x:"0",y:"0",width:"62",height:"62"}}),t("g",{attrs:{id:"home_buttons",transform:"matrix(0.804902,0,0,1,0.0430241,0)"}},[t("a",{class:e.xHomeClass,on:{click:e.doHomeX}},[t("g",{attrs:{id:"home_x",transform:"matrix(0.707107,-0.707107,0.707107,0.707107,-1.41799,4.05689)"}},[t("g",{staticClass:"home_button",attrs:{id:"home_button_x",transform:"matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)"}},[t("path",{attrs:{d:e.pathHomeButtonTop}})]),t("g",{attrs:{transform:"matrix(0.654426,0,0,0.654426,0.298666,4.01315)"}},[t("text",{attrs:{x:"3.789px",y:"6.089px"}},[e._v("X")])]),t("g",{staticClass:"home_icon",attrs:{id:"Icon",transform:"matrix(0.147059,0,0,0.147059,2.10662,2.08254)"}},[t("path",{staticStyle:{"fill-rule":"nonzero"},attrs:{d:e.homeIcon}})])])]),t("a",{class:e.yHomeClass,on:{click:e.doHomeY}},[t("g",{attrs:{id:"home_y",transform:"matrix(0.707107,0.707107,-0.707107,0.707107,57.8807,-1.41799)"}},[t("g",{staticClass:"home_button",attrs:{id:"home_button_y",transform:"matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)"}},[t("path",{attrs:{d:e.pathHomeButtonTop}})]),t("g",{attrs:{transform:"matrix(0.654426,0,0,0.654426,0.298666,4.01315)"}},[t("text",{attrs:{x:"3.789px",y:"6.089px"}},[e._v("Y")])]),t("g",{staticClass:"home_icon",attrs:{id:"icon",transform:"matrix(0.147059,0,0,0.147059,2.10662,2.08254)"}},[t("path",{staticStyle:{"fill-rule":"nonzero"},attrs:{d:e.homeIcon}})])])]),t("a",{class:e.zHomeClass,on:{click:e.doHomeZ}},[t("g",{attrs:{id:"home_z",transform:"matrix(-0.707107,0.707107,-0.707107,-0.707107,63.3555,57.8807)"}},[t("g",{staticClass:"home_button",attrs:{id:"home_button_z",transform:"matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)"}},[t("path",{attrs:{d:e.pathHomeButtonBottom}})]),t("g",{attrs:{transform:"matrix(0.654426,0,0,0.654426,0.298666,4.01315)"}},[t("text",{attrs:{x:"3.93px",y:"6.089px"}},[e._v("Z")])]),t("g",{staticClass:"home_icon",attrs:{id:"icon1",transform:"matrix(0.147059,0,0,0.147059,2.10662,2.08254)"}},[t("path",{staticStyle:{"fill-rule":"nonzero"},attrs:{d:e.homeIcon}})])])]),e.enableXYHoming?t("a",{class:e.xyHomeClass,on:{click:e.doHomeXY}},[t("g",{attrs:{id:"home_xy",transform:"matrix(-0.707107,-0.707107,0.707107,-0.707107,4.05689,63.3555)"}},[t("g",{staticClass:"home_button",attrs:{id:"home_button_xy",transform:"matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)"}},[t("path",{attrs:{d:e.pathHomeButtonBottom}})]),t("g",{attrs:{transform:"matrix(0.654426,0,0,0.654426,0.298666,4.01315)"}},[t("text",{attrs:{x:"2.3px",y:"6.089px"}},[e._v("XY")])]),t("g",{staticClass:"home_icon",attrs:{id:"icon2",transform:"matrix(0.147059,0,0,0.147059,2.10662,2.08254)"}},[t("path",{staticStyle:{"fill-rule":"nonzero"},attrs:{d:e.homeIcon}})])])]):t("a",{class:e.xyzHomeClass,on:{click:e.doHome}},[t("g",{attrs:{id:"home_all",transform:"matrix(-0.707107,-0.707107,0.707107,-0.707107,4.05689,63.3555)"}},[t("g",{staticClass:"home_button",attrs:{id:"home_button_all",transform:"matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)"}},[t("path",{attrs:{d:e.pathHomeButtonBottom}})]),t("g",{staticClass:"home_icon",attrs:{id:"icon3",transform:"matrix(0.29377,0,0,0.29377,0.346087,1.64241)"}},[t("path",{staticStyle:{"fill-rule":"nonzero"},attrs:{d:e.homeIcon}})])])]),e.enableXYHoming?t("a",{class:e.xyzHomeClass,on:{click:e.doHome}},[t("g",{staticClass:"home_button",attrs:{id:"home_all_center"}},[t("circle",{attrs:{id:"home_button_all_center",cx:"31",cy:"31",r:"5"}})]),t("g",{staticClass:"home-icon",attrs:{id:"icon4",transform:"scale(0.3) translate(91.25,91.25)"}},[t("path",{staticStyle:{"fill-rule":"nonzero"},attrs:{d:e.homeIcon}})])]):e._e()]),t("g",{attrs:{id:"step_buttons",transform:"matrix(0.804902,0,0,1,0.0430241,0)"}},[t("g",{attrs:{id:"Z",transform:"matrix(1.24239,0,0,1,-0.0534526,0)"}},[t("g",{class:e.zStepClass,attrs:{id:"Bottom",transform:"matrix(-1,-1.52149e-16,9.85721e-17,-1,114.34,62)"}},[t("a",{staticClass:"step inner",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"+":"-").concat(e.stepsZ.length>=0?e.stepsZ[0]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,0,0,1,0,0)"}},[t("path",{attrs:{d:e.zStepInner}})])]),t("a",{staticClass:"step inner-mid",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"+":"-").concat(e.stepsZ.length>=1?e.stepsZ[1]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,1.2326e-32,-9.92118e-33,1,-5.71917e-15,-7.10543e-15)"}},[t("path",{attrs:{d:e.zStepInnerMid}})])]),t("a",{staticClass:"step outer-mid",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"+":"-").concat(e.stepsZ.length>=2?e.stepsZ[2]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,0,0,1,0,0)"}},[t("path",{attrs:{d:e.zStepOuterMid}})])]),t("a",{staticClass:"step outer",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"+":"-").concat(e.stepsZ.length>=3?e.stepsZ[3]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,0,0,1,0,0)"}},[t("path",{attrs:{d:e.zStepOuter}})])])]),t("g",{class:e.zStepClass,attrs:{id:"Top"}},[t("a",{staticClass:"step inner",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"-":"+").concat(e.stepsZ.length>=0?e.stepsZ[0]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,0,0,1,0,0)"}},[t("path",{attrs:{d:e.zStepInner}})])]),t("a",{staticClass:"step inner-mid",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"-":"+").concat(e.stepsZ.length>=1?e.stepsZ[1]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,1.2326e-32,-9.92118e-33,1,-5.71917e-15,-7.10543e-15)"}},[t("path",{attrs:{d:e.zStepInnerMid}})])]),t("a",{staticClass:"step outer-mid",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"-":"+").concat(e.stepsZ.length>=2?e.stepsZ[2]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,0,0,1,0,0)"}},[t("path",{attrs:{d:e.zStepOuterMid}})])]),t("a",{staticClass:"step outer",on:{click:function(r){return e.doSendMove("Z".concat(e.reverseZ?"-":"+").concat(e.stepsZ.length>=3?e.stepsZ[3]:0),e.feedrateZ)}}},[t("g",{attrs:{transform:"matrix(0.804902,0,0,1,0,0)"}},[t("path",{attrs:{d:e.zStepOuter}})])])])]),t("g",{class:e.zStepClass,attrs:{id:"stepsZ",transform:"matrix(1,0,0,1,40,0)"}},[t("g",{attrs:{transform:"matrix(1,0,0,1,0.483899,4.07983)"}},[t("text",{attrs:{x:"30.7px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsZ.length>=0?e.stepsZ[0]:"--")+" ")])]),t("g",{attrs:{transform:"matrix(1,0,0,1,0.220227,-1.95729)"}},[t("text",{attrs:{x:"30.7px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsZ.length>=1?e.stepsZ[1]:"--")+" ")])]),t("g",{attrs:{transform:"matrix(1,0,0,1,0.220227,-7.99441)"}},[t("text",{attrs:{x:"30.7px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsZ.length>=2?e.stepsZ[2]:"--")+" ")])]),t("g",{attrs:{transform:"matrix(1,0,0,1,0.220227,-14.0315)"}},[t("text",{attrs:{x:"30.7px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsZ.length>=3?e.stepsZ[3]:"--")+" ")])])]),t("g",{attrs:{id:"XY"}},[t("g",{class:e.xStepClass,attrs:{id:"Right"}},[t("a",{staticClass:"step inner",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"-":"+").concat(e.stepsXY.length>=0?e.stepsXY[0]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.48,0,0,0.48,19,19)"}},[t("path",{attrs:{d:e.xyStepInner}})])]),t("a",{staticClass:"step inner-mid",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"-":"+").concat(e.stepsXY.length>=1?e.stepsXY[1]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.72,0,0,0.72,13,13)"}},[t("path",{attrs:{d:e.xyStepInnerMid}})])]),t("a",{staticClass:"step outer-mid",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"-":"+").concat(e.stepsXY.length>=2?e.stepsXY[2]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.96,0,0,0.96,7,7)"}},[t("path",{attrs:{d:e.xyStepOuterMid}})])]),t("a",{staticClass:"step outer",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"-":"+").concat(e.stepsXY.length>=3?e.stepsXY[3]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(1.2,0,0,1.2,1,1)"}},[t("path",{attrs:{d:e.xyStepOuter}})])])]),t("g",{class:e.xStepClass,attrs:{id:"Left",transform:"matrix(-1,-1.22465e-16,1.22465e-16,-1,61.9767,61.9767)"}},[t("a",{staticClass:"step inner",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"+":"-").concat(e.stepsXY.length>=0?e.stepsXY[0]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.48,0,0,0.48,19,19)"}},[t("path",{attrs:{d:e.xyStepInner}})])]),t("a",{staticClass:"step inner-mid",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"+":"-").concat(e.stepsXY.length>=1?e.stepsXY[1]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.72,0,0,0.72,13,13)"}},[t("path",{attrs:{d:e.xyStepInnerMid}})])]),t("a",{staticClass:"step outer-mid",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"+":"-").concat(e.stepsXY.length>=2?e.stepsXY[2]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.96,0,0,0.96,7,7)"}},[t("path",{attrs:{d:e.xyStepOuterMid}})])]),t("a",{staticClass:"step outer",on:{click:function(r){return e.doSendMove("X".concat(e.reverseX?"+":"-").concat(e.stepsXY.length>=3?e.stepsXY[3]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(1.2,0,0,1.2,1,1)"}},[t("path",{attrs:{d:e.xyStepOuter}})])])]),t("g",{class:e.yStepClass,attrs:{id:"Bottom1",transform:"matrix(6.12323e-17,1,-1,6.12323e-17,61.9767,-1.77705e-14)"}},[t("a",{staticClass:"step inner",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"+":"-").concat(e.stepsXY.length>=0?e.stepsXY[0]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.48,0,0,0.48,19,19)"}},[t("path",{attrs:{d:e.xyStepInner}})])]),t("a",{staticClass:"step inner-mid",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"+":"-").concat(e.stepsXY.length>=1?e.stepsXY[1]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.72,0,0,0.72,13,13)"}},[t("path",{attrs:{d:e.xyStepInnerMid}})])]),t("a",{staticClass:"step outer-mid",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"+":"-").concat(e.stepsXY.length>=2?e.stepsXY[2]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.96,0,0,0.96,7,7)"}},[t("path",{attrs:{d:e.xyStepOuterMid}})])]),t("a",{staticClass:"step outer",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"+":"-").concat(e.stepsXY.length>=3?e.stepsXY[3]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(1.2,0,0,1.2,1,1)"}},[t("path",{attrs:{d:e.xyStepOuter}})])])]),t("g",{class:e.yStepClass,attrs:{id:"Top1",transform:"matrix(6.12323e-17,-1,1,6.12323e-17,7.10543e-15,61.9767)"}},[t("a",{staticClass:"step inner",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"-":"+").concat(e.stepsXY.length>=0?e.stepsXY[0]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.48,0,0,0.48,19,19)"}},[t("path",{attrs:{d:e.xyStepInner}})])]),t("a",{staticClass:"step inner-mid",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"-":"+").concat(e.stepsXY.length>=1?e.stepsXY[1]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.72,0,0,0.72,13,13)"}},[t("path",{attrs:{d:e.xyStepInnerMid}})])]),t("a",{staticClass:"step outer-mid",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"-":"+").concat(e.stepsXY.length>=2?e.stepsXY[2]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(0.96,0,0,0.96,7,7)"}},[t("path",{attrs:{d:e.xyStepOuterMid}})])]),t("a",{staticClass:"step outer",on:{click:function(r){return e.doSendMove("Y".concat(e.reverseY?"-":"+").concat(e.stepsXY.length>=3?e.stepsXY[3]:0),e.feedrateXY)}}},[t("g",{attrs:{transform:"matrix(1.2,0,0,1.2,1,1)"}},[t("path",{attrs:{d:e.xyStepOuter}})])])])]),t("g",{class:e.stepTextClass,attrs:{id:"stepsXY"}},[t("g",{attrs:{transform:"matrix(1,0,0,1,0.483899,4.07983)"}},[t("text",{attrs:{x:"30.5px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsXY.length>=0?e.stepsXY[0]:"--")+" ")])]),t("g",{attrs:{transform:"matrix(1,0,0,1,0.220227,-1.95729)"}},[t("text",{attrs:{x:"30.5px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsXY.length>=1?e.stepsXY[1]:"--")+" ")])]),t("g",{attrs:{transform:"matrix(1,0,0,1,0.220227,-7.99441)"}},[t("text",{attrs:{x:"30.5px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsXY.length>=2?e.stepsXY[2]:"--")+" ")])]),t("g",{attrs:{transform:"matrix(1,0,0,1,0.220227,-14.0315)"}},[t("text",{attrs:{x:"30.5px",y:"19.056px","text-anchor":"middle"}},[e._v(" "+e._s(e.stepsXY.length>=3?e.stepsXY[3]:"--")+" ")])])])])]),e.existsQGL&&e.actionButton==="qgl"?t("a",{class:e.colorSpecialButton,attrs:{id:"tilt_adjust"},on:{click:e.clickSpecialButton}},[t("circle",{attrs:{id:"qgl_button",cx:"70.92",cy:"31",r:"5"}}),t("text",{attrs:{x:"66.776px",y:"32.066px"}},[e._v("QGL")]),t("g",{attrs:{id:"tilt_icon"}},[t("path",{attrs:{d:e.zTiltIcon1}}),t("path",{attrs:{d:e.zTiltIcon2}})])]):e.existsZtilt&&e.actionButton==="ztilt"?t("a",{class:e.colorSpecialButton,attrs:{id:"tilt_adjust"},on:{click:e.clickSpecialButton}},[t("circle",{attrs:{id:"tilt_button",cx:"70.92",cy:"31",r:"5"}}),t("text",{attrs:{x:"66.776px",y:"32.066px"}},[e._v("Z-TILT")]),t("g",{attrs:{id:"tilt_icon"}},[t("path",{attrs:{d:e.zTiltIcon1}}),t("path",{attrs:{d:e.zTiltIcon2}})])]):t("a",{class:e.motorsOffClass,attrs:{id:"stepper_off"},on:{click:function(r){return e.doSend("M84")}}},[t("circle",{attrs:{id:"stepper_off_button",cx:"70.92",cy:"31",r:"5"}}),t("g",{attrs:{id:"stepper_off_icon",transform:"scale(0.3) translate(224,91)"}},[t("path",{attrs:{d:e.engineOffIcon}})])])])])],1)],1)},VA=[],BA=E($h,NA,VA,!1,null,"c8151d8a");const UA=BA.exports;var WA=Object.getOwnPropertyDescriptor,zA=(s,e,t,r)=>{for(var i=r>1?void 0:r?WA(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let xh=class extends k(L,Je){constructor(){super(...arguments),this.mdiChevronUp=du,this.mdiChevronLeft=Sw,this.mdiChevronRight=Pw,this.mdiChevronDown=fr,this.mdiEngineOff=jp,this.mdiHome=av}get selectedCrossStep(){return this.$store.state.gui.control.selectedCrossStep}set selectedCrossStep(e){this.$store.dispatch("gui/saveSetting",{name:"control.selectedCrossStep",value:e})}get stepSize(){return this.stepsReversed[this.selectedCrossStep]}get reverseX(){return this.$store.state.gui.control.reverseX}get reverseY(){return this.$store.state.gui.control.reverseY}get reverseZ(){return this.$store.state.gui.control.reverseZ}get stepsAll(){var e,t;return(t=(e=this.$store.state.gui.control)==null?void 0:e.stepsAll)!=null?t:[]}get stepsReversed(){var e;return Array.from(new Set([...(e=this.stepsAll)!=null?e:[]])).sort((t,r)=>t-r)}};xh=zA([S({components:{Responsive:tt}})],xh);var GA=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(tt,{attrs:{breakpoints:{small:r=>r.width<=300}},scopedSlots:e._u([{key:"default",fn:function({el:r}){return[t("div",[t(x,[t(b,[t(x,{staticClass:"mb-1",attrs:{dense:""}},[t(b,{attrs:{cols:"3"}}),t(b,{attrs:{cols:"3"}},[t(g,{staticClass:"btnMinWidthAuto fill-width",attrs:{disabled:!e.yAxisHomed||e.selectedCrossStep===null||e.selectedCrossStep===void 0||["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("Y".concat(e.reverseY?"-":"+").concat(e.stepSize),e.feedrateXY)}}},[t(_,[e._v(e._s(e.mdiChevronUp))])],1)],1),t(b,{attrs:{cols:"3"}}),t(b,{attrs:{cols:"3"}},[t(g,{staticClass:"btnMinWidthAuto fill-width",attrs:{disabled:!e.zAxisHomed||e.selectedCrossStep===null||e.selectedCrossStep===void 0||["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("Z".concat(e.reverseZ?"-":"+").concat(e.stepSize),e.feedrateZ)}}},[t(_,[e._v(e._s(e.mdiChevronUp))])],1)],1)],1),t(x,{attrs:{dense:""}},[t(b,{staticClass:"position-relative",attrs:{cols:"3"}},[t(g,{staticClass:"btnMinWidthAuto fill-width position-absolute",staticStyle:{top:"-50%",width:"calc(100% - 8px)"},attrs:{disabled:!e.xAxisHomed||e.selectedCrossStep===null||e.selectedCrossStep===void 0||["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("X".concat(e.reverseX?"+":"-").concat(e.stepSize),e.feedrateXY)}}},[t(_,[e._v(e._s(e.mdiChevronLeft))])],1)],1),t(b,{attrs:{cols:"3"}},[t(g,{staticClass:"btnMinWidthAuto fill-width",attrs:{disabled:!e.yAxisHomed||e.selectedCrossStep===null||e.selectedCrossStep===void 0||["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("Y".concat(e.reverseY?"+":"-").concat(e.stepSize),e.feedrateXY)}}},[t(_,[e._v(e._s(e.mdiChevronDown))])],1)],1),t(b,{staticClass:"position-relative",attrs:{cols:"3"}},[t(g,{staticClass:"btnMinWidthAuto fill-width position-absolute",staticStyle:{top:"-50%",width:"calc(100% - 8px)"},attrs:{disabled:!e.xAxisHomed||e.selectedCrossStep===null||e.selectedCrossStep===void 0||["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("X".concat(e.reverseX?"-":"+").concat(e.stepSize),e.feedrateXY)}}},[t(_,[e._v(e._s(e.mdiChevronRight))])],1)],1),t(b,{attrs:{cols:"3"}},[t(g,{staticClass:"btnMinWidthAuto fill-width",attrs:{disabled:!e.zAxisHomed||e.selectedCrossStep===null||e.selectedCrossStep===void 0||["printing"].includes(e.printer_state)},on:{click:function(i){return e.doSendMove("Z".concat(e.reverseZ?"+":"-").concat(e.stepSize),e.feedrateZ)}}},[t(_,[e._v(e._s(e.mdiChevronDown))])],1)],1)],1)],1),r.is.small?e._e():t(b,{staticClass:"d-flex align-center"},[t("div",{staticClass:"flex-grow-1",staticStyle:{"border-radius":"4px",overflow:"hidden"}},[t(x,{staticStyle:{"margin-bottom":"-2px !important"},attrs:{dense:""}},[t(b,{attrs:{cols:"6"}},[t(g,{staticClass:"w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeAll"),color:e.homedAxes.includes("xyz")?"primary":"warning",height:"30",tile:""},on:{click:e.doHome}},[t("div",{staticClass:"d-flex align-center"},[t(_,[e._v(e._s(e.mdiHome))]),t("span",[e._v(e._s(e.$t("Panels.ToolheadControlPanel.ALL")))])],1)])],1),t(b,{staticClass:"d-flex",attrs:{cols:"6"}},[e.actionButton==="qgl"?t(g,{staticClass:"btnMinWidthAuto flex-grow-1 px-0",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("qgl"),color:e.colorQuadGantryLevel,height:"30",dense:"",tile:""},on:{click:e.doQGL}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.QGL"))+" ")]):e.actionButton==="ztilt"?t(g,{staticClass:"btnMinWidthAuto flex-grow-1 px-0",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("zTilt"),color:e.colorZTilt,height:"30",dense:"",tile:""},on:{click:e.doZtilt}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.ZTilt"))+" ")]):t(g,{staticClass:"flex-grow-1 px-0",attrs:{disabled:["printing"].includes(e.printer_state),color:e.homedAxes!==""?"primary":"warning",height:"30",dense:"",tile:""},on:{click:function(i){return e.doSend("M84")}}},[t(_,[e._v(e._s(e.mdiEngineOff))])],1)],1)],1),t(x,{attrs:{dense:""}},[e.enableXYHoming?e._e():t(b,{staticClass:"flex-grow-1",attrs:{cols:"4"}},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeX"),color:e.homedAxes.includes("x")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeX}},[e._v(" X ")])],1),e.enableXYHoming?t(b,{staticClass:"flex-grow-1",attrs:{cols:"6"}},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeY"),color:e.homedAxes.includes("xy")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeXY}},[e._v(" XY ")])],1):t(b,{staticClass:"flex-grow-1",attrs:{cols:"4"}},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeY"),color:e.homedAxes.includes("y")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeY}},[e._v(" Y ")])],1),t(b,{staticClass:"flex-grow-1",class:e.enableXYHoming?"col-6":"col-4"},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeZ"),color:e.homedAxes.includes("z")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeZ}},[e._v(" Z ")])],1)],1)],1)])],1),r.is.small?t(x,[t(b,{staticClass:"d-flex align-center"},[t("div",{staticClass:"flex-grow-1",staticStyle:{"border-radius":"4px",overflow:"hidden"}},[t(x,{staticStyle:{"margin-bottom":"-2px !important"},attrs:{dense:""}},[t(b,{attrs:{cols:"6"}},[t(g,{staticClass:"w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeAll"),color:e.homedAxes.includes("xyz")?"primary":"warning",height:"30",tile:""},on:{click:e.doHome}},[t("div",{staticClass:"d-flex align-center"},[t(_,[e._v(e._s(e.mdiHome))]),t("span",[e._v(e._s(e.$t("Panels.ToolheadControlPanel.ALL")))])],1)])],1),t(b,{staticClass:"d-flex",attrs:{cols:"6"}},[e.actionButton==="qgl"?t(g,{staticClass:"btnMinWidthAuto flex-grow-1 px-0",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("qgl"),color:e.colorQuadGantryLevel,height:"30",dense:"",tile:""},on:{click:e.doQGL}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.QGL"))+" ")]):e.actionButton==="ztilt"?t(g,{staticClass:"btnMinWidthAuto flex-grow-1 px-0",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("zTilt"),color:e.colorZTilt,height:"30",dense:"",tile:""},on:{click:e.doZtilt}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.ZTilt"))+" ")]):t(g,{staticClass:"flex-grow-1 px-0",attrs:{disabled:["printing"].includes(e.printer_state),color:e.homedAxes!==""?"primary":"warning",height:"30",dense:"",tile:""},on:{click:function(i){return e.doSend("M84")}}},[t(_,[e._v(e._s(e.mdiEngineOff))])],1)],1)],1),t(x,{attrs:{dense:""}},[e.enableXYHoming?e._e():t(b,{staticClass:"flex-grow-1",attrs:{cols:"4"}},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeX"),color:e.homedAxes.includes("x")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeX}},[e._v(" X ")])],1),e.enableXYHoming?t(b,{staticClass:"flex-grow-1",attrs:{cols:"6"}},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeY"),color:e.homedAxes.includes("xy")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeXY}},[e._v(" XY ")])],1):t(b,{staticClass:"flex-grow-1",attrs:{cols:"4"}},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeY"),color:e.homedAxes.includes("y")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeY}},[e._v(" Y ")])],1),t(b,{staticClass:"flex-grow-1",class:e.enableXYHoming?"col-6":"col-4"},[t(g,{staticClass:"btnMinWidthAuto w-100",attrs:{disabled:["printing"].includes(e.printer_state),loading:e.loadings.includes("homeZ"),color:e.homedAxes.includes("z")?"primary":"warning",tile:"",height:"30"},on:{click:e.doHomeZ}},[e._v(" Z ")])],1)],1)],1)])],1):e._e(),t(x,{staticClass:"mt-3",attrs:{"no-gutters":""}},[t(b,[e.stepsReversed.length>0?t(Nn,{key:"all-steps-".concat(e.stepsReversed.join("_")),staticStyle:{"flex-wrap":"nowrap",width:"100%"},attrs:{dense:"",mandatory:""},model:{value:e.selectedCrossStep,callback:function(i){e.selectedCrossStep=i},expression:"selectedCrossStep"}},e._l(e.stepsReversed,function(i){return t(g,{key:"step-".concat(i),staticClass:"btnMinWidthAuto flex-grow-1 px-0",staticStyle:{height:"28px"},attrs:{disabled:["printing"].includes(e.printer_state),dense:""}},[t("span",{staticClass:"body-2"},[e._v(e._s(i))])])}),1):t("div",{staticClass:"font-weight-bold warning rounded pa-2"},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.PleaseConfigureSteps"))+" "),t("br"),t("router-link",{staticStyle:{color:"white"},attrs:{to:"/settings/interface"}},[e._v(" "+e._s(e.$t("Panels.ToolheadControlPanel.SettingsInterfaceControl"))+" ")])],1)],1)],1)],1)]}}])})},ZA=[],qA=E(xh,GA,ZA,!1,null,"55a7e126");const XA=qA.exports;var YA=Object.getOwnPropertyDescriptor,JA=(s,e,t,r)=>{for(var i=r>1?void 0:r?YA(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let wh=class extends k(L,Je){constructor(){super(...arguments),this.mdiDotsVertical=mu,this.mdiEngineOff=jp,this.mdiGamepad=Up,this.mdiSpeedometer=Cv,this.mdiRestore=bS,this.mdiMenuDown=gr}get controlStyle(){var e;return(e=this.$store.state.gui.control.style)!=null?e:"bars"}get actionButton(){var e;return(e=this.$store.state.gui.control.actionButton)!=null?e:this.defaultActionButton}get speedFactor(){var e,t,r;return(r=(t=(e=this.$store.state.printer)==null?void 0:e.gcode_move)==null?void 0:t.speed_factor)!=null?r:1}get isPrinting(){return["printing"].includes(this.printer_state)}get axisControlVisible(){var e;return this.showControl?!(this.isPrinting&&((e=this.$store.state.gui.control.hideDuringPrint)!=null&&e)):!1}get showButtons(){return this.controlStyle!=="bars"&&(this.existsZtilt||this.existsQGL)?!0:this.existsBedScrews||this.existsBedTilt||this.existsDeltaCalibrate||this.existsScrewsTilt}get showControl(){var e;return(e=this.$store.state.gui.view.toolhead.showControl)!=null?e:!0}get showZOffset(){var e;return(e=this.$store.state.gui.view.toolhead.showZOffset)!=null?e:!0}get showSpeedFactor(){var e;return(e=this.$store.state.gui.view.toolhead.showSpeedFactor)!=null?e:!0}};wh=JA([S({components:{BarsControl:HA,CircleControl:UA,CrossControl:XA,MoveToControl:G0,Panel:U,ToolSlider:Fu,ZoffsetControl:z0}})],wh);var KA=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.klipperReadyForGui?t(U,{attrs:{icon:e.mdiGamepad,title:e.$t("Panels.ToolheadControlPanel.Headline"),collapsible:!0,"card-class":"toolhead-control-panel"},scopedSlots:e._u([{key:"buttons",fn:function(){return[e.showButtons?t(ye,{staticClass:"pa-0",attrs:{left:"","offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:"",disabled:["printing"].includes(e.printer_state)}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiDotsVertical))])],1)]}}],null,!1,3697264518)},[t(Me,{attrs:{dense:""}},[e.controlStyle!=="bars"&&e.actionButton!=="m84"?t(J,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){return e.doSend("M84")}}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiEngineOff))]),e._v(" "+e._s(e.$t("Settings.ControlTab.MotorsOff",{isDefault:""}))+" ")],1)],1):e._e(),e.controlStyle!=="bars"&&e.existsZtilt&&e.actionButton!=="ztilt"?t(J,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:e.doZtilt}},[e._v("Z-Tilt Adjust")])],1):e._e(),e.controlStyle!=="bars"&&e.existsQGL&&e.actionButton!=="qgl"?t(J,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:e.doQGL}},[e._v("Quad Gantry Level")])],1):e._e(),e.existsBedTilt?t(J,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){return e.doSend("BED_TILT_CALIBRATE")}}},[e._v(" BED TILT CALIBRATE ")])],1):e._e(),e.existsBedScrews?t(J,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){return e.doSend("BED_SCREWS_ADJUST")}}},[e._v("BED SCREWS ADJUST")])],1):e._e(),e.existsDeltaCalibrate?t(J,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){return e.doSend("DELTA_CALIBRATE")}}},[e._v("DELTA CALIBRATE")])],1):e._e(),e.existsScrewsTilt?t(J,[t("div",{staticClass:"d-flex align-center",staticStyle:{width:"100%"}},[t(g,{staticStyle:{"border-top-right-radius":"0","border-bottom-right-radius":"0"},attrs:{small:""},on:{click:function(r){return e.doSend("SCREWS_TILT_CALCULATE")}}},[e._v(" SCREWS TILT CALCULATE ")]),t(ye,{attrs:{"offset-y":"",left:"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"px-0",staticStyle:{"min-width":"32px","border-top-left-radius":"0","border-bottom-left-radius":"0"},attrs:{small:""}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiMenuDown))])],1)]}}],null,!1,274928364)},[t(Me,{attrs:{dense:""}},[t(J,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){return e.doSend("SCREWS_TILT_CALCULATE DIRECTION=CW")}}},[t(_,{staticStyle:{transform:"scaleX(-1)"},attrs:{left:"",small:""}},[e._v(e._s(e.mdiRestore))]),t("span",[e._v("CW")])],1)],1),t(J,[t(g,{staticStyle:{width:"100%"},attrs:{small:""},on:{click:function(r){return e.doSend("SCREWS_TILT_CALCULATE DIRECTION=CCW")}}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiRestore))]),t("span",[e._v("CCW")])],1)],1)],1)],1)],1)]):e._e()],1)],1):e._e(),t(kA)]},proxy:!0}],null,!1,2619595342)},[t(G0),e.axisControlVisible?t(Ee,[t("".concat(e.controlStyle,"-control"),{tag:"component"})],1):e._e(),e.showZOffset?t(I):e._e(),e.showZOffset?t(Ee,[t(z0)],1):e._e(),e.showSpeedFactor?t(I):e._e(),e.showSpeedFactor?t(Ee,[t(Fu,{attrs:{label:e.$t("Panels.ToolheadControlPanel.SpeedFactor"),icon:e.mdiSpeedometer,target:e.speedFactor,min:1,max:200,multi:100,step:5,"dynamic-range":!0,"has-input-field":!0,command:"M220","attribute-name":"S"}})],1):e._e()],1):e._e()},QA=[],eF=E(wh,KA,QA,!1,null,null);const tF=eF.exports;var sF=Object.defineProperty,rF=Object.getOwnPropertyDescriptor,Ef=(s,e,t,r)=>{for(var i=r>1?void 0:r?rF(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&sF(e,t,i),i};let va=class extends k(L,vt){constructor(){super(...arguments),this.hoverChart=!1,this.isVisible=!0}get chartOptions(){return{renderer:"svg",animation:!1,tooltip:this.tooltip,grid:{top:35,right:this.gridRight,bottom:30,left:25},legend:{animation:!1,show:!1,selected:this.selectedLegends},xAxis:{type:"time",splitNumber:5,minInterval:60*1e3,splitLine:{show:!0,lineStyle:{color:this.fgColorFaint}},axisLabel:{color:this.fgColorLow,margin:10,formatter:this.timeFormat}},yAxis:this.yAxis,media:this.media,dataset:{source:[]},series:this.series}}get tooltip(){return{animation:!1,trigger:"axis",backgroundColor:this.bgColor(1),borderWidth:0,textStyle:{color:this.fgColorHi,fontSize:"14px"},padding:15,formatter:this.tooltipFormatter,confine:!0,className:"echarts-tooltip",position:function(s,e,t,r,i){const n={top:60};return n[["left","right"][+(s[0]this.autoscale?Math.ceil((s.max+5)/20)*20:this.maxTemp,minInterval:20,maxInterval:100,nameLocation:"end",nameGap:5,nameTextStyle:{color:this.fgColorMid,align:"left"},splitLine:{lineStyle:{color:this.fgColorFaint}},axisLabel:{color:this.fgColorMid,formatter:"{value}",rotate:90,showMinLabel:!0,margin:5},axisLine:{show:!0,lineStyle:{color:this.fgColorLow}}},{show:this.boolDisplayPwmAxis,name:"PWM [%]",min:0,max:1,minInterval:.25,type:"value",nameLocation:"end",nameGap:5,nameTextStyle:{color:this.fgColorMid,align:"right"},splitLine:{show:!1},axisLabel:{color:this.fgColorMid,formatter:s=>s*100,showMinLabel:!0,rotate:90,margin:5},axisLine:{show:!0,lineStyle:{color:this.fgColorLow}}}]}get media(){return[{query:{minWidth:500},option:{grid:{right:this.optionGridRight,left:40},yAxis:[{maxInterval:50,axisLabel:{showMinLabel:!1,showMaxLabel:!0,rotate:0}},{maxInterval:25,axisLabel:{showMinLabel:!1,rotate:0}}]}}]}get chart(){var s,e;return(e=(s=this.$refs.tempchart)==null?void 0:s.chart)!=null?e:null}get maxHistory(){return this.$store.getters["printer/tempHistory/getTemperatureStoreSize"]}get series(){var s;return(s=this.$store.state.printer.tempHistory.series)!=null?s:{}}get source(){var s;return(s=this.$store.state.printer.tempHistory.source)!=null?s:[]}get autoscale(){var s;return(s=this.$store.state.gui.view.tempchart.autoscale)!=null?s:!0}get maxTemp(){var s;return(s=this.$store.getters["printer/getMaxTemp"])!=null?s:300}get boolDisplayPwmAxis(){return this.$store.getters["printer/tempHistory/getBoolDisplayPwmAxis"]}get selectedLegends(){return this.$store.getters["printer/tempHistory/getSelectedLegends"]}get timeFormat(){return this.hours12Format?"{hh}:{mm}":"{HH}:{mm}"}get tempchartHeight(){var s;return(s=this.$store.state.gui.uiSettings.tempchartHeight)!=null?s:250}get tempchartStyle(){return{height:this.tempchartHeight+"px"}}get gridRight(){return this.boolDisplayPwmAxis?25:15}get optionGridRight(){return this.boolDisplayPwmAxis?35:15}beforeDestroy(){typeof window>"u"||this.chart&&this.chart.dispose()}visibilityChanged(s){this.isVisible=s}tooltipFormatter(s){let e="";const t=s.filter(r=>r.seriesName.endsWith("-temperature"));if(s.length){let r=s[0].axisValueLabel;r=r.substring(r.indexOf(" "));const i=this.$vuetify.theme.dark?"theme-dark":"";e+='
')+r+"
"}return t.forEach(r=>{const i=r.seriesName.substring(0,r.seriesName.lastIndexOf("-"));let n=i;n.indexOf(" ")!==-1&&(n=n.substring(n.indexOf(" ")+1)),e+='
',e+='
',e+=r.marker,e+=""+Ye(n)+":",e+="
",e+='
';const a="".concat(i,"-temperature"),o="".concat(i,"-target");if(a in r.value){const l=r.value[a];e+=l!==null?l.toFixed(1):"--"}if(o in r.value){e+=" / ";const l=r.value[o];e+=l!==null?l.toFixed(1):"--"}e+="°C",Xn.forEach(l=>{const u="".concat(i,"-").concat(l);if(!(u in r.value))return;let c=r.value[u];c=c!==null?(r.value[u]*100).toFixed(0):"--",e+=" [ ".concat(c,"% ]")}),e+="
",e+="
"}),e}selectedLegendsChanged(s){var e,t;((e=this.chart)==null?void 0:e.isDisposed())!==!0&&((t=this.chart)==null||t.setOption({legend:{selected:s}}))}sourceChanged(s){var r;if(!this.chart||!this.isVisible||this.hoverChart)return;(r=this.chart)==null||r.setOption({dataset:{source:s}});const e=new Date(Date.now()-this.maxHistory*1e3);let t=s.filter(i=>i.date>=e);s.length>0&&t.length{for(var i=r>1?void 0:r?lF(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&oF(e,t,i),i};let ba=class extends k(L){get value(){return this.$store.getters["gui/getDatasetAdditionalSensorValue"]({name:this.objectName,type:this.additionalSensor})}set value(s){this.$store.dispatch("gui/setDatasetAdditionalSensorStatus",{objectName:this.objectName,dataset:this.additionalSensor,value:s})}get label(){return this.$t("Panels.TemperaturePanel.ShowNameInList",{name:this.additionalSensor})}};Lf([w({type:String,required:!0})],ba.prototype,"objectName",2);Lf([w({type:String,required:!0})],ba.prototype,"additionalSensor",2);ba=Lf([S],ba);var cF=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,[t(b,{staticClass:"col-12 py-1"},[t(ge,{staticClass:"mt-0",attrs:{label:e.label,"hide-details":""},model:{value:e.value,callback:function(r){e.value=r},expression:"value"}})],1)],1)},uF=[],dF=E(ba,cF,uF,!1,null,null);const q0=dF.exports;var mF=Object.defineProperty,hF=Object.getOwnPropertyDescriptor,Af=(s,e,t,r)=>{for(var i=r>1?void 0:r?hF(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&mF(e,t,i),i};let ya=class extends k(L){get value(){return this.$store.getters["gui/getDatasetValue"]({name:this.objectName,type:this.serieName})}get label(){return this.$t("Panels.TemperaturePanel.ShowNameInChart",{name:this.formatSerieName})}set value(s){this.$store.dispatch("gui/setChartDatasetStatus",{objectName:this.objectName,dataset:this.serieName,value:s})}get formatSerieName(){return lr(this.serieName)}};Af([w({type:String,required:!0})],ya.prototype,"objectName",2);Af([w({type:String,required:!0})],ya.prototype,"serieName",2);ya=Af([S],ya);var pF=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,[t(b,{staticClass:"py-1"},[t(ge,{staticClass:"mt-0",attrs:{label:e.label,"hide-details":""},model:{value:e.value,callback:function(r){e.value=r},expression:"value"}})],1)],1)},fF=[],gF=E(ya,pF,fF,!1,null,null);const X0=gF.exports;var _F=Object.defineProperty,vF=Object.getOwnPropertyDescriptor,zs=(s,e,t,r)=>{for(var i=r>1?void 0:r?vF(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&_F(e,t,i),i};let ms=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe}get chartSeries(){var s;return(s=this.$store.getters["printer/tempHistory/getSerieNames"](this.objectName))!=null?s:[]}get printerObjectAdditionalSensor(){return this.additionalSensorName===null||!(this.additionalSensorName in this.$store.state.printer)?{}:this.$store.state.printer[this.additionalSensorName]}get additionalValues(){return this.objectName==="z_thermal_adjust"?["current_z_adjust"]:this.objectName.startsWith("nevermore")?["temperature","pressure","humidity","rpm"]:Object.keys(this.printerObjectAdditionalSensor).filter(s=>s!=="temperature")}setChartColor(s){typeof s=="object"&&"hex"in s&&(s=s.hex),this.$store.dispatch("gui/setChartColor",{objectName:this.objectName,value:s}),this.$store.dispatch("printer/tempHistory/setColor",{name:this.objectName,value:s})}closeDialog(){this.$emit("close-dialog")}};zs([w({type:Boolean,required:!0})],ms.prototype,"boolShow",2);zs([w({type:String,required:!0})],ms.prototype,"objectName",2);zs([w({type:String,required:!0})],ms.prototype,"name",2);zs([w({required:!0})],ms.prototype,"additionalSensorName",2);zs([w({type:String,required:!0})],ms.prototype,"formatName",2);zs([w({type:String,required:!0})],ms.prototype,"icon",2);zs([w({type:String,required:!0})],ms.prototype,"color",2);zs([Ke(500)],ms.prototype,"setChartColor",1);ms=zs([S({components:{TemperaturePanelListItemEditAdditionalSensor:q0,TemperaturePanelListItemEditChartSerie:X0}})],ms);var bF=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{persistent:"",width:400},model:{value:e.boolShow,callback:function(r){e.boolShow=r},expression:"boolShow"}},[t(U,{attrs:{title:e.formatName,icon:e.icon,"card-class":"temperature-edit-heater-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"pt-6"},[e._l(e.chartSeries,function(r){return t(X0,{key:r,attrs:{"object-name":e.objectName,"serie-name":r}})}),e._l(e.additionalValues,function(r){return t(q0,{key:r,attrs:{"object-name":e.objectName,"additional-sensor":r}})}),t(x,[t(b,{staticClass:"col-12 text-center pb-0"},[t(Xt,{staticClass:"mx-auto",attrs:{"hide-mode-switch":"",mode:"hexa",value:e.color},on:{"update:color":e.setChartColor}})],1)],1)],2)],1)],1)},yF=[],CF=E(ms,bF,yF,!1,null,null);const Y0=CF.exports;var $F=Object.defineProperty,xF=Object.getOwnPropertyDescriptor,Gs=(s,e,t,r)=>{for(var i=r>1?void 0:r?xF(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&$F(e,t,i),i};let hs=class extends k(L,Je){constructor(){super(...arguments),this.mdiSnowflake=bu,this.mdiFire=sn,this.mdiMenuDown=gr,this.value=0}setTemps(){var e;if(typeof this.value=="object"&&(this.value=(e=this.value.value)!=null?e:0),this.value===null&&(this.value=0),this.value>this.max_temp)this.value={value:this.target,text:this.target},this.$toast.error(this.$t("Panels.TemperaturePanel.TempTooHigh",{name:this.name,max:this.max_temp})+"");else if(this.value{for(var i=r>1?void 0:r?TF(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&DF(e,t,i),i};let Ii=class extends k(L){get value(){var e;const s=(e=this.printerObject[this.keyName])!=null?e:null;return isNaN(s)?null:s}get formatValue(){var t;let s=(t=this.value)==null?void 0:t.toFixed(1);this.value===null&&(s="--");let e=null;switch(this.keyName){case"pressure":e="hPa";break;case"humidity":e="%";break;case"current_z_adjust":e="mm";break}return this.keyName==="current_z_adjust"&&this.value&&(s=this.value.toFixed(3),Math.abs(this.value)<.1&&(s=Math.round(this.value*1e3).toString(),e="μm")),e?"".concat(s," ").concat(e):s}get guiSetting(){return this.$store.getters["gui/getDatasetAdditionalSensorValue"]({name:this.objectName,sensor:this.keyName})}get isVisible(){return this.value===null?!1:this.guiSetting}};zu([w({type:Object,required:!0})],Ii.prototype,"printerObject",2);zu([w({type:String,required:!0})],Ii.prototype,"objectName",2);zu([w({type:String,required:!0})],Ii.prototype,"keyName",2);Ii=zu([S],Ii);var OF=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.isVisible?t("div",[t("small",[e._v(e._s(e.formatValue))])]):e._e()},MF=[],kF=E(Ii,OF,MF,!1,null,null);const EF=kF.exports;var LF=Object.defineProperty,AF=Object.getOwnPropertyDescriptor,Ff=(s,e,t,r)=>{for(var i=r>1?void 0:r?AF(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&LF(e,t,i),i};let Ca=class extends k(L){get printerObject(){return this.additionalObjectName in this.$store.state.printer?this.$store.state.printer[this.additionalObjectName]:{}}get additionalValues(){return this.objectName==="z_thermal_adjust"?["current_z_adjust"]:Object.keys(this.printerObject).filter(s=>s!=="temperature")}};Ff([w({type:String,required:!0})],Ca.prototype,"objectName",2);Ff([w({type:String,required:!0})],Ca.prototype,"additionalObjectName",2);Ca=Ff([S],Ca);var FF=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",e._l(e.additionalValues,function(r){return t(EF,{key:r,attrs:{"printer-object":e.printerObject,"object-name":e.objectName,"key-name":r}})}),1)},RF=[],HF=E(Ca,FF,RF,!1,null,null);const jF=HF.exports,zd=new y,Gd="close-temperature-context-menu";var IF=Object.defineProperty,NF=Object.getOwnPropertyDescriptor,Rf=(s,e,t,r)=>{for(var i=r>1?void 0:r?NF(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&IF(e,t,i),i};let $a=class extends k(L){constructor(){super(...arguments),this.mdiCog=ss,this.mdiSnowflake=bu,this.showEditDialog=!1,this.showContextMenu=!1,this.contextMenuX=0,this.contextMenuY=0}get printerObject(){return this.objectName in this.$store.state.printer?this.$store.state.printer[this.objectName]:{}}get printerObjectSettings(){var e,t,r,i,n;const s=this.objectName.toLowerCase();return s in((r=(t=(e=this.$store.state.printer)==null?void 0:e.configfile)==null?void 0:t.settings)!=null?r:{})?(n=(i=this.$store.state.printer)==null?void 0:i.configfile)==null?void 0:n.settings[s]:{}}get name(){const s=this.objectName.split(" ");return s.length===1?this.objectName:s[1]}get formatName(){return Ye(this.name)}get icon(){var s;return this.objectName.startsWith("extruder")?(s=this.printerObject.can_extrude)!=null&&s?Us:vv:this.objectName==="heater_bed"?this.temperature!==null&&this.temperature>50||this.target&&this.temperature&&this.temperature>this.target-5?gS:yv:this.objectName.startsWith("heater_generic")?sn:this.objectName.startsWith("tmc")?dv:this.isFan?Ip:fi}get color(){var s;return(s=this.$store.getters["printer/tempHistory/getDatasetColor"](this.objectName))!=null?s:"#FFFFFF"}get iconColor(){return this.target===null||this.target>0?"".concat(this.color).concat(N_):"".concat(this.color).concat(V_)}get iconClass(){var e,t,r;const s=["_no-focus-style","cursor-pointer"];return this.isFan&&!((t=(e=this.$store.state.gui)==null?void 0:e.uiSettings.disableFanAnimation)!=null&&t)&&((r=this.state)!=null?r:0)>0&&s.push("icon-rotate"),s}get isFan(){return this.objectName.startsWith("temperature_fan")}get state(){var s,e;return(e=(s=this.printerObject.power)!=null?s:this.printerObject.speed)!=null?e:null}get formatState(){return this.state===null?null:this.target===0&&this.state===0?"off":"".concat(Math.round(this.state*100)," %")}get avgPower(){var s;return(s=this.$store.getters["printer/tempHistory/getAvgPower"](this.name))!=null?s:0}get avgSpeed(){var s;return(s=this.$store.getters["printer/tempHistory/getAvgSpeed"](this.name))!=null?s:0}get avgState(){return"power"in this.printerObject?Math.round(this.avgPower):"speed"in this.printerObject?Math.round(this.avgSpeed):null}get temperature(){var s,e;return(e=(s=this.printerObject)==null?void 0:s.temperature)!=null?e:null}get formatTemperature(){var s,e;return"".concat((e=(s=this.temperature)==null?void 0:s.toFixed(1))!=null?e:"--","°C")}get min_temp(){var s;return parseInt((s=this.printerObjectSettings.min_temp)!=null?s:0)}get max_temp(){var s;return parseInt((s=this.printerObjectSettings.max_temp)!=null?s:0)}get measured_min_temp(){var s,e,t;return(t=(e=(s=this.printerObject)==null?void 0:s.measured_min_temp)==null?void 0:e.toFixed(1))!=null?t:null}get measured_max_temp(){var s,e,t;return(t=(e=(s=this.printerObject)==null?void 0:s.measured_max_temp)==null?void 0:e.toFixed(1))!=null?t:null}get target(){var s,e;return(e=(s=this.printerObject)==null?void 0:s.target)!=null?e:null}get additionalSensorName(){if(this.objectName==="z_thermal_adjust")return"z_thermal_adjust";const s=Kx.find(e=>{if("".concat(e," ").concat(this.name)in this.$store.state.printer)return!0});return s?"".concat(s," ").concat(this.name):null}get rpm(){var e;return((e=this.printerObject.rpm)!=null?e:null)===null?null:parseInt(this.printerObject.rpm)}get rpmClass(){var s;return this.rpm===0&&((s=this.printerObject.speed)!=null?s:0)>0?"red--text":""}get presets(){var s;return(s=this.$store.getters["gui/presets/getPresetsFromHeater"]({name:this.objectName}))!=null?s:[]}get command(){return this.objectName.startsWith("temperature_fan")?"SET_TEMPERATURE_FAN_TARGET":this.objectName.startsWith("extruder")||this.objectName.startsWith("heater_")?"SET_HEATER_TEMPERATURE":null}get commandAttributeName(){return this.command==="SET_HEATER_TEMPERATURE"?"HEATER":this.command==="SET_TEMPERATURE_FAN_TARGET"?"TEMPERATURE_FAN":""}get availableHeaters(){var s,e;return(e=(s=this.$store.state.printer.heaters)==null?void 0:s.available_heaters)!=null?e:[]}get isHeater(){return this.availableHeaters.includes(this.objectName)}get isHeaterActive(){return this.target>0}mounted(){zd.$on(Gd,this.closeContextMenu)}beforeDestroy(){zd.$off(Gd,this.closeContextMenu)}openContextMenu(s){zd.$emit(Gd),this.showContextMenu=!0,this.contextMenuX=(s==null?void 0:s.clientX)||(s==null?void 0:s.pageX)||window.screenX/2,this.contextMenuY=(s==null?void 0:s.clientY)||(s==null?void 0:s.pageY)||window.screenY/2}closeContextMenu(){this.showContextMenu=!1}openEditDialog(){this.closeContextMenu(),this.showEditDialog=!0}turnOffHeater(){const s="SET_HEATER_TEMPERATURE HEATER=".concat(this.name," TARGET=0");this.$store.dispatch("server/addEvent",{message:s,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s})}};Rf([w({type:String,required:!0})],$a.prototype,"objectName",2);Rf([w({type:Boolean,required:!0})],$a.prototype,"isResponsiveMobile",2);$a=Rf([S],$a);var VF=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:r=>e.openContextMenu(r),expression:"(e) => openContextMenu(e)",arg:"600"}],on:{contextmenu:function(r){return r.preventDefault(),e.openContextMenu(r)}}},[t("td",{staticClass:"icon"},[t(_,{class:e.iconClass,attrs:{color:e.iconColor,tabindex:"-1"},on:{click:e.openEditDialog}},[e._v(" "+e._s(e.icon)+" ")])],1),t("td",{staticClass:"name"},[t("span",{staticClass:"cursor-pointer",on:{click:e.openEditDialog}},[e._v(e._s(e.formatName))])]),e.isResponsiveMobile?e._e():t("td",{staticClass:"state"},[e.state!==null?t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("div",e._g(e._b({},"div",i,!1),r),[e._v(e._s(e.formatState))])]}}],null,!1,938967334)},[t("span",[e._v(e._s(e.$t("Panels.TemperaturePanel.Avg"))+": "+e._s(e.avgState)+" %")])]):e._e()],1),t("td",{staticClass:"current"},[t(de,{attrs:{top:"",disabled:!(e.measured_min_temp!==null||e.measured_max_temp!==null)},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("span",e._g(e._b({staticStyle:{cursor:"default"}},"span",i,!1),r),[e._v(" "+e._s(e.formatTemperature)+" ")])]}}])},[t("span",[e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Max"))+": "+e._s(e.measured_max_temp)+"°C "),t("br"),e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Min"))+": "+e._s(e.measured_min_temp)+"°C ")])]),e.rpm!==null?t("div",[t("small",{class:e.rpmClass},[e._v(e._s(e.rpm)+" RPM")])]):e._e(),e.additionalSensorName?t(jF,{attrs:{"object-name":e.objectName,"additional-object-name":e.additionalSensorName}}):e._e()],1),t("td",{staticClass:"target"},[e.command!==null?t(J0,{attrs:{name:e.name,target:e.target,presets:e.presets,min_temp:e.min_temp,max_temp:e.max_temp,command:e.command,"attribute-name":e.commandAttributeName}}):e._e()],1),t(Y0,{attrs:{"bool-show":e.showEditDialog,"object-name":e.objectName,name:e.name,"format-name":e.formatName,"additional-sensor-name":e.additionalSensorName,icon:e.icon,color:e.color},on:{"close-dialog":function(r){e.showEditDialog=!1}}}),t(ye,{attrs:{"position-x":e.contextMenuX,"position-y":e.contextMenuY,absolute:"","offset-y":""},model:{value:e.showContextMenu,callback:function(r){e.showContextMenu=r},expression:"showContextMenu"}},[t(Me,[e.isHeater?t(J,{attrs:{disabled:!e.isHeaterActive},on:{click:e.turnOffHeater}},[t(_,{attrs:{left:""}},[e._v(e._s(e.mdiSnowflake))]),e._v(" "+e._s(e.$t("Panels.TemperaturePanel.TurnHeaterOff"))+" ")],1):e._e(),t(J,{on:{click:e.openEditDialog}},[t(_,{attrs:{left:""}},[e._v(e._s(e.mdiCog))]),e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Settings"))+" ")],1)],1)],1)],1)},BF=[],UF=E($a,VF,BF,!1,null,"420c2d54");const Zd=UF.exports;var WF=Object.defineProperty,zF=Object.getOwnPropertyDescriptor,ao=(s,e,t,r)=>{for(var i=r>1?void 0:r?zF(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&WF(e,t,i),i};let qr=class extends k(L){get cssStyle(){let s={cursor:"default",fontSize:"1em"};return this.small&&(s.fontSize="0.8em"),s}get value(){var e;const s=(e=this.printerObject[this.keyName])!=null?e:null;return isNaN(s)?null:s}get intake_value(){var e;const s="intake_".concat(this.keyName);return(e=this.printerObject[s])!=null?e:null}get intake_value_min(){var e;const s="intake_".concat(this.keyName,"_min");return(e=this.printerObject[s])!=null?e:null}get intake_value_max(){var e;const s="intake_".concat(this.keyName,"_max");return(e=this.printerObject[s])!=null?e:null}get exhaust_value(){var e;const s="exhaust_".concat(this.keyName);return(e=this.printerObject[s])!=null?e:null}get exhaust_value_min(){var e;const s="exhaust_".concat(this.keyName,"_min");return(e=this.printerObject[s])!=null?e:null}get exhaust_value_max(){var e;const s="exhaust_".concat(this.keyName,"_max");return(e=this.printerObject[s])!=null?e:null}get unit(){switch(this.keyName){case"temperature":return"°C";case"pressure":return"hPa";case"humidity":return"%"}return null}get digits(){return["gas","pressure"].includes(this.keyName)?0:1}get formatValue(){return this.getFormatedValue(this.intake_value,this.exhaust_value)}get formatValue_min(){return this.getFormatedValue(this.intake_value_min,this.exhaust_value_min)}get formatValue_max(){return this.getFormatedValue(this.intake_value_max,this.exhaust_value_max)}getFormatedValue(s,e){let t=s==null?void 0:s.toFixed(this.digits),r=e==null?void 0:e.toFixed(this.digits);return this.intake_value===null&&(t="--"),this.exhaust_value===null&&(r="--"),this.unit===null?"".concat(t," > ").concat(r):"".concat(t," ").concat(this.unit," > ").concat(r," ").concat(this.unit)}get disableTooltip(){return this.intake_value_min===null||this.exhaust_value_min===null||this.intake_value_max===null||this.exhaust_value_max===null}get guiSetting(){return this.$store.getters["gui/getDatasetAdditionalSensorValue"]({name:this.objectName,sensor:this.keyName})}get isVisible(){return this.intake_value===null&&this.exhaust_value===null?!1:this.guiSetting}};ao([w({type:Object,required:!0})],qr.prototype,"printerObject",2);ao([w({type:String,required:!0})],qr.prototype,"objectName",2);ao([w({type:String,required:!0})],qr.prototype,"keyName",2);ao([w({type:Boolean,required:!1,default:!0})],qr.prototype,"small",2);qr=ao([S],qr);var GF=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.isVisible?t("div",[t(de,{attrs:{top:"",disabled:e.disableTooltip},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("span",e._g(e._b({style:e.cssStyle},"span",i,!1),r),[e._v(e._s(e.formatValue))])]}}],null,!1,2376366562)},[t("span",[e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Max"))+": "+e._s(e.formatValue_max)+" "),t("br"),e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Min"))+": "+e._s(e.formatValue_min)+" ")])])],1):e._e()},ZF=[],qF=E(qr,GF,ZF,!1,null,null);const u1=qF.exports;var XF=Object.defineProperty,YF=Object.getOwnPropertyDescriptor,Hf=(s,e,t,r)=>{for(var i=r>1?void 0:r?YF(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&XF(e,t,i),i};let xa=class extends k(L){constructor(){super(...arguments),this.mdiFan=Ip,this.showEditDialog=!1,this.nevermoreValues=["temperature","pressure","humidity"]}get printerObject(){var s;return(s=this.$store.state.printer[this.objectName])!=null?s:{}}get name(){const s=this.objectName.split(" ");return s.length===1?s[0]:s[1]}get formatName(){return Ye(this.name)}get color(){var s,e,t,r,i,n;return(n=(i=(r=(t=(e=(s=this.$store.state.gui)==null?void 0:s.view)==null?void 0:e.tempchart)==null?void 0:t.datasetSettings)==null?void 0:r[this.objectName])==null?void 0:i.color)!=null?n:"#ffffff"}get iconColor(){return this.state===null||this.state>0?"".concat(this.color).concat(N_):"".concat(this.color).concat(V_)}get iconClass(){var t,r,i;const s=["_no-focus-style","cursor-pointer"];return!((r=(t=this.$store.state.gui)==null?void 0:t.uiSettings.disableFanAnimation)!=null?r:!1)&&((i=this.state)!=null?i:0)>0&&s.push("icon-rotate"),s}get state(){var s;return(s=this.printerObject.speed)!=null?s:null}get rpm(){var e;return((e=this.printerObject.rpm)!=null?e:null)===null?null:parseInt(this.printerObject.rpm)}get rpmClass(){var s;return this.rpm===0&&((s=this.printerObject.speed)!=null?s:0)>0?"red--text":""}};Hf([w({type:String,required:!0})],xa.prototype,"objectName",2);Hf([w({type:Boolean,required:!0})],xa.prototype,"isResponsiveMobile",2);xa=Hf([S],xa);var JF=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("tr",[t("td",{staticClass:"icon"},[t(_,{class:e.iconClass,attrs:{color:e.iconColor,tabindex:"-1"},on:{click:function(r){e.showEditDialog=!0}}},[e._v(" "+e._s(e.mdiFan)+" ")])],1),t("td",{staticClass:"name"},[t("span",{staticClass:"cursor-pointer",on:{click:function(r){e.showEditDialog=!0}}},[e._v(e._s(e.formatName))])]),t("td",{staticClass:"text-no-wrap text-center",attrs:{colspan:"3"}},[t(u1,{attrs:{"printer-object":e.printerObject,"object-name":e.objectName,small:!1,"key-name":"gas"}}),e._l(e.nevermoreValues,function(r){return t(u1,{key:r,attrs:{"printer-object":e.printerObject,"object-name":e.objectName,"key-name":r}})}),e.rpm!==null?t("div",[t("small",{class:e.rpmClass},[e._v(e._s(e.rpm)+" RPM")])]):e._e()],2),t(Y0,{attrs:{"bool-show":e.showEditDialog,"object-name":e.objectName,name:e.name,"format-name":e.formatName,"additional-sensor-name":"nevermore",icon:e.mdiFan,color:e.color},on:{"close-dialog":function(r){e.showEditDialog=!1}}})],1)},KF=[],QF=E(xa,JF,KF,!1,null,"ca9b3c12");const K0=QF.exports;var eR=Object.getOwnPropertyDescriptor,tR=(s,e,t,r)=>{for(var i=r>1?void 0:r?eR(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Sh=class extends k(L){get available_heaters(){var s,e,t;return(t=(e=(s=this.$store.state.printer)==null?void 0:s.heaters)==null?void 0:e.available_heaters)!=null?t:[]}get filteredHeaters(){return this.filterNamesAndSort(this.available_heaters)}get available_sensors(){var s,e,t;return(t=(e=(s=this.$store.state.printer)==null?void 0:s.heaters)==null?void 0:e.available_sensors)!=null?t:[]}get available_monitors(){var s,e,t;return(t=(e=(s=this.$store.state.printer)==null?void 0:s.heaters)==null?void 0:e.available_monitors)!=null?t:[]}get available_nevermores(){return Object.keys(this.$store.state.printer).filter(s=>s.startsWith("nevermore"))}get monitors(){return this.available_monitors.sort(this.sortObjectName)}get temperature_fans(){return this.available_sensors.filter(s=>s.startsWith("temperature_fan")&&!s.startsWith("temperature_fan _")).sort(this.sortObjectName)}get hideMcuHostSensors(){var s;return(s=this.$store.state.gui.view.tempchart.hideMcuHostSensors)!=null?s:!1}get hideMonitors(){var s;return(s=this.$store.state.gui.view.tempchart.hideMonitors)!=null?s:!1}get temperature_sensors(){return this.filterNamesAndSort(this.available_sensors).filter(s=>!(this.available_heaters.includes(s)||this.temperature_fans.includes(s)||this.hideMcuHostSensors&&this.checkMcuHostSensor(s)))}get heaterObjects(){return[...this.filteredHeaters,...this.temperature_fans]}get nevermoreObjects(){return this.filterNamesAndSort(this.available_nevermores)}get settings(){var s,e,t;return(t=(e=(s=this.$store.state.printer)==null?void 0:s.configfile)==null?void 0:e.settings)!=null?t:{}}checkMcuHostSensor(s){var r,i;const t=(i=((r=this.settings[s.toLowerCase()])!=null?r:{}).sensor_type)!=null?i:"";return["temperature_mcu","temperature_host"].includes(t)}filterNamesAndSort(s){return s.filter(this.isVisibleName).sort(this.sortObjectName)}isVisibleName(s){return!this.shortName(s).startsWith("_")}sortObjectName(s,e){const t=this.shortName(s).toUpperCase(),r=this.shortName(e).toUpperCase();return tr?1:0}shortName(s){const e=s.split(" ");return e.length==1?e[0]:e[1]}};Sh=tR([S({components:{TemperaturePanelListItemNevermore:K0}})],Sh);var sR=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(tt,{attrs:{breakpoints:{mobile:r=>r.width<=395}},scopedSlots:e._u([{key:"default",fn:function({el:r}){return[t(Mp,{staticClass:"temperature-panel-table"},[t("thead",[t("tr",[t("th",{staticClass:"icon"},[e._v(" ")]),t("th",{staticClass:"name"},[e._v(e._s(e.$t("Panels.TemperaturePanel.Name")))]),r.is.mobile?e._e():t("th",{staticClass:"state"},[e._v(" "+e._s(e.$t("Panels.TemperaturePanel.State"))+" ")]),t("th",{staticClass:"current"},[e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Current"))+" ")]),t("th",{staticClass:"target"},[e._v(" "+e._s(e.$t("Panels.TemperaturePanel.Target"))+" ")])])]),t("tbody",[e._l(e.heaterObjects,function(i){var n;return t(Zd,{key:i,attrs:{"object-name":i,"is-responsive-mobile":(n=r.is.mobile)!=null?n:!1}})}),e._l(e.nevermoreObjects,function(i){var n;return t(K0,{key:i,attrs:{"object-name":i,"is-responsive-mobile":(n=r.is.mobile)!=null?n:!1}})}),e._l(e.temperature_sensors,function(i){var n;return t(Zd,{key:i,attrs:{"object-name":i,"is-responsive-mobile":(n=r.is.mobile)!=null?n:!1}})}),e.hideMonitors?e._e():e._l(e.monitors,function(i){var n;return t(Zd,{key:i,attrs:{"object-name":i,"is-responsive-mobile":(n=r.is.mobile)!=null?n:!1}})})],2)])]}}])})},rR=[],iR=E(Sh,sR,rR,!1,null,"6b5c1548");const nR=iR.exports;var aR=Object.getOwnPropertyDescriptor,oR=(s,e,t,r)=>{for(var i=r>1?void 0:r?aR(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Ph=class extends k(L){constructor(){super(...arguments),this.mdiCog=ss}get boolTempchart(){var s;return(s=this.$store.state.gui.view.tempchart.boolTempchart)!=null?s:!1}set boolTempchart(s){this.$store.dispatch("gui/saveSetting",{name:"view.tempchart.boolTempchart",value:s})}get autoscaleTempchart(){var s;return(s=this.$store.state.gui.view.tempchart.autoscale)!=null?s:!1}set autoscaleTempchart(s){this.$store.dispatch("gui/saveSetting",{name:"view.tempchart.autoscale",value:s})}get hideMcuHostSensors(){var s;return(s=this.$store.state.gui.view.tempchart.hideMcuHostSensors)!=null?s:!1}set hideMcuHostSensors(s){this.$store.dispatch("gui/saveSetting",{name:"view.tempchart.hideMcuHostSensors",value:s})}get hideMonitors(){var s;return(s=this.$store.state.gui.view.tempchart.hideMonitors)!=null?s:!1}set hideMonitors(s){this.$store.dispatch("gui/saveSetting",{name:"view.tempchart.hideMonitors",value:s})}};Ph=oR([S],Ph);var lR=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(ye,{attrs:{"offset-y":!0,"close-on-content-click":!1,title:e.$t("Panels.TemperaturePanel.SetupTemperatures")},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:""}},"v-btn",i,!1),r),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Me,[t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.TemperaturePanel.ShowChart")},model:{value:e.boolTempchart,callback:function(r){e.boolTempchart=r},expression:"boolTempchart"}})],1),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.TemperaturePanel.HideMcuHostSensors")},model:{value:e.hideMcuHostSensors,callback:function(r){e.hideMcuHostSensors=r},expression:"hideMcuHostSensors"}})],1),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.TemperaturePanel.HideMonitors")},model:{value:e.hideMonitors,callback:function(r){e.hideMonitors=r},expression:"hideMonitors"}})],1),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.TemperaturePanel.AutoscaleChart")},model:{value:e.autoscaleTempchart,callback:function(r){e.autoscaleTempchart=r},expression:"autoscaleTempchart"}})],1)],1)],1)},cR=[],uR=E(Ph,lR,cR,!1,null,null);const dR=uR.exports;var mR=Object.defineProperty,hR=Object.getOwnPropertyDescriptor,Q0=(s,e,t,r)=>{for(var i=r>1?void 0:r?hR(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&mR(e,t,i),i};let pc=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiSnowflake=bu}get cooldownGcode(){return this.$store.getters["gui/presets/getCooldownGcode"]}cooldown(){this.$store.dispatch("server/addEvent",{message:this.cooldownGcode,type:"command"}),this.$socket.emit("printer.gcode.script",{script:this.cooldownGcode}),this.closePrompt()}closePrompt(){this.$emit("close")}};Q0([w({type:Boolean,default:!1})],pc.prototype,"showDialog",2);pc=Q0([S({components:{Panel:U}})],pc);var pR=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.showDialog,width:"400",persistent:""}},[t(U,{attrs:{title:e.$t("CoolDownDialog.CoolDown"),"card-class":"cool-down-dialog",icon:e.mdiSnowflake,"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closePrompt}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[e._v(e._s(e.$t("CoolDownDialog.AreYouSure")))]),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.closePrompt}},[e._v(e._s(e.$t("CoolDownDialog.No")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.cooldown}},[e._v(e._s(e.$t("CoolDownDialog.Yes")))])],1)],1)],1)},fR=[],gR=E(pc,pR,fR,!1,null,"4acf0c79");const ey=gR.exports;var _R=Object.getOwnPropertyDescriptor,vR=(s,e,t,r)=>{for(var i=r>1?void 0:r?_R(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Dh=class extends k(L){constructor(){super(...arguments),this.mdiFire=sn,this.mdiMenuDown=gr,this.mdiSnowflake=bu,this.mdiCloseThick=pe,this.showCoolDownDialog=!1}get presets(){var s;return(s=this.$store.getters["gui/presets/getPresets"])!=null?s:[]}get cooldownGcode(){return this.$store.getters["gui/presets/getCooldownGcode"]}get confirmOnCoolDown(){return this.$store.state.gui.uiSettings.confirmOnCoolDown}preheat(s){var e;for(const[t,r]of Object.entries(s.values))if(r.bool){const i=t.split(" "),n=i[0];let a=(e=i[1])!=null?e:i[0],o="SET_HEATER_TEMPERATURE",l="HEATER";n==="temperature_fan"&&(o="SET_TEMPERATURE_FAN_TARGET",l="TEMPERATURE_FAN");const u="".concat(o," ").concat(l,"=").concat(a," TARGET=").concat(r.value);this.$store.dispatch("server/addEvent",{message:u,type:"command"}),this.$socket.emit("printer.gcode.script",{script:u})}s.gcode!==""&&setTimeout(()=>{this.$store.dispatch("server/addEvent",{message:s.gcode,type:"command"}),this.$socket.emit("printer.gcode.script",{script:s.gcode})},100)}btnCoolDown(){if(this.confirmOnCoolDown){this.showCoolDownDialog=!0;return}this.cooldown()}cooldown(){this.showCoolDownDialog=!1,this.$store.dispatch("server/addEvent",{message:this.cooldownGcode,type:"command"}),this.$socket.emit("printer.gcode.script",{script:this.cooldownGcode})}};Dh=vR([S({components:{CoolDownDialog:ey}})],Dh);var bR=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticStyle:{height:"100%"}},[e.presets.length?t(ye,{attrs:{"offset-y":!0,left:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"pa-1",attrs:{text:"",tile:"",color:"primary",disabled:["printing","paused"].includes(e.printer_state)}},"v-btn",i,!1),r),[t("span",{staticClass:"d-none ml-1 d-md-block"},[e._v(e._s(e.$t("Panels.TemperaturePanel.Presets")))]),t(_,{staticClass:"d-md-none"},[e._v(e._s(e.mdiFire))]),t(_,[e._v(e._s(e.mdiMenuDown))])],1)]}}],null,!1,1208155870)},[t(Me,{staticClass:"py-0",attrs:{dense:""}},e._l(e.presets,function(r,i){return t(J,{key:i,attrs:{link:""},on:{click:function(n){return e.preheat(r)}}},[t("div",{staticClass:"d-flex align-center _preset-title"},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiFire))]),t("span",{staticStyle:{"padding-top":"2px"}},[e._v(e._s(r.name))])],1)])}),1),t(I,{staticClass:"_fix_transparency"}),t(Me,{staticClass:"py-0",attrs:{dense:""}},[t(J,{attrs:{link:""},on:{click:e.btnCoolDown}},[t("div",{staticClass:"d-flex align-center _preset-title"},[t(_,{staticClass:"mr-1",attrs:{small:"",color:"primary"}},[e._v(e._s(e.mdiSnowflake))]),t("span",{staticClass:"primary--text"},[e._v(e._s(e.$t("Panels.TemperaturePanel.Cooldown")))])],1)])],1)],1):t(g,{attrs:{icon:e.$vuetify.breakpoint.smAndDown,text:e.$vuetify.breakpoint.mdAndUp,tile:"",color:"primary"},on:{click:e.btnCoolDown}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiSnowflake))]),t("span",{staticClass:"d-none ml-1 d-md-inline"},[e._v(e._s(e.$t("Panels.TemperaturePanel.Cooldown")))])],1),t(ey,{attrs:{"show-dialog":e.showCoolDownDialog},on:{close:function(r){e.showCoolDownDialog=!1}}})],1)},yR=[],CR=E(Dh,bR,yR,!1,null,"0097691a");const ty=CR.exports;var $R=Object.getOwnPropertyDescriptor,xR=(s,e,t,r)=>{for(var i=r>1?void 0:r?$R(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Th=class extends k(L,Je){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiThermometerLines=Dv,this.convertName=Ye,this.capitalize=lr}get boolTempchart(){var e;return(e=this.$store.state.gui.view.tempchart.boolTempchart)!=null?e:!1}};Th=xR([S({components:{Panel:U,TempChart:Z0,TemperatureInput:J0,Responsive:tt,TemperaturePanelPresets:ty}})],Th);var wR=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.klipperReadyForGui?t(U,{attrs:{icon:e.mdiThermometerLines,title:e.$t("Panels.TemperaturePanel.Headline"),collapsible:!0,"card-class":"temperature-panel"},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(ty),t(dR)]},proxy:!0}],null,!1,3208382191)},[t(Z,{staticClass:"pa-0"},[t(nR),e.boolTempchart?[t(I,{staticClass:"my-0"}),t(Z0)]:e._e()],2)],1):e._e()},SR=[],PR=E(Th,wR,SR,!1,null,null);const DR=PR.exports;var TR=Object.defineProperty,OR=Object.getOwnPropertyDescriptor,sy=(s,e,t,r)=>{for(var i=r>1?void 0:r?OR(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&TR(e,t,i),i};let fc=class extends k(L,ur){constructor(){super(...arguments),this.mdiWebcam=on,this.mdiMenuDown=gr,this.mdiViewGrid=Bg}get webcams(){return this.$store.getters["gui/webcams/getWebcams"]}get showSwitch(){return this.webcams.length>1}get currentCamId(){var e,t,r,i;if(this.webcams.length===1)return(e=this.webcams[0].name)!=null?e:"all";let s=(r=this.$store.state.gui.view.webcam.currentCam[(t=this.currentPage)!=null?t:""])!=null?r:"all";return this.webcams.findIndex(n=>n.name===s)!==-1?s:s!==void 0&&this.webcams.length===1?(i=this.webcams[0].name)!=null?i:"":"all"}set currentCamId(s){this.$store.dispatch("gui/setCurrentWebcam",{page:this.currentPage,value:s})}get currentCam(){const s=this.webcams.find(e=>e.name===this.currentCamId);return s!=null?s:{name:this.$t("Panels.WebcamPanel.All"),service:"grid",icon:Bg}}};sy([w({default:"dashboard"})],fc.prototype,"currentPage",2);fc=sy([S({components:{Panel:U}})],fc);var MR=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.socketIsConnected?t(U,{attrs:{icon:e.mdiWebcam,title:e.$t("Panels.WebcamPanel.Headline"),collapsible:e.$route.fullPath!=="/cam","card-class":"webcam-panel","margin-bottom":e.currentPage!=="page"},scopedSlots:e._u([{key:"buttons",fn:function(){return[e.showSwitch?t(ye,{attrs:{"offset-y":!0},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{text:"",tile:""}},"v-btn",i,!1),r),["icon"in e.currentCam?t(_,{staticClass:"mr-2",attrs:{small:""}},[e._v(" "+e._s(e.convertWebcamIcon(e.currentCam.icon))+" ")]):e._e(),t("span",{staticClass:"d-none d-md-block"},[e._v(e._s("name"in e.currentCam?e.currentCam.name:"unknown"))]),t(_,{attrs:{small:""}},[e._v(e._s(e.mdiMenuDown))])],1)]}}],null,!1,150688541)},[t(Me,{staticClass:"py-0",attrs:{dense:""}},[t(J,{attrs:{link:""},on:{click:function(r){e.currentCamId="all"}}},[t(Hs,{staticClass:"mr-2"},[t(_,{staticClass:"mt-1",attrs:{small:""}},[e._v(e._s(e.mdiViewGrid))])],1),t(_t,[t(Ze,[e._v(e._s(e.$t("Panels.WebcamPanel.All")))])],1)],1),e._l(e.webcams,function(r){return t(J,{key:r.name,attrs:{link:""},on:{click:function(i){e.currentCamId=r.name}}},[t(Hs,{staticClass:"mr-2"},[t(_,{staticClass:"mt-1",attrs:{small:""}},[e._v(e._s(e.convertWebcamIcon(r.icon)))])],1),t(_t,[t(Ze,{domProps:{textContent:e._s(r.name)}})],1)],1)})],2)],1):e._e()]},proxy:!0}],null,!1,467766518)},[e.webcams.length?t(Z,{staticClass:"px-0 py-0 content d-inline-block"},[t(x,[t(b,{staticClass:"pb-0",staticStyle:{position:"relative"}},[t(Cu,{attrs:{webcam:e.currentCam,page:e.currentPage}})],1)],1)],1):t(Z,[t("p",{staticClass:"text-center mb-0 text--disabled"},[e._v(e._s(e.$t("Panels.WebcamPanel.NoWebcam")))])])],1):e._e()},kR=[],ER=E(fc,MR,kR,!1,null,"c38c67ee");const jf=ER.exports;var LR=Object.getOwnPropertyDescriptor,AR=(s,e,t,r)=>{for(var i=r>1?void 0:r?LR(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Oh=class extends k(Ns){get mobileLayout(){return this.$store.getters["gui/getPanels"]("mobile",0,!0)}get tabletLayout1(){return this.$store.getters["gui/getPanels"]("tablet",1,!0)}get tabletLayout2(){return this.$store.getters["gui/getPanels"]("tablet",2,!0)}get desktopLayout1(){return this.$store.getters["gui/getPanels"]("desktop",1,!0)}get desktopLayout2(){return this.$store.getters["gui/getPanels"]("desktop",2,!0)}get widescreenLayout1(){return this.$store.getters["gui/getPanels"]("widescreen",1,!0)}get widescreenLayout2(){return this.$store.getters["gui/getPanels"]("widescreen",2,!0)}get widescreenLayout3(){return this.$store.getters["gui/getPanels"]("widescreen",3,!0)}extractPanelName(s){return s.split("_")[0]+"-panel"}extractPanelId(s){var e;return(e=s.split("_")[1])!=null?e:null}};Oh=AR([S({components:{ExtruderControlPanel:S7,KlippyStatePanel:so,MachineSettingsPanel:k7,MacrogroupPanel:H7,MacrosPanel:U7,MiniconsolePanel:$L,MinSettingsPanel:yf,MiscellaneousPanel:Z8,SpoolmanPanel:uA,StatusPanel:jn,ToolheadControlPanel:tF,TemperaturePanel:DR,WebcamPanel:jf}})],Oh);var FR=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.isMobile?t(x,[t(b,[t(jn),e._l(e.mobileLayout,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-mobileLayout-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2)],1):e.isTablet?t(x,[t(b,{staticClass:"col-6"},[t(jn),e._l(e.tabletLayout1,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-tabletLayout1-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2),t(b,{staticClass:"col-6"},[e._l(e.tabletLayout2,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-tabletLayout2-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2)],1):e.isDesktop?t(x,[t(b,{staticClass:"col-5"},[t(jn),e._l(e.desktopLayout1,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-desktopLayout1-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2),t(b,{staticClass:"col-7"},[e._l(e.desktopLayout2,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-desktopLayout2-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2)],1):e.isWidescreen?t(x,[t(b,{staticClass:"col-3"},[t(jn),e._l(e.widescreenLayout1,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-desktopLayout1-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2),t(b,{staticClass:"col-5"},[e._l(e.widescreenLayout2,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-desktopLayout2-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2),t(b,{staticClass:"col-4"},[e._l(e.widescreenLayout3,function(r){return[t(e.extractPanelName(r.name),{key:"dashboard-desktopLayout3-"+r.name,tag:"component",attrs:{"panel-id":e.extractPanelId(r.name)}})]})],2)],1):e._e()],1)},RR=[],HR=E(Oh,FR,RR,!1,null,null);const jR=HR.exports;var IR=Object.getOwnPropertyDescriptor,NR=(s,e,t,r)=>{for(var i=r>1?void 0:r?IR(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Mh=class extends k(L){};Mh=NR([S({components:{WebcamPanel:jf}})],Mh);var VR=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(x,[t(b,{attrs:{"col-12":""}},[t(jf,{attrs:{"current-page":"page"}})],1)],1)],1)},BR=[],UR=E(Mh,VR,BR,!1,null,"bd1524f8");const WR=UR.exports;var zR=Object.defineProperty,GR=Object.getOwnPropertyDescriptor,If=(s,e,t,r)=>{for(var i=r>1?void 0:r?GR(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&zR(e,t,i),i};let wa=class extends k(L){constructor(){super(...arguments),this.internalColor=Ir}colorChanged(s){this.internalColor=s!==""?s:Ir}created(){this.color!==""&&(this.internalColor=this.color)}};If([w({required:!1,default:""})],wa.prototype,"color",2);If([he("color")],wa.prototype,"colorChanged",1);wa=If([S],wa);var ZR=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("svg",{attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 599.38 523.11","xml:space":"preserve"}},[t("g",[t("path",{style:"fill:"+e.color+";",attrs:{d:"M382.29,142.98L132.98,522.82L0,522.68L344.3,0l0,0C352.18,49.06,365.2,97.68,382.29,142.98"}}),t("path",{style:"fill:"+e.color+";",attrs:{d:"M413.28,213.54L208.5,522.92l132.94,0.19l135.03-206.33l0,0C452.69,284.29,431.53,249.77,413.28,213.54 L413.28,213.54"}}),t("path",{style:"fill:"+e.color+";",attrs:{d:"M599.38,447.69l-49.25,75.42L417,522.82l101.6-153.67l0,0C543.48,397.35,570.49,423.61,599.38,447.69 L599.38,447.69z"}})])])},qR=[],XR=E(wa,ZR,qR,!1,null,null);const mn=XR.exports;var YR=Object.defineProperty,JR=Object.getOwnPropertyDescriptor,Gu=(s,e,t,r)=>{for(var i=r>1?void 0:r?JR(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&YR(e,t,i),i};let Ni=class extends k(L,vt,ur){constructor(){super(...arguments),this.mdiPrinter3d=qa,this.mdiWebcam=on,this.mdiMenuDown=gr,this.mdiWebcamOff=AS,this.mdiFileOutline=tv,this.imageHeight=200}get printerUrl(){let t=window.location.href.split("/")[0]+"//"+this.printer.socket.hostname;return this.printer.socket.webPort!==80&&(t+=":"+this.printer.socket.webPort),t}get isCurrentPrinter(){return this.$store.getters["farm/"+this.printer._namespace+"/isCurrentPrinter"]}get currentCamName(){return this.$store.getters["farm/"+this.printer._namespace+"/getSetting"]("currentCamName","off")}set currentCamName(s){this.$store.dispatch("farm/"+this.printer._namespace+"/setSettings",{currentCamName:s})}get printer_name(){return this.$store.getters["farm/"+this.printer._namespace+"/getPrinterName"]}get printer_status(){return this.$store.getters["farm/"+this.printer._namespace+"/getStatus"]}get printer_current_filename(){return this.$store.getters["farm/"+this.printer._namespace+"/getCurrentFilename"]}get printer_image(){var s;return this.currentWebcam?this.sidebarBgImage:(s=this.$store.getters["farm/"+this.printer._namespace+"/getImage"])!=null?s:this.sidebarBgImage}get printer_logo(){return this.$store.getters["farm/"+this.printer._namespace+"/getLogo"]}get printerLogoColor(){return this.$store.getters["farm/"+this.printer._namespace+"/getLogoColor"]}get printer_position(){return this.$store.getters["farm/"+this.printer._namespace+"/getPosition"]}get printer_preview(){return this.$store.getters["farm/"+this.printer._namespace+"/getPrinterPreview"]}get showWebcamSwitch(){return this.printer_webcams.length==0?!1:this.printer.socket.isConnected}get printer_webcams(){return this.$store.getters["farm/"+this.printer._namespace+"/getPrinterWebcams"]}get currentWebcam(){var e;const s=(e=this.printer_webcams)==null?void 0:e.find(t=>t.name===this.currentCamName);return s||null}get panelClass(){let s=[];return!this.printer.socket.isConnected&&!this.printer.socket.isConnecting&&s.push("disabledPrinter"),s}clickPrinter(){if(this.printer.socket.isConnected){this.$store.dispatch("changePrinter",{printer:this.printer._namespace});return}this.$store.dispatch("farm/"+this.printer._namespace+"/reconnect")}mounted(){this.calcImageHeight()}calcImageHeight(){var s,e;if((e=(s=this.imageDiv)==null?void 0:s.$el)!=null&&e.clientWidth){this.imageHeight=Math.round(this.imageDiv.$el.clientWidth/3*2);return}this.imageHeight=200}handleResize(){this.$nextTick(()=>{this.calcImageHeight()})}};Gu([w({type:Object,required:!0})],Ni.prototype,"printer",2);Gu([Ts()],Ni.prototype,"imageDiv",2);Gu([Ke(200)],Ni.prototype,"handleResize",1);Ni=Gu([S({components:{Panel:U,"webcam-wrapper":Cu,"mainsail-logo":mn}})],Ni);var KR=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(U,{class:e.panelClass,attrs:{icon:e.mdiPrinter3d,title:e.printer_name,"card-class":"farmprinter-panel",loading:e.printer.socket.isConnecting,"toolbar-color":e.isCurrentPrinter?"primary":""},scopedSlots:e._u([{key:"buttons",fn:function(){return[e.showWebcamSwitch?t(ye,{attrs:{"offset-y":!0,title:"Webcam"},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{text:""}},"v-btn",i,!1),r),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiWebcam))]),t(_,{attrs:{small:""}},[e._v(e._s(e.mdiMenuDown))])],1)]}}],null,!1,505444931)},[t(Me,{staticClass:"py-0",attrs:{dense:""}},[t(J,{attrs:{link:""},on:{click:function(r){e.currentCamName="off"}}},[t(Hs,{staticClass:"mr-2"},[t(_,{staticClass:"mt-1",attrs:{small:""}},[e._v(e._s(e.mdiWebcamOff))])],1),t(_t,[t(Ze,[e._v(e._s(e.$t("Panels.FarmPrinterPanel.WebcamOff")))])],1)],1),e._l(e.printer_webcams,function(r){return t(J,{key:r.name,attrs:{link:""},on:{click:function(i){e.currentCamName=r.name}}},[t(Hs,{staticClass:"mr-2"},[t(_,{staticClass:"mt-1",attrs:{small:""}},[e._v(e._s(e.convertWebcamIcon(r.icon)))])],1),t(_t,[t(Ze,{domProps:{textContent:e._s(r.name)}})],1)],1)})],2)],1):e._e()]},proxy:!0}])},[t(M$,{scopedSlots:e._u([{key:"default",fn:function({hover:r}){return[t("div",[t(nu,{ref:"imageDiv",staticClass:"d-flex align-end",attrs:{height:e.imageHeight,src:e.printer_image}},[e.printer.socket.isConnected&&e.currentCamName!=="off"&&e.currentWebcam&&"service"in e.currentWebcam?t("div",{staticClass:"webcamContainer"},[t(Cu,{attrs:{webcam:e.currentWebcam,"printer-url":e.printerUrl,"show-fps":!1}})],1):e._e(),t(gt,{staticClass:"white--text py-2",staticStyle:{"background-color":"rgba(0, 0, 0, 0.3)","backdrop-filter":"blur(3px)"}},[t(x,[t(b,{staticClass:"col-auto pr-0 d-flex align-center",staticStyle:{width:"58px"}},[e.printer_logo?t("img",{staticClass:"my-auto",staticStyle:{width:"100%"},attrs:{src:e.printer_logo,alt:"Logo"}}):t(mn,{staticClass:"my-auto",staticStyle:{width:"100%"},attrs:{color:e.printerLogoColor}})],1),t(b,{staticClass:"col",staticStyle:{width:"100px"}},[t("h3",{staticClass:"font-weight-regular"},[e._v(e._s(e.printer_status))]),e.printer_current_filename!==""?t("span",{staticClass:"subtitle-2 text-truncate px-0 text--disabled d-block"},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiFileOutline))]),e._v(" "+e._s(e.printer_current_filename)+" ")],1):e._e()])],1)],1)],1),e.printer_preview.length?t(Z,{staticClass:"px-0 py-2"},[t(Ee,{staticClass:"py-0"},[t(x,e._l(e.printer_preview,function(i){return t(b,{key:i.name,class:i.name==="ETA"?"col-auto":"col px-2"},[t("strong",{staticClass:"d-block text-center"},[e._v(e._s(i.name))]),t("span",{staticClass:"d-block text-center"},[e._v(e._s(i.value))])])}),1)],1)],1):e._e(),t(k$,[r?t(E$,{attrs:{absolute:"","z-index":4}},[t(g,{attrs:{color:"primary"},on:{click:e.clickPrinter}},[e._v(" "+e._s(e.printer.socket.isConnected?e.$t("Panels.FarmPrinterPanel.SwitchToPrinter"):e.$t("Panels.FarmPrinterPanel.ReconnectToPrinter"))+" ")])],1):e._e()],1)],1)]}}])}),t("resize-observer",{on:{notify:e.handleResize}})],1)},QR=[],eH=E(Ni,KR,QR,!1,null,"05f75be0");const ry=eH.exports;var tH=Object.getOwnPropertyDescriptor,sH=(s,e,t,r)=>{for(var i=r>1?void 0:r?tH(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let kh=class extends k(L){get printers(){return this.$store.getters["farm/getPrinters"]}};kh=sH([S({components:{FarmPrinterPanel:ry}})],kh);var rH=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,e._l(e.printers,function(r,i){return t(b,{key:i,staticClass:"col-12 col-sm-6 col-md-4 pb-0"},[t(ry,{attrs:{printer:r}})],1)}),1)},iH=[],nH=E(kh,rH,iH,!1,null,null);const aH=nH.exports;var oH=Object.defineProperty,lH=Object.getOwnPropertyDescriptor,oo=(s,e,t,r)=>{for(var i=r>1?void 0:r?lH(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&oH(e,t,i),i};let Xr=class extends k(L,fa){constructor(){super(...arguments),this.mdiCog=ss,this.mdiTrashCan=Mv}get events(){return this.$store.getters["server/getConsoleEvents"](this.consoleDirection==="table")}eventsChanged(){this.consoleDirection==="shell"&&this.autoscroll&&setTimeout(()=>{this.scrollToBottom()},50)}autoscrollChanged(s){s&&this.scrollToBottom()}commandClick(s){this.gcodeCommandField.setGcode(s)}mounted(){this.consoleDirection==="shell"&&this.scrollToBottom()}scrollToBottom(){this.$nextTick(()=>{if(!this.consoleScroll)return;const s=this.consoleScroll.osInstance();s==null||s.scroll({y:"100%"})})}};oo([Ts()],Xr.prototype,"consoleScroll",2);oo([Ts()],Xr.prototype,"gcodeCommandField",2);oo([he("events")],Xr.prototype,"eventsChanged",1);oo([he("autoscroll")],Xr.prototype,"autoscrollChanged",1);Xr=oo([S({components:{CommandHelpModal:ju,ConsoleTable:Ru}})],Xr);var cH=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"d-flex flex-column"},[t(x,{class:e.consoleDirection==="table"?"order-0":"order-1 mt-3"},[t(b,[t(g0,{ref:"gcodeCommandField"})],1),t(b,{staticClass:"col-auto d-flex align-center"},[t(g,{staticClass:"mr-3 px-2 minwidth-0",attrs:{color:"lightgray"},on:{click:e.clearConsole}},[t(_,[e._v(e._s(e.mdiTrashCan))])],1),t(ju,{on:{onCommand:function(r){return e.commandClick(r)}}}),t(ye,{attrs:{"offset-y":"",top:e.consoleDirection==="shell","close-on-content-click":!1,title:e.$t("Console.SetupConsole")},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"ml-3 px-2 minwidth-0",attrs:{color:"lightgray"}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Me,[e.consoleDirection==="shell"?t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.MiniconsolePanel.Autoscroll")},model:{value:e.autoscroll,callback:function(r){e.autoscroll=r},expression:"autoscroll"}})],1):e._e(),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Console.HideTemperatures")},model:{value:e.hideWaitTemperatures,callback:function(r){e.hideWaitTemperatures=r},expression:"hideWaitTemperatures"}})],1),e.moonrakerComponents.includes("timelapse")?t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Console.HideTimelapse")},model:{value:e.hideTlCommands,callback:function(r){e.hideTlCommands=r},expression:"hideTlCommands"}})],1):e._e(),e._l(e.customFilters,function(r,i){return t(J,{key:i,staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:r.name},on:{change:function(n){return e.toggleFilter(i,r)}},model:{value:r.bool,callback:function(n){e.$set(r,"bool",n)},expression:"filter.bool"}})],1)}),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Panels.MiniconsolePanel.RawOutput")},model:{value:e.rawOutput,callback:function(r){e.rawOutput=r},expression:"rawOutput"}})],1)],2)],1)],1)],1),t(x,{class:e.consoleDirection==="table"?"order-1":"order-0 mt-0"},[t(b,{class:e.consoleDirection==="table"?"col":"col pt-0"},[t(Pe,[t(Z,{staticClass:"pa-0"},[t("overlay-scrollbars",{ref:"consoleScroll",staticClass:"consoleScrollContainer d-flex flex-column"},[t(Ru,{ref:"console",attrs:{"is-mini":!1,events:e.events},on:{"command-click":e.commandClick}})],1)],1)],1)],1)],1)],1)},uH=[],dH=E(Xr,cH,uH,!1,null,"63e954e1");const mH=dH.exports;var hH=Object.defineProperty,pH=Object.getOwnPropertyDescriptor,iy=(s,e,t,r)=>{for(var i=r>1?void 0:r?pH(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&hH(e,t,i),i};let gc=class extends k(L){get sums(){const s={filamentLength:0,filamentWeight:0,estimatedTime:0};return this.jobs.forEach(e=>{var r,i,n,a,o,l,u,c;const t=((i=(r=e.combinedIds)==null?void 0:r.length)!=null?i:0)+1;s.filamentLength+=((a=(n=e.metadata)==null?void 0:n.filament_total)!=null?a:0)*t,s.filamentWeight+=((l=(o=e.metadata)==null?void 0:o.filament_weight_total)!=null?l:0)*t,s.estimatedTime+=((c=(u=e.metadata)==null?void 0:u.estimated_time)!=null?c:0)*t}),s}get count(){let s=0;return this.jobs.forEach(e=>{var t,r;s+=((r=(t=e.combinedIds)==null?void 0:t.length)!=null?r:0)+1}),s}get filamentLength(){const s=this.sums.filamentLength;return s===0?null:s>=1e3?(s/1e3).toFixed(1)+" m":s.toFixed(0)+" mm"}get filamentWeight(){const s=this.sums.filamentWeight;return s===0?null:s>=1e3?(s/1e3).toFixed(1)+" kg":s.toFixed(0)+" g"}get filamentOutput(){const s=[];return this.filamentLength&&s.push(this.filamentLength),this.filamentWeight&&s.push(this.filamentWeight),s.length?s.join(" / "):"--"}get estimatedTime(){let s=this.sums.estimatedTime;if(s==0)return"--";const e=[],t=Math.floor(s/(3600*24));t&&(s%=3600*24,e.push(t+"d"));const r=Math.floor(s/3600);s%=3600,r&&e.push(r+"h");const i=Math.floor(s/60);if(i&&e.push(i+"m"),r>0)return e.join(" ");const n=s%60;return n&&e.push(n.toFixed(0)+"s"),e.join(" ")}get currentPrintEta(){var e,t,r;let s=this.$store.getters["printer/getEstimatedTimeETA"];return s||(this.printerIsPrinting&&((e=this.$store.state.printer.print_stats)==null?void 0:e.print_duration)===0?Date.now()+((r=(t=this.$store.state.printer.current_file)==null?void 0:t.estimated_time)!=null?r:0)*1e3:Date.now())}get eta(){var l;if(this.sums.estimatedTime===0)return"--";let s=this.currentPrintEta+this.sums.estimatedTime*1e3;const e=(l=this.$store.getters["gui/getHours12Format"])!=null?l:!1,t=new Date(s);let r=!0,i=t.getHours();e&&i>11&&(r=!1),e&&i>12&&(i-=12),e&&i==0&&(i+=12),i<10&&(i="0"+i);const n=t.getMinutes()>=10?t.getMinutes():"0"+t.getMinutes(),a=s-new Date().getTime();let o=i+":"+n;return e&&(o+=" ".concat(r?"AM":"PM")),a>60*60*24*1e3&&(o+="+".concat(Math.trunc(a/(60*60*24*1e3)))),o}};iy([w({type:Array,required:!0})],gc.prototype,"jobs",2);gc=iy([S],gc);var fH=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,{staticClass:"jobqueue-entry-sum"},[t(b,{staticClass:"py-2",staticStyle:{"font-size":"0.875em"}},[t("small",[t("span",{staticClass:"text-no-wrap mr-1"},[e._v(e._s(e.$t("Panels.StatusPanel.Filament"))+": "+e._s(e.filamentOutput)+",")]),t("span",{staticClass:"text-no-wrap mr-1"},[e._v(e._s(e.$t("Panels.StatusPanel.PrintTime"))+": "+e._s(e.estimatedTime)+",")]),t("span",{staticClass:"text-no-wrap mr-1"},[e._v(e._s(e.$t("Panels.StatusPanel.ETA"))+": "+e._s(e.eta))])])])],1)},gH=[],_H=E(gc,fH,gH,!1,null,"e3a87c1b");const ny=_H.exports;var vH=Object.getOwnPropertyDescriptor,bH=(s,e,t,r)=>{for(var i=r>1?void 0:r?vH(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Eh=class extends k(L){constructor(){super(...arguments),this.mdiPlay=nn,this.mdiPause=Zp,this.mdiTrayFull=kv,this.joblist=[]}get jobs(){return this.$store.getters["server/jobQueue/getJobs"]}get queueState(){var s;return(s=this.$store.state.server.jobQueue.queue_state)!=null?s:""}startJobqueue(){this.$store.dispatch("server/jobQueue/start")}pauseJobqueue(){this.$store.dispatch("server/jobQueue/pause")}updateOrder(s){this.$store.dispatch("server/jobQueue/changePosition",{newIndex:s.newIndex,oldIndex:s.oldIndex})}};Eh=bH([S({components:{JobqueueEntrySum:ny,draggable:si,JobqueueEntry:Tu,Panel:U}})],Eh);var yH=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(U,{attrs:{icon:e.mdiTrayFull,title:e.$t("JobQueue.JobQueue"),"card-class":"jobqueue-panel"},scopedSlots:e._u([{key:"buttons",fn:function(){return[e.queueState==="paused"?t(g,{attrs:{color:"success",loading:e.loadings.includes("startJobqueue"),icon:"",tile:"",disabled:!e.klipperReadyForGui},on:{click:e.startJobqueue}},[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(_,e._g(e._b({},"v-icon",i,!1),r),[e._v(e._s(e.mdiPlay))])]}}],null,!1,2134053718)},[t("span",[e._v(e._s(e.$t("JobQueue.Start")))])])],1):e._e(),["ready","loading"].includes(e.queueState)?t(g,{attrs:{color:"warning",loading:e.loadings.includes("pauseJobqueue"),icon:"",tile:""},on:{click:e.pauseJobqueue}},[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(_,e._g(e._b({},"v-icon",i,!1),r),[e._v(e._s(e.mdiPause))])]}}],null,!1,1749587264)},[t("span",[e._v(e._s(e.$t("JobQueue.Pause")))])])],1):e._e()]},proxy:!0}])},[e.jobs.length?t(x,{staticClass:"mx-0 mt-0"},[t(b,[t("draggable",{staticClass:"jobqueue-list mb-3",attrs:{handle:".handle","ghost-class":"ghost",group:"jobs"},on:{end:e.updateOrder},model:{value:e.joblist,callback:function(r){e.joblist=r},expression:"joblist"}},e._l(e.jobs,function(r){return t(Tu,{key:r.job_id,attrs:{job:r,"show-handle":!0}})}),1),t(ny,{attrs:{jobs:e.jobs}})],1)],1):t(Z,[t("p",[e._v(e._s(e.$t("JobQueue.Empty")))])])],1)},CH=[],$H=E(Eh,yH,CH,!1,null,null);const ay=$H.exports;var xH=Object.defineProperty,wH=Object.getOwnPropertyDescriptor,Zu=(s,e,t,r)=>{for(var i=r>1?void 0:r?wH(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&xH(e,t,i),i};let Vi=class extends k(L){constructor(){super(...arguments),this.segmentSeparator="/"}get pathSegments(){const[s,...e]=(this.path||"").split(this.segmentSeparator),t={directoryName:s,location:s};return e.reduce((r,i)=>{const n=r[r.length-1].location,a="".concat(n).concat(this.segmentSeparator).concat(i),o={directoryName:i,location:a};return r.push(o),r},[t])}};Zu([w({default:!1})],Vi.prototype,"path",2);Zu([w({default:!1})],Vi.prototype,"baseDirectoryLabel",2);Zu([w({default:!1})],Vi.prototype,"onSegmentClick",2);Vi=Zu([S],Vi);var SH=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",e._l(e.pathSegments,function({directoryName:r,location:i},n){return t("span",{key:i,staticClass:"navigation-container"},[n!==0?[t("span",{staticClass:"navigation-divider text--disabled"},[e._v(e._s(e.segmentSeparator))])]:e._e(),n!==e.pathSegments.length-1?[t("span",{staticClass:"cursor-pointer navigation-segment",attrs:{tabindex:"0",role:"button"},on:{click:function(a){return e.onSegmentClick({location:i})},keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.onSegmentClick({location:i})}}},[r?[e._v(e._s(r))]:[e._v(e._s(e.baseDirectoryLabel))]],2)]:[t("span",[r?[e._v(e._s(r))]:[e._v(e._s(e.baseDirectoryLabel))]],2)]],2)}),0)},PH=[],DH=E(Vi,SH,PH,!1,null,"057e3ba1");const hn=DH.exports;var TH=Object.defineProperty,OH=Object.getOwnPropertyDescriptor,oy=(s,e,t,r)=>{for(var i=r>1?void 0:r?OH(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&TH(e,t,i),i};let _c=class extends k(L,Je){constructor(){super(...arguments),this.mdiContentCopy=Fp,this.mdiFile=Bs,this.mdiFileDocumentMultipleOutline=Ga,this.mdiMagnify=rn,this.mdiUpload=ES,this.mdiFolderPlus=Vp,this.mdiRefresh=an,this.mdiCog=ss,this.mdiFolderUpload=Bp,this.mdiFolder=Np,this.mdiPlay=nn,this.mdiPlaylistPlus=Za,this.mdiFire=sn,this.mdiVideo3d=yu,this.mdiCloudDownload=Kn,this.mdiRenameBox=vu,this.mdiFileDocumentEditOutline=za,this.mdiDelete=Ue,this.mdiCloseThick=pe,this.mdiCheckboxBlankOutline=Ep,this.mdiCheckboxMarked=Lp,this.mdiDragVertical=Wa,this.formatFilesize=Xe,this.sortFiles=rf,this.search="",this.dialogCreateDirectory={show:!1,name:""},this.contextMenu={shown:!1,isDirectory:!1,touchTimer:void 0,x:0,y:0,item:{isDirectory:!1,filename:"",permissions:"",modified:new Date,preheat_gcode:null,small_thumbnail:null,big_thumbnail:null,big_thumbnail_width:null,count_printed:0,last_filament_used:null,last_start_time:null,last_end_time:null,last_print_duration:null,last_status:null,last_total_duration:null}},this.draggingFile={item:{...this.contextMenu.item}},this.dialogPrintFile={show:!1,item:{...this.contextMenu.item}},this.dialogAddBatchToQueue={isVisible:!1,filename:""},this.dialogRenameFile={show:!1,newName:"",item:{...this.contextMenu.item}},this.dialogDuplicateFile={show:!1,newName:"",item:{...this.contextMenu.item}},this.dialogRenameDirectory={show:!1,newName:"",item:{...this.contextMenu.item}},this.dialogDeleteDirectory={show:!1,newName:"",item:{...this.contextMenu.item}},this.deleteDialog=!1,this.deleteSelectedDialog=!1,this.isInvalidName=!0,this.nameInputRules=[s=>!!s||this.$t("Files.InvalidNameEmpty"),s=>!this.existsFilename(s)||this.$t("Files.InvalidNameAlreadyExists")],this.countInputRules=[s=>!!s||this.$t("JobQueue.InvalidCountEmpty"),s=>parseInt(s)>0||this.$t("JobQueue.InvalidCountGreaterZero")]}existsFilename(s){return this.files.findIndex(e=>e.filename===s)>=0}get gcodeInputFileAccept(){return this.isIOS?[]:Pi}get currentPath(){const s=this.$store.state.gui.view.gcodefiles.currentPath;return s==="gcodes"?"":s}set currentPath(s){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.gcodefiles.currentPath",value:s})}get selectedFiles(){var s;return(s=this.$store.state.gui.view.gcodefiles.selectedFiles)!=null?s:[]}set selectedFiles(s){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.gcodefiles.selectedFiles",value:s})}get fixedHeaders(){return[{text:"",value:"",visible:!0,sortable:!1},{text:this.$t("Files.Name").toString(),value:"filename",visible:!0,class:"text-no-wrap"},{text:"",value:"status",visible:!0,class:"text-no-wrap",sortable:!1}]}get configurableHeaders(){const s=[{text:this.$t("Files.Filesize").toString(),value:"size",visible:!0,class:"text-no-wrap",outputType:"filesize"},{text:this.$t("Files.LastModified").toString(),value:"modified",visible:!0,class:"text-no-wrap",outputType:"date"},{text:this.$t("Files.ObjectHeight").toString(),value:"object_height",visible:!0,class:"text-no-wrap",outputType:"length"},{text:this.$t("Files.LayerHeight").toString(),value:"layer_height",visible:!0,class:"text-no-wrap",outputType:"length"},{text:this.$t("Files.NozzleDiameter").toString(),value:"nozzle_diameter",visible:!0,class:"text-no-wrap",outputType:"length"},{text:this.$t("Files.ExtruderTemp").toString(),value:"first_layer_extr_temp",visible:!0,class:"text-no-wrap",outputType:"temp"},{text:this.$t("Files.BedTemp").toString(),value:"first_layer_bed_temp",visible:!0,class:"text-no-wrap",outputType:"temp"},{text:this.$t("Files.ChamberTemp").toString(),value:"chamber_temp",visible:!0,class:"text-no-wrap",outputType:"temp"},{text:this.$t("Files.FilamentName").toString(),value:"filament_name",visible:!0,class:"text-no-wrap"},{text:this.$t("Files.FilamentType").toString(),value:"filament_type",visible:!0,class:"text-no-wrap",outputType:"string"},{text:this.$t("Files.FilamentUsage").toString(),value:"filament_total",visible:!0,class:"text-no-wrap",outputType:"length"},{text:this.$t("Files.FilamentWeight").toString(),value:"filament_weight_total",visible:!0,class:"text-no-wrap",outputType:"weight"},{text:this.$t("Files.PrintTime").toString(),value:"estimated_time",visible:!0,class:"text-no-wrap",outputType:"time"},{text:this.$t("Files.LastStartTime").toString(),value:"last_start_time",visible:!0,class:"text-no-wrap",outputType:"date"},{text:this.$t("Files.LastEndTime").toString(),value:"last_end_time",visible:!0,class:"text-no-wrap",outputType:"date"},{text:this.$t("Files.LastPrintDuration").toString(),value:"last_print_duration",visible:!0,class:"text-no-wrap",outputType:"time"},{text:this.$t("Files.LastTotalDuration").toString(),value:"last_total_duration",visible:!0,class:"text-no-wrap",outputType:"time"},{text:this.$t("Files.LastFilamentUsed").toString(),value:"last_filament_used",visible:!0,class:"text-no-wrap",outputType:"length"},{text:this.$t("Files.Slicer").toString(),value:"slicer",visible:!0,class:"text-no-wrap",outputType:"string"}];let e=0;return s.forEach(t=>{var i;t.visible=!this.hideMetadataColumns.includes(t.value);let r=(i=this.orderMetadataColumns)==null?void 0:i.findIndex(n=>n===t.value);r===-1&&(e++,r=this.orderMetadataColumns.length+e),t.pos=r}),s.sort((t,r)=>{var i,n;return((i=t.pos)!=null?i:0)-((n=r.pos)!=null?n:0)})}set configurableHeaders(s){const e=[];s.forEach(t=>e.push(t.value)),this.orderMetadataColumns=e}get headers(){return[...this.fixedHeaders,...this.configurableHeaders]}get tableColumns(){return this.configurableHeaders.filter(s=>s.visible)}get directory(){return this.$store.getters["files/getDirectory"]("gcodes"+this.currentPath)}get disk_usage(){var s,e;return(e=(s=this.directory)==null?void 0:s.disk_usage)!=null?e:{used:0,free:0,total:0}}get files(){return this.$store.getters["files/getGcodeFiles"](this.currentPath,this.showHiddenFiles,this.showPrintedFiles)}get filteredHeaders(){return this.headers.filter(s=>s.visible)}get orderMetadataColumns(){var s;return(s=this.$store.state.gui.view.gcodefiles.orderMetadataColumns)!=null?s:[]}set orderMetadataColumns(s){this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.orderMetadataColumns",value:s})}get hideMetadataColumns(){var s;return(s=this.$store.state.gui.view.gcodefiles.hideMetadataColumns)!=null?s:[]}set hideMetadataColumns(s){this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.hideMetadataColumns",value:s})}get showHiddenFiles(){return this.$store.state.gui.view.gcodefiles.showHiddenFiles}set showHiddenFiles(s){this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.showHiddenFiles",value:s})}get showPrintedFiles(){return this.$store.state.gui.view.gcodefiles.showPrintedFiles}set showPrintedFiles(s){this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.showPrintedFiles",value:s})}get sortBy(){return this.$store.state.gui.view.gcodefiles.sortBy}set sortBy(s){s===void 0&&(s="modified"),this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.sortBy",value:s})}get sortDesc(){return this.$store.state.gui.view.gcodefiles.sortDesc}set sortDesc(s){s===void 0&&(s=!1),this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.sortDesc",value:s})}get countPerPage(){return this.$store.state.gui.view.gcodefiles.countPerPage}set countPerPage(s){this.$store.dispatch("gui/saveSetting",{name:"view.gcodefiles.countPerPage",value:s})}get bigThumbnailBackground(){var s;return(s=this.$store.state.gui.uiSettings.bigThumbnailBackground)!=null?s:At}get bigThumbnailTooltipColor(){if(At.toLowerCase()!==this.bigThumbnailBackground.toLowerCase())return this.bigThumbnailBackground}getStatusIcon(s){return this.$store.getters["server/history/getPrintStatusIcon"](s)}getStatusTextColor(s){return this.$store.getters["server/history/getPrintStatusTextColor"](s)}getStatusColor(s){return this.$store.getters["server/history/getPrintStatusIconColor"](s)}dragOverFilelist(s,e){s.preventDefault(),e.isDirectory&&(s.target.parentElement.style.backgroundColor="#43A04720")}dragLeaveFilelist(s){s.preventDefault(),s.stopPropagation(),s.target.parentElement.style.backgroundColor="transparent"}async dragDropFilelist(s,e){s.preventDefault(),s.target.parentElement.style.backgroundColor="transparent";let t;e.filename===".."?t=this.currentPath.substring(0,this.currentPath.lastIndexOf("/")+1)+this.draggingFile.item.filename:t=this.currentPath+"/"+e.filename+"/"+this.draggingFile.item.filename,this.$socket.emit("server.files.move",{source:"gcodes"+this.currentPath+"/"+this.draggingFile.item.filename,dest:"gcodes"+t},{action:"files/getMove"})}async uploadFile(){var s;if((s=this.$refs.fileUpload.files)!=null&&s.length){const e=[...this.$refs.fileUpload.files];this.$refs.fileUpload.value="",await this.$store.dispatch("socket/addLoading",{name:"gcodeUpload"}),await this.$store.dispatch("files/uploadSetCurrentNumber",0),await this.$store.dispatch("files/uploadSetMaxNumber",this.$refs.fileUpload.files.length);for(const t of e){await this.$store.dispatch("files/uploadIncrementCurrentNumber");const r=this.currentPath.slice(0,1)==="/"?this.currentPath.slice(1):this.currentPath,i=await this.$store.dispatch("files/uploadFile",{file:t,path:r,root:"gcodes"});i!==!1&&this.$toast.success(this.$t("Files.SuccessfullyUploaded",{filename:i}).toString())}await this.$store.dispatch("socket/removeLoading",{name:"gcodeUpload"})}}clickUploadButton(){this.$refs.fileUpload.click()}createDirectory(){this.dialogCreateDirectory.name="",this.dialogCreateDirectory.show=!0,setTimeout(()=>{var s;(s=this.$refs.inputFieldCreateDirectory)==null||s.focus()},200)}createDirectoryAction(){this.dialogCreateDirectory.name.length&&(this.dialogCreateDirectory.show=!1,this.$socket.emit("server.files.post_directory",{path:"gcodes"+this.currentPath+"/"+this.dialogCreateDirectory.name},{action:"files/getCreateDir"}))}refreshFileList(){this.$socket.emit("server.files.get_directory",{path:"gcodes"+this.currentPath},{action:"files/getDirectory"})}advancedSearch(s,e){if(e===null||typeof s!="string")return!1;s=s.toString().toLowerCase();const t=e.toLowerCase().split(" ");for(const r of t)if(!s.includes(r))return!1;return!0}refreshMetadata(s){const e=s.filter(t=>!t.isDirectory&&!t.metadataRequested&&!t.metadataPulled);this.$store.dispatch("files/requestMetadata",e.map(t=>({filename:"gcodes"+this.currentPath+"/"+t.filename})))}clickRow(s,e=!1){(!this.contextMenu.shown||e)&&(e&&(this.contextMenu.shown=!1),s.isDirectory?this.currentPath+="/"+s.filename:!["error","printing","paused"].includes(this.printer_state)&&this.isGcodeFile(s)&&(this.dialogPrintFile.show=!0,this.dialogPrintFile.item=s))}clickRowGoBack(){this.currentPath=this.currentPath.slice(0,this.currentPath.lastIndexOf("/"))}clickPathNavGoToDirectory(s){this.currentPath=s.location}async addToQueue(s){let e=[this.currentPath,s.filename].join("/");e.startsWith("/")&&(e=e.slice(1)),await this.$store.dispatch("server/jobQueue/addToQueue",[e])}openAddBatchToQueueDialog(s){let e=[this.currentPath,s.filename].join("/");e.startsWith("/")&&(e=e.slice(1)),this.dialogAddBatchToQueue.isVisible=!0,this.dialogAddBatchToQueue.filename=e}closeAddBatchToQueueDialog(){this.dialogAddBatchToQueue.isVisible=!1}changeMetadataVisible(s,e){this.$store.dispatch("gui/setGcodefilesMetadata",{name:s,value:e})}showContextMenu(s,e){this.contextMenu.shown||(s==null||s.preventDefault(),this.contextMenu.shown=!0,this.contextMenu.x=(s==null?void 0:s.clientX)||(s==null?void 0:s.pageX)||window.screenX/2,this.contextMenu.y=(s==null?void 0:s.clientY)||(s==null?void 0:s.pageY)||window.screenY/2,this.contextMenu.item=e,this.$nextTick(()=>{this.contextMenu.shown=!0}))}editFile(s){this.$store.dispatch("editor/openFile",{root:"gcodes",path:this.currentPath,filename:s.filename,size:s.size,permissions:s.permissions})}downloadFile(){const s=this.currentPath+"/"+this.contextMenu.item.filename,e=this.apiUrl+"/server/files/gcodes"+Ie(s);window.open(e)}async downloadSelectedFiles(){let s=[];const e=async(i,n)=>{for(const a of n){const o="".concat(i,"/").concat(Ie(a.filename));if(a.isDirectory&&a.childrens){await e(o,a.childrens);continue}s.push(o)}};await e("gcodes/"+this.currentPath,this.selectedFiles);const t=new Date,r="".concat(t.getFullYear()).concat(t.getMonth()).concat(t.getDate(),"-").concat(t.getHours()).concat(t.getMinutes()).concat(t.getSeconds());this.$socket.emit("server.files.zip",{items:s,dest:"config/gcodes-".concat(r,".zip")},{action:"files/downloadZip",loading:"gcodeDownloadZip"}),this.selectedFiles=[]}renameFile(s){this.dialogRenameFile.item=s,this.dialogRenameFile.newName=s.filename,this.dialogRenameFile.show=!0,setTimeout(()=>{var e;(e=this.$refs.inputFieldRenameFile)==null||e.focus()},200)}renameFileAction(){this.dialogRenameFile.show=!1,this.$socket.emit("server.files.move",{source:"gcodes"+this.currentPath+"/"+this.dialogRenameFile.item.filename,dest:"gcodes"+this.currentPath+"/"+this.dialogRenameFile.newName},{action:"files/getMove"})}duplicateFile(s){this.dialogDuplicateFile.item=s,this.dialogDuplicateFile.newName=s.filename,this.dialogDuplicateFile.show=!0,setTimeout(()=>{var e;(e=this.$refs.inputFieldDuplicateFile)==null||e.focus()},200)}duplicateFileAction(){this.dialogDuplicateFile.show=!1,this.$socket.emit("server.files.copy",{source:"gcodes"+this.currentPath+"/"+this.dialogDuplicateFile.item.filename,dest:"gcodes"+this.currentPath+"/"+this.dialogDuplicateFile.newName})}renameDirectory(s){this.dialogRenameDirectory.item=s,this.dialogRenameDirectory.newName=s.filename,this.dialogRenameDirectory.show=!0,setTimeout(()=>{var e;(e=this.$refs.inputFieldRenameDirectory)==null||e.focus()},200)}renameDirectoryAction(){this.dialogRenameDirectory.show=!1,this.$socket.emit("server.files.move",{source:"gcodes"+this.currentPath+"/"+this.dialogRenameDirectory.item.filename,dest:"gcodes"+this.currentPath+"/"+this.dialogRenameDirectory.newName},{action:"files/getMove"})}removeFile(){this.$socket.emit("server.files.delete_file",{path:"gcodes"+this.currentPath+"/"+this.contextMenu.item.filename},{action:"files/getDeleteFile"}),this.deleteDialog=!1}deleteDirectory(s){this.dialogDeleteDirectory.item=s,this.dialogDeleteDirectory.show=!0}deleteDirectoryAction(){this.dialogDeleteDirectory.show=!1,this.$socket.emit("server.files.delete_directory",{path:"gcodes"+this.currentPath+"/"+this.contextMenu.item.filename,force:!0},{action:"files/getDeleteDir"})}closeStartPrint(){this.dialogPrintFile.show=!1}dragFile(s,e){s.preventDefault(),this.draggingFile.item=e}dragendFile(s){s.preventDefault(),this.draggingFile.item={isDirectory:!1,filename:"",permissions:"",modified:new Date,count_printed:0,preheat_gcode:null,small_thumbnail:null,big_thumbnail:null,big_thumbnail_width:null,last_filament_used:null,last_start_time:null,last_end_time:null,last_print_duration:null,last_status:null,last_total_duration:null}}hideMetadataColumsCanged(s){s.forEach(e=>{let t=this.headers.find(r=>r.value===e);t&&(t.visible=!1)})}isGcodeFile(s){const e=s.filename.slice(s.filename.lastIndexOf("."));return Pi.includes(e)}view3D(s){this.$router.push({path:"/viewer",query:{filename:"gcodes"+this.currentPath+"/"+s.filename}})}scanMeta(s){this.$store.dispatch("files/scanMetadata",{filename:"gcodes"+this.currentPath+"/"+s.filename})}deleteSelectedFiles(){this.selectedFiles.forEach(s=>{s.isDirectory?this.$socket.emit("server.files.delete_directory",{path:"gcodes"+this.currentPath+"/"+s.filename,force:!0},{action:"files/getDeleteDir"}):this.$socket.emit("server.files.delete_file",{path:"gcodes"+this.currentPath+"/"+s.filename},{action:"files/getDeleteFile"})}),this.selectedFiles=[],this.deleteSelectedDialog=!1}outputValue(s,e){const t=s.value in e?e[s.value]:null;if(t===null)return"--";switch(s.outputType){case"filesize":return Xe(t);case"date":return this.formatDateTime(t);case"time":return Is(t);case"temp":return t.toFixed()+" °C";case"length":return t>1e3?(t/1e3).toFixed(2)+" m":t.toFixed(2)+" mm";case"weight":return t.toFixed(2)+" g";default:return t}}};oy([he("hideMetadataColums")],_c.prototype,"hideMetadataColumsCanged",1);_c=oy([S({components:{StartPrintDialog:Eu,AddBatchToQueueDialog:ri,Panel:U,SettingsRow:j,PathNavigation:hn,draggable:si}})],_c);var MH=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(U,{attrs:{title:e.$t("Files.GCodeFiles"),icon:e.mdiFileDocumentMultipleOutline,"card-class":"gcode-files-panel"}},[t(Z,[t(x,[t(b,{staticClass:"col-12 d-flex align-center"},[t(se,{staticStyle:{"max-width":"300px"},attrs:{"append-icon":e.mdiMagnify,label:e.$t("Files.Search"),"single-line":"",outlined:"",clearable:"","hide-details":"",dense:""},model:{value:e.search,callback:function(r){e.search=r},expression:"search"}}),t(ae),e.selectedFiles.length?t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Files.Download"),color:"primary",loading:e.loadings.includes("gcodeDownloadZip")},on:{click:e.downloadSelectedFiles}},[t(_,[e._v(e._s(e.mdiCloudDownload))])],1):e._e(),e.selectedFiles.length?t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Files.Delete"),color:"error"},on:{click:function(r){e.deleteSelectedDialog=!0}}},[t(_,[e._v(e._s(e.mdiDelete))])],1):e._e(),t("input",{ref:"fileUpload",staticStyle:{display:"none"},attrs:{type:"file",accept:e.gcodeInputFileAccept.join(", "),multiple:""},on:{change:e.uploadFile}}),t(g,{staticClass:"primary--text px-2 minwidth-0 ml-3",attrs:{title:e.$t("Files.UploadNewGcode"),loading:e.loadings.includes("gcodeUpload")},on:{click:e.clickUploadButton}},[t(_,[e._v(e._s(e.mdiUpload))])],1),t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Files.CreateNewDirectory")},on:{click:e.createDirectory}},[t(_,[e._v(e._s(e.mdiFolderPlus))])],1),t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Files.RefreshCurrentDirectory")},on:{click:e.refreshFileList}},[t(_,[e._v(e._s(e.mdiRefresh))])],1),t(ye,{attrs:{"offset-y":"",left:"","close-on-content-click":!1,title:e.$t("Files.SetupCurrentList")},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"px-2 minwidth-0 ml-3"},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Me,[t(J,{staticClass:"minHeight36",attrs:{link:""}},[t(x,[t(b,{staticClass:"pr-0"},[e._v(" "+e._s(e.$t("Files.HiddenFiles"))+" ")]),t(b,{staticClass:"col-auto pl-0"},[e.showHiddenFiles?t(_,{attrs:{color:"primary"},on:{click:function(r){r.stopPropagation(),e.showHiddenFiles=!1}}},[e._v(" "+e._s(e.mdiCheckboxMarked)+" ")]):t(_,{attrs:{color:"grey lighten-1"},on:{click:function(r){r.stopPropagation(),e.showHiddenFiles=!0}}},[e._v(" "+e._s(e.mdiCheckboxBlankOutline)+" ")])],1)],1)],1),t(J,{staticClass:"minHeight36",attrs:{link:""}},[t(x,[t(b,{staticClass:"pr-0"},[e._v(" "+e._s(e.$t("Files.PrintedFiles"))+" ")]),t(b,{staticClass:"col-auto pl-0"},[e.showPrintedFiles?t(_,{attrs:{color:"primary"},on:{click:function(r){r.stopPropagation(),e.showPrintedFiles=!1}}},[e._v(" "+e._s(e.mdiCheckboxMarked)+" ")]):t(_,{attrs:{color:"grey lighten-1"},on:{click:function(r){r.stopPropagation(),e.showPrintedFiles=!0}}},[e._v(" "+e._s(e.mdiCheckboxBlankOutline)+" ")])],1)],1)],1),t(I),t("draggable",{staticClass:"v-list-item-group",attrs:{handle:".handle","ghost-class":"ghost",group:"gcodeFilesColumnOrder"},model:{value:e.configurableHeaders,callback:function(r){e.configurableHeaders=r},expression:"configurableHeaders"}},e._l(e.configurableHeaders,function(r){return t(J,{key:r.value,staticClass:"minHeight36"},[t(x,[t(b,{staticClass:"col-auto pr-0"},[t(_,{staticClass:"handle"},[e._v(e._s(e.mdiDragVertical))])],1),t(b,[e._v(" "+e._s(r.text)+" ")]),t(b,{staticClass:"col-auto pl-0"},[r.visible?t(_,{attrs:{color:"primary"},on:{click:function(i){return i.stopPropagation(),e.changeMetadataVisible(r.value,!1)}}},[e._v(" "+e._s(e.mdiCheckboxMarked)+" ")]):t(_,{attrs:{color:"grey lighten-1"},on:{click:function(i){return i.stopPropagation(),e.changeMetadataVisible(r.value,!0)}}},[e._v(" "+e._s(e.mdiCheckboxBlankOutline)+" ")])],1)],1)],1)}),1)],1)],1)],1)],1)],1),t(Z,[t(x,[t(b,{staticClass:"col-12 py-2 d-flex align-center"},[t("span",[t("b",{staticClass:"mr-1"},[e._v(e._s(e.$t("Files.CurrentPath"))+":")]),t(hn,{attrs:{path:e.currentPath,"base-directory-label":"/gcodes","on-segment-click":e.clickPathNavGoToDirectory}})],1),t(ae),e.disk_usage!==null?[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("span",e._g(e._b({},"span",i,!1),r),[t("b",[e._v(e._s(e.$t("Files.FreeDisk"))+":")]),e._v(" "+e._s(e.formatFilesize(e.disk_usage.free))+" ")])]}}],null,!1,1145199616)},[t("span",[e._v(" "+e._s(e.$t("Files.Used"))+": "+e._s(e.formatFilesize(e.disk_usage.used))+" "),t("br"),e._v(" "+e._s(e.$t("Files.Free"))+": "+e._s(e.formatFilesize(e.disk_usage.free))+" "),t("br"),e._v(" "+e._s(e.$t("Files.Total"))+": "+e._s(e.formatFilesize(e.disk_usage.total))+" ")])])]:e._e()],2)],1)],1),t(I,{staticClass:"mb-3"}),t(Qr,{staticClass:"files-table",attrs:{items:e.files,headers:e.filteredHeaders,"custom-sort":e.sortFiles,"sort-by":e.sortBy,"sort-desc":e.sortDesc,"items-per-page":e.countPerPage,"footer-props":{itemsPerPageText:e.$t("Files.Files"),itemsPerPageAllText:e.$t("Files.AllFiles"),itemsPerPageOptions:[10,25,50,100,-1]},"item-key":"filename",search:e.search,"custom-filter":e.advancedSearch,"mobile-breakpoint":"0","show-select":""},on:{"update:sortBy":function(r){e.sortBy=r},"update:sort-by":function(r){e.sortBy=r},"update:sortDesc":function(r){e.sortDesc=r},"update:sort-desc":function(r){e.sortDesc=r},"update:itemsPerPage":function(r){e.countPerPage=r},"update:items-per-page":function(r){e.countPerPage=r},"current-items":e.refreshMetadata},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("Files.Empty")))])]},proxy:!0},e.currentPath!==""?{key:"body.prepend",fn:function(){return[t("tr",{staticClass:"file-list-cursor",on:{click:e.clickRowGoBack,dragover:function(r){return e.dragOverFilelist(r,{isDirectory:!0,filename:".."})},dragleave:e.dragLeaveFilelist,drop:function(r){return r.preventDefault(),r.stopPropagation(),e.dragDropFilelist(r,{isDirectory:!0,filename:".."})}}},[t("td",{staticClass:"file-list__select-td pr-0"},[t(jr,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{disabled:""}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[t(_,[e._v(e._s(e.mdiFolderUpload))])],1),t("td",{staticClass:"",attrs:{colspan:e.filteredHeaders.length}},[e._v("..")])])]},proxy:!0}:null,{key:"item",fn:function({index:r,item:i,isSelected:n,select:a}){return[t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:o=>e.showContextMenu(o,i),expression:"(e) => showContextMenu(e, item)",arg:"600"}],key:"".concat(r," ").concat(i.filename),staticClass:"file-list-cursor user-select-none",attrs:{draggable:"true","data-name":i.filename},on:{contextmenu:function(o){return e.showContextMenu(o,i)},click:function(o){return e.clickRow(i)},drag:function(o){return e.dragFile(o,i)},dragend:function(o){return e.dragendFile(o)},dragover:function(o){return e.dragOverFilelist(o,i)},dragleave:e.dragLeaveFilelist,drop:function(o){return o.preventDefault(),o.stopPropagation(),e.dragDropFilelist(o,i)}}},[t("td",{staticClass:"file-list__select-td pr-0"},[t(jr,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{value:n},on:{click:function(o){return o.stopPropagation(),a(!n)}}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[i.isDirectory?[t(_,[e._v(e._s(e.mdiFolder))])]:i.small_thumbnail?[t(de,{attrs:{top:"","content-class":"tooltip__content-opacity1",color:e.bigThumbnailTooltipColor,disabled:!i.big_thumbnail},scopedSlots:e._u([{key:"activator",fn:function({on:o,attrs:l}){return[t("vue-load-image",[t("img",e._g(e._b({attrs:{slot:"image",src:i.small_thumbnail,width:"32",height:"32",alt:i.filename},slot:"image"},"img",l,!1),o)),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(ot,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(_,[e._v(e._s(e.mdiFile))])],1)])]}}],null,!0)},[t("span",[t("img",{attrs:{src:i.big_thumbnail,width:"250",alt:i.filename}})])])]:[t(_,[e._v(e._s(e.mdiFile))])]],2),t("td",{staticClass:""},[e._v(e._s(i.filename))]),t("td",{staticClass:"text-right text-no-wrap"},[i.last_status?t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:o,attrs:l}){return[t("span",e._g(e._b({},"span",l,!1),o),[i.count_printed>0?t("span",{class:"file-list__count_printed ".concat(e.getStatusTextColor(i.last_status))},[e._v(" "+e._s(i.count_printed)+" ")]):e._e(),t(_,{attrs:{small:"",color:e.getStatusColor(i.last_status)}},[e._v(" "+e._s(e.getStatusIcon(i.last_status))+" ")])],1)]}}],null,!0)},[t("span",[e._v(e._s(i.last_status.replace(/_/g," ")))])]):e._e()],1),e._l(e.tableColumns,function(o){return t("td",{key:o.value,class:o.outputType!=="date"?"text-no-wrap":""},[e._v(" "+e._s(e.outputValue(o,i))+" "),o.value==="slicer"?[t("br"),i.slicer_version?t("small",[e._v(e._s(i.slicer_version))]):e._e()]:e._e()],2)})],2)]}}],null,!0),model:{value:e.selectedFiles,callback:function(r){e.selectedFiles=r},expression:"selectedFiles"}})],1),t(Eu,{attrs:{bool:e.dialogPrintFile.show,file:e.dialogPrintFile.item,"current-path":e.currentPath},on:{closeDialog:e.closeStartPrint}}),t(ye,{attrs:{"position-x":e.contextMenu.x,"position-y":e.contextMenu.y,absolute:"","offset-y":""},model:{value:e.contextMenu.shown,callback:function(r){e.$set(e.contextMenu,"shown",r)},expression:"contextMenu.shown"}},[t(Me,[e.contextMenu.item.isDirectory?e._e():t(J,{attrs:{disabled:e.printerIsPrinting||!e.klipperReadyForGui||!e.isGcodeFile(e.contextMenu.item)},on:{click:function(r){return e.clickRow(e.contextMenu.item,!0)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlay))]),e._v(" "+e._s(e.$t("Files.PrintStart"))+" ")],1),!e.contextMenu.item.isDirectory&&e.moonrakerComponents.includes("job_queue")?t(J,{attrs:{disabled:!e.isGcodeFile(e.contextMenu.item)},on:{click:function(r){return e.addToQueue(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddToQueue"))+" ")],1):e._e(),!e.contextMenu.item.isDirectory&&e.moonrakerComponents.includes("job_queue")?t(J,{attrs:{disabled:!e.isGcodeFile(e.contextMenu.item)},on:{click:function(r){return e.openAddBatchToQueueDialog(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddBatchToQueue"))+" ")],1):e._e(),e.contextMenu.item.preheat_gcode!==null?t(J,{attrs:{disabled:["error","printing","paused"].includes(e.printer_state)},on:{click:function(r){return e.doSend(e.contextMenu.item.preheat_gcode)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiFire))]),e._v(" "+e._s(e.$t("Files.Preheat"))+" ")],1):e._e(),e.contextMenu.item.isDirectory?e._e():t(J,{attrs:{disabled:!e.isGcodeFile(e.contextMenu.item)},on:{click:function(r){return e.view3D(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiVideo3d))]),e._v(" "+e._s(e.$t("Files.View3D"))+" ")],1),e.contextMenu.item.isDirectory?e._e():t(J,{attrs:{disabled:!e.isGcodeFile(e.contextMenu.item)},on:{click:function(r){return e.scanMeta(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiMagnify))]),e._v(" "+e._s(e.$t("Files.ScanMeta"))+" ")],1),e.contextMenu.item.isDirectory?e._e():t(J,{on:{click:e.downloadFile}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiCloudDownload))]),e._v(" "+e._s(e.$t("Files.Download"))+" ")],1),e.contextMenu.item.isDirectory?t(J,{on:{click:function(r){return e.renameDirectory(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiRenameBox))]),e._v(" "+e._s(e.$t("Files.Rename"))+" ")],1):e._e(),e.contextMenu.item.isDirectory?e._e():t(J,{on:{click:function(r){return e.editFile(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiFileDocumentEditOutline))]),e._v(" "+e._s(e.$t("Files.EditFile"))+" ")],1),e.contextMenu.item.isDirectory?e._e():t(J,{on:{click:function(r){return e.renameFile(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiRenameBox))]),e._v(" "+e._s(e.$t("Files.Rename"))+" ")],1),e.contextMenu.item.isDirectory?e._e():t(J,{on:{click:function(r){return e.duplicateFile(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiContentCopy))]),e._v(" "+e._s(e.$t("Files.Duplicate"))+" ")],1),e.contextMenu.item.isDirectory?e._e():t(J,{staticClass:"red--text",on:{click:function(r){e.deleteDialog=!0}}},[t(_,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("Files.Delete"))+" ")],1),e.contextMenu.item.isDirectory?t(J,{staticClass:"red--text",on:{click:function(r){return e.deleteDirectory(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("Files.Delete"))+" ")],1):e._e()],1)],1),t(le,{attrs:{"max-width":400},model:{value:e.dialogCreateDirectory.show,callback:function(r){e.$set(e.dialogCreateDirectory,"show",r)},expression:"dialogCreateDirectory.show"}},[t(U,{attrs:{title:e.$t("Files.NewDirectory"),"card-class":"gcode-files-new-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogCreateDirectory.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputFieldCreateDirectory",attrs:{label:e.$t("Files.Name"),required:"",rules:e.nameInputRules},on:{"update:error":r=>e.isInvalidName=r,keypress:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.createDirectoryAction.apply(null,arguments)}},model:{value:e.dialogCreateDirectory.name,callback:function(r){e.$set(e.dialogCreateDirectory,"name",r)},expression:"dialogCreateDirectory.name"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogCreateDirectory.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.createDirectoryAction}},[e._v(" "+e._s(e.$t("Files.Create"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":400},model:{value:e.dialogRenameFile.show,callback:function(r){e.$set(e.dialogRenameFile,"show",r)},expression:"dialogRenameFile.show"}},[t(U,{attrs:{title:e.$t("Files.RenameFile"),"card-class":"gcode-files-rename-file-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogRenameFile.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputFieldRenameFile",attrs:{label:e.$t("Files.Name"),required:"",rules:e.nameInputRules},on:{"update:error":r=>e.isInvalidName=r,keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.renameFileAction.apply(null,arguments)}},model:{value:e.dialogRenameFile.newName,callback:function(r){e.$set(e.dialogRenameFile,"newName",r)},expression:"dialogRenameFile.newName"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogRenameFile.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.renameFileAction}},[e._v(" "+e._s(e.$t("Files.Rename"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":400},model:{value:e.dialogDuplicateFile.show,callback:function(r){e.$set(e.dialogDuplicateFile,"show",r)},expression:"dialogDuplicateFile.show"}},[t(U,{attrs:{title:e.$t("Files.DuplicateFile"),"card-class":"gcode-files-duplicate-file-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogDuplicateFile.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputFieldDuplicateFile",attrs:{label:e.$t("Files.Name"),required:"",rules:e.nameInputRules},on:{"update:error":r=>e.isInvalidName=r,keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.duplicateFileAction.apply(null,arguments)}},model:{value:e.dialogDuplicateFile.newName,callback:function(r){e.$set(e.dialogDuplicateFile,"newName",r)},expression:"dialogDuplicateFile.newName"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogDuplicateFile.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.duplicateFileAction}},[e._v(" "+e._s(e.$t("Files.Duplicate"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.dialogRenameDirectory.show,callback:function(r){e.$set(e.dialogRenameDirectory,"show",r)},expression:"dialogRenameDirectory.show"}},[t(U,{attrs:{title:e.$t("Files.RenameDirectory"),"card-class":"gcode-files-rename-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogRenameDirectory.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputFieldRenameDirectory",attrs:{label:e.$t("Files.Name"),required:"",rules:e.nameInputRules},on:{"update:error":r=>e.isInvalidName=r,keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.renameDirectoryAction.apply(null,arguments)}},model:{value:e.dialogRenameDirectory.newName,callback:function(r){e.$set(e.dialogRenameDirectory,"newName",r)},expression:"dialogRenameDirectory.newName"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogRenameDirectory.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.renameDirectoryAction}},[e._v(" "+e._s(e.$t("Files.Rename"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.dialogDeleteDirectory.show,callback:function(r){e.$set(e.dialogDeleteDirectory,"show",r)},expression:"dialogDeleteDirectory.show"}},[t(U,{attrs:{title:e.$t("Files.DeleteDirectory"),"card-class":"gcode-files-delete-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogDeleteDirectory.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Files.DeleteDirectoryQuestion",{name:e.dialogDeleteDirectory.item.filename}))+" ")])]),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogDeleteDirectory.show=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteDirectoryAction}},[e._v(e._s(e.$t("Files.Delete")))])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.deleteDialog,callback:function(r){e.deleteDialog=r},expression:"deleteDialog"}},[t(U,{attrs:{title:e.$t("Files.Delete"),"card-class":"gcode-files-delete-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.deleteDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Files.DeleteSingleFileQuestion",{name:e.contextMenu.item.filename}))+" ")])]),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.deleteDialog=!1}}},[e._v(" "+e._s(e.$t("Files.Cancel"))+" ")]),t(g,{attrs:{color:"error",text:""},on:{click:e.removeFile}},[e._v(" "+e._s(e.$t("Files.Delete"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.deleteSelectedDialog,callback:function(r){e.deleteSelectedDialog=r},expression:"deleteSelectedDialog"}},[t(U,{attrs:{title:e.$t("Files.Delete"),"card-class":"gcode-files-delete-selected-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.deleteSelectedDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[e.selectedFiles.length===1?t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Files.DeleteSingleFileQuestion",{name:e.selectedFiles[0].filename}))+" ")]):t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Files.DeleteSelectedQuestion",{count:e.selectedFiles.length})))])]),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.deleteSelectedDialog=!1}}},[e._v(e._s(e.$t("Files.Cancel")))]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteSelectedFiles}},[e._v(e._s(e.$t("Files.Delete")))])],1)],1)],1),t(ri,{attrs:{"is-visible":e.dialogAddBatchToQueue.isVisible,filename:e.dialogAddBatchToQueue.filename},on:{close:e.closeAddBatchToQueueDialog}})],1)},kH=[],EH=E(_c,MH,kH,!1,null,null);const ly=EH.exports;var LH=Object.getOwnPropertyDescriptor,AH=(s,e,t,r)=>{for(var i=r>1?void 0:r?LH(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Lh=class extends k(L){constructor(){super(...arguments),this.mdiLockOutline=fu}get queued_jobs(){var s;return(s=this.$store.state.server.jobQueue.queued_jobs)!=null?s:[]}get showJobQueue(){return this.moonrakerComponents.includes("job_queue")&&this.queued_jobs.length}};Lh=AH([S({components:{JobqueuePanel:ay,GcodefilesPanel:ly}})],Lh);var FH=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.existGcodesRootDirectory?t(x,[t(b,{class:e.showJobQueue?"col-12 col-md-8 pt-0 pt-md-3 order-1 order-md-0":"col-12"},[t(ly)],1),e.showJobQueue?t(b,{staticClass:"col-12 col-md-4 pb-0 pb-sm-3 order-0 order-md-1"},[t(ay)],1):e._e()],1):t(x,[t(it,{staticClass:"mx-auto mt-6",attrs:{dense:"",text:"",type:"warning",elevation:"2","max-width":"500",icon:e.mdiLockOutline}},[e._v(" "+e._s(e.$t("Files.GcodesRootDirectoryDoesntExists"))+" ")])],1)},RH=[],HH=E(Lh,FH,RH,!1,null,null);const jH=HH.exports;var IH=Object.defineProperty,NH=Object.getOwnPropertyDescriptor,Nf=(s,e,t,r)=>{for(var i=r>1?void 0:r?NH(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&IH(e,t,i),i};let Sa=class extends k(L){constructor(){super(...arguments),this.mdiAdjust=tn,this.mdiAlarm=Yn,this.mdiCalendar=uu,this.mdiCloseThick=pe,this.mdiNotebookPlus=fv,this.name="",this.note="",this.reminder=null,this.reminderFilament=!1,this.reminderFilamentValue=0,this.reminderPrinttime=!1,this.reminderPrinttimeValue=0,this.reminderDate=!1,this.reminderDateValue=0,this.nameInputRules=[e=>!!e||this.$t("History.InvalidNameEmpty")]}get reminderItems(){return[{text:this.$t("History.NoReminder").toString(),value:null},{text:this.$t("History.OneTime").toString(),value:"one-time"},{text:this.$t("History.Repeat").toString(),value:"repeat"}]}get totalFilamentUsed(){var e,t;return(t=(e=this.$store.state.server.history.job_totals)==null?void 0:e.total_filament_used)!=null?t:0}get totalPrinttime(){var e,t;return(t=(e=this.$store.state.server.history.job_totals)==null?void 0:e.total_print_time)!=null?t:0}get isValid(){return!(this.name===""||this.reminder!==null&&(!this.reminderFilament&&!this.reminderPrinttime&&!this.reminderDate||this.reminderFilament&&this.reminderFilamentValue<=0||this.reminderPrinttime&&this.reminderPrinttimeValue<=0||this.reminderDate&&this.reminderDateValue<=0))}closeDialog(){this.$emit("close")}save(){const e=new Date;this.$store.dispatch("gui/maintenance/store",{entry:{name:this.name,note:this.note,start_time:e.getTime()/1e3,end_time:null,start_filament:this.totalFilamentUsed,end_filament:null,start_printtime:this.totalPrinttime,end_printtime:null,reminder:{type:this.reminder,filament:{bool:this.reminderFilament,value:this.reminderFilamentValue},printtime:{bool:this.reminderPrinttime,value:this.reminderPrinttimeValue},date:{bool:this.reminderDate,value:this.reminderDateValue}}}}),this.closeDialog()}resetValues(){this.name="",this.note="",this.reminder=null,this.reminderFilament=!1,this.reminderFilamentValue=0,this.reminderPrinttime=!1,this.reminderPrinttimeValue=0,this.reminderDate=!1,this.reminderDateValue=0}onShowChanged(){this.show&&this.resetValues()}};Nf([w({type:Boolean,default:!1})],Sa.prototype,"show",2);Nf([he("show")],Sa.prototype,"onShowChanged",1);Sa=Nf([S({components:{Panel:U,SettingsRow:j}})],Sa);var VH=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.show,"max-width":600,persistent:""},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[t(U,{attrs:{title:e.$t("History.AddMaintenance"),icon:e.mdiNotebookPlus,"card-class":"history-add-maintenance-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"pb-0"},[t(x,[t(b,[t(se,{attrs:{rules:e.nameInputRules,label:e.$t("History.Name"),"hide-details":"auto",outlined:"",dense:""},model:{value:e.name,callback:function(r){e.name=r},expression:"name"}})],1)],1),t(x,[t(b,[t(pr,{attrs:{outlined:"","hide-details":"auto",label:e.$t("History.Note")},model:{value:e.note,callback:function(r){e.note=r},expression:"note"}})],1)],1),t(x,[t(b,[t(j,{attrs:{title:e.$t("History.Reminder")}},[t(ke,{staticClass:"mt-0",attrs:{items:e.reminderItems,outlined:"",dense:"","hide-details":""},model:{value:e.reminder,callback:function(r){e.reminder=r},expression:"reminder"}})],1)],1)],1),e.reminder?[t(x,[t(b,[t(j,{attrs:{icon:e.mdiAdjust,title:e.$t("History.FilamentBasedReminder"),"sub-title":e.$t("History.FilamentBasedReminderDescription")}},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reminderFilament,callback:function(r){e.reminderFilament=r},expression:"reminderFilament"}}),t(se,{staticClass:"mt-0",attrs:{"hide-details":"auto",type:"number",outlined:"",dense:"",suffix:e.$t("History.Meter")},model:{value:e.reminderFilamentValue,callback:function(r){e.reminderFilamentValue=e._n(r)},expression:"reminderFilamentValue"}})],1)],1)],1),t(x,[t(b,[t(j,{attrs:{icon:e.mdiAlarm,title:e.$t("History.PrinttimeBasedReminder"),"sub-title":e.$t("History.PrinttimeBasedReminderDescription")}},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reminderPrinttime,callback:function(r){e.reminderPrinttime=r},expression:"reminderPrinttime"}}),t(se,{staticClass:"mt-0",attrs:{"hide-details":"auto",type:"number",outlined:"",dense:"",suffix:e.$t("History.Hours")},model:{value:e.reminderPrinttimeValue,callback:function(r){e.reminderPrinttimeValue=e._n(r)},expression:"reminderPrinttimeValue"}})],1)],1)],1),t(x,[t(b,[t(j,{attrs:{icon:e.mdiCalendar,title:e.$t("History.DateBasedReminder"),"sub-title":e.$t("History.DateBasedReminderDescription")}},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.reminderDate,callback:function(r){e.reminderDate=r},expression:"reminderDate"}}),t(se,{staticClass:"mt-0",attrs:{"hide-details":"auto",type:"number",outlined:"",dense:"",suffix:e.$t("History.Days")},model:{value:e.reminderDateValue,callback:function(r){e.reminderDateValue=e._n(r)},expression:"reminderDateValue"}})],1)],1)],1)]:e._e()],2),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("History.Cancel")))]),t(g,{attrs:{color:"primary",text:"",disabled:!e.isValid},on:{click:e.save}},[e._v(e._s(e.$t("History.Save")))])],1)],1)],1)},BH=[],UH=E(Sa,VH,BH,!1,null,null);const cy=UH.exports;var WH=Object.defineProperty,zH=Object.getOwnPropertyDescriptor,uy=(s,e,t,r)=>{for(var i=r>1?void 0:r?zH(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&WH(e,t,i),i};let vc=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe}get selectedJobs(){var s;return(s=this.$store.state.gui.view.history.selectedJobs)!=null?s:[]}set selectedJobs(s){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.history.selectedJobs",value:s})}get question(){return this.selectedJobs.length===1?this.$t("History.DeleteSingleJobQuestion"):this.$t("History.DeleteSelectedQuestion",{count:this.selectedJobs.length})}closeDialog(){this.$emit("close")}deleteSelectedJobs(){this.selectedJobs.forEach(s=>{if(s.type==="maintenance"){this.$store.dispatch("gui/maintenance/delete",s.id);return}"job_id"in s&&this.$socket.emit("server.history.delete_job",{uid:s.job_id},{action:"server/history/getDeletedJobs"})}),this.selectedJobs=[],this.closeDialog()}};uy([w({type:Boolean,required:!0})],vc.prototype,"show",2);vc=uy([S({components:{Panel:U}})],vc);var GH=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.show,"max-width":"400"}},[t(U,{attrs:{title:e.$t("History.Delete"),"card-class":"history-delete-selected-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.question))])]),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("History.Cancel")))]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteSelectedJobs}},[e._v(e._s(e.$t("History.Delete")))])],1)],1)],1)},ZH=[],qH=E(vc,GH,ZH,!1,null,null);const dy=qH.exports;var XH=Object.defineProperty,YH=Object.getOwnPropertyDescriptor,qu=(s,e,t,r)=>{for(var i=r>1?void 0:r?YH(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&XH(e,t,i),i};let Bi=class extends k(L){constructor(){super(...arguments),this.mdiAdjust=tn,this.mdiAlarm=Yn,this.mdiCalendar=uu,this.mdiCloseThick=pe,this.mdiNotebook=gu,this.name="",this.note="",this.reminder=null,this.reminderFilament=!1,this.reminderFilamentValue=0,this.reminderPrinttime=!1,this.reminderPrinttimeValue=0,this.reminderDate=!1,this.reminderDateValue=0,this.nameInputRules=[s=>!!s||this.$t("History.InvalidNameEmpty")]}get reminderItems(){return[{text:this.$t("History.NoReminder").toString(),value:null},{text:this.$t("History.OneTime").toString(),value:"one-time"},{text:this.$t("History.Repeat").toString(),value:"repeat"}]}get totalFilamentUsed(){var s,e;return(e=(s=this.$store.state.server.history.job_totals)==null?void 0:s.total_filament_used)!=null?e:0}get totalPrinttime(){var s,e;return(e=(s=this.$store.state.server.history.job_totals)==null?void 0:s.total_print_time)!=null?e:0}get isValid(){return!(this.name===""||this.reminder!==null&&(!this.reminderFilament&&!this.reminderPrinttime&&!this.reminderDate||this.reminderFilament&&this.reminderFilamentValue<=0||this.reminderPrinttime&&this.reminderPrinttimeValue<=0||this.reminderDate&&this.reminderDateValue<=0))}closeDialog(){this.$emit("close")}save(){const s={...this.item};"type"in s&&delete s.type,s.name=this.name,s.note=this.note,s.reminder={type:this.reminder,filament:{bool:this.reminderFilament,value:this.reminderFilamentValue},printtime:{bool:this.reminderPrinttime,value:this.reminderPrinttimeValue},date:{bool:this.reminderDate,value:this.reminderDateValue}},this.$store.dispatch("gui/maintenance/update",s),this.closeDialog()}onShowChanged(){var s,e,t,r,i,n,a,o,l,u,c,d,m,h;this.show&&(this.name=this.item.name,this.note=this.item.note,this.reminder=(e=(s=this.item.reminder)==null?void 0:s.type)!=null?e:null,this.reminderFilament=(r=(t=this.item.reminder)==null?void 0:t.filament.bool)!=null?r:!1,this.reminderFilamentValue=(n=(i=this.item.reminder)==null?void 0:i.filament.value)!=null?n:0,this.reminderPrinttime=(o=(a=this.item.reminder)==null?void 0:a.printtime.bool)!=null?o:!1,this.reminderPrinttimeValue=(u=(l=this.item.reminder)==null?void 0:l.printtime.value)!=null?u:0,this.reminderDate=(d=(c=this.item.reminder)==null?void 0:c.date.bool)!=null?d:!1,this.reminderDateValue=(h=(m=this.item.reminder)==null?void 0:m.date.value)!=null?h:0)}};qu([w({type:Boolean,default:!1})],Bi.prototype,"show",2);qu([w({type:Object,required:!0})],Bi.prototype,"item",2);qu([he("show")],Bi.prototype,"onShowChanged",1);Bi=qu([S({components:{Panel:U,SettingsRow:j}})],Bi);var JH=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.show,"max-width":600,persistent:""},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[t(U,{attrs:{title:e.$t("History.EditMaintenance"),icon:e.mdiNotebook,"card-class":"history-edit-maintenance-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"pb-0"},[t(x,[t(b,[t(se,{attrs:{rules:e.nameInputRules,label:e.$t("History.Name"),"hide-details":"auto",outlined:"",dense:""},model:{value:e.name,callback:function(r){e.name=r},expression:"name"}})],1)],1),t(x,[t(b,[t(pr,{attrs:{outlined:"","hide-details":"auto",label:e.$t("History.Note")},model:{value:e.note,callback:function(r){e.note=r},expression:"note"}})],1)],1),t(x,[t(b,[t(j,{attrs:{title:e.$t("History.Reminder")}},[t(ke,{staticClass:"mt-0",attrs:{items:e.reminderItems,disabled:e.item.end_time!==null,outlined:"",dense:"","hide-details":""},model:{value:e.reminder,callback:function(r){e.reminder=r},expression:"reminder"}})],1)],1)],1),e.reminder?[t(x,[t(b,[t(j,{attrs:{icon:e.mdiAdjust,title:e.$t("History.FilamentBasedReminder"),"sub-title":e.$t("History.FilamentBasedReminderDescription")}},[t(ge,{staticClass:"mt-0",attrs:{disabled:e.item.end_time!==null,"hide-details":""},model:{value:e.reminderFilament,callback:function(r){e.reminderFilament=r},expression:"reminderFilament"}}),t(se,{staticClass:"mt-0",attrs:{disabled:e.item.end_time!==null,"hide-details":"auto",type:"number",outlined:"",dense:"",suffix:e.$t("History.Meter")},model:{value:e.reminderFilamentValue,callback:function(r){e.reminderFilamentValue=e._n(r)},expression:"reminderFilamentValue"}})],1)],1)],1),t(x,[t(b,[t(j,{attrs:{icon:e.mdiAlarm,title:e.$t("History.PrinttimeBasedReminder"),"sub-title":e.$t("History.PrinttimeBasedReminderDescription")}},[t(ge,{staticClass:"mt-0",attrs:{disabled:e.item.end_time!==null,"hide-details":""},model:{value:e.reminderPrinttime,callback:function(r){e.reminderPrinttime=r},expression:"reminderPrinttime"}}),t(se,{staticClass:"mt-0",attrs:{disabled:e.item.end_time!==null,"hide-details":"auto",type:"number",outlined:"",dense:"",suffix:e.$t("History.Hours")},model:{value:e.reminderPrinttimeValue,callback:function(r){e.reminderPrinttimeValue=e._n(r)},expression:"reminderPrinttimeValue"}})],1)],1)],1),t(x,[t(b,[t(j,{attrs:{icon:e.mdiCalendar,title:e.$t("History.DateBasedReminder"),"sub-title":e.$t("History.DateBasedReminderDescription")}},[t(ge,{staticClass:"mt-0",attrs:{disabled:e.item.end_time!==null,"hide-details":""},model:{value:e.reminderDate,callback:function(r){e.reminderDate=r},expression:"reminderDate"}}),t(se,{staticClass:"mt-0",attrs:{disabled:e.item.end_time!==null,"hide-details":"auto",type:"number",outlined:"",dense:"",suffix:e.$t("History.Days")},model:{value:e.reminderDateValue,callback:function(r){e.reminderDateValue=e._n(r)},expression:"reminderDateValue"}})],1)],1)],1)]:e._e()],2),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("History.Cancel")))]),t(g,{attrs:{color:"primary",text:"",disabled:!e.isValid},on:{click:e.save}},[e._v(e._s(e.$t("History.Save")))])],1)],1)],1)},KH=[],QH=E(Bi,JH,KH,!1,null,null);const ej=QH.exports;var tj=Object.defineProperty,sj=Object.getOwnPropertyDescriptor,Xu=(s,e,t,r)=>{for(var i=r>1?void 0:r?sj(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&tj(e,t,i),i};let Ui=class extends k(L){constructor(){super(...arguments),this.mdiAdjust=tn,this.mdiAlarm=Yn,this.mdiCalendar=uu,this.mdiCloseThick=pe}get date(){return this.formatDateTime(this.item.start_time*1e3,!1)}get dateText(){return this.last?this.$t("History.EntryCreatedAt",{date:this.date}):this.$t("History.EntryPerformedAt",{date:this.date})}get showGoals(){return this.item.reminder.type===null?!1:this.current&&this.item.end_time===null}get restFilament(){var i,n,a,o,l;const s=(n=(i=this.item)==null?void 0:i.start_filament)!=null?n:0,e=(a=this.item.end_filament)!=null?a:0;let r=((l=(o=this.$store.state.server.history.job_totals)==null?void 0:o.total_filament_used)!=null?l:0)-s;return e&&(r=e-s),r/=1e3,r}get restFilamentText(){var e,t;const s=(t=(e=this.item.reminder.filament)==null?void 0:e.value)!=null?t:0;return this.showGoals?this.item.reminder.filament.bool?"".concat(this.restFilament.toFixed(0)," / ").concat(s," m"):!1:"".concat(this.restFilament.toFixed(0)," m")}get restFilamentClass(){var t,r;const s=["mr-3"];if(!this.showGoals||!this.item.reminder.filament.bool)return s;const e=(r=(t=this.item.reminder.filament)==null?void 0:t.value)!=null?r:0;return this.restFilament>e?[...s,"error--text","font-weight-bold"]:s}get restPrinttime(){var i,n,a,o;const s=(i=this.item.start_printtime)!=null?i:0,e=(n=this.item.end_printtime)!=null?n:0;let r=((o=(a=this.$store.state.server.history.job_totals)==null?void 0:a.total_print_time)!=null?o:0)-s;return e&&(r=e-s),r/=3600,r}get restPrinttimeText(){var e,t;const s=(t=(e=this.item.reminder.printtime)==null?void 0:e.value)!=null?t:0;return this.showGoals?this.item.reminder.printtime.bool?"".concat(this.restPrinttime.toFixed(1)," / ").concat(s," h"):!1:"".concat(this.restPrinttime.toFixed(1)," h")}get restPrinttimeClass(){var t,r;const s=["mr-3"];if(!this.showGoals||!this.item.reminder.printtime.bool)return s;const e=(r=(t=this.item.reminder.printtime)==null?void 0:t.value)!=null?r:0;return this.restPrinttime>e?[...s,"error--text","font-weight-bold"]:s}get restDays(){var i,n;const s=(i=this.item.start_time)!=null?i:0,e=(n=this.item.end_time)!=null?n:0;let r=new Date().getTime()/1e3-s;return e&&(r=e-s),r/(60*60*24)}get restDaysText(){var e,t;const s=(t=(e=this.item.reminder.date)==null?void 0:e.value)!=null?t:0;return this.showGoals?this.item.reminder.date.bool?"".concat(this.restDays.toFixed(0)," / ").concat(s," days"):!1:"".concat(this.restDays.toFixed(0)," days")}get restDaysClass(){var t,r;const s=["mr-3"];if(!this.showGoals||!this.item.reminder.date.bool)return s;const e=(r=(t=this.item.reminder.date)==null?void 0:t.value)!=null?r:0;return this.restDays>e?[...s,"error--text","font-weight-bold"]:s}get classDateItem(){return{"pb-2":!this.last,"pb-5":this.last}}get note(){var s;return(s=this.item.perform_note)==null?void 0:s.replaceAll("\n","
")}};Xu([w({type:Object,default:!1})],Ui.prototype,"item",2);Xu([w({type:Boolean,default:!1})],Ui.prototype,"current",2);Xu([w({type:Boolean,default:!1})],Ui.prototype,"last",2);Ui=Xu([S({components:{Panel:U}})],Ui);var rj=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(Zn,{staticClass:"pb-2",attrs:{small:"","hide-dot":""}},[t("div",[e.restFilamentText?t("span",{class:e.restFilamentClass},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiAdjust))]),e._v(" "+e._s(e.restFilamentText)+" ")],1):e._e(),e.restPrinttimeText?t("span",{class:e.restPrinttimeClass},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiAlarm))]),e._v(" "+e._s(e.restPrinttimeText)+" ")],1):e._e(),e.restDaysText?t("span",{class:e.restDaysClass},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiCalendar))]),e._v(" "+e._s(e.restDaysText)+" ")],1):e._e()]),e.note?t("p",{staticClass:"mt-2 mb-0",domProps:{innerHTML:e._s(e.note)}}):e._e()]),t(Zn,{class:e.classDateItem,attrs:{small:""}},[t("strong",[e._v(e._s(e.dateText))])])],1)},ij=[],nj=E(Ui,rj,ij,!1,null,null);const Vf=nj.exports;var aj=Object.defineProperty,oj=Object.getOwnPropertyDescriptor,Yu=(s,e,t,r)=>{for(var i=r>1?void 0:r?oj(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&aj(e,t,i),i};let Wi=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiNotebook=gu,this.note=""}get showPerformButton(){var s,e;return this.item.end_time?!1:(e=(s=this.item.reminder)==null?void 0:s.type)!=null?e:!1}get performButtonText(){var s;return((s=this.item.reminder)==null?void 0:s.type)==="repeat"?this.$t("History.PerformedAndReschedule"):this.$t("History.Performed")}closeDialog(){this.$emit("close")}perform(){this.$store.dispatch("gui/maintenance/perform",{id:this.item.id,note:this.note}),this.$emit("close-both")}onShowChanged(s){s&&(this.note="")}};Yu([w({type:Boolean,default:!1})],Wi.prototype,"show",2);Yu([w({type:Object,default:!1})],Wi.prototype,"item",2);Yu([he("show")],Wi.prototype,"onShowChanged",1);Wi=Yu([S({components:{Panel:U,HistoryListPanelDetailMaintenanceHistoryEntry:Vf}})],Wi);var lj=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.show,"max-width":400,persistent:""},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[t(U,{attrs:{title:e.$t("History.PerformMaintenance"),icon:e.mdiNotebook,"card-class":"history-perform-maintenance-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"pb-0"},[t(x,[t(b,[t(pr,{attrs:{outlined:"","hide-details":"auto",label:e.$t("History.AddANote")},model:{value:e.note,callback:function(r){e.note=r},expression:"note"}})],1)],1)],1),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("History.Cancel")))]),e.showPerformButton?t(g,{attrs:{text:"",color:"primary"},on:{click:e.perform}},[e._v(e._s(e.performButtonText))]):e._e()],1)],1)],1)},cj=[],uj=E(Wi,lj,cj,!1,null,null);const my=uj.exports;var dj=Object.defineProperty,mj=Object.getOwnPropertyDescriptor,Bf=(s,e,t,r)=>{for(var i=r>1?void 0:r?mj(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&dj(e,t,i),i};let Pa=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiNotebook=gu,this.mdiPencil=bt,this.showEditDialog=!1,this.showPerformDialog=!1}get date(){return this.formatDateTime(this.item.start_time*1e3,!1)}get note(){return this.item.note.replaceAll("\n","
")}get showPerformButton(){var s,e;return this.item.end_time?!1:(e=(s=this.item.reminder)==null?void 0:s.type)!=null?e:!1}get allEntries(){var s;return(s=this.$store.getters["gui/maintenance/getEntries"])!=null?s:[]}get history(){const s=[];let e=this.item.id;for(;e;){const t=this.allEntries.find(r=>r.id===e);if(!t)break;s.push(t),e=t.last_entry}return s}get outputFirstPointOfHistory(){return this.item.reminder.type===null?this.$t("History.EntrySince"):this.item.end_time===null?this.$t("History.EntryNextPerform"):this.$t("History.EntryPerformedAt",{date:this.formatDateTime(this.item.end_time*1e3)})}closeDialog(){this.$emit("close")}closePerform(){this.showPerformDialog=!1,this.closeDialog()}};Bf([w({type:Boolean,default:!1})],Pa.prototype,"show",2);Bf([w({type:Object,default:!1})],Pa.prototype,"item",2);Pa=Bf([S({components:{HistoryListPanelPerformMaintenance:my,Panel:U,HistoryListPanelDetailMaintenanceHistoryEntry:Vf}})],Pa);var hj=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.show,"max-width":500,persistent:""},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}}},[t(U,{attrs:{title:e.$t("History.Maintenance"),icon:e.mdiNotebook,"card-class":"history-maintenance-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.showEditDialog=!0}}},[t(_,[e._v(e._s(e.mdiPencil))])],1),t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t("overlay-scrollbars",{staticStyle:{height:"350px"}},[t(Z,{staticClass:"pb-0"},[t(x,[t(b,[t("div",[e._v(e._s(e.date))]),t("p",{staticClass:"text-h4 text--primary"},[e._v(e._s(e.item.name))]),e.note?t("div",{staticClass:"text--primary",domProps:{innerHTML:e._s(e.note)}}):e._e()])],1)],1),t(I,{staticClass:"mt-3 mb-0"}),t(Z,{staticClass:"pt-0 mb-0 pb-0"},[t(M_,{attrs:{"align-top":"",dense:""}},[t(Zn,{staticClass:"pb-1",attrs:{small:""}},[t("strong",[e._v(e._s(e.outputFirstPointOfHistory))])]),e._l(e.history,function(r){return t(Vf,{key:r.id,attrs:{item:r,current:r.id===e.item.id,last:r.id===e.history[e.history.length-1].id}})})],2)],1)],1),t(I,{staticClass:"mt-0"}),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("History.Cancel")))]),e.showPerformButton?t(g,{attrs:{text:"",color:"primary"},on:{click:function(r){e.showPerformDialog=!0}}},[e._v(" "+e._s(e.$t("History.Perform"))+" ")]):e._e()],1)],1),t(my,{attrs:{show:e.showPerformDialog,item:e.item},on:{close:function(r){e.showPerformDialog=!1},"close-both":e.closePerform}}),t(ej,{attrs:{show:e.showEditDialog,item:e.item},on:{close:function(r){e.showEditDialog=!1}}})],1)},pj=[],fj=E(Pa,hj,pj,!1,null,null);const Uf=fj.exports;var gj=Object.defineProperty,_j=Object.getOwnPropertyDescriptor,Ju=(s,e,t,r)=>{for(var i=r>1?void 0:r?_j(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&gj(e,t,i),i};let zi=class extends k(L){constructor(){super(...arguments),this.mdiAdjust=tn,this.mdiAlarm=Yn,this.mdiCalendar=uu,this.mdiDelete=Ue,this.mdiTextBoxSearch=Sv,this.detailsDialogBool=!1,this.contextMenuBool=!1,this.contextMenuX=0,this.contextMenuY=0}get cssClasses(){return["file-list-cursor","user-select-none"]}get restFilament(){var n,a,o,l,u;const e=(a=(n=this.item)==null?void 0:n.start_filament)!=null?a:0,t=(o=this.item.end_filament)!=null?o:0;let i=((u=(l=this.$store.state.server.history.job_totals)==null?void 0:l.total_filament_used)!=null?u:0)-e;return t&&(i=t-e),i/=1e3,i}get restTextFilament(){var t,r;if(!this.item.reminder.filament.bool)return!1;const e=(r=(t=this.item.reminder.filament)==null?void 0:t.value)!=null?r:0;return"".concat(this.restFilament.toFixed(0)," / ").concat(e," m")}get restPrinttime(){var n,a,o,l;const e=(n=this.item.start_printtime)!=null?n:0,t=(a=this.item.end_printtime)!=null?a:0;let i=((l=(o=this.$store.state.server.history.job_totals)==null?void 0:o.total_print_time)!=null?l:0)-e;return t&&(i=t-e),i/=3600,i}get restTextPrinttime(){var t,r;if(!this.item.reminder.printtime.bool)return!1;const e=(r=(t=this.item.reminder.printtime)==null?void 0:t.value)!=null?r:0;return"".concat(this.restPrinttime.toFixed(1)," / ").concat(e," h")}get restDays(){var n,a;const e=(n=this.item.start_time)!=null?n:0,t=(a=this.item.end_time)!=null?a:0;let i=new Date().getTime()/1e3-e;return t&&(i=t-e),i/(60*60*24)}get restTextDays(){var t,r;if(!this.item.reminder.date.bool)return!1;const e=(r=(t=this.item.reminder.date)==null?void 0:t.value)!=null?r:0;return"".concat(this.restDays.toFixed(0)," / ").concat(e," days")}get reminder(){var e,t;return(t=(e=this.item.reminder)==null?void 0:e.type)!=null?t:null}get alarmIcon(){return this.reminder==="repeat"?uw:Yn}get icon(){return this.item.end_time!==null?cS:gu}select(e){this.$emit("select",e)}showContextMenu(e){e==null||e.preventDefault(),!this.contextMenuBool&&(this.contextMenuBool=!0,this.contextMenuX=(e==null?void 0:e.clientX)||(e==null?void 0:e.pageX)||window.screenX/2,this.contextMenuY=(e==null?void 0:e.clientY)||(e==null?void 0:e.pageY)||window.screenY/2,this.$nextTick(()=>{this.contextMenuBool=!0}))}deleteEntry(){this.$store.dispatch("gui/maintenance/delete",this.item.id)}};Ju([w({type:Object,required:!0})],zi.prototype,"item",2);Ju([w({type:Array,required:!0})],zi.prototype,"tableFields",2);Ju([w({type:Boolean,required:!0})],zi.prototype,"isSelected",2);zi=Ju([S({components:{HistoryListPanelDetailMaintenance:Uf,Panel:U}})],zi);var vj=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:r=>e.showContextMenu(r),expression:"(e) => showContextMenu(e)",arg:"600"}],key:e.item.id,class:e.cssClasses,on:{contextmenu:function(r){return e.showContextMenu(r)},click:function(r){e.detailsDialogBool=!0}}},[t("td",{staticClass:"pr-0"},[t(jr,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{value:e.isSelected},on:{click:function(r){return r.stopPropagation(),e.select(!e.isSelected)}}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[t(_,{attrs:{color:"primary"}},[e._v(e._s(e.icon))])],1),t("td",[e._v(e._s(e.item.name))]),t("td",{staticClass:"text-right text-no-wrap"},[e.reminder!==null?t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(_,e._g(e._b({attrs:{small:"",color:"primary"}},"v-icon",i,!1),r),[e._v(" "+e._s(e.alarmIcon)+" ")])]}}],null,!1,95998964)},[t("div",[e.restTextFilament?t("div",[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiAdjust))]),e._v(" "+e._s(e.restTextFilament)+" ")],1):e._e(),e.restTextPrinttime?t("div",[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiAlarm))]),e._v(" "+e._s(e.restTextPrinttime)+" ")],1):e._e(),e.restTextDays?t("div",[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiCalendar))]),e._v(" "+e._s(e.restTextDays)+" ")],1):e._e()])]):e._e()],1),t("td",{staticClass:"text-left text-no-wrap"},[e._v(" "+e._s(e.formatDateTime(e.item.start_time*1e3,!1))+" ")]),t("td",{attrs:{colspan:e.tableFields.length-1}}),t(ye,{attrs:{"position-x":e.contextMenuX,"position-y":e.contextMenuY,absolute:"","offset-y":""},model:{value:e.contextMenuBool,callback:function(r){e.contextMenuBool=r},expression:"contextMenuBool"}},[t(Me,[t(J,{on:{click:function(r){e.detailsDialogBool=!0}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiTextBoxSearch))]),e._v(" "+e._s(e.$t("History.Details"))+" ")],1),t(J,{staticClass:"red--text",on:{click:e.deleteEntry}},[t(_,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("History.Delete"))+" ")],1)],1)],1),t(Uf,{attrs:{show:e.detailsDialogBool,item:e.item},on:{close:function(r){e.detailsDialogBool=!1}}})],1)},bj=[],yj=E(zi,vj,bj,!1,null,null);const hy=yj.exports;var Cj=Object.defineProperty,$j=Object.getOwnPropertyDescriptor,lo=(s,e,t,r)=>{for(var i=r>1?void 0:r?$j(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&Cj(e,t,i),i};let Yr=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.note=""}get panelTitle(){return this.type==="create"?this.$t("History.CreateNote").toString():this.$t("History.EditNote").toString()}get icon(){return this.type==="create"?pv:hv}saveNote(){var s;this.$store.dispatch("server/history/saveHistoryNote",{job_id:(s=this.job)==null?void 0:s.job_id,note:this.note}),this.closeDialog()}closeDialog(){this.$emit("close-dialog")}onShowChanged(){var s;this.show&&(this.note=(s=this.job.note)!=null?s:"")}};lo([w({type:Boolean,required:!0})],Yr.prototype,"show",2);lo([w({type:String,required:!0})],Yr.prototype,"type",2);lo([w({type:Object,required:!0})],Yr.prototype,"job",2);lo([he("show",{immediate:!0})],Yr.prototype,"onShowChanged",1);Yr=lo([S({components:{Panel:U,SettingsRow:j}})],Yr);var xj=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{"max-width":600,persistent:""},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}},model:{value:e.show,callback:function(r){e.show=r},expression:"show"}},[t(U,{attrs:{title:e.panelTitle,icon:e.icon,"card-class":"history-note-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"pb-0"},[t(x,[t(b,[t(pr,{attrs:{outlined:"","hide-details":"",label:e.$t("History.Note")},model:{value:e.note,callback:function(r){e.note=r},expression:"note"}})],1)],1)],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("History.Cancel")))]),t(g,{attrs:{color:"primary",text:""},on:{click:e.saveNote}},[e._v(e._s(e.$t("History.Save")))])],1)],1)],1)},wj=[],Sj=E(Yr,xj,wj,!1,null,"5377fa07");const py=Sj.exports;var Pj=Object.defineProperty,Dj=Object.getOwnPropertyDescriptor,Wf=(s,e,t,r)=>{for(var i=r>1?void 0:r?Dj(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&Pj(e,t,i),i};let Da=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiUpdate=Xa,this.formatFilesize=Xe,this.formatPrintTime=Is}get entries(){var t,r,i,n,a,o,l,u,c,d,m,h,f,p,v,C,P,M,F,O,$,D,V,N,W,G,te,X,q,z,K,Q,re;let e=[{name:this.$t("History.Filename").toString(),value:this.job.filename,exists:!0},{name:this.$t("History.Filesize").toString(),value:Xe((r=(t=this.job.metadata)==null?void 0:t.filesize)!=null?r:0),exists:((n=(i=this.job.metadata)==null?void 0:i.filesize)!=null?n:0)>0},{name:this.$t("History.LastModified").toString(),value:this.formatDateTime(((o=(a=this.job.metadata)==null?void 0:a.modified)!=null?o:0)*1e3),exists:((u=(l=this.job.metadata)==null?void 0:l.modified)!=null?u:0)>0},{name:this.$t("History.Status").toString(),value:this.$te("History.StatusValues.".concat(this.job.status),"en")?this.$t("History.StatusValues.".concat(this.job.status)).toString():this.job.status,exists:!0},{name:this.$t("History.StartTime").toString(),value:this.formatDateTime(this.job.start_time*1e3),exists:!0},{name:this.$t("History.EndTime").toString(),value:this.formatDateTime(this.job.end_time*1e3),exists:this.job.end_time>0},{name:this.$t("History.EstimatedTime").toString(),value:this.formatPrintTime((d=(c=this.job.metadata)==null?void 0:c.estimated_time)!=null?d:0),exists:this.job.metadata&&"estimated_time"in this.job.metadata},{name:this.$t("History.PrintDuration").toString(),value:this.formatPrintTime((m=this.job.print_duration)!=null?m:0),exists:this.job.print_duration>0},{name:this.$t("History.TotalDuration").toString(),value:this.formatPrintTime((h=this.job.total_duration)!=null?h:0),exists:this.job.total_duration>0},{name:this.$t("History.EstimatedFilamentWeight").toString(),value:"".concat(Math.round(((p=(f=this.job.metadata)==null?void 0:f.filament_weight_total)!=null?p:0)*100)/100," g"),exists:this.job.metadata&&"filament_weight_total"in this.job.metadata},{name:this.$t("History.EstimatedFilament").toString(),value:"".concat(Math.round((C=(v=this.job.metadata)==null?void 0:v.filament_total)!=null?C:0)," mm"),exists:this.job.metadata&&"filament_total"in this.job.metadata},{name:this.$t("History.FilamentUsed").toString(),value:"".concat(Math.round((M=(P=this.job.metadata)==null?void 0:P.filament_used)!=null?M:0)," mm"),exists:this.job.metadata&&"filament_used"in this.job.metadata},{name:this.$t("History.FirstLayerExtTemp").toString(),value:"".concat((O=(F=this.job.metadata)==null?void 0:F.first_layer_extr_temp)!=null?O:0," °C"),exists:this.job.metadata&&"first_layer_extr_temp"in this.job.metadata},{name:this.$t("History.FirstLayerBedTemp").toString(),value:"".concat((D=($=this.job.metadata)==null?void 0:$.first_layer_bed_temp)!=null?D:0," °C"),exists:this.job.metadata&&"first_layer_bed_temp"in this.job.metadata},{name:this.$t("History.FirstLayerHeight").toString(),value:"".concat((N=(V=this.job.metadata)==null?void 0:V.first_layer_height)!=null?N:0," mm"),exists:this.job.metadata&&"first_layer_height"in this.job.metadata},{name:this.$t("History.LayerHeight").toString(),value:"".concat((G=(W=this.job.metadata)==null?void 0:W.layer_height)!=null?G:0," mm"),exists:this.job.metadata&&"layer_height"in this.job.metadata},{name:this.$t("History.ObjectHeight").toString(),value:"".concat((X=(te=this.job.metadata)==null?void 0:te.object_height)!=null?X:0," mm"),exists:this.job.metadata&&"object_height"in this.job.metadata},{name:this.$t("History.Slicer").toString(),value:(z=(q=this.job.metadata)==null?void 0:q.slicer)!=null?z:"--",exists:this.job.metadata&&"slicer"in this.job.metadata},{name:this.$t("History.SlicerVersion").toString(),value:(Q=(K=this.job.metadata)==null?void 0:K.slicer_version)!=null?Q:"--",exists:this.job.metadata&&"slicer_version"in this.job.metadata}];return"auxiliary_data"in this.job&&((re=this.job.auxiliary_data)==null||re.forEach(R=>{let B=R.value.toString();Array.isArray(R.value)||(B="".concat(Math.round(R.value*1e3)/1e3," ").concat(R.units)),B===""&&(B="--"),e.push({name:R.description,value:B,exists:!0})})),e.filter(R=>R.exists)}closeDialog(){this.$emit("close-dialog")}};Wf([w({type:Boolean,required:!0})],Da.prototype,"show",2);Wf([w({type:Object,required:!0})],Da.prototype,"job",2);Da=Wf([S({components:{Panel:U,SettingsRow:j}})],Da);var Tj=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{"max-width":600,persistent:""},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"])?null:e.closeDialog.apply(null,arguments)}},model:{value:e.show,callback:function(r){e.show=r},expression:"show"}},[t(U,{attrs:{title:e.$t("History.JobDetails").toString(),icon:e.mdiUpdate,"card-class":"history-detail-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"pa-0"},[t("overlay-scrollbars",{staticClass:"px-6",staticStyle:{height:"350px"}},[e._l(e.entries,function(r,i){return[i>0?t(I,{key:"history_detail_entry_divider_"+i,staticClass:"my-3"}):e._e(),t(x,{key:"history_detail_entry_"+i},[t(b,[e._v(e._s(r.name))]),t(b,{staticClass:"text-right"},[e._v(e._s(r.value))])],1)]})],2)],1)],1)],1)},Oj=[],Mj=E(Da,Tj,Oj,!1,null,"5124be47");const zf=Mj.exports;var kj=Object.defineProperty,Ej=Object.getOwnPropertyDescriptor,Ku=(s,e,t,r)=>{for(var i=r>1?void 0:r?Ej(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&kj(e,t,i),i};let Gi=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiDelete=Ue,this.mdiFile=Bs,this.mdiFileCancel=Vw,this.mdiNoteEditOutline=hv,this.mdiNotePlusOutline=pv,this.mdiNoteTextOutline=lS,this.mdiPrinter=Xp,this.mdiTextBoxSearch=Sv,this.mdiPlaylistPlus=Za,this.detailsDialogBool=!1,this.contextMenuBool=!1,this.contextMenuX=0,this.contextMenuY=0,this.noteDialogBool=!1,this.noteDialogType="create",this.addBatchToQueueDialogBool=!1}get smallThumbnail(){var t,r,i,n,a;if(((i=(r=(t=this.item.metadata)==null?void 0:t.thumbnails)==null?void 0:r.length)!=null?i:0)<1)return!1;const e=(a=(n=this.item.metadata)==null?void 0:n.thumbnails)==null?void 0:a.find(o=>o.width>=Yt&&o.width<=Jt&&o.height>=Yt&&o.height<=Jt);return e?this.createThumbnailUrl(e):!1}get bigThumbnail(){var t,r,i,n,a;if(((i=(r=(t=this.item.metadata)==null?void 0:t.thumbnails)==null?void 0:r.length)!=null?i:0)<1)return!1;const e=(a=(n=this.item.metadata)==null?void 0:n.thumbnails)==null?void 0:a.find(o=>o.width>=Ls);return e?this.createThumbnailUrl(e):!1}get statusIcon(){return this.$store.getters["server/history/getPrintStatusIcon"](this.item.status)}get statusColor(){return this.$store.getters["server/history/getPrintStatusIconColor"](this.item.status)}get statusName(){return this.$t("History.StatusValues.".concat(this.item.status),"en")?this.$t("History.StatusValues.".concat(this.item.status)):this.item.status.replace(/_/g," ")}get cssClasses(){let e=["file-list-cursor","user-select-none"];return this.item.exists||e.push("text--disabled"),e}get isJobQueueAvailable(){return this.moonrakerComponents.includes("job_queue")}select(e){this.$emit("select",e)}showContextMenu(e){e==null||e.preventDefault(),!this.contextMenuBool&&(this.contextMenuBool=!0,this.contextMenuX=(e==null?void 0:e.clientX)||(e==null?void 0:e.pageX)||window.screenX/2,this.contextMenuY=(e==null?void 0:e.clientY)||(e==null?void 0:e.pageY)||window.screenY/2,this.$nextTick(()=>{this.contextMenuBool=!0}))}startPrint(){this.item.exists&&this.$socket.emit("printer.print.start",{filename:this.item.filename},{action:"switchToDashboard"})}createNote(){this.noteDialogType="create",this.noteDialogBool=!0}editNote(){this.noteDialogType="edit",this.noteDialogBool=!0}addToQueue(){this.$store.dispatch("server/jobQueue/addToQueue",[this.item.filename]),this.$toast.info(this.$t("History.AddToQueueSuccessful",{filename:this.item.filename}).toString())}deleteJob(){this.$socket.emit("server.history.delete_job",{uid:this.item.job_id},{action:"server/history/getDeletedJobs"})}outputValue(e,t){var i;let r=e.value in t?t[e.value]:null;if(r===null&&(r=e.value in t.metadata?t.metadata[e.value]:null),e.value.startsWith("history_field_")){const n=e.value.replace("history_field_",""),a=(i=t.auxiliary_data)==null?void 0:i.find(o=>o.name===n);if(a&&!Array.isArray(a.value))return"".concat(Math.round(a.value*1e3)/1e3," ").concat(a.units)}if(r===null)return"--";switch(e.value==="slicer"&&(r+="
"+t.metadata.slicer_version),e.outputType){case"filesize":return Xe(r);case"date":return this.formatDateTime(r*1e3);case"time":return Is(r,!1);case"temp":return(r==null?void 0:r.toFixed())+" °C";case"length":return r>1e3?(r/1e3).toFixed(2)+" m":(r==null?void 0:r.toFixed(2))+" mm";default:return r}}createThumbnailUrl(e){let t="";return this.item.filename.lastIndexOf("/")!==-1&&(t=this.item.filename.substring(0,this.item.filename.lastIndexOf("/")+1)),"".concat(this.apiUrl,"/server/files/gcodes/").concat(Ie(t+e.relative_path),"?timestamp=").concat(this.item.metadata.modified)}};Ku([w({type:Object,required:!0})],Gi.prototype,"item",2);Ku([w({type:Array,required:!0})],Gi.prototype,"tableFields",2);Ku([w({type:Boolean,required:!0})],Gi.prototype,"isSelected",2);Gi=Ku([S({components:{AddBatchToQueueDialog:ri,HistoryListPanelNoteDialog:py,HistoryListPanelDetailsDialog:zf,Panel:U}})],Gi);var Lj=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:r=>e.showContextMenu(r),expression:"(e) => showContextMenu(e)",arg:"600"}],key:e.item.job_id,class:e.cssClasses,on:{contextmenu:function(r){return e.showContextMenu(r)},click:function(r){e.detailsDialogBool=!0}}},[t("td",{staticClass:"pr-0"},[t(jr,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{value:e.isSelected},on:{click:function(r){return r.stopPropagation(),e.select(!e.isSelected)}}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[e.item.exists?e.smallThumbnail&&e.bigThumbnail?[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("vue-load-image",[t("img",e._g(e._b({attrs:{slot:"image",alt:e.item.filename,src:e.smallThumbnail,width:"32",height:"32"},slot:"image"},"img",i,!1),r)),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(ot,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(_,[e._v(e._s(e.mdiFile))])],1)])]}}])},[t("span",[t("img",{attrs:{alt:e.item.filename,src:e.bigThumbnail,width:"250"}})])])]:e.smallThumbnail?[t("vue-load-image",[t("img",{attrs:{slot:"image",alt:e.item.filename,src:e.smallThumbnail,width:"32",height:"32"},slot:"image"}),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(ot,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(_,[e._v(e._s(e.mdiFile))])],1)])]:[t(_,[e._v(e._s(e.mdiFile))])]:[t(_,{staticClass:"text--disabled"},[e._v(e._s(e.mdiFileCancel))])]],2),t("td",[e._v(e._s(e.item.filename))]),t("td",{staticClass:"text-right text-no-wrap"},["note"in e.item&&e.item.note?[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(_,e._g(e._b({staticClass:"mr-2",attrs:{small:""}},"v-icon",i,!1),r),[e._v(" "+e._s(e.mdiNoteTextOutline)+" ")])]}}],null,!1,3447416518)},[t("span",{domProps:{innerHTML:e._s(e.item.note.replaceAll("\n","
"))}})])]:e._e(),t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("span",e._g(e._b({},"span",i,!1),r),[t(_,{attrs:{small:"",color:e.statusColor,disabled:!e.item.exists}},[e._v(" "+e._s(e.statusIcon)+" ")])],1)]}}])},[t("span",[e._v(e._s(e.statusName))])])],2),e._l(e.tableFields,function(r){return t("td",{key:r.value,staticClass:"text-no-wrap",domProps:{innerHTML:e._s(e.outputValue(r,e.item))}})}),t(ye,{attrs:{"position-x":e.contextMenuX,"position-y":e.contextMenuY,absolute:"","offset-y":""},model:{value:e.contextMenuBool,callback:function(r){e.contextMenuBool=r},expression:"contextMenuBool"}},[t(Me,[t(J,{on:{click:function(r){e.detailsDialogBool=!0}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiTextBoxSearch))]),e._v(" "+e._s(e.$t("History.Details"))+" ")],1),e.item.note?t(J,{on:{click:e.editNote}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiNoteEditOutline))]),e._v(" "+e._s(e.$t("History.EditNote"))+" ")],1):t(J,{on:{click:e.createNote}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiNotePlusOutline))]),e._v(" "+e._s(e.$t("History.AddNote"))+" ")],1),e.item.exists?t(J,{attrs:{disabled:e.printerIsPrinting||!e.klipperReadyForGui},on:{click:e.startPrint}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPrinter))]),e._v(" "+e._s(e.$t("History.Reprint"))+" ")],1):e._e(),e.item.exists&&e.isJobQueueAvailable?t(J,{on:{click:e.addToQueue}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddToQueue"))+" ")],1):e._e(),e.item.exists&&e.isJobQueueAvailable?t(J,{on:{click:function(r){e.addBatchToQueueDialogBool=!0}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiPlaylistPlus))]),e._v(" "+e._s(e.$t("Files.AddBatchToQueue"))+" ")],1):e._e(),t(J,{staticClass:"red--text",on:{click:e.deleteJob}},[t(_,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("History.Delete"))+" ")],1)],1)],1),t(zf,{attrs:{show:e.detailsDialogBool,job:e.item},on:{"close-dialog":function(r){e.detailsDialogBool=!1}}}),t(py,{attrs:{show:e.noteDialogBool,type:e.noteDialogType,job:e.item},on:{"close-dialog":function(r){e.noteDialogBool=!1}}}),t(ri,{attrs:{"is-visible":e.addBatchToQueueDialogBool,"show-toast":!0,filename:e.item.filename},on:{close:function(r){e.addBatchToQueueDialogBool=!1}}})],2)},Aj=[],Fj=E(Gi,Lj,Aj,!1,null,null);const fy=Fj.exports;var Rj=Object.getOwnPropertyDescriptor,Hj=(s,e,t,r)=>{for(var i=r>1?void 0:r?Rj(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Jr=class extends y{get hidePrintStatus(){var s;return(s=this.$store.state.gui.view.history.hidePrintStatus)!=null?s:[]}get allJobs(){var s;return(s=this.$store.state.server.history.jobs)!=null?s:[]}get jobs(){return this.allJobs.filter(s=>!this.hidePrintStatus.includes(s.status))}get selectedJobs(){var e;return((e=this.$store.state.gui.view.history.selectedJobs)!=null?e:[]).filter(t=>t.type==="job")}get moonrakerHistoryFields(){var r,i;const s=(i=(r=this.$store.state.server.config)==null?void 0:r.config)!=null?i:{},e=Object.keys(s).filter(n=>n.startsWith("sensor ")),t=[];return e.forEach(n=>{var o;const a=(o=s[n])!=null?o:{};Object.keys(a).filter(l=>l.startsWith("history_field_")).forEach(l=>{const u=a[l];t.push({desc:u.desc,unit:u.units,provider:n,parameter:u.parameter,name:l})})}),t}};Jr=Hj([S],Jr);const jj=(s,e,t)=>{const r=s[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((i,n)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(n.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==t?". Note that variables only represent file names one level deep.":""))))})};/*! + * vue-i18n v8.28.2 + * (c) 2022 kazuya kawaguchi + * Released under the MIT License. + */var gy=["compactDisplay","currency","currencyDisplay","currencySign","localeMatcher","notation","numberingSystem","signDisplay","style","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"],Ij=["dateStyle","timeStyle","calendar","localeMatcher","hour12","hourCycle","timeZone","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function Zi(s,e){typeof console<"u"&&console.warn("[vue-i18n] "+s)}function Nj(s,e){typeof console<"u"&&console.error("[vue-i18n] "+s)}var Ds=Array.isArray;function ts(s){return s!==null&&typeof s=="object"}function Vj(s){return typeof s=="boolean"}function lt(s){return typeof s=="string"}var Bj=Object.prototype.toString,Uj="[object Object]";function ws(s){return Bj.call(s)===Uj}function Et(s){return s==null}function Ah(s){return typeof s=="function"}function Qu(){for(var s=[],e=arguments.length;e--;)s[e]=arguments[e];var t=null,r=null;return s.length===1?ts(s[0])||Ds(s[0])?r=s[0]:typeof s[0]=="string"&&(t=s[0]):s.length===2&&(typeof s[0]=="string"&&(t=s[0]),(ts(s[1])||Ds(s[1]))&&(r=s[1])),{locale:t,params:r}}function pn(s){return JSON.parse(JSON.stringify(s))}function Wj(s,e){if(s.delete(e))return s}function zj(s){var e=[];return s.forEach(function(t){return e.push(t)}),e}function co(s,e){return!!~s.indexOf(e)}var Gj=Object.prototype.hasOwnProperty;function Zj(s,e){return Gj.call(s,e)}function Fr(s){for(var e=arguments,t=Object(s),r=1;r/g,">").replace(/"/g,""").replace(/'/g,"'")}function Xj(s){return s!=null&&Object.keys(s).forEach(function(e){typeof s[e]=="string"&&(s[e]=qj(s[e]))}),s}function Yj(s){s.prototype.hasOwnProperty("$i18n")||Object.defineProperty(s.prototype,"$i18n",{get:function(){return this._i18n}}),s.prototype.$t=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var i=this.$i18n;return i._t.apply(i,[e,i.locale,i._getMessages(),this].concat(t))},s.prototype.$tc=function(e,t){for(var r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];var n=this.$i18n;return n._tc.apply(n,[e,n.locale,n._getMessages(),this,t].concat(r))},s.prototype.$te=function(e,t){var r=this.$i18n;return r._te(e,r.locale,r._getMessages(),t)},s.prototype.$d=function(e){for(var t,r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];return(t=this.$i18n).d.apply(t,[e].concat(r))},s.prototype.$n=function(e){for(var t,r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];return(t=this.$i18n).n.apply(t,[e].concat(r))}}function Jj(s){s===void 0&&(s=!1);function e(){this!==this.$root&&this.$options.__INTLIFY_META__&&this.$el&&this.$el.setAttribute("data-intlify",this.$options.__INTLIFY_META__)}return s?{mounted:e}:{beforeCreate:function(){var r=this.$options;if(r.i18n=r.i18n||(r.__i18nBridge||r.__i18n?{}:null),r.i18n){if(r.i18n instanceof ce){if(r.__i18nBridge||r.__i18n)try{var i=r.i18n&&r.i18n.messages?r.i18n.messages:{},n=r.__i18nBridge||r.__i18n;n.forEach(function(d){i=Fr(i,JSON.parse(d))}),Object.keys(i).forEach(function(d){r.i18n.mergeLocaleMessage(d,i[d])})}catch{}this._i18n=r.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(ws(r.i18n)){var a=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof ce?this.$root.$i18n:null;if(a&&(r.i18n.root=this.$root,r.i18n.formatter=a.formatter,r.i18n.fallbackLocale=a.fallbackLocale,r.i18n.formatFallbackMessages=a.formatFallbackMessages,r.i18n.silentTranslationWarn=a.silentTranslationWarn,r.i18n.silentFallbackWarn=a.silentFallbackWarn,r.i18n.pluralizationRules=a.pluralizationRules,r.i18n.preserveDirectiveContent=a.preserveDirectiveContent),r.__i18nBridge||r.__i18n)try{var o=r.i18n&&r.i18n.messages?r.i18n.messages:{},l=r.__i18nBridge||r.__i18n;l.forEach(function(d){o=Fr(o,JSON.parse(d))}),r.i18n.messages=o}catch{}var u=r.i18n,c=u.sharedMessages;c&&ws(c)&&(r.i18n.messages=Fr(r.i18n.messages,c)),this._i18n=new ce(r.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(r.i18n.sync===void 0||r.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),a&&a.onComponentInstanceCreated(this._i18n)}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof ce?this._i18n=this.$root.$i18n:r.parent&&r.parent.$i18n&&r.parent.$i18n instanceof ce&&(this._i18n=r.parent.$i18n)},beforeMount:function(){var r=this.$options;r.i18n=r.i18n||(r.__i18nBridge||r.__i18n?{}:null),r.i18n?r.i18n instanceof ce?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):ws(r.i18n)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof ce?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):r.parent&&r.parent.$i18n&&r.parent.$i18n instanceof ce&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},mounted:e,beforeDestroy:function(){if(this._i18n){var r=this;this.$nextTick(function(){r._subscribing&&(r._i18n.unsubscribeDataChanging(r),delete r._subscribing),r._i18nWatcher&&(r._i18nWatcher(),r._i18n.destroyVM(),delete r._i18nWatcher),r._localeWatcher&&(r._localeWatcher(),delete r._localeWatcher)})}}}}var d1={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(e,t){var r=t.data,i=t.parent,n=t.props,a=t.slots,o=i.$i18n;if(o){var l=n.path,u=n.locale,c=n.places,d=a(),m=o.i(l,u,Kj(d)||c?Qj(d.default,c):d),h=n.tag&&n.tag!==!0||n.tag===!1?n.tag:"span";return h?e(h,r,m):m}}};function Kj(s){var e;for(e in s)if(e!=="default")return!1;return!!e}function Qj(s,e){var t=e?eI(e):{};if(!s)return t;s=s.filter(function(i){return i.tag||i.text.trim()!==""});var r=s.every(sI);return s.reduce(r?tI:_y,t)}function eI(s){return Array.isArray(s)?s.reduce(_y,{}):Object.assign({},s)}function tI(s,e){return e.data&&e.data.attrs&&e.data.attrs.place&&(s[e.data.attrs.place]=e),s}function _y(s,e,t){return s[t]=e,s}function sI(s){return!!(s.data&&s.data.attrs&&s.data.attrs.place)}var m1={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render:function(e,t){var r=t.props,i=t.parent,n=t.data,a=i.$i18n;if(!a)return null;var o=null,l=null;lt(r.format)?o=r.format:ts(r.format)&&(r.format.key&&(o=r.format.key),l=Object.keys(r.format).reduce(function(h,f){var p;return co(gy,f)?Object.assign({},h,(p={},p[f]=r.format[f],p)):h},null));var u=r.locale||a.locale,c=a._ntp(r.value,u,o,l),d=c.map(function(h,f){var p,v=n.scopedSlots&&n.scopedSlots[h.type];return v?v((p={},p[h.type]=h.value,p.index=f,p.parts=c,p)):h.value}),m=r.tag&&r.tag!==!0||r.tag===!1?r.tag:"span";return m?e(m,{attrs:n.attrs,class:n.class,staticClass:n.staticClass},d):d}};function rI(s,e,t){vy(s,t)&&by(s,e,t)}function iI(s,e,t,r){if(vy(s,t)){var i=t.context.$i18n;aI(s,t)&&bc(e.value,e.oldValue)&&bc(s._localeMessage,i.getLocaleMessage(i.locale))||by(s,e,t)}}function nI(s,e,t,r){var i=t.context;if(!i){Zi("Vue instance does not exists in VNode context");return}var n=t.context.$i18n||{};!e.modifiers.preserve&&!n.preserveDirectiveContent&&(s.textContent=""),s._vt=void 0,delete s._vt,s._locale=void 0,delete s._locale,s._localeMessage=void 0,delete s._localeMessage}function vy(s,e){var t=e.context;return t?t.$i18n?!0:(Zi("VueI18n instance does not exists in Vue instance"),!1):(Zi("Vue instance does not exists in VNode context"),!1)}function aI(s,e){var t=e.context;return s._locale===t.$i18n.locale}function by(s,e,t){var r,i,n=e.value,a=oI(n),o=a.path,l=a.locale,u=a.args,c=a.choice;if(!o&&!l&&!u){Zi("value type not supported");return}if(!o){Zi("`path` is required in v-t directive");return}var d=t.context;c!=null?s._vt=s.textContent=(r=d.$i18n).tc.apply(r,[o,c].concat(h1(l,u))):s._vt=s.textContent=(i=d.$i18n).t.apply(i,[o].concat(h1(l,u))),s._locale=d.$i18n.locale,s._localeMessage=d.$i18n.getLocaleMessage(d.$i18n.locale)}function oI(s){var e,t,r,i;return lt(s)?e=s:ws(s)&&(e=s.path,t=s.locale,r=s.args,i=s.choice),{path:e,locale:t,args:r,choice:i}}function h1(s,e){var t=[];return s&&t.push(s),e&&(Array.isArray(e)||ws(e))&&t.push(e),t}var Ct;function Gf(s,e){e===void 0&&(e={bridge:!1}),Gf.installed=!0,Ct=s,Ct.version&&Number(Ct.version.split(".")[0]),Yj(Ct),Ct.mixin(Jj(e.bridge)),Ct.directive("t",{bind:rI,update:iI,unbind:nI}),Ct.component(d1.name,d1),Ct.component(m1.name,m1);var t=Ct.config.optionMergeStrategies;t.i18n=function(r,i){return i===void 0?r:i}}var yy=function(){this._caches=Object.create(null)};yy.prototype.interpolate=function(e,t){if(!t)return[e];var r=this._caches[e];return r||(r=uI(e),this._caches[e]=r),dI(r,t)};var lI=/^(?:\d)+/,cI=/^(?:\w)+/;function uI(s){for(var e=[],t=0,r="";t0)i--,r=Fs,m[at]();else{if(i=0,a===void 0||(a=gI(a),a===!1))return!1;m[bi]()}};function h(){var f=s[t+1];if(r===$c&&f==="'"||r===xc&&f==='"')return t++,o="\\"+f,m[at](),!0}for(;r!==null;)if(t++,n=s[t],!(n==="\\"&&h())){if(l=fI(n),d=br[r],u=d[l]||d.else||Ta,u===Ta||(r=u[0],c=m[u[1]],c&&(o=u[2],o=o===void 0?n:o,c()===!1)))return;if(r===ed)return e}}var Zf=function(){this._cache=Object.create(null)};Zf.prototype.parsePath=function(e){var t=this._cache[e];return t||(t=_I(e),t&&(this._cache[e]=t)),t||[]};Zf.prototype.getPathValue=function(e,t){if(!ts(e))return null;var r=this.parsePath(t);if(r.length===0)return null;for(var i=r.length,n=e,a=0;a/,bI=/(?:@(?:\.[a-zA-Z]+)?:(?:[\w\-_|./]+|\([\w\-_:|./]+\)))/g,yI=/^@(?:\.([a-zA-Z]+))?:/,CI=/[()]/g,p1={upper:function(s){return s.toLocaleUpperCase()},lower:function(s){return s.toLocaleLowerCase()},capitalize:function(s){return""+s.charAt(0).toLocaleUpperCase()+s.substr(1)}},Rh=new yy,ce=function(e){var t=this;e===void 0&&(e={}),!Ct&&typeof window<"u"&&window.Vue&&Gf(window.Vue);var r=e.locale||"en-US",i=e.fallbackLocale===!1?!1:e.fallbackLocale||"en-US",n=e.messages||{},a=e.dateTimeFormats||e.datetimeFormats||{},o=e.numberFormats||{};this._vm=null,this._formatter=e.formatter||Rh,this._modifiers=e.modifiers||{},this._missing=e.missing||null,this._root=e.root||null,this._sync=e.sync===void 0?!0:!!e.sync,this._fallbackRoot=e.fallbackRoot===void 0?!0:!!e.fallbackRoot,this._fallbackRootWithEmptyString=e.fallbackRootWithEmptyString===void 0?!0:!!e.fallbackRootWithEmptyString,this._formatFallbackMessages=e.formatFallbackMessages===void 0?!1:!!e.formatFallbackMessages,this._silentTranslationWarn=e.silentTranslationWarn===void 0?!1:e.silentTranslationWarn,this._silentFallbackWarn=e.silentFallbackWarn===void 0?!1:!!e.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new Zf,this._dataListeners=new Set,this._componentInstanceCreatedListener=e.componentInstanceCreatedListener||null,this._preserveDirectiveContent=e.preserveDirectiveContent===void 0?!1:!!e.preserveDirectiveContent,this.pluralizationRules=e.pluralizationRules||{},this._warnHtmlInMessage=e.warnHtmlInMessage||"off",this._postTranslation=e.postTranslation||null,this._escapeParameterHtml=e.escapeParameterHtml||!1,"__VUE_I18N_BRIDGE__"in e&&(this.__VUE_I18N_BRIDGE__=e.__VUE_I18N_BRIDGE__),this.getChoiceIndex=function(l,u){var c=Object.getPrototypeOf(t);if(c&&c.getChoiceIndex){var d=c.getChoiceIndex;return d.call(t,l,u)}var m=function(h,f){return h=Math.abs(h),f===2?h?h>1?1:0:1:h?Math.min(h,2):0};return t.locale in t.pluralizationRules?t.pluralizationRules[t.locale].apply(t,[l,u]):m(l,u)},this._exist=function(l,u){return!l||!u?!1:!!(!Et(t._path.getPathValue(l,u))||l[u])},(this._warnHtmlInMessage==="warn"||this._warnHtmlInMessage==="error")&&Object.keys(n).forEach(function(l){t._checkLocaleMessage(l,t._warnHtmlInMessage,n[l])}),this._initVM({locale:r,fallbackLocale:i,messages:n,dateTimeFormats:a,numberFormats:o})},Ae={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0},sync:{configurable:!0}};ce.prototype._checkLocaleMessage=function(e,t,r){var i=[],n=function(a,o,l,u){if(ws(l))Object.keys(l).forEach(function(m){var h=l[m];ws(h)?(u.push(m),u.push("."),n(a,o,h,u),u.pop(),u.pop()):(u.push(m),n(a,o,h,u),u.pop())});else if(Ds(l))l.forEach(function(m,h){ws(m)?(u.push("["+h+"]"),u.push("."),n(a,o,m,u),u.pop(),u.pop()):(u.push("["+h+"]"),n(a,o,m,u),u.pop())});else if(lt(l)){var c=vI.test(l);if(c){var d="Detected HTML in message '"+l+"' of keypath '"+u.join("")+"' at '"+o+"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp";a==="warn"?Zi(d):a==="error"&&Nj(d)}}};n(t,e,r,i)};ce.prototype._initVM=function(e){var t=Ct.config.silent;Ct.config.silent=!0,this._vm=new Ct({data:e,__VUE18N__INSTANCE__:!0}),Ct.config.silent=t};ce.prototype.destroyVM=function(){this._vm.$destroy()};ce.prototype.subscribeDataChanging=function(e){this._dataListeners.add(e)};ce.prototype.unsubscribeDataChanging=function(e){Wj(this._dataListeners,e)};ce.prototype.watchI18nData=function(){var e=this;return this._vm.$watch("$data",function(){for(var t=zj(e._dataListeners),r=t.length;r--;)Ct.nextTick(function(){t[r]&&t[r].$forceUpdate()})},{deep:!0})};ce.prototype.watchLocale=function(e){if(e){if(!this.__VUE_I18N_BRIDGE__)return null;var r=this,i=this._vm;return this.vm.$watch("locale",function(n){i.$set(i,"locale",n),r.__VUE_I18N_BRIDGE__&&e&&(e.locale.value=n),i.$forceUpdate()},{immediate:!0})}else{if(!this._sync||!this._root)return null;var t=this._vm;return this._root.$i18n.vm.$watch("locale",function(n){t.$set(t,"locale",n),t.$forceUpdate()},{immediate:!0})}};ce.prototype.onComponentInstanceCreated=function(e){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(e,this)};Ae.vm.get=function(){return this._vm};Ae.messages.get=function(){return pn(this._getMessages())};Ae.dateTimeFormats.get=function(){return pn(this._getDateTimeFormats())};Ae.numberFormats.get=function(){return pn(this._getNumberFormats())};Ae.availableLocales.get=function(){return Object.keys(this.messages).sort()};Ae.locale.get=function(){return this._vm.locale};Ae.locale.set=function(s){this._vm.$set(this._vm,"locale",s)};Ae.fallbackLocale.get=function(){return this._vm.fallbackLocale};Ae.fallbackLocale.set=function(s){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",s)};Ae.formatFallbackMessages.get=function(){return this._formatFallbackMessages};Ae.formatFallbackMessages.set=function(s){this._formatFallbackMessages=s};Ae.missing.get=function(){return this._missing};Ae.missing.set=function(s){this._missing=s};Ae.formatter.get=function(){return this._formatter};Ae.formatter.set=function(s){this._formatter=s};Ae.silentTranslationWarn.get=function(){return this._silentTranslationWarn};Ae.silentTranslationWarn.set=function(s){this._silentTranslationWarn=s};Ae.silentFallbackWarn.get=function(){return this._silentFallbackWarn};Ae.silentFallbackWarn.set=function(s){this._silentFallbackWarn=s};Ae.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent};Ae.preserveDirectiveContent.set=function(s){this._preserveDirectiveContent=s};Ae.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage};Ae.warnHtmlInMessage.set=function(s){var e=this,t=this._warnHtmlInMessage;if(this._warnHtmlInMessage=s,t!==s&&(s==="warn"||s==="error")){var r=this._getMessages();Object.keys(r).forEach(function(i){e._checkLocaleMessage(i,e._warnHtmlInMessage,r[i])})}};Ae.postTranslation.get=function(){return this._postTranslation};Ae.postTranslation.set=function(s){this._postTranslation=s};Ae.sync.get=function(){return this._sync};Ae.sync.set=function(s){this._sync=s};ce.prototype._getMessages=function(){return this._vm.messages};ce.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats};ce.prototype._getNumberFormats=function(){return this._vm.numberFormats};ce.prototype._warnDefault=function(e,t,r,i,n,a){if(!Et(r))return r;if(this._missing){var o=this._missing.apply(null,[e,t,i,n]);if(lt(o))return o}if(this._formatFallbackMessages){var l=Qu.apply(void 0,n);return this._render(t,a,l.params,t)}else return t};ce.prototype._isFallbackRoot=function(e){return(this._fallbackRootWithEmptyString?!e:Et(e))&&!Et(this._root)&&this._fallbackRoot};ce.prototype._isSilentFallbackWarn=function(e){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(e):this._silentFallbackWarn};ce.prototype._isSilentFallback=function(e,t){return this._isSilentFallbackWarn(t)&&(this._isFallbackRoot()||e!==this.fallbackLocale)};ce.prototype._isSilentTranslationWarn=function(e){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(e):this._silentTranslationWarn};ce.prototype._interpolate=function(e,t,r,i,n,a,o){if(!t)return null;var l=this._path.getPathValue(t,r);if(Ds(l)||ws(l))return l;var u;if(Et(l))if(ws(t)){if(u=t[r],!(lt(u)||Ah(u)))return null}else return null;else if(lt(l)||Ah(l))u=l;else return null;return lt(u)&&(u.indexOf("@:")>=0||u.indexOf("@.")>=0)&&(u=this._link(e,t,u,i,"raw",a,o)),this._render(u,n,a,r)};ce.prototype._link=function(e,t,r,i,n,a,o){var l=r,u=l.match(bI);for(var c in u)if(u.hasOwnProperty(c)){var d=u[c],m=d.match(yI),h=m[0],f=m[1],p=d.replace(h,"").replace(CI,"");if(co(o,p))return l;o.push(p);var v=this._interpolate(e,t,p,i,n==="raw"?"string":n,n==="raw"?void 0:a,o);if(this._isFallbackRoot(v)){if(!this._root)throw Error("unexpected error");var C=this._root.$i18n;v=C._translate(C._getMessages(),C.locale,C.fallbackLocale,p,i,n,a)}v=this._warnDefault(e,p,v,i,Ds(a)?a:[a],n),this._modifiers.hasOwnProperty(f)?v=this._modifiers[f](v):p1.hasOwnProperty(f)&&(v=p1[f](v)),o.pop(),l=v?l.replace(d,v):l}return l};ce.prototype._createMessageContext=function(e,t,r,i){var n=this,a=Ds(e)?e:[],o=ts(e)?e:{},l=function(m){return a[m]},u=function(m){return o[m]},c=this._getMessages(),d=this.locale;return{list:l,named:u,values:e,formatter:t,path:r,messages:c,locale:d,linked:function(m){return n._interpolate(d,c[d]||{},m,null,i,void 0,[m])}}};ce.prototype._render=function(e,t,r,i){if(Ah(e))return e(this._createMessageContext(r,this._formatter||Rh,i,t));var n=this._formatter.interpolate(e,r,i);return n||(n=Rh.interpolate(e,r,i)),t==="string"&&!lt(n)?n.join(""):n};ce.prototype._appendItemToChain=function(e,t,r){var i=!1;return co(e,t)||(i=!0,t&&(i=t[t.length-1]!=="!",t=t.replace(/!/g,""),e.push(t),r&&r[t]&&(i=r[t]))),i};ce.prototype._appendLocaleToChain=function(e,t,r){var i,n=t.split("-");do{var a=n.join("-");i=this._appendItemToChain(e,a,r),n.splice(-1,1)}while(n.length&&i===!0);return i};ce.prototype._appendBlockToChain=function(e,t,r){for(var i=!0,n=0;n0;)a[o]=arguments[o+4];if(!e)return"";var l=Qu.apply(void 0,a);this._escapeParameterHtml&&(l.params=Xj(l.params));var u=l.locale||t,c=this._translate(r,u,this.fallbackLocale,e,i,"string",l.params);if(this._isFallbackRoot(c)){if(!this._root)throw Error("unexpected error");return(n=this._root).$t.apply(n,[e].concat(a))}else return c=this._warnDefault(u,e,c,i,a,"string"),this._postTranslation&&c!==null&&c!==void 0&&(c=this._postTranslation(c,e)),c};ce.prototype.t=function(e){for(var t,r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];return(t=this)._t.apply(t,[e,this.locale,this._getMessages(),null].concat(r))};ce.prototype._i=function(e,t,r,i,n){var a=this._translate(r,t,this.fallbackLocale,e,i,"raw",n);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(e,t,n)}else return this._warnDefault(t,e,a,i,[n],"raw")};ce.prototype.i=function(e,t,r){return e?(lt(t)||(t=this.locale),this._i(e,t,this._getMessages(),null,r)):""};ce.prototype._tc=function(e,t,r,i,n){for(var a,o=[],l=arguments.length-5;l-- >0;)o[l]=arguments[l+5];if(!e)return"";n===void 0&&(n=1);var u={count:n,n},c=Qu.apply(void 0,o);return c.params=Object.assign(u,c.params),o=c.locale===null?[c.params]:[c.locale,c.params],this.fetchChoice((a=this)._t.apply(a,[e,t,r,i].concat(o)),n)};ce.prototype.fetchChoice=function(e,t){if(!e||!lt(e))return null;var r=e.split("|");return t=this.getChoiceIndex(t,r.length),r[t]?r[t].trim():e};ce.prototype.tc=function(e,t){for(var r,i=[],n=arguments.length-2;n-- >0;)i[n]=arguments[n+2];return(r=this)._tc.apply(r,[e,this.locale,this._getMessages(),null,t].concat(i))};ce.prototype._te=function(e,t,r){for(var i=[],n=arguments.length-3;n-- >0;)i[n]=arguments[n+3];var a=Qu.apply(void 0,i).locale||t;return this._exist(r[a],e)};ce.prototype.te=function(e,t){return this._te(e,this.locale,this._getMessages(),t)};ce.prototype.getLocaleMessage=function(e){return pn(this._vm.messages[e]||{})};ce.prototype.setLocaleMessage=function(e,t){(this._warnHtmlInMessage==="warn"||this._warnHtmlInMessage==="error")&&this._checkLocaleMessage(e,this._warnHtmlInMessage,t),this._vm.$set(this._vm.messages,e,t)};ce.prototype.mergeLocaleMessage=function(e,t){(this._warnHtmlInMessage==="warn"||this._warnHtmlInMessage==="error")&&this._checkLocaleMessage(e,this._warnHtmlInMessage,t),this._vm.$set(this._vm.messages,e,Fr(typeof this._vm.messages[e]<"u"&&Object.keys(this._vm.messages[e]).length?Object.assign({},this._vm.messages[e]):{},t))};ce.prototype.getDateTimeFormat=function(e){return pn(this._vm.dateTimeFormats[e]||{})};ce.prototype.setDateTimeFormat=function(e,t){this._vm.$set(this._vm.dateTimeFormats,e,t),this._clearDateTimeFormat(e,t)};ce.prototype.mergeDateTimeFormat=function(e,t){this._vm.$set(this._vm.dateTimeFormats,e,Fr(this._vm.dateTimeFormats[e]||{},t)),this._clearDateTimeFormat(e,t)};ce.prototype._clearDateTimeFormat=function(e,t){for(var r in t){var i=e+"__"+r;this._dateTimeFormatters.hasOwnProperty(i)&&delete this._dateTimeFormatters[i]}};ce.prototype._localizeDateTime=function(e,t,r,i,n,a){for(var o=t,l=i[o],u=this._getLocaleChain(t,r),c=0;c0;)t[r]=arguments[r+1];var i=this.locale,n=null,a=null;return t.length===1?(lt(t[0])?n=t[0]:ts(t[0])&&(t[0].locale&&(i=t[0].locale),t[0].key&&(n=t[0].key)),a=Object.keys(t[0]).reduce(function(o,l){var u;return co(Ij,l)?Object.assign({},o,(u={},u[l]=t[0][l],u)):o},null)):t.length===2&&(lt(t[0])&&(n=t[0]),lt(t[1])&&(i=t[1])),this._d(e,i,n,a)};ce.prototype.getNumberFormat=function(e){return pn(this._vm.numberFormats[e]||{})};ce.prototype.setNumberFormat=function(e,t){this._vm.$set(this._vm.numberFormats,e,t),this._clearNumberFormat(e,t)};ce.prototype.mergeNumberFormat=function(e,t){this._vm.$set(this._vm.numberFormats,e,Fr(this._vm.numberFormats[e]||{},t)),this._clearNumberFormat(e,t)};ce.prototype._clearNumberFormat=function(e,t){for(var r in t){var i=e+"__"+r;this._numberFormatters.hasOwnProperty(i)&&delete this._numberFormatters[i]}};ce.prototype._getNumberFormatter=function(e,t,r,i,n,a){for(var o=t,l=i[o],u=this._getLocaleChain(t,r),c=0;c0;)t[r]=arguments[r+1];var i=this.locale,n=null,a=null;return t.length===1?lt(t[0])?n=t[0]:ts(t[0])&&(t[0].locale&&(i=t[0].locale),t[0].key&&(n=t[0].key),a=Object.keys(t[0]).reduce(function(o,l){var u;return co(gy,l)?Object.assign({},o,(u={},u[l]=t[0][l],u)):o},null)):t.length===2&&(lt(t[0])&&(n=t[0]),lt(t[1])&&(i=t[1])),this._n(e,i,n,a)};ce.prototype._ntp=function(e,t,r,i){if(!ce.availabilities.numberFormat)return[];if(!r){var n=i?new Intl.NumberFormat(t,i):new Intl.NumberFormat(t);return n.formatToParts(e)}var a=this._getNumberFormatter(e,t,this.fallbackLocale,this._getNumberFormats(),r,i),o=a&&a.formatToParts(e);if(this._isFallbackRoot(o)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(e,t,r,i)}else return o||[]};Object.defineProperties(ce.prototype,Ae);var qd;Object.defineProperty(ce,"availabilities",{get:function(){if(!qd){var e=typeof Intl<"u";qd={dateTimeFormat:e&&typeof Intl.DateTimeFormat<"u",numberFormat:e&&typeof Intl.NumberFormat<"u"}}return qd}});ce.install=Gf;ce.version="8.28.2";y.use(ce);const $I="en",ve=new ce({locale:$I,fallbackLocale:"en",messages:{},warnHtmlInMessage:"off"});async function xy(s){const e=await jj(Object.assign({"../locales/cz.json":()=>fe(()=>import("./cz-D8m9rjS3.js"),[]),"../locales/da.json":()=>fe(()=>import("./da-DYgaz82Z.js"),[]),"../locales/de.json":()=>fe(()=>import("./de-P4W13_SZ.js"),[]),"../locales/en.json":()=>fe(()=>import("./en-o7vnTKjO.js"),[]),"../locales/es.json":()=>fe(()=>import("./es-DJtSPj3U.js"),[]),"../locales/fr.json":()=>fe(()=>import("./fr-BgUf3CTX.js"),[]),"../locales/hu.json":()=>fe(()=>import("./hu-B1cvWa_J.js"),[]),"../locales/it.json":()=>fe(()=>import("./it-CPOq0Dki.js"),[]),"../locales/ja.json":()=>fe(()=>import("./ja-CS5xLYiw.js"),[]),"../locales/ko.json":()=>fe(()=>import("./ko-D481bVT5.js"),[]),"../locales/nl.json":()=>fe(()=>import("./nl-B9Xo5zsI.js"),[]),"../locales/pl.json":()=>fe(()=>import("./pl-bBR_77jy.js"),[]),"../locales/pt.json":()=>fe(()=>import("./pt-D716Rj3y.js"),[]),"../locales/ru.json":()=>fe(()=>import("./ru-BYzx4dUn.js"),[]),"../locales/se.json":()=>fe(()=>import("./se-Dt3G_241.js"),[]),"../locales/tr.json":()=>fe(()=>import("./tr-cyYpyxgv.js"),[]),"../locales/uk.json":()=>fe(()=>import("./uk-DIP7xo0c.js"),[]),"../locales/zh.json":()=>fe(()=>import("./zh-T9gotgQQ.js"),[]),"../locales/zh_TW.json":()=>fe(()=>import("./zh_TW-BFyG3P84.js"),[])}),"../locales/".concat(s,".json"),3);return ve.setLocaleMessage(s,e.default),ve.locale=s,e}var xI=Object.getOwnPropertyDescriptor,wI=(s,e,t,r)=>{for(var i=r>1?void 0:r?xI(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Oa=class extends k(Jr){getStatusColor(s){var t;const e={completed:"#BDBDBD",in_progress:"#EEEEEE",cancelled:"#616161",default:"#424242"};return(t=e[s])!=null?t:e.default}getLocalizedStatusName(s){return ve.te("History.StatusValues.".concat(s),"en")?ve.t("History.StatusValues.".concat(s)).toString():s}groupSmallEntries(s,e){const r=s.reduce((l,u)=>l+u.value,0)*e,i=s.filter(l=>l.valuel+u.value,0),a=s.filter(l=>l.value>=r),o=ve.t("History.StatusValues.Others").toString()+" (".concat(i.length,")");return a.push({name:o,displayName:o,value:n,valueFilament:0,valueTime:0,itemStyle:{opacity:.9,color:"#616161",borderColor:"#1E1E1E",borderWidth:2,borderRadius:3},showInTable:!0}),a}get allPrintStati(){let s=this.allJobs.map(e=>e.status);return s=s.filter((e,t)=>s.indexOf(e)===t),s}get printStatusArray(){return this.allPrintStati.map(s=>{const e=this.allJobs.filter(t=>t.status===s);return{name:s,displayName:this.getLocalizedStatusName(s),showInTable:!this.hidePrintStatus.includes(s),value:e.length,itemStyle:{opacity:.9,color:this.getStatusColor(s),borderColor:"#1E1E1E",borderWidth:2,borderRadius:3}}})}get printStatusArrayChart(){if(this.valueName==="filament"){const s=this.selectedJobs.length?this.selectedJobs:this.jobs;return this.printStatusArray.map(e=>{const t=s.reduce((r,i)=>i.status===e.name?r+i.filament_used:r,0);return{...e,value:t}}).filter(e=>e.value>0)}if(this.valueName==="time"){const s=this.selectedJobs.length?this.selectedJobs:this.jobs;return this.printStatusArray.map(e=>{const t=s.reduce((r,i)=>i.status===e.name?r+i.total_duration:r,0);return{...e,value:t}}).filter(e=>e.value>0)}return this.printStatusArray}get groupedPrintStatusArray(){return this.groupSmallEntries(this.printStatusArrayChart,.05)}};Oa=wI([S],Oa);var SI=Object.getOwnPropertyDescriptor,PI=(s,e,t,r)=>{for(var i=r>1?void 0:r?SI(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Hh=class extends k(L,Jr,Oa){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiCog=ss,this.mdiDatabaseArrowDownOutline=J_,this.mdiDatabaseExportOutline=Rw,this.mdiDelete=Ue,this.mdiFileDocumentMultipleOutline=Ga,this.mdiMagnify=rn,this.mdiNotebookPlus=fv,this.formatFilesize=Xe,this.search="",this.sortBy="start_time",this.sortDesc=!0,this.addMaintenanceDialog=!1,this.deleteSelectedDialog=!1}get allLoaded(){var s;return(s=this.$store.state.server.history.all_loaded)!=null?s:!1}get maintenanceEntries(){var s;return(s=this.$store.getters["gui/maintenance/getEntries"])!=null?s:[]}get entries(){let s=[];return this.showPrintJobs&&(s=[...this.jobs].map(e=>({...e,type:"job",select_id:"job_".concat(e.job_id)}))),this.sortBy!=="start_time"||this.showMaintenanceEntries&&(s=[...s,...this.maintenanceEntries.map(e=>({...e,type:"maintenance",select_id:"maintenance_".concat(e.id)}))]),s}get headers(){const s=[{text:"",value:"",align:"left",configable:!1,visible:!0,filterable:!1},{text:this.$t("History.Filename").toString(),value:"filename",align:"left",configable:!1,visible:!0},{text:"",value:"status",align:"left",configable:!1,visible:!0,filterable:!1},{text:this.$t("History.Filesize").toString(),value:"size",align:"left",configable:!0,visible:!0,outputType:"filesize"},{text:this.$t("History.LastModified").toString(),value:"modified",align:"left",configable:!0,visible:!0,outputType:"date"},{text:this.$t("History.StartTime").toString(),value:"start_time",align:"left",configable:!0,visible:!0,outputType:"date"},{text:this.$t("History.EndTime").toString(),value:"end_time",align:"left",configable:!0,visible:!0,outputType:"date"},{text:this.$t("History.EstimatedTime").toString(),value:"estimated_time",align:"left",configable:!0,visible:!0,outputType:"time"},{text:this.$t("History.PrintTime").toString(),value:"print_duration",align:"left",configable:!0,visible:!0,outputType:"time"},{text:this.$t("History.TotalTime").toString(),value:"total_duration",align:"left",configable:!0,visible:!0,outputType:"time"},{text:this.$t("History.FilamentCalc").toString(),value:"filament_total",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.FilamentUsed").toString(),value:"filament_used",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.FirstLayerExtTemp").toString(),value:"first_layer_extr_temp",align:"left",configable:!0,visible:!0,outputType:"temp"},{text:this.$t("History.FirstLayerBedTemp").toString(),value:"first_layer_bed_temp",align:"left",configable:!0,visible:!0,outputType:"temp"},{text:this.$t("History.FirstLayerHeight").toString(),value:"first_layer_height",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.LayerHeight").toString(),value:"layer_height",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.ObjectHeight").toString(),value:"object_height",align:"left",configable:!0,visible:!0,outputType:"length"},{text:this.$t("History.Slicer").toString(),value:"slicer",align:"left",configable:!0,visible:!0}];return this.moonrakerHistoryFields.forEach(e=>{s.push({text:e.desc,value:e.name,align:"left",configable:!0,visible:!1})}),s.forEach(e=>{e.visible&&this.hideColums.includes(e.value)?e.visible=!1:!e.visible&&!this.hideColums.includes(e.value)&&(e.visible=!0)}),s}get tableFields(){return this.filteredHeaders.filter(s=>!["filename","status"].includes(s.value)&&s.value!=="")}get configHeaders(){return this.headers.filter(s=>s.configable===!0)}get filteredHeaders(){return this.headers.filter(s=>s.visible===!0)}get allPrintStatusArray(){var s;return Ft((s=this.$store.getters["server/history/getAllPrintStatusArray"])!=null?s:[],"name")}get countPerPage(){var s;return(s=this.$store.state.gui.view.history.countPerPage)!=null?s:10}set countPerPage(s){this.$store.dispatch("gui/saveSetting",{name:"view.history.countPerPage",value:s})}get hideColums(){var s;return(s=this.$store.state.gui.view.history.hideColums)!=null?s:[]}set hideColums(s){this.$store.dispatch("gui/saveSetting",{name:"view.history.hideColums",value:s})}get showMaintenanceEntries(){return this.$store.state.gui.view.history.showMaintenanceEntries}set showMaintenanceEntries(s){this.$store.dispatch("gui/saveSetting",{name:"view.history.showMaintenanceEntries",value:s})}get showPrintJobs(){return this.$store.state.gui.view.history.showPrintJobs}set showPrintJobs(s){this.$store.dispatch("gui/saveSetting",{name:"view.history.showPrintJobs",value:s})}get selectedJobsTable(){var s;return(s=this.$store.state.gui.view.history.selectedJobs)!=null?s:[]}set selectedJobsTable(s){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.history.selectedJobs",value:s})}refreshHistory(){this.$store.dispatch("socket/addLoading",{name:"historyLoadAll"}),this.$socket.emit("server.history.list",{start:0,limit:50},{action:"server/history/getHistory"})}sortFiles(s,e,t){const r=e.length?e[0]:"filename",i=t[0];return s!==void 0&&(s.sort(function(n,a){if(n[r]===a[r])return 0;if(n[r]===null||n[r]===void 0)return-1;if(a[r]===null||a[r]===void 0)return 1;if(n[r].constructor===String&&a[r].constructor===String)return n[r].localeCompare(a[r],void 0,{sensivity:"base"});if(n[r]instanceof Array&&a[r]instanceof Array){const o=n[r].length?n.filament.reduce((u,c)=>u+c):0,l=a[r].length?a.filament.reduce((u,c)=>u+c):0;return o-l}return n[r]-a[r]}),i&&s.reverse()),s}advancedSearch(s,e){return s!=null&&e!=null&&s.toString().toLowerCase().indexOf(e.toLowerCase())!==-1}changeColumnVisible(s){if(this.headers.filter(e=>e.value===s).length){let e=this.headers.filter(t=>t.value===s)[0].visible;this.$store.dispatch("gui/setHistoryColumns",{name:s,value:e})}}changeStatusVisible(s){this.$store.dispatch("gui/toggleStatusInHistoryList",s.name)}exportHistory(){const t=(parseFloat("1.23").toLocaleString(this.browserLocale).indexOf(",")>=0?",":".")===","?";":",",r=[],i=[];i.push("filename"),i.push("type"),i.push("status"),this.tableFields.forEach(l=>{if(l.value.startsWith("history_field_")){const u=l.value.replace("history_field_","");i.push(u);return}i.push(l.value)}),r.push(i);let n=[...this.entries];this.selectedJobs.length&&(n=[...this.selectedJobs]),n.length&&n.sort((l,u)=>u.start_time-l.start_time).forEach(l=>{var h,f;const u=[];if(((h=l.type)!=null?h:"job")==="maintenance"){const p=l;u.push(p.name),u.push("maintenance"),u.push(p.end_time!==null?"performed":"open"),this.tableFields.filter(v=>v.value!=="slicer").forEach(v=>{if(v.value==="start_time"){u.push(this.formatDateTime(p.start_time*1e3));return}if(v.value==="end_time"&&p.end_time!==null){u.push(this.formatDateTime(p.end_time*1e3));return}if(v.value==="print_duration"&&p.end_printtime!==null){const C=p.end_printtime-p.start_printtime;u.push(C.toLocaleString(this.browserLocale,{useGrouping:!1}));return}if(v.value==="filament_used"&&p.end_filament!==null){const C=p.end_filament-p.start_filament;u.push(C.toLocaleString(this.browserLocale,{useGrouping:!1}));return}u.push("")}),(f=this.tableFields.find(v=>v.value==="slicer"))!=null&&f.visible&&u.push(""),r.push(u);return}const d=l;let m=d.filename;m.includes(t)&&(m='"'+m+'"'),u.push(m),u.push("job"),u.push(d.status),this.tableFields.forEach(p=>{u.push(this.outputValue(p,d,t))}),r.push(u)});const a="data:text/csv;charset=utf-8,"+r.map(l=>l.map(u=>(u==null?void 0:u.indexOf(t))===-1?u:'"'.concat(u,'"')).join(t)).join("\n"),o=document.createElement("a");o.setAttribute("href",encodeURI(a)),o.setAttribute("download","print_history.csv"),document.body.appendChild(o),o.click(),o.remove()}outputValue(s,e,t=null){var i,n,a,o,l,u;let r=s.value in e?e[s.value]:null;if(r===null&&(r=s.value in e.metadata?e.metadata[s.value]:null),s.value==="slicer"){let c="slicer"in e.metadata&&e.metadata.slicer?e.metadata.slicer:"--";return"slicer_version"in e.metadata&&e.metadata.slicer_version&&(c+=" "+e.metadata.slicer_version),t!==null&&r.includes(t)?'"'+c+'"':c}if(s.value.startsWith("history_field_")){const c=s.value.replace("history_field_",""),d=(i=e.auxiliary_data)==null?void 0:i.find(h=>h.name===c);let m=(n=d==null?void 0:d.value)==null?void 0:n.toString();return d&&!Array.isArray(d.value)&&(m=(o=(a=d.value)==null?void 0:a.toLocaleString(this.browserLocale,{useGrouping:!1}))!=null?o:0),m?t!==null&&(m!=null&&m.includes(t))?'"'.concat(m,'"'):m:"--"}switch(s.outputType){case"date":return this.formatDateTime(r*1e3);case"time":return(l=r==null?void 0:r.toFixed())!=null?l:"";default:switch(typeof r){case"number":return(u=r==null?void 0:r.toLocaleString(this.browserLocale,{useGrouping:!1}))!=null?u:0;case"string":return t!==null&&r.includes(t)&&(r='"'+r+'"'),r;default:return r}}}};Hh=PI([S({components:{HistoryListPanelDeleteSelectedDialog:dy,HistoryListEntryMaintenance:hy,HistoryListPanelAddMaintenance:cy,HistoryListEntryJob:fy,HistoryListPanelDetailsDialog:zf,Panel:U}})],Hh);var DI=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(U,{attrs:{icon:e.mdiFileDocumentMultipleOutline,title:e.$t("History.PrintHistory"),"card-class":"history-list-panel"}},[t(Z,[t(x,[t(b,{staticClass:"col-4 d-flex align-center"},[t(se,{attrs:{"append-icon":e.mdiMagnify,label:e.$t("History.Search"),"single-line":"",outlined:"",clearable:"","hide-details":"",dense:""},model:{value:e.search,callback:function(r){e.search=r},expression:"search"}})],1),t(b,{staticClass:"offset-4 col-4 d-flex align-center justify-end"},[e.selectedJobs.length?t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"px-2 minwidth-0 ml-3",attrs:{color:"error"},on:{click:function(n){e.deleteSelectedDialog=!0}}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiDelete))])],1)]}}],null,!1,3710056784)},[t("span",[e._v(e._s(e.$t("History.Delete")))])]):e._e(),t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"px-2 minwidth-0 ml-3",on:{click:function(n){e.addMaintenanceDialog=!0}}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiNotebookPlus))])],1)]}}])},[t("span",[e._v(e._s(e.$t("History.AddMaintenance")))])]),e.allLoaded?e._e():t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"px-2 minwidth-0 ml-3",attrs:{loading:e.loadings.includes("historyLoadAll")},on:{click:e.refreshHistory}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiDatabaseArrowDownOutline))])],1)]}}],null,!1,788240949)},[t("span",[e._v(e._s(e.$t("History.LoadCompleteHistory")))])]),t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"px-2 minwidth-0 ml-3",on:{click:e.exportHistory}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiDatabaseExportOutline))])],1)]}}])},[t("span",[e._v(e._s(e.$t("History.TitleExportHistory")))])]),t(ye,{attrs:{"offset-y":!0,"close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:n}){return[t(g,e._g(e._b({staticClass:"px-2 minwidth-0 ml-3"},"v-btn",i,!1),{...r,...n}),[t(_,[e._v(e._s(e.mdiCog))])],1)]}}],null,!0)},[t("span",[e._v(e._s(e.$t("History.Settings")))])])]}}])},[t(Me,[t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"","input-value":e.showMaintenanceEntries,label:e.$t("History.MaintenanceEntries")},on:{change:function(r){e.showMaintenanceEntries=!e.showMaintenanceEntries}}})],1),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"","input-value":e.showPrintJobs,label:e.$t("History.PrintJobs")},on:{change:function(r){e.showPrintJobs=!e.showPrintJobs}}})],1),t(I),e.printStatusArray.length?[e._l(e.printStatusArray,function(r){return t(J,{key:r.name,staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"","input-value":r.showInTable,label:"".concat(r.displayName," (").concat(r.value,")")},on:{change:function(i){return e.changeStatusVisible(r)}}})],1)}),t(I)]:e._e(),e._l(e.configHeaders,function(r,i){return t(J,{key:"history-list-panel-header-option-"+i,staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:r.text},on:{change:function(n){return e.changeColumnVisible(r.value)}},model:{value:r.visible,callback:function(n){e.$set(r,"visible",n)},expression:"header.visible"}})],1)})],2)],1)],1)],1)],1),t(I,{staticClass:"mb-3"}),t(Qr,{staticClass:"history-jobs-table",attrs:{items:e.entries,headers:e.filteredHeaders,"custom-sort":e.sortFiles,"sort-by":e.sortBy,"sort-desc":e.sortDesc,"items-per-page":e.countPerPage,"footer-props":{itemsPerPageText:e.$t("History.Jobs"),itemsPerPageAllText:e.$t("History.AllJobs"),itemsPerPageOptions:[10,25,50,100,-1]},"item-key":"select_id",search:e.search,"custom-filter":e.advancedSearch,"mobile-breakpoint":"0","show-select":""},on:{"update:sortBy":function(r){e.sortBy=r},"update:sort-by":function(r){e.sortBy=r},"update:sortDesc":function(r){e.sortDesc=r},"update:sort-desc":function(r){e.sortDesc=r},"update:itemsPerPage":function(r){e.countPerPage=r},"update:items-per-page":function(r){e.countPerPage=r}},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("History.Empty")))])]},proxy:!0},{key:"item",fn:function({item:r,isSelected:i,select:n}){return[r.type==="job"?t(fy,{key:r.select_id,attrs:{"is-selected":i,item:r,"table-fields":e.tableFields},on:{select:n}}):r.type==="maintenance"?t(hy,{key:r.select_id,attrs:{"is-selected":i,item:r,"table-fields":e.tableFields},on:{select:n}}):e._e()]}}]),model:{value:e.selectedJobsTable,callback:function(r){e.selectedJobsTable=r},expression:"selectedJobsTable"}}),t(dy,{attrs:{show:e.deleteSelectedDialog},on:{close:function(r){e.deleteSelectedDialog=!1}}}),t(cy,{attrs:{show:e.addMaintenanceDialog},on:{close:function(r){e.addMaintenanceDialog=!1}}})],1)},TI=[],OI=E(Hh,DI,TI,!1,null,"00a01d41");const wy=OI.exports;var MI=Object.defineProperty,kI=Object.getOwnPropertyDescriptor,Sy=(s,e,t,r)=>{for(var i=r>1?void 0:r?kI(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&MI(e,t,i),i};let wc=class extends k(L,Jr,vt){get chartOptions(){return{animation:!1,grid:{top:25,right:40,bottom:30,left:40},tooltip:{trigger:"item",borderWidth:0},xAxis:{type:"category",data:["0-2h","2-6h","6-12h","12-24h",">24h"],splitLine:{show:!0,lineStyle:{color:this.fgColorFaint}},axisLabel:{color:this.fgColorLow,margin:10}},yAxis:{name:this.$t("History.HistoryPrinttimeAVG"),type:"value",minInterval:10,maxInterval:100,nameLocation:"end",nameGap:5,nameTextStyle:{color:this.fgColorLow,align:"left"},splitLine:{lineStyle:{color:this.fgColorLow}},axisLabel:{color:this.fgColorLow,formatter:"{value}",showMinLabel:!0,margin:5},axisLine:{show:!0,lineStyle:{color:this.fgColorLow}}},series:[{type:"bar",data:this.printtimeAvgArray,itemStyle:{color:"#BDBDBD"}}]}}get printtimeAvgArray(){const e=[0,0,0,0,0],t=new Date(new Date().getTime()-60*60*24*14*1e3);let r=[...this.allJobs.filter(i=>new Date(i.start_time*1e3)>=t&&i.status==="completed")];if(this.selectedJobs.length&&(r=[...this.selectedJobs.filter(i=>new Date(i.start_time*1e3)>=t&&i.status==="completed")]),r.length){const i=n=>n/3600;r.forEach(n=>{const a=i(n.print_duration);a>0&&a<=2?e[0]++:a<=6?e[1]++:a<=12?e[2]++:a<=24?e[3]++:e[4]++})}return e}get chart(){var e,t;return(t=(e=this.$refs.historyPrinttimeAvg)==null?void 0:e.chart)!=null?t:null}beforeDestroy(){typeof window>"u"||this.chart&&this.chart.dispose()}printtimeAvgArrayChanged(e){var t;(t=this.chart)==null||t.setOption({series:{data:e}},!1,!0)}visibilityChanged(e){var t;e&&((t=this.chart)==null||t.resize())}};Sy([he("printtimeAvgArray")],wc.prototype,"printtimeAvgArrayChanged",1);wc=Sy([S({components:{}})],wc);var EI=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("e-chart",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.visibilityChanged,expression:"visibilityChanged"}],ref:"historyPrinttimeAvg",staticStyle:{height:"175px",width:"100%"},attrs:{option:e.chartOptions,"init-options":{renderer:"svg"}}})},LI=[],AI=E(wc,EI,LI,!1,null,null);const Py=AI.exports;var FI=Object.defineProperty,RI=Object.getOwnPropertyDescriptor,Dy=(s,e,t,r)=>{for(var i=r>1?void 0:r?RI(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&FI(e,t,i),i};let Sc=class extends k(L,Jr,vt){get chartOptions(){return{animation:!1,grid:{top:25,right:40,bottom:30,left:40},tooltip:{trigger:"axis",borderWidth:0,formatter:s=>{let e="";if(s.length){e=s[0].marker;const r=s[0].axisValueLabel.split(/[^0-9]/),i=new Date(r[0],r[1]-1,r[2]),n=Math.round(s[0].data[1]*10)/10;e+=i.toLocaleDateString()+": "+n+"m"}return e}},xAxis:{type:"time",min:new Date().setHours(0,0,0)-60*60*24*14*1e3,max:new Date().setHours(0,0,0),minInterval:60*60*24*1e3,splitLine:{show:!0,lineStyle:{color:this.fgColorLow}},axisLabel:{color:this.fgColorLow,margin:10}},yAxis:{name:this.$t("History.HistoryFilamentUsage"),type:"value",minInterval:10,maxInterval:100,nameLocation:"end",nameGap:5,nameTextStyle:{color:this.fgColorLow,align:"left"},splitLine:{lineStyle:{color:this.fgColorLow}},axisLabel:{color:this.fgColorLow,formatter:"{value}",showMinLabel:!0,margin:5},axisLine:{show:!0,lineStyle:{color:this.fgColorMid}}},color:["#BDBDBD"],series:[{type:"bar",data:this.filamentUsageArray,showSymbol:!1}]}}get filamentUsageArray(){const s=[],e=new Date;e.setDate(e.getDate()-14),e.setHours(0,0,0,0);let t=[...this.allJobs.filter(r=>new Date(r.start_time*1e3)>=e&&r.filament_used>0)];this.selectedJobs.length&&(t=[...this.selectedJobs.filter(r=>new Date(r.start_time*1e3)>=e&&r.filament_used>0)]);for(let r=0;r<=14;r++){const i=new Date(e.getTime());i.setDate(i.getDate()+r),i.setHours(0,0,0,0),s.push([i.getTime(),0])}return t.length&&t.forEach(r=>{const i=new Date(r.start_time*1e3).setHours(0,0,0,0),n=s.findIndex(a=>a[0]===i);n!==-1&&(s[n][1]+=Math.round(r.filament_used)/1e3)}),s.sort((r,i)=>i[0]-r[0])}get chart(){var s,e;return(e=(s=this.$refs.historyFilamentUsage)==null?void 0:s.chart)!=null?e:null}beforeDestroy(){typeof window>"u"||this.chart&&this.chart.dispose()}filamentUsageArrayChanged(s){var e;(e=this.chart)==null||e.setOption({series:{data:s}},!1,!0)}visibilityChanged(s){var e;s&&((e=this.chart)==null||e.resize())}};Dy([he("filamentUsageArray")],Sc.prototype,"filamentUsageArrayChanged",1);Sc=Dy([S({})],Sc);var HI=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("e-chart",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.visibilityChanged,expression:"visibilityChanged"}],ref:"historyFilamentUsage",staticStyle:{height:"175px",width:"100%"},attrs:{option:e.chartOptions,autoresize:!0,"init-options":{renderer:"svg"}}})},jI=[],II=E(Sc,HI,jI,!1,null,null);const Ty=II.exports;var NI=Object.defineProperty,VI=Object.getOwnPropertyDescriptor,qf=(s,e,t,r)=>{for(var i=r>1?void 0:r?VI(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&NI(e,t,i),i};let Ma=class extends k(L){get value(){return this.valueName==="filament"?this.item.value>1e3?Math.round(this.item.value/1e3).toFixed(2)+" m":this.item.value.toFixed(0)+" mm":this.valueName==="time"?Is(this.item.value,!1):this.item.value.toString()}};qf([w({type:Object})],Ma.prototype,"item",2);qf([w({type:String,default:"amount"})],Ma.prototype,"valueName",2);Ma=qf([S({components:{}})],Ma);var BI=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("tr",[t("td",[e._v(e._s(e.item.displayName))]),t("td",{staticClass:"text-right"},[e._v(e._s(e.value))])])},UI=[],WI=E(Ma,BI,UI,!1,null,null);const Oy=WI.exports;var zI=Object.defineProperty,GI=Object.getOwnPropertyDescriptor,My=(s,e,t,r)=>{for(var i=r>1?void 0:r?GI(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&zI(e,t,i),i};let Pc=class extends k(L,Oa){};My([w({type:String,default:"amount"})],Pc.prototype,"valueName",2);Pc=My([S({components:{HistoryAllPrintStatusTableItem:Oy}})],Pc);var ZI=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Mp,[t("tbody",e._l(e.printStatusArrayChart,function(r){return t(Oy,{key:r.name,attrs:{item:r,"value-name":e.valueName}})}),1)])},qI=[],XI=E(Pc,ZI,qI,!1,null,null);const YI=XI.exports;var JI=Object.defineProperty,KI=Object.getOwnPropertyDescriptor,td=(s,e,t,r)=>{for(var i=r>1?void 0:r?KI(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&JI(e,t,i),i};let qi=class extends k(L,vt,Oa){get chartOptions(){return{animation:!1,grid:{top:10,right:0,bottom:0,left:10},tooltip:{trigger:"item",borderWidth:0,valueFormatter:s=>this.valueName==="filament"?s>1e3?Math.round(s/1e3).toString()+" m":s.toString()+" mm":this.valueName==="time"?Is(s,!1):s.toString()},series:[{type:"pie",data:this.groupedPrintStatusArray,avoidLabelOverlap:!1,minAngle:5,radius:["35%","60%"],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{color:this.fgColorHi}}]}}get chart(){var s,e;return(e=(s=this.historyAllPrintStatus)==null?void 0:s.chart)!=null?e:null}beforeDestroy(){typeof window>"u"||this.chart&&this.chart.dispose()}groupedPrintStatusArrayChanged(s){var e;(e=this.chart)==null||e.setOption({series:{data:s}},!1,!0)}visibilityChanged(s){var e;s&&((e=this.chart)==null||e.resize())}};td([w({type:String,default:"jobs"})],qi.prototype,"valueName",2);td([Ts("historyAllPrintStatus")],qi.prototype,"historyAllPrintStatus",2);td([he("groupedPrintStatusArray")],qi.prototype,"groupedPrintStatusArrayChanged",1);qi=td([S({components:{}})],qi);var QI=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("e-chart",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.visibilityChanged,expression:"visibilityChanged"}],ref:"historyAllPrintStatus",staticStyle:{height:"200px",width:"100%"},attrs:{option:e.chartOptions,autoresize:!0,"init-options":{renderer:"svg"}}})},eN=[],tN=E(qi,QI,eN,!1,null,null);const ky=tN.exports;var sN=Object.getOwnPropertyDescriptor,rN=(s,e,t,r)=>{for(var i=r>1?void 0:r?sN(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let jh=class extends k(L,Jr){constructor(){super(...arguments),this.mdiChartAreaspline=$w,this.mdiDatabaseArrowDownOutline=J_,this.formatPrintTime=Is,this.toggleValue="jobs"}get toggleValueOptions(){return[{text:this.$t("History.Jobs"),value:"jobs"},{text:this.$t("History.Filament"),value:"filament"},{text:this.$t("History.Time"),value:"time"}]}get existsSelectedJobs(){return this.selectedJobs.length>0}get totalPrintTime(){var s,e;return(e=(s=this.$store.state.server.history.job_totals)==null?void 0:s.total_print_time)!=null?e:0}get selectedPrintTime(){let s=0;return this.selectedJobs.forEach(e=>{s+=e.print_duration}),s}get longestPrintTime(){var s,e;return(e=(s=this.$store.state.server.history.job_totals)==null?void 0:s.longest_print)!=null?e:0}get selectedLongestPrintTime(){let s=0;return this.selectedJobs.forEach(e=>{e.print_duration>s&&(s=e.print_duration)}),s}get avgPrintTime(){return this.totalJobsCount>0&&this.totalPrintTime>0?Math.round(this.totalPrintTime/this.totalJobsCount):0}get selectedAvgPrintTime(){return this.selectedJobs.length>0&&this.selectedPrintTime>0?Math.round(this.selectedPrintTime/this.selectedJobs.length):0}get totalFilamentUsed(){var s,e;return(e=(s=this.$store.state.server.history.job_totals)==null?void 0:s.total_filament_used)!=null?e:0}get totalFilamentUsedFormat(){const s=Math.round(this.totalFilamentUsed/100)/10;return"".concat(s," m")}get selectedFilamentUsed(){let s=0;return this.selectedJobs.forEach(e=>{s+=e.filament_used}),s}get selectedFilamentUsedFormat(){const s=Math.round(this.selectedFilamentUsed/100)/10;return"".concat(s," m")}get totalJobsCount(){var s,e;return(e=(s=this.$store.state.server.history.job_totals)==null?void 0:s.total_jobs)!=null?e:0}get toggleChart(){return this.$store.state.gui.view.history.toggleChartCol3}set toggleChart(s){this.$store.dispatch("gui/saveSetting",{name:"view.history.toggleChartCol3",value:s})}get togglePrintStatus(){return this.$store.state.gui.view.history.toggleChartCol2}set togglePrintStatus(s){this.$store.dispatch("gui/saveSetting",{name:"view.history.toggleChartCol2",value:s})}get allLoaded(){var s;return(s=this.$store.state.server.history.all_loaded)!=null?s:!1}get selectedTotals(){const s=[{title:this.$t("History.SelectedPrinttime"),value:this.formatPrintTime(this.selectedPrintTime,!1)},{title:this.$t("History.LongestPrinttime"),value:this.formatPrintTime(this.selectedLongestPrintTime,!1)},{title:this.$t("History.AvgPrinttime"),value:this.formatPrintTime(this.selectedAvgPrintTime,!1)},{title:this.$t("History.SelectedFilamentUsed"),value:this.selectedFilamentUsedFormat},{title:this.$t("History.SelectedJobs"),value:this.selectedJobs.length.toString()}];return s.push(...this.auxiliarySelectedTotals),s}get auxiliarySelectedTotals(){const s=[];return this.moonrakerHistoryFields.forEach(e=>{const t=this.selectedJobs.reduce((r,i)=>{var o;const n=e.name.replace("history_field_",""),a=(o=i.auxiliary_data)==null?void 0:o.find(l=>l.provider===e.provider&&l.name===n);return!a||typeof a.value!="number"?r:r+a.value},0);s.push({title:e.desc,value:"".concat(Math.round(t*1e3)/1e3," ").concat(e.unit)})}),s}get genericTotals(){const s=[{title:this.$t("History.TotalPrinttime"),value:this.formatPrintTime(this.totalPrintTime,!1)},{title:this.$t("History.LongestPrinttime"),value:this.formatPrintTime(this.longestPrintTime,!1)},{title:this.$t("History.AvgPrinttime"),value:this.formatPrintTime(this.avgPrintTime,!1)},{title:this.$t("History.TotalFilamentUsed"),value:this.totalFilamentUsedFormat},{title:this.$t("History.TotalJobs"),value:this.totalJobsCount.toString()}];return s.push(...this.auxiliaryTotals),s}get auxiliaryTotals(){var t;const s=(t=this.$store.state.server.history.auxiliary_totals)!=null?t:[],e=[];return s.forEach(r=>{var o,l;const i="history_field_".concat(r.field),n=this.moonrakerHistoryFields.find(u=>u.provider===r.provider&&u.name===i),a=Math.round(((o=r.total)!=null?o:0)*1e3)/1e3;e.push({title:(l=n==null?void 0:n.desc)!=null?l:r.field,value:"".concat(a," ").concat(n==null?void 0:n.unit)})}),e}get totals(){return this.existsSelectedJobs?this.selectedTotals:this.genericTotals}refreshHistory(){this.$store.dispatch("socket/addLoading",{name:"historyLoadAll"}),this.$socket.emit("server.history.list",{start:0,limit:50},{action:"server/history/getHistory"})}};jh=rN([S({components:{Panel:U,HistoryFilamentUsage:Ty,HistoryPrinttimeAvg:Py,HistoryAllPrintStatusChart:ky}})],jh);var iN=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(U,{attrs:{icon:e.mdiChartAreaspline,title:e.$t("History.Statistics"),"card-class":"history-statistics-panel",collapsible:!0}},[t(Z,{staticClass:"pa-0"},[t(x,{attrs:{align:"center"}},[t(b,{staticClass:"col-12 col-sm-6 col-md-4"},[t(Mp,[t("tbody",e._l(e.totals,function(r){return t("tr",{key:r.title},[t("td",[e._v(e._s(r.title))]),t("td",{staticClass:"text-right"},[e._v(e._s(r.value))])])}),0)])],1),t(b,{staticClass:"col-12 col-sm-6 col-md-4"},[e.togglePrintStatus==="chart"?t(ky,{attrs:{"value-name":e.toggleValue}}):t(YI,{attrs:{"value-name":e.toggleValue}}),t("div",{staticClass:"text-center mb-3"},[t(Nn,{attrs:{small:"",mandatory:""},model:{value:e.togglePrintStatus,callback:function(r){e.togglePrintStatus=r},expression:"togglePrintStatus"}},[t(g,{attrs:{small:"",value:"chart"}},[e._v(e._s(e.$t("History.Chart")))]),t(g,{attrs:{small:"",value:"table"}},[e._v(e._s(e.$t("History.Table")))])],1),e.allLoaded?e._e():t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"ml-3 minwidth-0 px-2",attrs:{outlined:"",small:"",loading:e.loadings.includes("historyLoadAll"),color:"primary"},on:{click:e.refreshHistory}},"v-btn",i,!1),r),[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiDatabaseArrowDownOutline))])],1)]}}],null,!1,1343318810)},[t("span",[e._v(e._s(e.$t("History.LoadCompleteHistory")))])])],1),t("div",{staticClass:"text-center mb-3"},[t(Nn,{attrs:{small:"",mandatory:""},model:{value:e.toggleValue,callback:function(r){e.toggleValue=r},expression:"toggleValue"}},e._l(e.toggleValueOptions,function(r){return t(g,{key:r.value,attrs:{small:"",value:r.value}},[e._v(" "+e._s(r.text)+" ")])}),1)],1)],1),t(b,{staticClass:"col-12 col-sm-12 col-md-4"},[e.toggleChart==="filament_usage"?t(Ty):e.toggleChart==="printtime_avg"?t(Py):e._e(),t("div",{staticClass:"text-center mt-3"},[t(Nn,{attrs:{small:"",mandatory:""},model:{value:e.toggleChart,callback:function(r){e.toggleChart=r},expression:"toggleChart"}},[t(g,{attrs:{small:"",value:"filament_usage"}},[e._v(e._s(e.$t("History.FilamentUsage")))]),t(g,{attrs:{small:"",value:"printtime_avg"}},[e._v(e._s(e.$t("History.PrinttimeAvg")))])],1)],1)],1)],1)],1)],1)},nN=[],aN=E(jh,iN,nN,!1,null,null);const Ey=aN.exports;var oN=Object.getOwnPropertyDescriptor,lN=(s,e,t,r)=>{for(var i=r>1?void 0:r?oN(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Ih=class extends k(L){};Ih=lN([S({components:{HistoryListPanel:wy,HistoryStatisticsPanel:Ey}})],Ih);var cN=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(x,[t(b,[t(Ey)],1)],1),t(x,{staticClass:"mt-0"},[t(b,[t(wy)],1)],1)],1)},uN=[],dN=E(Ih,cN,uN,!1,null,null);const mN=dN.exports;var hN=Object.getOwnPropertyDescriptor,pN=(s,e,t,r)=>{for(var i=r>1?void 0:r?hN(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Dc=class extends y{get variable_fps(){var s,e,t;return(t=(e=(s=this.$store.state.server.timelapse)==null?void 0:s.settings)==null?void 0:e.variable_fps)!=null?t:!1}set variable_fps(s){this.$store.dispatch("server/timelapse/saveSetting",{variable_fps:s})}get variable_fps_min(){var s,e,t;return(t=(e=(s=this.$store.state.server.timelapse)==null?void 0:s.settings)==null?void 0:e.variable_fps_min)!=null?t:5}set variable_fps_min(s){this.$store.dispatch("server/timelapse/saveSetting",{variable_fps_min:s})}get variable_fps_max(){var s,e,t;return(t=(e=(s=this.$store.state.server.timelapse)==null?void 0:s.settings)==null?void 0:e.variable_fps_max)!=null?t:60}set variable_fps_max(s){this.$store.dispatch("server/timelapse/saveSetting",{variable_fps_max:s})}get targetlength(){var s,e,t;return(t=(e=(s=this.$store.state.server.timelapse)==null?void 0:s.settings)==null?void 0:e.targetlength)!=null?t:10}set targetlength(s){this.$store.dispatch("server/timelapse/saveSetting",{targetlength:s})}get output_framerate(){var s,e,t;return(t=(e=(s=this.$store.state.server.timelapse)==null?void 0:s.settings)==null?void 0:e.output_framerate)!=null?t:30}set output_framerate(s){this.$store.dispatch("server/timelapse/saveSetting",{output_framerate:s})}get duplicatelastframe(){var s,e,t;return(t=(e=(s=this.$store.state.server.timelapse)==null?void 0:s.settings)==null?void 0:e.duplicatelastframe)!=null?t:0}set duplicatelastframe(s){this.$store.dispatch("server/timelapse/saveSetting",{duplicatelastframe:s})}get framesCount(){var s,e,t;return(t=(e=(s=this.$store.state.server.timelapse)==null?void 0:s.lastFrame)==null?void 0:e.count)!=null?t:0}get estimatedVideoLength(){let s=Math.round((this.framesCount+this.duplicatelastframe)/this.output_framerate);return this.variable_fps&&(s=Math.round((this.framesCount+this.duplicatelastframe)/this.variableTargetFps),s60?Math.floor(s/60)+"m "+(s-Math.floor(s/60)*60)+"s":s+"s"}get variableTargetFps(){let s=Math.floor(this.framesCount/this.targetlength);return s=Math.max(s,this.variable_fps_min),s=Math.min(s,this.variable_fps_max),s}};Dc=pN([S],Dc);var fN=Object.defineProperty,gN=Object.getOwnPropertyDescriptor,Ly=(s,e,t,r)=>{for(var i=r>1?void 0:r?gN(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&fN(e,t,i),i};let Tc=class extends k(L,Dc){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiTextBoxSearchOutline=Pv}get framerateTypeOptions(){return[{value:!1,text:this.$t("Timelapse.Fixed")},{value:!0,text:this.$t("Timelapse.Variable")}]}startRender(){this.$socket.emit("machine.timelapse.render",{}),this.close()}close(){this.$emit("close")}};Ly([w({type:Boolean,default:!1})],Tc.prototype,"show",2);Tc=Ly([S({components:{Panel:U,SettingsRow:j}})],Tc);var _N=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.show,"max-width":700,"max-height":500}},[t(U,{attrs:{title:e.$t("Timelapse.RenderSettings"),icon:e.mdiTextBoxSearchOutline,"card-class":"timelapse-rendersettings-dialog-panel","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:""},on:{click:e.close}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{},[t(x,[t(b,{staticClass:"col-4"},[t(ke,{attrs:{label:e.$t("Timelapse.Type"),items:e.framerateTypeOptions,outlined:"",dense:"","hide-details":""},model:{value:e.variable_fps,callback:function(r){e.variable_fps=r},expression:"variable_fps"}})],1),t(b,{staticClass:"col-4"},[e.variable_fps?[t(se,{attrs:{label:e.$t("Timelapse.MinFramerate"),type:"number",outlined:"",dense:"","hide-details":"","hide-spin-buttons":""},model:{value:e.variable_fps_min,callback:function(r){e.variable_fps_min=r},expression:"variable_fps_min"}}),t(se,{staticClass:"mt-3",attrs:{label:e.$t("Timelapse.MaxFramerate"),type:"number",outlined:"",dense:"","hide-details":"","hide-spin-buttons":""},model:{value:e.variable_fps_max,callback:function(r){e.variable_fps_max=r},expression:"variable_fps_max"}}),t(se,{staticClass:"mt-3",attrs:{label:e.$t("Timelapse.Targetlength"),type:"number",outlined:"",dense:"","hide-details":"","hide-spin-buttons":""},model:{value:e.targetlength,callback:function(r){e.targetlength=r},expression:"targetlength"}})]:t(se,{attrs:{label:e.$t("Timelapse.Framerate"),type:"number",outlined:"",dense:"","hide-details":"","hide-spin-buttons":""},model:{value:e.output_framerate,callback:function(r){e.output_framerate=r},expression:"output_framerate"}}),t(se,{staticClass:"mt-3",attrs:{label:e.$t("Timelapse.DuplicateLastframe"),type:"number",outlined:"",dense:"","hide-details":"","hide-spin-buttons":""},model:{value:e.duplicatelastframe,callback:function(r){e.duplicatelastframe=r},expression:"duplicatelastframe"}})],2),t(b,{staticClass:"col-4"},[e.variable_fps?t(se,{staticClass:"mb-3",attrs:{label:e.$t("Timelapse.TargetFps"),type:"number",outlined:"",dense:"","hide-details":"",readonly:""},model:{value:e.variableTargetFps,callback:function(r){e.variableTargetFps=r},expression:"variableTargetFps"}}):e._e(),t(se,{attrs:{label:e.$t("Timelapse.EstimatedLength"),outlined:"",dense:"","hide-details":"",readonly:""},model:{value:e.estimatedVideoLength,callback:function(r){e.estimatedVideoLength=r},expression:"estimatedVideoLength"}})],1)],1)],1),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.close}},[e._v(e._s(e.$t("Timelapse.Cancel")))]),t(g,{attrs:{text:"",color:"primary"},on:{click:e.startRender}},[e._v(e._s(e.$t("Timelapse.StartRender")))])],1)],1)],1)},vN=[],bN=E(Tc,_N,vN,!1,null,null);const Ay=bN.exports;var yN=Object.defineProperty,CN=Object.getOwnPropertyDescriptor,Fy=(s,e,t,r)=>{for(var i=r>1?void 0:r?CN(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&yN(e,t,i),i};let Oc=class extends k(L,Dc,ur){constructor(){super(...arguments),this.mdiInformation=Ht,this.mdiFile=Bs,this.mdiCloseThick=pe,this.boolDialogRendersettings=!1,this.scale=1}get frameUrl(){var e,t,r;const s=(r=(t=(e=this.$store.state.server.timelapse)==null?void 0:e.lastFrame)==null?void 0:t.file)!=null?r:null;return s?this.apiUrl+"/server/files/timelapse_frames/"+s:null}get enabled(){var s,e,t;return(t=(e=(s=this.$store.state.server.timelapse)==null?void 0:s.settings)==null?void 0:e.enabled)!=null?t:!1}set enabled(s){this.$socket.emit("machine.timelapse.post_settings",{enabled:s},{action:"server/timelapse/initSettings"})}get autorender(){var s,e,t;return(t=(e=(s=this.$store.state.server.timelapse)==null?void 0:s.settings)==null?void 0:e.autorender)!=null?t:!1}set autorender(s){this.$socket.emit("machine.timelapse.post_settings",{autorender:s},{action:"server/timelapse/initSettings"})}get disableRenderButton(){var s,e;return((e=(s=this.$store.state.server.timelapse)==null?void 0:s.rendering.status)!=null?e:"")==="running"}get existsSnapshoturlInMoonrakerConfig(){return"snapshoturl"in this.$store.state.server.config.orig.timelapse}get moonrakerTimelapseConfig(){var s;return(s=this.$store.state.server.config.config.timelapse)!=null?s:{}}get camId(){var s;return(s=this.$store.state.server.timelapse.settings.camera)!=null?s:""}get camSettings(){return this.$store.getters["gui/webcams/getWebcam"](this.camId)}get webcamStyle(){var s,e,t,r,i;return this.existsSnapshoturlInMoonrakerConfig?{transform:this.generateTransform((s=this.moonrakerTimelapseConfig.flip_x)!=null?s:!1,(e=this.moonrakerTimelapseConfig.flip_y)!=null?e:!1,0)}:this.camSettings?{transform:this.generateTransform((t=this.camSettings.flip_horizontal)!=null?t:!1,(r=this.camSettings.flip_vertical)!=null?r:!1,(i=this.camSettings.rotation)!=null?i:0)}:{}}saveFrames(){this.$socket.emit("machine.timelapse.saveframes",{},{loading:"timelapse_saveframes"})}calcRatio(){this.scale=this.timelapsePreview.naturalHeight/this.timelapsePreview.naturalWidth,this.scale>1&&(this.scale=this.timelapsePreview.naturalWidth/this.timelapsePreview.naturalHeight)}};Fy([Ts("timelapsePreview")],Oc.prototype,"timelapsePreview",2);Oc=Fy([S({components:{TimelapseRenderingsettingsDialog:Ay,Panel:U,SettingsRow:j}})],Oc);var $N=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(U,{attrs:{title:e.$t("Timelapse.Status"),icon:e.mdiInformation,"card-class":"timelapse-status-panel"}},[e.framesCount?t(Z,[e.frameUrl?t(x,[t(b,{staticClass:"pb-0"},[t("vue-load-image",{staticClass:"d-flex align-center justify-center"},[t("img",{ref:"timelapsePreview",staticClass:"w-100",style:e.webcamStyle,attrs:{slot:"image",src:e.frameUrl,alt:e.$t("Timelapse.Preview").toString()},on:{load:e.calcRatio},slot:"image"}),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(ot,{attrs:{indeterminate:"",color:"primary"}})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(_,[e._v(e._s(e.mdiFile))])],1)])],1)],1):e._e(),t(x,[t(b,{staticClass:"text--secondary"},[t(j,{attrs:{title:e.$t("Timelapse.Frames"),"dynamic-slot-width":!0}},[e._v(" "+e._s(e.framesCount)+" ")]),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Timelapse.EstimatedLength"),"dynamic-slot-width":!0}},[e._v(" "+e._s(e.estimatedVideoLength)+" ")]),["printing","paused"].includes(e.printer_state)?e._e():[t(I,{staticClass:"mt-2 mb-4"}),t(x,[t(b,{staticClass:"text-center py-1"},[t(g,{attrs:{text:"",color:"primary",disabled:e.disableRenderButton},on:{click:function(r){e.boolDialogRendersettings=!0}}},[e._v(" "+e._s(e.$t("Timelapse.Render"))+" ")]),t(g,{attrs:{text:"",color:"primary",loading:e.loadings.includes("timelapse_saveframes")},on:{click:e.saveFrames}},[e._v(" "+e._s(e.$t("Timelapse.SaveFrames"))+" ")])],1)],1)]],2)],1)],1):t(Z,{},[t("p",{staticClass:"text-center my-0 font-italic"},[e._v(e._s(e.$t("Timelapse.NoActiveTimelapse")))])]),["printing","paused"].includes(e.printer_state)?t(Z,{staticClass:"pt-0"},[t(I,{staticClass:"mt-0 mb-2"}),t(j,{attrs:{title:e.$t("Timelapse.Enabled"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.enabled,callback:function(r){e.enabled=r},expression:"enabled"}})],1),e.enabled?[t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Timelapse.Autorender"),"dynamic-slot-width":!0}},[t(we,{staticClass:"mt-0",attrs:{"hide-details":""},model:{value:e.autorender,callback:function(r){e.autorender=r},expression:"autorender"}})],1)]:e._e()],2):e._e(),t(Ay,{attrs:{show:e.boolDialogRendersettings},on:{close:function(r){e.boolDialogRendersettings=!1}}})],1)},xN=[],wN=E(Oc,$N,xN,!1,null,null);const Ry=wN.exports;var SN=Object.getOwnPropertyDescriptor,PN=(s,e,t,r)=>{for(var i=r>1?void 0:r?SN(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Nh=class extends k(L){constructor(){super(...arguments),this.formatFilesize=Xe,this.sortFiles=rf,this.mdiFileVideo=Gw,this.mdiCloseThick=pe,this.mdiFileDocumentMultipleOutline=Ga,this.mdiMagnify=rn,this.mdiFolderPlus=Vp,this.mdiRefresh=an,this.mdiFolderUpload=Bp,this.mdiFolder=Np,this.mdiFolderZipOutline=Xw,this.mdiFile=Bs,this.mdiCloudDownload=Kn,this.mdiRenameBox=vu,this.mdiDelete=Ue,this.search="",this.boolVideoDialog=!1,this.videoDialogFilename="",this.dialogCreateDirectory={show:!1,name:""},this.contextMenu={shown:!1,isDirectory:!1,touchTimer:void 0,x:0,y:0,item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogRenameFile={show:!1,newName:"",item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogRenameDirectory={show:!1,newName:"",item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogDeleteDirectory={show:!1,newName:"",item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.deleteDialog=!1,this.deleteSelectedDialog=!1,this.isInvalidName=!0,this.nameInputRules=[s=>!!s||this.$t("Files.InvalidNameEmpty"),s=>!this.existsFilename(s)||this.$t("Files.InvalidNameAlreadyExists")],this.rootDirectory="timelapse"}existsFilename(s){return this.files.findIndex(e=>e.filename===s)>=0}get headers(){return[{text:"",value:"",align:"left",configable:!1,visible:!0,sortable:!1},{text:this.$t("Timelapse.Name"),value:"filename",align:"left",configable:!1,visible:!0},{text:this.$t("Timelapse.Filesize"),value:"size",align:"right",configable:!0,visible:!0},{text:this.$t("Timelapse.LastModified"),value:"modified",align:"right",configable:!0,visible:!0}]}get directory(){return this.$store.getters["files/getDirectory"](this.currentPath)}get disk_usage(){var s,e;return(e=(s=this.directory)==null?void 0:s.disk_usage)!=null?e:{used:0,free:0,total:0}}get directoryPermissions(){var s,e;return(e=(s=this.directory)==null?void 0:s.permissions)!=null?e:"r"}get files(){var s,e;return[...(e=(s=this.directory)==null?void 0:s.childrens)!=null?e:[]]}get sortBy(){var s;return(s=this.$store.state.gui.view.gcodefiles.sortBy)!=null?s:"modified"}set sortBy(s){s===void 0&&(s="modified"),this.$store.dispatch("gui/saveSetting",{name:"view.timelapse.sortBy",value:s})}get sortDesc(){var s;return(s=this.$store.state.gui.view.gcodefiles.sortDesc)!=null?s:!0}set sortDesc(s){s===void 0&&(s=!1),this.$store.dispatch("gui/saveSetting",{name:"view.timelapse.sortDesc",value:s})}get countPerPage(){var s,e;return(e=(s=this.$store.state.gui.view.timelapse)==null?void 0:s.countPerPage)!=null?e:10}set countPerPage(s){this.$store.dispatch("gui/saveSetting",{name:"view.timelapse.countPerPage",value:s})}get displayFiles(){var s,e;return(e=(s=this.files)==null?void 0:s.filter(t=>t.isDirectory?!0:t.filename.endsWith("mp4")||t.filename.endsWith("zip")))!=null?e:[]}get currentPath(){return this.$store.state.gui.view.timelapse.currentPath}get currentPathForNavigation(){return this.currentPath===this.rootDirectory?"":this.currentPath.substring(this.rootDirectory.length)}set currentPath(s){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.timelapse.currentPath",value:s})}get selectedFiles(){var s;return(s=this.$store.state.gui.view.timelapse.selectedFiles)!=null?s:[]}set selectedFiles(s){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.timelapse.selectedFiles",value:s})}createDirectory(){this.dialogCreateDirectory.name="",this.dialogCreateDirectory.show=!0,setTimeout(()=>{var s;(s=this.$refs.inputFieldCreateDirectory)==null||s.focus()},200)}createDirectoryAction(){this.dialogCreateDirectory.show=!1,this.$socket.emit("server.files.post_directory",{path:this.currentPath+"/"+this.dialogCreateDirectory.name},{action:"files/getCreateDir"})}refreshFileList(){this.$socket.emit("server.files.get_directory",{path:this.currentPath},{action:"files/getDirectory"})}advancedSearch(s,e){return s!=null&&e!=null&&typeof s=="string"&&s.toString().toLowerCase().indexOf(e.toLowerCase())!==-1}getThumbnail(s){var r;const e=s.filename.slice(0,s.filename.lastIndexOf(".")),t=(r=this.files)==null?void 0:r.find(i=>i.filename===e+".jpg");return t?"".concat(this.apiUrl,"/server/files/").concat(Ie(this.currentPath),"/").concat(Ie(t.filename),"?timestamp=").concat(t.modified.getTime()):""}clickRow(s,e=!1){(!this.contextMenu.shown||e)&&(e&&(this.contextMenu.shown=!1),s.isDirectory?this.currentPath+="/"+s.filename:s.filename.endsWith("zip")?this.downloadFile(s.filename):s.filename.endsWith("mp4")&&(this.videoDialogFilename=Ie("".concat(this.currentPath,"/").concat(s.filename)),this.boolVideoDialog=!0))}clickRowGoBack(){this.currentPath=this.currentPath.slice(0,this.currentPath.lastIndexOf("/"))}clickPathNavGoToDirectory(s){this.currentPath="".concat(this.rootDirectory).concat(s.location)}showContextMenu(s,e){this.contextMenu.shown||(s==null||s.preventDefault(),this.contextMenu.shown=!0,this.contextMenu.x=(s==null?void 0:s.clientX)||(s==null?void 0:s.pageX)||window.screenX/2,this.contextMenu.y=(s==null?void 0:s.clientY)||(s==null?void 0:s.pageY)||window.screenY/2,this.contextMenu.item=e,this.$nextTick(()=>{this.contextMenu.shown=!0}))}existsFramesZip(s){const e=s.filename.lastIndexOf("."),t=s.filename.slice(0,e)+".zip";return this.files.findIndex(r=>r.filename===t)!==-1}downloadFile(s){const e=this.currentPath+"/"+s,t=this.apiUrl+"/server/files/"+Ie(e);window.open(t)}async downloadSelectedFiles(){let s=[];const e=async(i,n)=>{for(const a of n){const o="".concat(i,"/").concat(a.filename);if(a.isDirectory&&a.childrens){await e(o,a.childrens);continue}if(s.push(o),a.filename.endsWith(".mp4")){const l=a.filename.lastIndexOf("."),u=a.filename.slice(0,l),c="".concat(u,".jpg");this.files.indexOf(d=>d.filename===c)!==-1&&s.push("".concat(i,"/").concat(c))}}};await e(this.currentPath,this.selectedFiles);const t=new Date,r="".concat(t.getFullYear()).concat(t.getMonth()).concat(t.getDate(),"-").concat(t.getHours()).concat(t.getMinutes()).concat(t.getSeconds());this.$socket.emit("server.files.zip",{items:s,dest:"timelapse/timelapse-".concat(r,".zip")},{action:"files/downloadZip",loading:"timelapseDownloadZip"}),this.selectedFiles=[]}renameFile(s){const e=s.filename.lastIndexOf(".");this.dialogRenameFile.newName=s.filename.slice(0,e),this.dialogRenameFile.item=s,this.dialogRenameFile.show=!0,setTimeout(()=>{var t;(t=this.$refs.inputFieldRenameFile)==null||t.focus()},200)}renameFileAction(){const s=this.dialogRenameFile.item.filename.lastIndexOf("."),e=this.dialogRenameFile.item.filename.slice(0,s),t=this.dialogRenameFile.item.filename.split(".").pop();if(this.dialogRenameFile.show=!1,this.$socket.emit("server.files.move",{source:"".concat(this.currentPath,"/").concat(this.dialogRenameFile.item.filename),dest:"".concat(this.currentPath,"/").concat(this.dialogRenameFile.newName,".").concat(t)},{action:"files/getMove"}),t!=="mp4")return;this.files.find(i=>i.filename==="".concat(e,".jpg"))&&this.$socket.emit("server.files.move",{source:"".concat(this.currentPath,"/").concat(e,".jpg"),dest:"".concat(this.currentPath,"/").concat(this.dialogRenameFile.newName,".jpg")})}renameDirectory(s){this.dialogRenameDirectory.item=s,this.dialogRenameDirectory.newName=s.filename,this.dialogRenameDirectory.show=!0,setTimeout(()=>{var e;(e=this.$refs.inputFieldRenameDirectory)==null||e.focus()},200)}renameDirectoryAction(){this.dialogRenameDirectory.show=!1,this.$socket.emit("server.files.move",{source:this.currentPath+"/"+this.dialogRenameDirectory.item.filename,dest:this.currentPath+"/"+this.dialogRenameDirectory.newName},{action:"files/getMove"})}removeFile(){const s=this.contextMenu.item.filename.slice(0,this.contextMenu.item.filename.lastIndexOf(".")),e=this.contextMenu.item.filename.split(".").pop();if(this.$socket.emit("server.files.delete_file",{path:this.currentPath+"/"+this.contextMenu.item.filename},{action:"files/getDeleteFile"}),e!=="mp4")return;const t=s+".jpg";this.files.findIndex(i=>i.filename===t)!==-1&&this.$socket.emit("server.files.delete_file",{path:this.currentPath+"/"+t},{action:"files/getDeleteFile"}),this.deleteDialog=!1}deleteDirectory(s){this.dialogDeleteDirectory.item=s,this.dialogDeleteDirectory.show=!0}deleteDirectoryAction(){this.dialogDeleteDirectory.show=!1,this.$socket.emit("server.files.delete_directory",{path:this.currentPath+"/"+this.contextMenu.item.filename,force:!0},{action:"files/getDeleteDir"})}deleteSelectedFiles(){this.selectedFiles.forEach(s=>{if(s.isDirectory)this.$socket.emit("server.files.delete_directory",{path:this.currentPath+"/"+s.filename,force:!0},{action:"files/getDeleteDir"});else{const e=s.filename.slice(0,s.filename.lastIndexOf(".")),t=s.filename.split(".").pop();if(this.$socket.emit("server.files.delete_file",{path:this.currentPath+"/"+s.filename},{action:"files/getDeleteFile"}),t!=="mp4")return;const r=e+".jpg";this.files.findIndex(n=>n.filename===r)!==-1&&this.$socket.emit("server.files.delete_file",{path:this.currentPath+"/"+r},{action:"files/getDeleteFile"})}}),this.selectedFiles=[],this.deleteSelectedDialog=!1}};Nh=PN([S({components:{Panel:U,PathNavigation:hn}})],Nh);var DN=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(U,{attrs:{title:e.$t("Timelapse.TimelapseFiles"),icon:e.mdiFileDocumentMultipleOutline,"card-class":"timelapse-files-panel"}},[t(Z,[t(x,[t(b,{staticClass:"col-12 d-flex align-center"},[t(se,{staticStyle:{"max-width":"300px"},attrs:{"append-icon":e.mdiMagnify,label:e.$t("Timelapse.Search"),"single-line":"",outlined:"",clearable:"","hide-details":"",dense:""},model:{value:e.search,callback:function(r){e.search=r},expression:"search"}}),t(ae),e.selectedFiles.length?t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Timelapse.Download"),color:"primary",loading:e.loadings.includes("timelapseDownloadZip")},on:{click:e.downloadSelectedFiles}},[t(_,[e._v(e._s(e.mdiCloudDownload))])],1):e._e(),e.selectedFiles.length?t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Timelapse.Delete"),color:"error"},on:{click:function(r){e.deleteSelectedDialog=!0}}},[t(_,[e._v(e._s(e.mdiDelete))])],1):e._e(),e.directoryPermissions.includes("w")?t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Timelapse.CreateNewDirectory")},on:{click:e.createDirectory}},[t(_,[e._v(e._s(e.mdiFolderPlus))])],1):e._e(),t(g,{staticClass:"px-2 minwidth-0 ml-3",attrs:{title:e.$t("Timelapse.RefreshCurrentDirectory")},on:{click:e.refreshFileList}},[t(_,[e._v(e._s(e.mdiRefresh))])],1)],1)],1)],1),t(Z,[t(x,[t(b,{staticClass:"col-12 py-2 d-flex align-center"},[t("span",[t("b",{staticClass:"mr-1"},[e._v(e._s(e.$t("Timelapse.CurrentPath"))+":")]),t(hn,{attrs:{path:e.currentPathForNavigation,"base-directory-label":"/".concat(e.rootDirectory),"on-segment-click":e.clickPathNavGoToDirectory}})],1),t(ae),e.disk_usage!==null?[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("span",e._g(e._b({},"span",i,!1),r),[t("b",[e._v(e._s(e.$t("Timelapse.FreeDisk"))+":")]),e._v(" "+e._s(e.formatFilesize(e.disk_usage.free))+" ")])]}}],null,!1,2240604619)},[t("span",[e._v(" "+e._s(e.$t("Timelapse.Used"))+": "+e._s(e.formatFilesize(e.disk_usage.used))+" "),t("br"),e._v(" "+e._s(e.$t("Timelapse.Free"))+": "+e._s(e.formatFilesize(e.disk_usage.free))+" "),t("br"),e._v(" "+e._s(e.$t("Timelapse.Total"))+": "+e._s(e.formatFilesize(e.disk_usage.total))+" ")])])]:e._e()],2)],1)],1),t(I,{staticClass:"mb-3"}),t(Qr,{staticClass:"files-table",attrs:{items:e.displayFiles,headers:e.headers,"custom-sort":e.sortFiles,"sort-by":e.sortBy,"sort-desc":e.sortDesc,"items-per-page":e.countPerPage,"footer-props":{itemsPerPageText:e.$t("Timelapse.Files"),itemsPerPageAllText:e.$t("Timelapse.AllFiles"),itemsPerPageOptions:[10,25,50,100,-1]},"item-key":"filename",search:e.search,"custom-filter":e.advancedSearch,"mobile-breakpoint":"0","show-select":""},on:{"update:sortBy":function(r){e.sortBy=r},"update:sort-by":function(r){e.sortBy=r},"update:sortDesc":function(r){e.sortDesc=r},"update:sort-desc":function(r){e.sortDesc=r},"update:itemsPerPage":function(r){e.countPerPage=r},"update:items-per-page":function(r){e.countPerPage=r}},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"text-center font-italic"},[e._v(e._s(e.$t("Timelapse.Empty")))])]},proxy:!0},{key:"item",fn:function({index:r,item:i,isSelected:n,select:a}){return[t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:o=>e.showContextMenu(o,i),expression:"(e) => showContextMenu(e, item)",arg:"600"}],key:"".concat(r," ").concat(i.filename),staticClass:"file-list-cursor user-select-none",on:{contextmenu:function(o){return e.showContextMenu(o,i)},click:function(o){return e.clickRow(i)}}},[t("td",{staticClass:"file-list__select-td pr-0"},[t(jr,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{value:n},on:{click:function(o){return o.stopPropagation(),a(!n)}}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[i.isDirectory?[t(_,{attrs:{width:"32"}},[e._v(e._s(e.mdiFolder))])]:i.filename.endsWith("zip")?[t(_,{attrs:{width:"32"}},[e._v(e._s(e.mdiFolderZipOutline))])]:e.getThumbnail(i)?[!i.isDirectory&&e.getThumbnail(i)?t(de,{attrs:{top:"","content-class":"tooltip__content-opacity1"},scopedSlots:e._u([{key:"activator",fn:function({on:o,attrs:l}){return[t("vue-load-image",[t("img",e._g(e._b({attrs:{slot:"image",src:e.getThumbnail(i),alt:i.filename,width:"32"},slot:"image"},"img",l,!1),o)),t("div",{attrs:{slot:"preloader"},slot:"preloader"},[t(ot,{attrs:{slot:"preloader",indeterminate:"",color:"primary"},slot:"preloader"})],1),t("div",{attrs:{slot:"error"},slot:"error"},[t(_,[e._v(e._s(e.mdiFile))])],1)])]}}],null,!0)},[t("span",[t("img",{attrs:{src:e.getThumbnail(i),alt:i.filename,width:"250"}})])]):e._e()]:[t(_,[e._v(e._s(e.mdiFile))])]],2),t("td",{staticClass:""},[e._v(e._s(i.filename))]),e.headers.find(o=>o.value==="size").visible?t("td",{staticClass:"text-no-wrap text-right"},[e._v(" "+e._s(i.isDirectory?"--":e.formatFilesize(i.size))+" ")]):e._e(),e.headers.find(o=>o.value==="modified").visible?t("td",{staticClass:"text-right"},[e._v(" "+e._s(e.formatDateTime(i.modified))+" ")]):e._e()])]}}]),model:{value:e.selectedFiles,callback:function(r){e.selectedFiles=r},expression:"selectedFiles"}},[t("template",{slot:"items"},e._l(e.headers,function(r){return t("td",{key:r.value},[e._v(e._s(r.text))])}),0),e.currentPath!==e.rootDirectory?t("template",{slot:"body.prepend"},[t("tr",{staticClass:"file-list-cursor",on:{click:e.clickRowGoBack}},[t("td",{staticClass:"pr-0 text-center",staticStyle:{width:"32px"}},[t(_,[e._v(e._s(e.mdiFolderUpload))])],1),t("td",{staticClass:"",attrs:{colspan:e.headers.length}},[e._v("..")])])]):e._e()],2)],1),t(ye,{attrs:{"position-x":e.contextMenu.x,"position-y":e.contextMenu.y,absolute:"","offset-y":""},model:{value:e.contextMenu.shown,callback:function(r){e.$set(e.contextMenu,"shown",r)},expression:"contextMenu.shown"}},[t(Me,[e.contextMenu.item.isDirectory?e._e():t(J,{on:{click:function(r){return e.downloadFile(e.contextMenu.item.filename)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiCloudDownload))]),e._v(" "+e._s(e.$t("Timelapse.Download"))+" ")],1),e.contextMenu.item.isDirectory&&e.contextMenu.item.permissions.includes("w")?t(J,{on:{click:function(r){return e.renameDirectory(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiRenameBox))]),e._v(" "+e._s(e.$t("Timelapse.Rename"))+" ")],1):e._e(),!e.contextMenu.item.isDirectory&&e.contextMenu.item.permissions.includes("w")?t(J,{on:{click:function(r){return e.renameFile(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiRenameBox))]),e._v(" "+e._s(e.$t("Timelapse.Rename"))+" ")],1):e._e(),!e.contextMenu.item.isDirectory&&e.contextMenu.item.permissions.includes("w")?t(J,{staticClass:"red--text",on:{click:function(r){e.deleteDialog=!0}}},[t(_,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("Timelapse.Delete"))+" ")],1):e._e(),e.contextMenu.item.isDirectory&&e.contextMenu.item.permissions.includes("w")?t(J,{staticClass:"red--text",on:{click:function(r){return e.deleteDirectory(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("Timelapse.Delete"))+" ")],1):e._e()],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.dialogRenameFile.show,callback:function(r){e.$set(e.dialogRenameFile,"show",r)},expression:"dialogRenameFile.show"}},[t(U,{attrs:{title:e.$t("Timelapse.RenameFile"),"card-class":"gcode-files-rename-file-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogRenameFile.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputFieldRenameFile",attrs:{label:e.$t("Timelapse.Name"),required:"",rules:e.nameInputRules},on:{"update:error":r=>e.isInvalidName=r,keypress:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.renameFileAction.apply(null,arguments)}},model:{value:e.dialogRenameFile.newName,callback:function(r){e.$set(e.dialogRenameFile,"newName",r)},expression:"dialogRenameFile.newName"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogRenameFile.show=!1}}},[e._v(e._s(e.$t("Timelapse.Cancel")))]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.renameFileAction}},[e._v(" "+e._s(e.$t("Timelapse.Rename"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.dialogCreateDirectory.show,callback:function(r){e.$set(e.dialogCreateDirectory,"show",r)},expression:"dialogCreateDirectory.show"}},[t(U,{attrs:{title:e.$t("Timelapse.NewDirectory"),"card-class":"gcode-files-new-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogCreateDirectory.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputFieldCreateDirectory",attrs:{label:e.$t("Timelapse.Name"),required:"",rules:e.nameInputRules},on:{"update:error":r=>e.isInvalidName=r,keypress:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.createDirectoryAction.apply(null,arguments)}},model:{value:e.dialogCreateDirectory.name,callback:function(r){e.$set(e.dialogCreateDirectory,"name",r)},expression:"dialogCreateDirectory.name"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogCreateDirectory.show=!1}}},[e._v(" "+e._s(e.$t("Timelapse.Cancel"))+" ")]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.createDirectoryAction}},[e._v(" "+e._s(e.$t("Timelapse.Create"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.dialogRenameDirectory.show,callback:function(r){e.$set(e.dialogRenameDirectory,"show",r)},expression:"dialogRenameDirectory.show"}},[t(U,{attrs:{title:e.$t("Timelapse.RenameDirectory"),"card-class":"gcode-files-rename-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogRenameDirectory.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputFieldRenameDirectory",attrs:{label:e.$t("Timelapse.Name"),required:"",rules:e.nameInputRules},on:{"update:error":r=>e.isInvalidName=r,keyup:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.renameDirectoryAction.apply(null,arguments)}},model:{value:e.dialogRenameDirectory.newName,callback:function(r){e.$set(e.dialogRenameDirectory,"newName",r)},expression:"dialogRenameDirectory.newName"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogRenameDirectory.show=!1}}},[e._v(" "+e._s(e.$t("Timelapse.Cancel"))+" ")]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.renameDirectoryAction}},[e._v(" "+e._s(e.$t("Timelapse.Rename"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.dialogDeleteDirectory.show,callback:function(r){e.$set(e.dialogDeleteDirectory,"show",r)},expression:"dialogDeleteDirectory.show"}},[t(U,{attrs:{title:e.$t("Timelapse.DeleteDirectory"),"card-class":"gcode-files-delete-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.dialogDeleteDirectory.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Timelapse.DeleteDirectoryQuestion",{name:e.dialogDeleteDirectory.item.filename}))+" ")])]),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.dialogDeleteDirectory.show=!1}}},[e._v(" "+e._s(e.$t("Timelapse.Cancel"))+" ")]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteDirectoryAction}},[e._v(e._s(e.$t("Timelapse.Delete")))])],1)],1)],1),t(le,{attrs:{"max-width":700},model:{value:e.boolVideoDialog,callback:function(r){e.boolVideoDialog=r},expression:"boolVideoDialog"}},[t(U,{attrs:{title:e.$t("Timelapse.Video"),icon:e.mdiFileVideo,"card-class":"timelapse-video-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.boolVideoDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{},[t(x,[t(b,{staticClass:"pb-0"},[t("video",{staticStyle:{width:"100%"},attrs:{src:e.apiUrl+"/server/files/"+e.videoDialogFilename,controls:""}},[e._v(" Sorry, your browser doesn't support embedded videos, but don't worry, you can "),t("a",{attrs:{href:e.apiUrl+"/server/files/"+e.videoDialogFilename}},[e._v("download it")]),e._v(" and watch it with your favorite video player! ")])])],1),t(x,[t(b,{staticClass:"text-center"},[t(g,{attrs:{text:"",color:"primary",href:e.apiUrl+"/server/files/"+e.videoDialogFilename,target:"_blank"}},[e._v(" "+e._s(e.$t("Timelapse.Download"))+" ")])],1)],1)],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.deleteDialog,callback:function(r){e.deleteDialog=r},expression:"deleteDialog"}},[t(U,{attrs:{title:e.$t("Timelapse.Delete"),"card-class":"timelapse-delete-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.deleteDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Timelapse.DeleteSingleFileQuestion",{name:e.contextMenu.item.filename}))+" ")])]),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.deleteDialog=!1}}},[e._v(" "+e._s(e.$t("Timelapse.Cancel"))+" ")]),t(g,{attrs:{color:"error",text:""},on:{click:e.removeFile}},[e._v(" "+e._s(e.$t("Timelapse.Delete"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.deleteSelectedDialog,callback:function(r){e.deleteSelectedDialog=r},expression:"deleteSelectedDialog"}},[t(U,{attrs:{title:e.$t("Timelapse.Delete"),"card-class":"timelapse-delete-selected-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.deleteSelectedDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[e.selectedFiles.length===1?t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Timelapse.DeleteSingleFileQuestion",{name:e.selectedFiles[0].filename}))+" ")]):t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Timelapse.DeleteSelectedQuestion",{count:e.selectedFiles.length}))+" ")])]),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(r){e.deleteSelectedDialog=!1}}},[e._v(e._s(e.$t("Timelapse.Cancel")))]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteSelectedFiles}},[e._v(e._s(e.$t("Timelapse.Delete")))])],1)],1)],1)],1)},TN=[],ON=E(Nh,DN,TN,!1,null,"594d4cbf");const Hy=ON.exports;var MN=Object.getOwnPropertyDescriptor,kN=(s,e,t,r)=>{for(var i=r>1?void 0:r?MN(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Vh=class extends k(L){};Vh=kN([S({components:{TimelapseStatusPanel:Ry,TimelapseFilesPanel:Hy}})],Vh);var EN=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,[t(b,{staticClass:"col-12 col-md-8 pt-0 pt-md-3",attrs:{order:e.$vuetify.breakpoint.mdAndUp?"":"2"}},[t(Hy)],1),t(b,{staticClass:"col-12 col-md-4",attrs:{order:e.$vuetify.breakpoint.mdAndUp?"":"1"}},[t(Ry)],1)],1)},LN=[],AN=E(Vh,EN,LN,!1,null,"b10baa86");const FN=AN.exports;var RN=Object.defineProperty,HN=Object.getOwnPropertyDescriptor,jy=(s,e,t,r)=>{for(var i=r>1?void 0:r?HN(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&RN(e,t,i),i};let Mc=class extends k(L){constructor(){super(...arguments),this.mdiDownload=K_}get logfiles(){var e,t;return(t=(e=this.$store.getters["files/getDirectory"]("logs"))==null?void 0:e.childrens)!=null?t:[]}get filename(){return this.name+".log"}get exists(){return["klippy","moonraker"].includes(this.name)?!0:this.logfiles.findIndex(e=>e.filename===this.filename)!==-1}get href(){let e="/server/files/logs/";return["klippy","moonraker"].includes(this.name)&&(e="/server/files/"),this.apiUrl+e+this.filename}get classes(){const e=["col-12","pt-0"];return this.klipperState!=="ready"?(e.push("col-md-6"),e.push("mt-md-3")):e.push("col-md-12"),e}downloadLog(e){e.preventDefault();let t="";"href"in e.target.attributes&&(t=e.target.attributes.href.value),"href"in e.target.parentElement.attributes&&(t=e.target.parentElement.attributes.href.value),window.open(t)}};jy([w({type:String,required:!0})],Mc.prototype,"name",2);Mc=jy([S({components:{Panel:U}})],Mc);var jN=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.exists?t(b,{class:e.classes},[t(g,{staticClass:"primary--text",attrs:{href:e.href,block:""},on:{click:e.downloadLog}},[t(_,{staticClass:"mr-2"},[e._v(e._s(e.mdiDownload))]),e._v(" "+e._s(e.name)+" ")],1)],1):e._e()},IN=[],NN=E(Mc,jN,IN,!1,null,null);const Xf=NN.exports;var VN=Object.defineProperty,BN=Object.getOwnPropertyDescriptor,Yf=(s,e,t,r)=>{for(var i=r>1?void 0:r?BN(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&VN(e,t,i),i};let ka=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiFileSyncOutline=sv,this.rolloverLogfiles=cw,this.capitalize=lr,this.selectedRolloverLogs=[]}get loadingRolloverLogs(){return this.loadings.filter(s=>s==null?void 0:s.startsWith("rolloverLog_")).length>0}loadingRolloverLogsChanged(s){s&&this.closeDialog()}btnRolloverLogs(){this.selectedRolloverLogs.length!==0&&(this.selectedRolloverLogs.forEach(s=>{this.$socket.emit("server.logs.rollover",{application:s},{loading:"rolloverLog_"+s,action:"files/rolloverLog"})}),this.selectedRolloverLogs=[])}closeDialog(){this.$emit("close-dialog")}};Yf([w({type:Boolean,default:!1})],ka.prototype,"show",2);Yf([he("loadingRolloverLogs")],ka.prototype,"loadingRolloverLogsChanged",1);ka=Yf([S({components:{LogfilesPanelGenericLog:Xf,Panel:U}})],ka);var UN=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{value:e.show,persistent:"",width:"400",fullscreen:e.isMobile}},[t(U,{attrs:{title:e.$t("Machine.LogfilesPanel.Rollover"),"card-class":"machine_rollover_logfiles-dialog",icon:e.mdiFileSyncOutline,"margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(x,[t(b,[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Machine.LogfilesPanel.RolloverDescription")))])])],1),t(x,{staticClass:"mt-0"},[t(b,e._l(e.rolloverLogfiles,function(r){return t(ge,{key:r,staticClass:"mt-0",attrs:{label:e.capitalize(r),value:r,"hide-details":""},model:{value:e.selectedRolloverLogs,callback:function(i){e.selectedRolloverLogs=i},expression:"selectedRolloverLogs"}})}),1)],1)],1),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(" "+e._s(e.$t("Machine.LogfilesPanel.Cancel"))+" ")]),t(g,{attrs:{color:"primary",text:""},on:{click:e.btnRolloverLogs}},[e._v(" "+e._s(e.$t("Machine.LogfilesPanel.Accept"))+" ")])],1)],1)],1)},WN=[],zN=E(ka,UN,WN,!1,null,null);const GN=zN.exports;var ZN=Object.getOwnPropertyDescriptor,qN=(s,e,t,r)=>{for(var i=r>1?void 0:r?ZN(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Bh=class extends k(L){constructor(){super(...arguments),this.mdiFileDocumentEdit=Bw,this.mdiFileSyncOutline=sv,this.genericLogfiles=lw,this.showRolloverDialog=!1}};Bh=qN([S({components:{LogfilesPanelGenericLog:Xf,Panel:U}})],Bh);var XN=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(U,{attrs:{title:e.$t("Machine.LogfilesPanel.Logfiles"),icon:e.mdiFileDocumentEdit,"card-class":"machine-logfiles-panel",collapsible:!0},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:"",color:"primary",ripple:!0,loading:e.loadings.includes("loadingBtnRolloverLogs"),disabled:["printing","paused"].includes(e.printer_state)},on:{click:function(n){e.showRolloverDialog=!0}}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiFileSyncOutline))])],1)]}}])},[t("span",[e._v(e._s(e.$t("Machine.LogfilesPanel.Rollover")))])])]},proxy:!0}])},[t(Z,{class:"text-center text-lg-left"},[t(x,{staticClass:"pt-3"},e._l(e.genericLogfiles,function(r){return t(Xf,{key:r,attrs:{name:r}})}),1)],1)],1),t(GN,{attrs:{show:e.showRolloverDialog},on:{"close-dialog":function(r){e.showRolloverDialog=!1}}})],1)},YN=[],JN=E(Bh,XN,YN,!1,null,null);const Iy=JN.exports;var KN=Object.defineProperty,QN=Object.getOwnPropertyDescriptor,Ny=(s,e,t,r)=>{for(var i=r>1?void 0:r?QN(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&KN(e,t,i),i};let kc=class extends k(L){get name(){return this.item.type==="endstop"?this.item.name.toUpperCase():Ye(this.item.name)}get chipColor(){return this.item.value==="open"?"green":"red"}get value(){return this.item.value==="open"?this.$t("Machine.EndstopPanel.open"):this.$t("Machine.EndstopPanel.TRIGGERED")}};Ny([w({type:Object})],kc.prototype,"item",2);kc=Ny([S({components:{Panel:U}})],kc);var eV=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,[t(b,{staticClass:"py-1"},[t("label",{staticClass:"mt-1 d-inline-block"},[e.item.type==="endstop"?t("span",{staticClass:"mr-2"},[e._v(e._s(e.$t("Machine.EndstopPanel.Endstop")))]):e._e(),t("b",[e._v(e._s(e.name))])]),t($s,{staticClass:"float-right",attrs:{small:"",label:"",color:e.chipColor,"text-color":"white"}},[e._v(e._s(e.value))])],1)],1)},tV=[],sV=E(kc,eV,tV,!1,null,null);const rV=sV.exports;var iV=Object.getOwnPropertyDescriptor,nV=(s,e,t,r)=>{for(var i=r>1?void 0:r?iV(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Uh=class extends k(L){constructor(){super(...arguments),this.mdiArrowExpandVertical=fw,this.mdiSync=wv}get items(){var t,r;let s=[];const e=(t=this.$store.state.printer.endstops)!=null?t:{};if(Object.keys(e).forEach(i=>{s.push({type:"endstop",name:i,value:e[i]})}),s.length===0)return[];if(s=s.sort((i,n)=>i.name.localeCompare(n.name)),"probe"in this.$store.state.printer&&"last_query"in this.$store.state.printer.probe){const i=this.$store.state.printer.probe.last_query?"TRIGGERED":"open";s.push({type:"probe",name:(r=this.$store.state.printer.probe.name)!=null?r:"probe",value:i})}return s}get existsQueryProbe(){var e,t;const s=(t=(e=this.$store.state.printer.gcode)==null?void 0:e.commands)!=null?t:null;return s?"QUERY_PROBE"in s:"probe"in this.$store.state.printer}syncEndstops(){this.$socket.emit("printer.query_endstops.status",{},{action:"printer/getEndstopStatus",loading:"queryEndstops"}),this.existsQueryProbe&&(this.$store.dispatch("server/addEvent",{message:"QUERY_PROBE",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"QUERY_PROBE"}))}};Uh=nV([S({components:{Panel:U}})],Uh);var aV=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(U,{attrs:{title:e.$t("Machine.EndstopPanel.Endstops"),icon:e.mdiArrowExpandVertical,"card-class":"machine-endstop-panel",collapsible:!0}},[t(Z,{staticClass:"pb-0 pt-6"},[e._l(e.items,function(r){return t(rV,{key:r.name,attrs:{item:r}})}),e.items.length===0?t(x,[t(b,{staticClass:"pt-0"},[t("p",{staticClass:"mb-0"},[e._v(e._s(e.$t("Machine.EndstopPanel.EndstopInfo")))])])],1):e._e()],2),t(oe,{staticClass:"pt-3"},[t(ae),t(g,{attrs:{icon:"",loading:e.loadings.includes("queryEndstops")},on:{click:e.syncEndstops}},[t(_,[e._v(e._s(e.mdiSync))])],1)],1)],1)},oV=[],lV=E(Uh,aV,oV,!1,null,null);const Vy=lV.exports;var cV=Object.defineProperty,uV=Object.getOwnPropertyDescriptor,Jf=(s,e,t,r)=>{for(var i=r>1?void 0:r?uV(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&cV(e,t,i),i};let Ea=class extends k(L){constructor(){super(...arguments),this.mdiDotsHorizontal=Iw,this.showDetails=!1}get title(){return this.commit.subject}get message(){return this.commit.message}get author(){return this.commit.author}get commitFormatDate(){const s=new Date(this.commit.date*1e3);s.setHours(0,0,0,0);const e=new Date;e.setHours(0,0,0,0);const t=Math.floor((e.getTime()-s.getTime())/(1e3*60*60*24));if(t===0){const r=Math.floor((new Date().getTime()-this.commit.date*1e3)/36e5);return this.$t("Machine.UpdatePanel.CommittedHoursAgo",{hours:r})}else return t===1?this.$t("Machine.UpdatePanel.CommittedYesterday"):t<29?this.$t("Machine.UpdatePanel.CommittedDaysAgo",{days:t}):this.$t("Machine.UpdatePanel.CommittedOnDate",{date:s.toLocaleDateString(this.browserLocale,{year:"numeric",month:"short",day:"numeric"})})}get repo_name(){var s,e;return(e=(s=this.repo.repo_name)!=null?s:this.repo.name)!=null?e:""}get commitHref(){return"https://github.com/".concat(this.repo.owner,"/").concat(this.repo_name,"/commit/").concat(this.commit.sha)}get commitShortSha(){return this.commit.sha.substring(0,6)}};Jf([w({required:!0})],Ea.prototype,"commit",2);Jf([w({required:!0})],Ea.prototype,"repo",2);Ea=Jf([S({components:{Panel:U}})],Ea);var dV=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("li",{staticClass:"commit px-3 py-2"},[t(x,{staticClass:"flex-column flex-sm-row"},[t(b,[t("h4",{staticClass:"subtitle-2 text--white mb-0"},[e._v(" "+e._s(e.title)+" "),t($s,{staticClass:"ml-2 px-2",attrs:{outlined:"",label:"","x-small":""},on:{click:function(r){e.showDetails=!e.showDetails}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiDotsHorizontal))])],1)],1),e.showDetails?t("p",{staticClass:"caption text--secondary mb-2",staticStyle:{"white-space":"pre-line"},domProps:{innerHTML:e._s(e.message)}}):e._e(),t("p",{staticClass:"caption mb-0"},[t("span",{staticClass:"font-weight-bold text-decoration-none white--text"},[e._v(" "+e._s(e.author)+" ")]),t("span",[e._v(e._s(e.commitFormatDate))])])]),t(b,{staticClass:"col-auto pt-0 pt-sm-4"},[t($s,{attrs:{outlined:"",label:"",small:"",href:e.commitHref,target:"_blank"}},[e._v(" "+e._s(e.commitShortSha)+" ")])],1)],1)],1)},mV=[],hV=E(Ea,dV,mV,!1,null,"92f7e2cd");const By=hV.exports;var pV=Object.defineProperty,fV=Object.getOwnPropertyDescriptor,Kf=(s,e,t,r)=>{for(var i=r>1?void 0:r?fV(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&pV(e,t,i),i};let La=class extends k(L){get groupedCommitsDate(){return new Date(this.groupedCommits.date).toLocaleDateString(this.browserLocale,{year:"numeric",month:"short",day:"numeric"})}};Kf([w({required:!0})],La.prototype,"groupedCommits",2);Kf([w({required:!0})],La.prototype,"repo",2);La=Kf([S({components:{Panel:U,GitCommitsListDayCommit:By}})],La);var gV=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(Zn,{staticClass:"git-commit-list-day",attrs:{small:""}},[t(x,{staticClass:"pt-0"},[t(b,{staticClass:"pr-12"},[t("h3",{staticClass:"caption"},[e._v(" "+e._s(e.$t("Machine.UpdatePanel.CommitsOnDate",{date:e.groupedCommitsDate}))+" ")]),t("ul",{staticClass:"commits mt-3 pl-0"},e._l(e.groupedCommits.commits,function(r){return t(By,{key:r.sha,attrs:{commit:r,repo:e.repo}})}),1)])],1)],1)],1)},_V=[],vV=E(La,gV,_V,!1,null,"16ae9399");const uo=vV.exports;var bV=Object.defineProperty,yV=Object.getOwnPropertyDescriptor,Qf=(s,e,t,r)=>{for(var i=r>1?void 0:r?yV(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&bV(e,t,i),i};let Aa=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiAlertCircle=U_,this.mdiEye=Nw,this.mdiOpenInNew=gv}get name(){var s,e;return(e=(s=this.repo)==null?void 0:s.name)!=null?e:"UNKNOWN"}get formatName(){return lr(this.name)}get configured_type(){var s,e;return(e=(s=this.repo)==null?void 0:s.configured_type)!=null?e:"UNKNOWN"}get description1(){return this.name==="klipper"?this.$t("Machine.UpdatePanel.KlipperUpdateQuestionFirmware"):this.name==="moonraker"?this.$t("Machine.UpdatePanel.MoonrakerUpdateQuestion"):this.configured_type==="web"?this.$t("Machine.UpdatePanel.WebClientUpdateQuestion"):this.$t("Machine.UpdatePanel.GenericUpdateQuestion")}get description2(){return this.name==="klipper"?this.$t("Machine.UpdatePanel.KlipperUpdateQuestionConfig"):null}get repo_name(){var s,e;return(e=(s=this.repo.repo_name)!=null?s:this.repo.name)!=null?e:""}get externalLink(){var s;return this.name==="klipper"?"//www.klipper3d.org/Config_Changes.html":this.name==="moonraker"?"//moonraker.readthedocs.io/en/latest/changelog/":((s=this.repo)==null?void 0:s.configured_type)==="web"?"//github.com/".concat(this.repo.owner,"/").concat(this.repo_name,"/releases/tag/").concat(this.repo.remote_version):"//github.com/".concat(this.repo.owner,"/").concat(this.repo_name)}get externalLinkText(){return["klipper","moonraker"].includes(this.name)?this.$t("Machine.UpdatePanel.ConfigChanges"):this.$t("Machine.UpdatePanel.GitHubPage")}openCommitHistory(){this.$emit("open-commit-history")}};Qf([w({required:!0})],Aa.prototype,"repo",2);Qf([w({required:!1,default:!1})],Aa.prototype,"boolTitle",2);Aa=Qf([S({components:{GitCommitsListDay:uo,Panel:U}})],Aa);var CV=function(){var r;var e=this,t=e._self._c;return e._self._setupProxy,t(it,{attrs:{text:"",dense:"",border:"left",color:"orange",icon:e.mdiAlertCircle}},[e.boolTitle?[t("strong",[e._v(e._s(e.$t("Machine.UpdatePanel.UpdateWarning",{name:e.formatName})))]),t("br")]:e._e(),e.description1?t("p",[e._v(e._s(e.description1))]):e._e(),e.description2?t("p",[e._v(e._s(e.description2))]):e._e(),t("div",{staticClass:"text-center"},[e.configured_type==="git_repo"&&((r=e.repo.commits_behind)!=null&&r.length)?t(g,{staticClass:"mx-2 mt-3 mt-sm-0",on:{click:e.openCommitHistory}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiEye))]),e._v(" "+e._s(e.$t("Machine.UpdatePanel.CommitHistory"))+" ")],1):e._e(),e.externalLink?t(g,{staticClass:"mx-2 mt-3 mt-sm-0",attrs:{href:e.externalLink,target:"_blank"}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiOpenInNew))]),e._v(" "+e._s(e.externalLinkText)+" ")],1):e._e()],1)],2)},$V=[],xV=E(Aa,CV,$V,!1,null,null);const sd=xV.exports;var wV=Object.defineProperty,SV=Object.getOwnPropertyDescriptor,eg=(s,e,t,r)=>{for(var i=r>1?void 0:r?SV(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&wV(e,t,i),i};let Fa=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiProgressQuestion=bv,this.checkboxUpdateQuestion=!1}doUpdate(){this.$emit("do-update")}openCommitHistory(){this.$emit("open-commit-history")}closeDialog(){this.$emit("close-dialog")}};eg([w({required:!0})],Fa.prototype,"boolShowDialog",2);eg([w({required:!0})],Fa.prototype,"repo",2);Fa=eg([S({components:{GitCommitsListDay:uo,Panel:U,UpdateHintAlert:sd}})],Fa);var PV=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{persistent:"","max-width":"600"},model:{value:e.boolShowDialog,callback:function(r){e.boolShowDialog=r},expression:"boolShowDialog"}},[t(U,{attrs:{title:e.$t("Machine.UpdatePanel.AreYouSure"),icon:e.mdiProgressQuestion,"margin-bottom":!1,"card-class":"machine-update-hint-dialog"},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(x,[t(b,[t(sd,{attrs:{repo:e.repo},on:{"open-commit-history":e.openCommitHistory}}),t("div",[t(ge,{attrs:{label:e.$t("Machine.UpdatePanel.IUnderstandTheRisks"),"hide-details":""},model:{value:e.checkboxUpdateQuestion,callback:function(r){e.checkboxUpdateQuestion=r},expression:"checkboxUpdateQuestion"}})],1)],1)],1)],1),t(I),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Machine.UpdatePanel.Abort")))]),t(g,{attrs:{text:"",color:"primary",disabled:!e.checkboxUpdateQuestion},on:{click:e.doUpdate}},[e._v(" "+e._s(e.$t("Machine.UpdatePanel.StartUpdate"))+" ")])],1)],1)],1)},DV=[],TV=E(Fa,PV,DV,!1,null,null);const Uy=TV.exports;var OV=Object.defineProperty,MV=Object.getOwnPropertyDescriptor,tg=(s,e,t,r)=>{for(var i=r>1?void 0:r?MV(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&OV(e,t,i),i};let Ra=class extends k(L){constructor(){super(...arguments),this.mdiUpdate=Xa,this.mdiCloseThick=pe}get commitsBehind(){var s,e;return(e=(s=this.repo)==null?void 0:s.commits_behind)!=null?e:[]}get groupedCommits(){let s=[],e=null;return this.commitsBehind.forEach(t=>{var n;const r=new Date(((n=e==null?void 0:e.date)!=null?n:0)*1e3),i=new Date(t.date*1e3);(i.getFullYear()!==r.getFullYear()||i.getMonth()!==r.getMonth()||i.getDate()!==r.getDate())&&s.push({date:i,commits:[]}),s[s.length-1].commits.push(t),e=t}),s}get displayFullHistoryWaring(){return this.commitsBehind.length>=30}get lastCommit(){return this.commitsBehind.slice(-1)[0]}get linkToGithub(){var s,e,t,r;return"https://github.com/".concat((s=this.repo)==null?void 0:s.owner,"/").concat((e=this.repo)==null?void 0:e.repo_name,"/commits/").concat((t=this.repo)==null?void 0:t.branch,"/?after=").concat((r=this.lastCommit)==null?void 0:r.sha,"+0")}get overlayScrollbarsStyle(){return this.isMobile?{height:"calc(100vh - 48px)"}:{height:"400px"}}get timelineClassName(){return this.isMobile?["groupedCommits","mobile"]:["groupedCommits"]}closeDialog(){this.$emit("close-dialog")}};tg([w({required:!0})],Ra.prototype,"boolShowDialog",2);tg([w({required:!0})],Ra.prototype,"repo",2);Ra=tg([S({components:{GitCommitsListDay:uo,Panel:U}})],Ra);var kV=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{persistent:"","max-width":800,fullscreen:e.isMobile},model:{value:e.boolShowDialog,callback:function(r){e.boolShowDialog=r},expression:"boolShowDialog"}},[t(U,{attrs:{title:e.$t("Machine.UpdatePanel.Commits"),icon:e.mdiUpdate,"margin-bottom":!1,"card-class":"machine-update-commits-dialog"},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"py-0 px-0"},[t("overlay-scrollbars",{style:e.overlayScrollbarsStyle,attrs:{options:{overflowBehavior:{x:"hidden"}}}},[t(M_,{class:e.timelineClassName,staticStyle:{"min-height":"100%"},attrs:{"align-top":"",dense:""}},[e._l(e.groupedCommits,function(r){return t(uo,{key:r.date.getTime(),attrs:{repo:e.repo,"grouped-commits":r}})}),e.displayFullHistoryWaring?t(Zn,{staticClass:"git-commit-list-day git-commit-list-warning",attrs:{small:""}},[t(x,{staticClass:"pt-0"},[t(b,{staticClass:"pr-12"},[t(it,{attrs:{dense:"",text:"",type:"info"}},[t("p",[e._v(e._s(e.$t("Machine.UpdatePanel.MoreCommitsInfo")))]),t("div",{staticClass:"text-center mb-3"},[t(g,{attrs:{href:e.linkToGithub,target:"_blank"}},[e._v(" "+e._s(e.$t("Machine.UpdatePanel.LinkToGithub"))+" ")])],1)])],1)],1)],1):e._e()],2)],1)],1)],1)],1)},EV=[],LV=E(Ra,kV,EV,!1,null,"d66de5bf");const sg=LV.exports;var Wh={exports:{}};const AV="2.0.0",Wy=256,FV=Number.MAX_SAFE_INTEGER||9007199254740991,RV=16,HV=Wy-6,jV=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var rd={MAX_LENGTH:Wy,MAX_SAFE_COMPONENT_LENGTH:RV,MAX_SAFE_BUILD_LENGTH:HV,MAX_SAFE_INTEGER:FV,RELEASE_TYPES:jV,SEMVER_SPEC_VERSION:AV,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Xd={};const IV=typeof process=="object"&&Xd&&Xd.NODE_DEBUG&&/\bsemver\b/i.test(Xd.NODE_DEBUG)?(...s)=>console.error("SEMVER",...s):()=>{};var id=IV;(function(s,e){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=rd,n=id;e=s.exports={};const a=e.re=[],o=e.safeRe=[],l=e.src=[],u=e.safeSrc=[],c=e.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[m,r]],f=v=>{for(const[C,P]of h)v=v.split("".concat(C,"*")).join("".concat(C,"{0,").concat(P,"}")).split("".concat(C,"+")).join("".concat(C,"{1,").concat(P,"}"));return v},p=(v,C,P)=>{const M=f(C),F=d++;n(v,F,C),c[v]=F,l[F]=C,u[F]=M,a[F]=new RegExp(C,P?"g":void 0),o[F]=new RegExp(M,P?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-]".concat(m,"*")),p("MAINVERSION","(".concat(l[c.NUMERICIDENTIFIER],")\\.")+"(".concat(l[c.NUMERICIDENTIFIER],")\\.")+"(".concat(l[c.NUMERICIDENTIFIER],")")),p("MAINVERSIONLOOSE","(".concat(l[c.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(l[c.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(l[c.NUMERICIDENTIFIERLOOSE],")")),p("PRERELEASEIDENTIFIER","(?:".concat(l[c.NUMERICIDENTIFIER],"|").concat(l[c.NONNUMERICIDENTIFIER],")")),p("PRERELEASEIDENTIFIERLOOSE","(?:".concat(l[c.NUMERICIDENTIFIERLOOSE],"|").concat(l[c.NONNUMERICIDENTIFIER],")")),p("PRERELEASE","(?:-(".concat(l[c.PRERELEASEIDENTIFIER],"(?:\\.").concat(l[c.PRERELEASEIDENTIFIER],")*))")),p("PRERELEASELOOSE","(?:-?(".concat(l[c.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(l[c.PRERELEASEIDENTIFIERLOOSE],")*))")),p("BUILDIDENTIFIER","".concat(m,"+")),p("BUILD","(?:\\+(".concat(l[c.BUILDIDENTIFIER],"(?:\\.").concat(l[c.BUILDIDENTIFIER],")*))")),p("FULLPLAIN","v?".concat(l[c.MAINVERSION]).concat(l[c.PRERELEASE],"?").concat(l[c.BUILD],"?")),p("FULL","^".concat(l[c.FULLPLAIN],"$")),p("LOOSEPLAIN","[v=\\s]*".concat(l[c.MAINVERSIONLOOSE]).concat(l[c.PRERELEASELOOSE],"?").concat(l[c.BUILD],"?")),p("LOOSE","^".concat(l[c.LOOSEPLAIN],"$")),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE","".concat(l[c.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),p("XRANGEIDENTIFIER","".concat(l[c.NUMERICIDENTIFIER],"|x|X|\\*")),p("XRANGEPLAIN","[v=\\s]*(".concat(l[c.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(l[c.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(l[c.XRANGEIDENTIFIER],")")+"(?:".concat(l[c.PRERELEASE],")?").concat(l[c.BUILD],"?")+")?)?"),p("XRANGEPLAINLOOSE","[v=\\s]*(".concat(l[c.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(l[c.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(l[c.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(l[c.PRERELEASELOOSE],")?").concat(l[c.BUILD],"?")+")?)?"),p("XRANGE","^".concat(l[c.GTLT],"\\s*").concat(l[c.XRANGEPLAIN],"$")),p("XRANGELOOSE","^".concat(l[c.GTLT],"\\s*").concat(l[c.XRANGEPLAINLOOSE],"$")),p("COERCEPLAIN","(^|[^\\d])(\\d{1,".concat(t,"})")+"(?:\\.(\\d{1,".concat(t,"}))?")+"(?:\\.(\\d{1,".concat(t,"}))?")),p("COERCE","".concat(l[c.COERCEPLAIN],"(?:$|[^\\d])")),p("COERCEFULL",l[c.COERCEPLAIN]+"(?:".concat(l[c.PRERELEASE],")?")+"(?:".concat(l[c.BUILD],")?")+"(?:$|[^\\d])"),p("COERCERTL",l[c.COERCE],!0),p("COERCERTLFULL",l[c.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM","(\\s*)".concat(l[c.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",p("TILDE","^".concat(l[c.LONETILDE]).concat(l[c.XRANGEPLAIN],"$")),p("TILDELOOSE","^".concat(l[c.LONETILDE]).concat(l[c.XRANGEPLAINLOOSE],"$")),p("LONECARET","(?:\\^)"),p("CARETTRIM","(\\s*)".concat(l[c.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",p("CARET","^".concat(l[c.LONECARET]).concat(l[c.XRANGEPLAIN],"$")),p("CARETLOOSE","^".concat(l[c.LONECARET]).concat(l[c.XRANGEPLAINLOOSE],"$")),p("COMPARATORLOOSE","^".concat(l[c.GTLT],"\\s*(").concat(l[c.LOOSEPLAIN],")$|^$")),p("COMPARATOR","^".concat(l[c.GTLT],"\\s*(").concat(l[c.FULLPLAIN],")$|^$")),p("COMPARATORTRIM","(\\s*)".concat(l[c.GTLT],"\\s*(").concat(l[c.LOOSEPLAIN],"|").concat(l[c.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE","^\\s*(".concat(l[c.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(l[c.XRANGEPLAIN],")")+"\\s*$"),p("HYPHENRANGELOOSE","^\\s*(".concat(l[c.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(l[c.XRANGEPLAINLOOSE],")")+"\\s*$"),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Wh,Wh.exports);var mo=Wh.exports;const NV=Object.freeze({loose:!0}),VV=Object.freeze({}),BV=s=>s?typeof s!="object"?NV:s:VV;var rg=BV;const f1=/^[0-9]+$/,zy=(s,e)=>{const t=f1.test(s),r=f1.test(e);return t&&r&&(s=+s,e=+e),s===e?0:t&&!r?-1:r&&!t?1:szy(e,s);var Gy={compareIdentifiers:zy,rcompareIdentifiers:UV};const Oo=id,{MAX_LENGTH:g1,MAX_SAFE_INTEGER:Mo}=rd,{safeRe:_1,safeSrc:v1,t:ko}=mo,WV=rg,{compareIdentifiers:di}=Gy;let zV=class Cs{constructor(e,t){if(t=WV(t),e instanceof Cs){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError('Invalid version. Must be a string. Got type "'.concat(typeof e,'".'));if(e.length>g1)throw new TypeError("version is longer than ".concat(g1," characters"));Oo("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?_1[ko.LOOSE]:_1[ko.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Mo||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Mo||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Mo||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const n=+i;if(n>=0&&n=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let n=[t,i];r===!1&&(n=[t]),di(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error("invalid increment argument: ".concat(e))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}};var St=zV;const b1=St,GV=(s,e,t=!1)=>{if(s instanceof b1)return s;try{return new b1(s,e)}catch(r){if(!t)return null;throw r}};var fn=GV;const ZV=fn,qV=(s,e)=>{const t=ZV(s,e);return t?t.version:null};var XV=qV;const YV=fn,JV=(s,e)=>{const t=YV(s.trim().replace(/^[=v]+/,""),e);return t?t.version:null};var KV=JV;const y1=St,QV=(s,e,t,r,i)=>{typeof t=="string"&&(i=r,r=t,t=void 0);try{return new y1(s instanceof y1?s.version:s,t).inc(e,r,i).version}catch{return null}};var eB=QV;const C1=fn,tB=(s,e)=>{const t=C1(s,null,!0),r=C1(e,null,!0),i=t.compare(r);if(i===0)return null;const n=i>0,a=n?t:r,o=n?r:t,l=!!a.prerelease.length;if(!!o.prerelease.length&&!l){if(!o.patch&&!o.minor)return"major";if(o.compareMain(a)===0)return o.minor&&!o.patch?"minor":"patch"}const c=l?"pre":"";return t.major!==r.major?c+"major":t.minor!==r.minor?c+"minor":t.patch!==r.patch?c+"patch":"prerelease"};var sB=tB;const rB=St,iB=(s,e)=>new rB(s,e).major;var nB=iB;const aB=St,oB=(s,e)=>new aB(s,e).minor;var lB=oB;const cB=St,uB=(s,e)=>new cB(s,e).patch;var dB=uB;const mB=fn,hB=(s,e)=>{const t=mB(s,e);return t&&t.prerelease.length?t.prerelease:null};var pB=hB;const $1=St,fB=(s,e,t)=>new $1(s,t).compare(new $1(e,t));var ps=fB;const gB=ps,_B=(s,e,t)=>gB(e,s,t);var vB=_B;const bB=ps,yB=(s,e)=>bB(s,e,!0);var CB=yB;const x1=St,$B=(s,e,t)=>{const r=new x1(s,t),i=new x1(e,t);return r.compare(i)||r.compareBuild(i)};var ig=$B;const xB=ig,wB=(s,e)=>s.sort((t,r)=>xB(t,r,e));var SB=wB;const PB=ig,DB=(s,e)=>s.sort((t,r)=>PB(r,t,e));var TB=DB;const OB=ps,MB=(s,e,t)=>OB(s,e,t)>0;var nd=MB;const kB=ps,EB=(s,e,t)=>kB(s,e,t)<0;var ng=EB;const LB=ps,AB=(s,e,t)=>LB(s,e,t)===0;var Zy=AB;const FB=ps,RB=(s,e,t)=>FB(s,e,t)!==0;var qy=RB;const HB=ps,jB=(s,e,t)=>HB(s,e,t)>=0;var ag=jB;const IB=ps,NB=(s,e,t)=>IB(s,e,t)<=0;var og=NB;const VB=Zy,BB=qy,UB=nd,WB=ag,zB=ng,GB=og,ZB=(s,e,t,r)=>{switch(e){case"===":return typeof s=="object"&&(s=s.version),typeof t=="object"&&(t=t.version),s===t;case"!==":return typeof s=="object"&&(s=s.version),typeof t=="object"&&(t=t.version),s!==t;case"":case"=":case"==":return VB(s,t,r);case"!=":return BB(s,t,r);case">":return UB(s,t,r);case">=":return WB(s,t,r);case"<":return zB(s,t,r);case"<=":return GB(s,t,r);default:throw new TypeError("Invalid operator: ".concat(e))}};var Xy=ZB;const qB=St,XB=fn,{safeRe:Eo,t:Lo}=mo,YB=(s,e)=>{if(s instanceof qB)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;e=e||{};let t=null;if(!e.rtl)t=s.match(e.includePrerelease?Eo[Lo.COERCEFULL]:Eo[Lo.COERCE]);else{const l=e.includePrerelease?Eo[Lo.COERCERTLFULL]:Eo[Lo.COERCERTL];let u;for(;(u=l.exec(s))&&(!t||t.index+t[0].length!==s.length);)(!t||u.index+u[0].length!==t.index+t[0].length)&&(t=u),l.lastIndex=u.index+u[1].length+u[2].length;l.lastIndex=-1}if(t===null)return null;const r=t[2],i=t[3]||"0",n=t[4]||"0",a=e.includePrerelease&&t[5]?"-".concat(t[5]):"",o=e.includePrerelease&&t[6]?"+".concat(t[6]):"";return XB("".concat(r,".").concat(i,".").concat(n).concat(a).concat(o),e)};var JB=YB;class KB{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}}var QB=KB,Yd,w1;function fs(){if(w1)return Yd;w1=1;const s=/\s+/g;class e{constructor(z,K){if(K=i(K),z instanceof e)return z.loose===!!K.loose&&z.includePrerelease===!!K.includePrerelease?z:new e(z.raw,K);if(z instanceof n)return this.raw=z.value,this.set=[[z]],this.formatted=void 0,this;if(this.options=K,this.loose=!!K.loose,this.includePrerelease=!!K.includePrerelease,this.raw=z.trim().replace(s," "),this.set=this.raw.split("||").map(Q=>this.parseRange(Q.trim())).filter(Q=>Q.length),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){const Q=this.set[0];if(this.set=this.set.filter(re=>!p(re[0])),this.set.length===0)this.set=[Q];else if(this.set.length>1){for(const re of this.set)if(re.length===1&&v(re[0])){this.set=[re];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let z=0;z0&&(this.formatted+="||");const K=this.set[z];for(let Q=0;Q0&&(this.formatted+=" "),this.formatted+=K[Q].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(z){const Q=((this.options.includePrerelease&&h)|(this.options.loose&&f))+":"+z,re=r.get(Q);if(re)return re;const R=this.options.loose,B=R?l[u.HYPHENRANGELOOSE]:l[u.HYPHENRANGE];z=z.replace(B,te(this.options.includePrerelease)),a("hyphen replace",z),z=z.replace(l[u.COMPARATORTRIM],c),a("comparator trim",z),z=z.replace(l[u.TILDETRIM],d),a("tilde trim",z),z=z.replace(l[u.CARETTRIM],m),a("caret trim",z);let T=z.split(" ").map(ie=>P(ie,this.options)).join(" ").split(/\s+/).map(ie=>G(ie,this.options));R&&(T=T.filter(ie=>(a("loose invalid filter",ie,this.options),!!ie.match(l[u.COMPARATORLOOSE])))),a("range list",T);const A=new Map,H=T.map(ie=>new n(ie,this.options));for(const ie of H){if(p(ie))return[ie];A.set(ie.value,ie)}A.size>1&&A.has("")&&A.delete("");const ee=[...A.values()];return r.set(Q,ee),ee}intersects(z,K){if(!(z instanceof e))throw new TypeError("a Range is required");return this.set.some(Q=>C(Q,K)&&z.set.some(re=>C(re,K)&&Q.every(R=>re.every(B=>R.intersects(B,K)))))}test(z){if(!z)return!1;if(typeof z=="string")try{z=new o(z,this.options)}catch{return!1}for(let K=0;Kq.value==="<0.0.0-0",v=q=>q.value==="",C=(q,z)=>{let K=!0;const Q=q.slice();let re=Q.pop();for(;K&&Q.length;)K=Q.every(R=>re.intersects(R,z)),re=Q.pop();return K},P=(q,z)=>(a("comp",q,z),q=$(q,z),a("caret",q),q=F(q,z),a("tildes",q),q=V(q,z),a("xrange",q),q=W(q,z),a("stars",q),q),M=q=>!q||q.toLowerCase()==="x"||q==="*",F=(q,z)=>q.trim().split(/\s+/).map(K=>O(K,z)).join(" "),O=(q,z)=>{const K=z.loose?l[u.TILDELOOSE]:l[u.TILDE];return q.replace(K,(Q,re,R,B,T)=>{a("tilde",q,Q,re,R,B,T);let A;return M(re)?A="":M(R)?A=">=".concat(re,".0.0 <").concat(+re+1,".0.0-0"):M(B)?A=">=".concat(re,".").concat(R,".0 <").concat(re,".").concat(+R+1,".0-0"):T?(a("replaceTilde pr",T),A=">=".concat(re,".").concat(R,".").concat(B,"-").concat(T," <").concat(re,".").concat(+R+1,".0-0")):A=">=".concat(re,".").concat(R,".").concat(B," <").concat(re,".").concat(+R+1,".0-0"),a("tilde return",A),A})},$=(q,z)=>q.trim().split(/\s+/).map(K=>D(K,z)).join(" "),D=(q,z)=>{a("caret",q,z);const K=z.loose?l[u.CARETLOOSE]:l[u.CARET],Q=z.includePrerelease?"-0":"";return q.replace(K,(re,R,B,T,A)=>{a("caret",q,re,R,B,T,A);let H;return M(R)?H="":M(B)?H=">=".concat(R,".0.0").concat(Q," <").concat(+R+1,".0.0-0"):M(T)?R==="0"?H=">=".concat(R,".").concat(B,".0").concat(Q," <").concat(R,".").concat(+B+1,".0-0"):H=">=".concat(R,".").concat(B,".0").concat(Q," <").concat(+R+1,".0.0-0"):A?(a("replaceCaret pr",A),R==="0"?B==="0"?H=">=".concat(R,".").concat(B,".").concat(T,"-").concat(A," <").concat(R,".").concat(B,".").concat(+T+1,"-0"):H=">=".concat(R,".").concat(B,".").concat(T,"-").concat(A," <").concat(R,".").concat(+B+1,".0-0"):H=">=".concat(R,".").concat(B,".").concat(T,"-").concat(A," <").concat(+R+1,".0.0-0")):(a("no pr"),R==="0"?B==="0"?H=">=".concat(R,".").concat(B,".").concat(T).concat(Q," <").concat(R,".").concat(B,".").concat(+T+1,"-0"):H=">=".concat(R,".").concat(B,".").concat(T).concat(Q," <").concat(R,".").concat(+B+1,".0-0"):H=">=".concat(R,".").concat(B,".").concat(T," <").concat(+R+1,".0.0-0")),a("caret return",H),H})},V=(q,z)=>(a("replaceXRanges",q,z),q.split(/\s+/).map(K=>N(K,z)).join(" ")),N=(q,z)=>{q=q.trim();const K=z.loose?l[u.XRANGELOOSE]:l[u.XRANGE];return q.replace(K,(Q,re,R,B,T,A)=>{a("xRange",q,Q,re,R,B,T,A);const H=M(R),ee=H||M(B),ie=ee||M(T),ue=ie;return re==="="&&ue&&(re=""),A=z.includePrerelease?"-0":"",H?re===">"||re==="<"?Q="<0.0.0-0":Q="*":re&&ue?(ee&&(B=0),T=0,re===">"?(re=">=",ee?(R=+R+1,B=0,T=0):(B=+B+1,T=0)):re==="<="&&(re="<",ee?R=+R+1:B=+B+1),re==="<"&&(A="-0"),Q="".concat(re+R,".").concat(B,".").concat(T).concat(A)):ee?Q=">=".concat(R,".0.0").concat(A," <").concat(+R+1,".0.0-0"):ie&&(Q=">=".concat(R,".").concat(B,".0").concat(A," <").concat(R,".").concat(+B+1,".0-0")),a("xRange return",Q),Q})},W=(q,z)=>(a("replaceStars",q,z),q.trim().replace(l[u.STAR],"")),G=(q,z)=>(a("replaceGTE0",q,z),q.trim().replace(l[z.includePrerelease?u.GTE0PRE:u.GTE0],"")),te=q=>(z,K,Q,re,R,B,T,A,H,ee,ie,ue)=>(M(Q)?K="":M(re)?K=">=".concat(Q,".0.0").concat(q?"-0":""):M(R)?K=">=".concat(Q,".").concat(re,".0").concat(q?"-0":""):B?K=">=".concat(K):K=">=".concat(K).concat(q?"-0":""),M(H)?A="":M(ee)?A="<".concat(+H+1,".0.0-0"):M(ie)?A="<".concat(H,".").concat(+ee+1,".0-0"):ue?A="<=".concat(H,".").concat(ee,".").concat(ie,"-").concat(ue):q?A="<".concat(H,".").concat(ee,".").concat(+ie+1,"-0"):A="<=".concat(A),"".concat(K," ").concat(A).trim()),X=(q,z,K)=>{for(let Q=0;Q0){const re=q[Q].semver;if(re.major===z.major&&re.minor===z.minor&&re.patch===z.patch)return!0}return!1}return!0};return Yd}var Jd,S1;function ad(){if(S1)return Jd;S1=1;const s=Symbol("SemVer ANY");class e{static get ANY(){return s}constructor(c,d){if(d=t(d),c instanceof e){if(c.loose===!!d.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),a("comparator",c,d),this.options=d,this.loose=!!d.loose,this.parse(c),this.semver===s?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(c){const d=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],m=c.match(d);if(!m)throw new TypeError("Invalid comparator: ".concat(c));this.operator=m[1]!==void 0?m[1]:"",this.operator==="="&&(this.operator=""),m[2]?this.semver=new o(m[2],this.options.loose):this.semver=s}toString(){return this.value}test(c){if(a("Comparator.test",c,this.options.loose),this.semver===s||c===s)return!0;if(typeof c=="string")try{c=new o(c,this.options)}catch{return!1}return n(c,this.operator,this.semver,this.options)}intersects(c,d){if(!(c instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(c.value,d).test(this.value):c.operator===""?c.value===""?!0:new l(this.value,d).test(c.semver):(d=t(d),d.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||n(this.semver,"<",c.semver,d)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||n(this.semver,">",c.semver,d)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}Jd=e;const t=rg,{safeRe:r,t:i}=mo,n=Xy,a=id,o=St,l=fs();return Jd}const eU=fs(),tU=(s,e,t)=>{try{e=new eU(e,t)}catch{return!1}return e.test(s)};var od=tU;const sU=fs(),rU=(s,e)=>new sU(s,e).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" "));var iU=rU;const nU=St,aU=fs(),oU=(s,e,t)=>{let r=null,i=null,n=null;try{n=new aU(e,t)}catch{return null}return s.forEach(a=>{n.test(a)&&(!r||i.compare(a)===-1)&&(r=a,i=new nU(r,t))}),r};var lU=oU;const cU=St,uU=fs(),dU=(s,e,t)=>{let r=null,i=null,n=null;try{n=new uU(e,t)}catch{return null}return s.forEach(a=>{n.test(a)&&(!r||i.compare(a)===1)&&(r=a,i=new cU(r,t))}),r};var mU=dU;const Kd=St,hU=fs(),P1=nd,pU=(s,e)=>{s=new hU(s,e);let t=new Kd("0.0.0");if(s.test(t)||(t=new Kd("0.0.0-0"),s.test(t)))return t;t=null;for(let r=0;r{const o=new Kd(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!n||P1(o,n))&&(n=o);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(a.operator))}}),n&&(!t||P1(t,n))&&(t=n)}return t&&s.test(t)?t:null};var fU=pU;const gU=fs(),_U=(s,e)=>{try{return new gU(s,e).range||"*"}catch{return null}};var vU=_U;const bU=St,Yy=ad(),{ANY:yU}=Yy,CU=fs(),$U=od,D1=nd,T1=ng,xU=og,wU=ag,SU=(s,e,t,r)=>{s=new bU(s,r),e=new CU(e,r);let i,n,a,o,l;switch(t){case">":i=D1,n=xU,a=T1,o=">",l=">=";break;case"<":i=T1,n=wU,a=D1,o="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if($U(s,e,r))return!1;for(let u=0;u{h.semver===yU&&(h=new Yy(">=0.0.0")),d=d||h,m=m||h,i(h.semver,d.semver,r)?d=h:a(h.semver,m.semver,r)&&(m=h)}),d.operator===o||d.operator===l||(!m.operator||m.operator===o)&&n(s,m.semver))return!1;if(m.operator===l&&a(s,m.semver))return!1}return!0};var lg=SU;const PU=lg,DU=(s,e,t)=>PU(s,e,">",t);var TU=DU;const OU=lg,MU=(s,e,t)=>OU(s,e,"<",t);var kU=MU;const O1=fs(),EU=(s,e,t)=>(s=new O1(s,t),e=new O1(e,t),s.intersects(e,t));var LU=EU;const AU=od,FU=ps;var RU=(s,e,t)=>{const r=[];let i=null,n=null;const a=s.sort((c,d)=>FU(c,d,t));for(const c of a)AU(c,e,t)?(n=c,i||(i=c)):(n&&r.push([i,n]),n=null,i=null);i&&r.push([i,null]);const o=[];for(const[c,d]of r)c===d?o.push(c):!d&&c===a[0]?o.push("*"):d?c===a[0]?o.push("<=".concat(d)):o.push("".concat(c," - ").concat(d)):o.push(">=".concat(c));const l=o.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return l.length{if(s===e)return!0;s=new M1(s,t),e=new M1(e,t);let r=!1;e:for(const i of s.set){for(const n of e.set){const a=IU(i,n,t);if(r=r||a!==null,a)continue e}if(r)return!1}return!0},jU=[new cg(">=0.0.0-0")],k1=[new cg(">=0.0.0")],IU=(s,e,t)=>{if(s===e)return!0;if(s.length===1&&s[0].semver===Qd){if(e.length===1&&e[0].semver===Qd)return!0;t.includePrerelease?s=jU:s=k1}if(e.length===1&&e[0].semver===Qd){if(t.includePrerelease)return!0;e=k1}const r=new Set;let i,n;for(const h of s)h.operator===">"||h.operator===">="?i=E1(i,h,t):h.operator==="<"||h.operator==="<="?n=L1(n,h,t):r.add(h.semver);if(r.size>1)return null;let a;if(i&&n){if(a=ug(i.semver,n.semver,t),a>0)return null;if(a===0&&(i.operator!==">="||n.operator!=="<="))return null}for(const h of r){if(i&&!Pn(h,String(i),t)||n&&!Pn(h,String(n),t))return null;for(const f of e)if(!Pn(h,String(f),t))return!1;return!0}let o,l,u,c,d=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,m=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&n.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(const h of e){if(c=c||h.operator===">"||h.operator===">=",u=u||h.operator==="<"||h.operator==="<=",i){if(m&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===m.major&&h.semver.minor===m.minor&&h.semver.patch===m.patch&&(m=!1),h.operator===">"||h.operator===">="){if(o=E1(i,h,t),o===h&&o!==i)return!1}else if(i.operator===">="&&!Pn(i.semver,String(h),t))return!1}if(n){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(l=L1(n,h,t),l===h&&l!==n)return!1}else if(n.operator==="<="&&!Pn(n.semver,String(h),t))return!1}if(!h.operator&&(n||i)&&a!==0)return!1}return!(i&&u&&!n&&a!==0||n&&c&&!i&&a!==0||m||d)},E1=(s,e,t)=>{if(!s)return e;const r=ug(s.semver,e.semver,t);return r>0?s:r<0||e.operator===">"&&s.operator===">="?e:s},L1=(s,e,t)=>{if(!s)return e;const r=ug(s.semver,e.semver,t);return r<0?s:r>0||e.operator==="<"&&s.operator==="<="?e:s};var NU=HU;const em=mo,A1=rd,VU=St,F1=Gy,BU=fn,UU=XV,WU=KV,zU=eB,GU=sB,ZU=nB,qU=lB,XU=dB,YU=pB,JU=ps,KU=vB,QU=CB,eW=ig,tW=SB,sW=TB,rW=nd,iW=ng,nW=Zy,aW=qy,oW=ag,lW=og,cW=Xy,uW=JB,dW=ad(),mW=fs(),hW=od,pW=iU,fW=lU,gW=mU,_W=fU,vW=vU,bW=lg,yW=TU,CW=kU,$W=LU,xW=RU,wW=NU;var SW={parse:BU,valid:UU,clean:WU,inc:zU,diff:GU,major:ZU,minor:qU,patch:XU,prerelease:YU,compare:JU,rcompare:KU,compareLoose:QU,compareBuild:eW,sort:tW,rsort:sW,gt:rW,lt:iW,eq:nW,neq:aW,gte:oW,lte:lW,cmp:cW,coerce:uW,Comparator:dW,Range:mW,satisfies:hW,toComparators:pW,maxSatisfying:fW,minSatisfying:gW,minVersion:_W,validRange:vW,outside:bW,gtr:yW,ltr:CW,intersects:$W,simplifyRange:xW,subset:wW,SemVer:VU,re:em.re,src:em.src,tokens:em.t,SEMVER_SPEC_VERSION:A1.SEMVER_SPEC_VERSION,RELEASE_TYPES:A1.RELEASE_TYPES,compareIdentifiers:F1.compareIdentifiers,rcompareIdentifiers:F1.rcompareIdentifiers};const nt=en(SW);var PW=Object.defineProperty,DW=Object.getOwnPropertyDescriptor,Jy=(s,e,t,r)=>{for(var i=r>1?void 0:r?DW(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&PW(e,t,i),i};let Ec=class extends k(L){constructor(){super(...arguments),this.mdiInformation=Ht,this.mdiMenuDown=gr,this.mdiReload=vS,this.mdiCloseCircle=ol,this.mdiUpdate=Xa,this.mdiInformationOutline=ov,this.boolShowCommitList=!1,this.boolShowUpdateHint=!1,this.toggleAnomalies=!1}get name(){var r,i;const t=((r=this.repo.info_tags)!=null?r:[]).find(n=>n.startsWith("desc="));return t&&t.trim()!=="desc="?t.replace("desc=","").trim():(i=this.repo.name)!=null?i:"UNKNOWN"}get type(){return this.repo.configured_type}get localVersion(){var t;const e=(t=this.repo.version)!=null?t:"?";return nt.valid(e,{loose:!0})?e:null}get remoteVersion(){var t;const e=(t=this.repo.remote_version)!=null?t:"?";return nt.valid(e,{loose:!0})?e:null}get branch(){var e;return(e=this.repo.branch)!=null?e:"master"}get remoteAlias(){var e;return(e=this.repo.remote_alias)!=null?e:"origin"}get branchOutput(){return this.remoteAlias!=="origin"?"".concat(this.remoteAlias,"/").concat(this.branch):["master","main"].includes(this.branch)?null:this.branch}get commitsBehind(){var e;return(e=this.repo.commits_behind)!=null?e:[]}get fullVersionString(){var e;return(e=this.repo.full_version_string)!=null?e:null}get versionOutput(){let e=this.branchOutput?"".concat(this.branchOutput,": "):"";if(this.semverUpdatable)return"".concat(e).concat(this.localVersion," > ").concat(this.remoteVersion);if(this.commitsBehind.length){const t=this.$tc("Machine.UpdatePanel.CommitsAvailable",this.commitsBehind.length,{count:this.commitsBehind.length}).toString();return this.localVersion?"".concat(e).concat(this.localVersion," > ").concat(t):"".concat(e).concat(t)}return this.fullVersionString?this.fullVersionString:this.localVersion?this.localVersion:"UNKNOWN"}get configuredType(){var e;return(e=this.repo.configured_type)!=null?e:"git_repo"}get isValid(){var e;return(e=this.repo.is_valid)!=null?e:!0}get isDirty(){var e;return(e=this.repo.is_dirty)!=null?e:!1}get isCorrupt(){var e;return this.configuredType!=="git_repo"?!1:(e=this.repo.corrupt)!=null?e:!1}get debugEnabled(){var e;return(e=this.repo.debug_enabled)!=null?e:!1}get isDetached(){var e;return this.configuredType!=="git_repo"?!1:!this.debugEnabled&&((e=this.repo.detached)!=null?e:!1)}get existsRecoveryUrl(){var t;return((t=this.repo.recovery_url)!=null?t:"?")!=="?"}get btnDisabled(){return["printing","paused"].includes(this.printer_state)?!0:!this.isValid||this.isCorrupt||this.isDirty||this.commitsBehind.length?!1:["python","web"].includes(this.type)?!this.semverUpdatable:this.commitsBehind.length===0}get btnIcon(){if(this.isDetached||!this.isValid||this.isCorrupt||this.isDirty)return ol;if(["python","web"].includes(this.type)){if(this.semverUpdatable)return ll;if(this.localVersion===null||this.remoteVersion===null)return iv}return this.type==="git_repo"&&this.commitsBehind.length?ll:q_}get btnColor(){return this.isCorrupt||this.isDetached||this.isDirty||!this.isValid?"orange":["python","web"].includes(this.type)&&this.semverUpdatable||this.type==="git_repo"&&this.commitsBehind.length?"primary":"green"}get btnText(){if(this.isCorrupt)return this.$t("Machine.UpdatePanel.Corrupt");if(this.isDetached)return this.$t("Machine.UpdatePanel.Detached");if(this.isDirty)return this.$t("Machine.UpdatePanel.Dirty");if(!this.isValid)return this.$t("Machine.UpdatePanel.Invalid");if(["python","web"].includes(this.type)){if(this.semverUpdatable)return this.$t("Machine.UpdatePanel.Update");if(this.localVersion===null||this.remoteVersion===null)return this.$t("Machine.UpdatePanel.Unknown")}return this.type==="git_repo"&&this.commitsBehind.length?this.$t("Machine.UpdatePanel.Update"):this.$t("Machine.UpdatePanel.UpToDate")}get anomalies(){var e;return(e=this.repo.anomalies)!=null?e:[]}get warnings(){var e;return(e=this.repo.warnings)!=null?e:[]}get semverUpdatable(){return!this.localVersion||!this.remoteVersion?!1:nt.gt(this.remoteVersion,this.localVersion,{loose:!0})}get repo_name(){var e,t;return(t=(e=this.repo.repo_name)!=null?e:this.repo.name)!=null?t:""}get githubRepoUrl(){return"https://github.com/".concat(this.repo.owner,"/").concat(this.repo_name)}get webLinkRelease(){return"".concat(this.githubRepoUrl,"/releases/tag/").concat(this.repo.remote_version)}get pythonChangelog(){return this.repo.channel==="dev"?"".concat(this.githubRepoUrl,"/compare/").concat(this.repo.current_hash,"..").concat(this.repo.remote_hash):this.repo.changelog_url?this.repo.changelog_url:this.webLinkRelease}get hideUpdateWarning(){var e;return(e=this.$store.state.gui.uiSettings.hideUpdateWarnings)!=null?e:!1}clickUpdate(){if(this.hideUpdateWarning){this.doUpdate();return}this.boolShowUpdateHint=!0}doUpdate(){if(["klipper","moonraker"].includes(this.repo.name)){this.$socket.emit("machine.update."+this.repo.name,{});return}this.$socket.emit("machine.update.client",{name:this.repo.name})}doRecovery(e){this.$socket.emit("machine.update.recover",{name:this.repo.name,hard:e})}closeCommitList(){this.boolShowCommitList=!1}closeShowUpdateHint(){this.boolShowUpdateHint=!1}};Jy([w({required:!0})],Ec.prototype,"repo",2);Ec=Jy([S({components:{GitCommitsList:sg,UpdateHint:Uy}})],Ec);var TW=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(x,{staticClass:"py-2"},[t(b,{staticClass:"pl-6"},[t("strong",[e._v(e._s(e.name))]),t("br"),e.type==="git_repo"&&e.commitsBehind.length?[t("a",{staticClass:"info--text cursor--pointer",on:{click:function(r){e.boolShowCommitList=!0}}},[t(_,{staticClass:"mr-1",attrs:{small:"",color:"info"}},[e._v(e._s(e.mdiUpdate))]),e._v(" "+e._s(e.versionOutput)+" ")],1)]:e.type==="web"&&e.semverUpdatable?[t("a",{staticClass:"info--text text-decoration-none",attrs:{href:e.webLinkRelease,target:"_blank"}},[t(_,{staticClass:"mr-1",attrs:{small:"",color:"info"}},[e._v(e._s(e.mdiUpdate))]),e._v(" "+e._s(e.versionOutput)+" ")],1)]:e.type==="python"&&e.semverUpdatable?[t("a",{staticClass:"info--text text-decoration-none",attrs:{href:e.pythonChangelog,target:"_blank"}},[t(_,{staticClass:"mr-1",attrs:{small:"",color:"info"}},[e._v(e._s(e.mdiUpdate))]),e._v(" "+e._s(e.versionOutput)+" ")],1)]:t("span",[e._v(e._s(e.versionOutput))])],2),t(b,{staticClass:"col-auto pr-6 text-right",attrs:{"align-self":"center"}},[e.anomalies.length>0?t($s,{staticClass:"minwidth-0 px-1 mr-2",attrs:{small:"",label:"",outlined:!e.toggleAnomalies,color:"grey"},on:{click:function(r){e.toggleAnomalies=!e.toggleAnomalies}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.toggleAnomalies?e.mdiInformationOutline:e.mdiInformation))])],1):e._e(),e.isValid?t($s,{staticClass:"minwidth-0 px-2 text-uppercase",attrs:{small:"",label:"",outlined:"",color:e.btnColor,disabled:e.btnDisabled},on:{click:e.clickUpdate}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.btnIcon))]),e._v(" "+e._s(e.btnText)+" ")],1):[t(ye,{attrs:{"offset-y":!0},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t($s,e._g(e._b({staticClass:"minwidth-0 px-2 text-uppercase",attrs:{small:"",label:"",outlined:"",color:e.btnColor,disabled:e.btnDisabled}},"v-chip",i,!1),r),[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.btnIcon))]),e._v(" "+e._s(e.btnText)+" "),t(_,{attrs:{small:""}},[e._v(e._s(e.mdiMenuDown))])],1)]}}],null,!1,56479232)},[t(Me,{staticClass:"py-0",attrs:{dense:""}},[e.isCorrupt?e._e():t(J,{on:{click:function(r){return e.doRecovery(!1)}}},[t(Hs,{staticClass:"mr-0 pt-1"},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiReload))])],1),t(_t,[t(Ze,[e._v(e._s(e.$t("Machine.UpdatePanel.SoftRecovery")))])],1)],1),t(J,{attrs:{disabled:!e.existsRecoveryUrl},on:{click:function(r){return e.doRecovery(!0)}}},[t(Hs,{staticClass:"mr-0 pt-1"},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiReload))])],1),t(_t,[t(Ze,[e._v(e._s(e.$t("Machine.UpdatePanel.HardRecovery")))])],1)],1)],1)],1)]],2)],1),e.warnings.length?t(x,{staticClass:"mt-0"},[t(b,{staticClass:"px-6 pt-0"},e._l(e.warnings,function(r,i){return t(it,{key:"warnings_"+i,attrs:{dense:"",text:"",color:"orange",border:"left",icon:e.mdiCloseCircle}},[t("p",{staticClass:"text--disabled mb-0"},[e._v(e._s(r))])])}),1)],1):e._e(),t(x,{directives:[{name:"show",rawName:"v-show",value:e.toggleAnomalies,expression:"toggleAnomalies"}],staticClass:"mt-0"},[t(b,{staticClass:"px-6 pt-0"},e._l(e.anomalies,function(r,i){return t(it,{key:"anomalies_"+i,attrs:{dense:"",text:"",color:"grey",border:"left",icon:e.mdiInformation}},[e._v(" "+e._s(r)+" ")])}),1)],1),e.type==="git_repo"?t(sg,{attrs:{"bool-show-dialog":e.boolShowCommitList,repo:e.repo},on:{"close-dialog":e.closeCommitList}}):e._e(),t(Uy,{attrs:{"bool-show-dialog":e.boolShowUpdateHint,repo:e.repo},on:{"open-commit-history":function(r){e.boolShowCommitList=!0},"do-update":e.doUpdate,"close-dialog":e.closeShowUpdateHint}})],1)},OW=[],MW=E(Ec,TW,OW,!1,null,"d5c4f3f3");const kW=MW.exports;var EW=Object.defineProperty,LW=Object.getOwnPropertyDescriptor,dg=(s,e,t,r)=>{for(var i=r>1?void 0:r?LW(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&EW(e,t,i),i};let Ha=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiPackageVariantClosed=uS}closeDialog(){this.$emit("close-dialog")}};dg([w({required:!0})],Ha.prototype,"boolShowDialog",2);dg([w({required:!0})],Ha.prototype,"packagesList",2);Ha=dg([S({components:{Panel:U}})],Ha);var AW=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{persistent:"","max-width":"800"},model:{value:e.boolShowDialog,callback:function(r){e.boolShowDialog=r},expression:"boolShowDialog"}},[t(U,{attrs:{title:e.$t("Machine.UpdatePanel.UpgradeableSystemPackages"),icon:e.mdiPackageVariantClosed,"margin-bottom":!1,"card-class":"machine-update-system-packages-list-dialog"},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(x,[t(b,[t("p",[e._v(e._s(e.$t("Machine.UpdatePanel.ThesePackagesCanBeUpgrade")))]),t("p",{staticClass:"system-packages-list"},[e._v(e._s(e.packagesList.join(", ")))])])],1)],1),t(oe,[t(ae),t(g,{attrs:{text:"",color:"primary"},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Machine.UpdatePanel.Close")))])],1)],1)],1)},FW=[],RW=E(Ha,AW,FW,!1,null,"3976e09a");const HW=RW.exports;var jW=Object.getOwnPropertyDescriptor,IW=(s,e,t,r)=>{for(var i=r>1?void 0:r?jW(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let zh=class extends k(L){constructor(){super(...arguments),this.mdiInformation=Ht,this.boolShowPackageList=!1}get package_count(){var e,t,r;return(r=(t=(e=this.$store.state.server.updateManager)==null?void 0:e.system)==null?void 0:t.package_count)!=null?r:0}get package_list(){var e,t,r;return(r=(t=(e=this.$store.state.server.updateManager)==null?void 0:e.system)==null?void 0:t.package_list)!=null?r:[]}get btnDisabled(){return["printing","paused"].includes(this.printer_state)?!0:this.package_count===0}get btnIcon(){return this.package_count?ll:q_}get btnColor(){return this.package_count?"primary":"green"}get btnText(){return this.package_count?this.$t("Machine.UpdatePanel.Upgrade"):this.$t("Machine.UpdatePanel.UpToDate")}doUpdate(){this.$socket.emit("machine.update.system",{})}closePackagesList(){this.boolShowPackageList=!1}};zh=IW([S],zh);var NW=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(x,{staticClass:"py-2"},[t(b,{staticClass:"pl-6"},[t("strong",[e._v(e._s(e.$t("Machine.UpdatePanel.System")))]),t("br"),e.package_count?[t("a",{staticClass:"info--text cursor--pointer",on:{click:function(r){e.boolShowPackageList=!0}}},[t(_,{staticClass:"mr-1",attrs:{small:"",color:"info"}},[e._v(e._s(e.mdiInformation))]),e._v(" "+e._s(e.$t("Machine.UpdatePanel.CountPackagesCanBeUpgraded",{count:e.package_count}))+" ")],1)]:t("span",[e._v(e._s(e.$t("Machine.UpdatePanel.OSPackages")))])],2),t(b,{staticClass:"col-auto pr-6 text-right",attrs:{"align-self":"center"}},[t($s,{staticClass:"minwidth-0 px-2 text-uppercase",attrs:{small:"",label:"",outlined:"",color:e.btnColor,disabled:e.btnDisabled},on:{click:e.doUpdate}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.btnIcon))]),e._v(" "+e._s(e.btnText)+" ")],1)],1)],1),t(HW,{attrs:{"bool-show-dialog":e.boolShowPackageList,"packages-list":e.package_list},on:{"close-dialog":e.closePackagesList}})],1)},VW=[],BW=E(zh,NW,VW,!1,null,"22cffe3a");const UW=BW.exports;var WW=Object.defineProperty,zW=Object.getOwnPropertyDescriptor,Ky=(s,e,t,r)=>{for(var i=r>1?void 0:r?zW(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&WW(e,t,i),i};let Lc=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiProgressQuestion=bv,this.checkboxUpdateQuestion=!1,this.boolShowCommitHistory=!1,this.showCommitsRepo=null}get modules(){var s;return(s=this.$store.getters["server/updateManager/getUpdateManagerList"])!=null?s:[]}get filteredModules(){return this.modules.filter(s=>{var e,t,r,i,n,a;return!!(s.type==="git"&&((t=(e=s.data)==null?void 0:e.commits_behind)!=null&&t.length)||s.type==="web"&&nt.valid((r=s.data)==null?void 0:r.remote_version,{loose:!0})&&nt.valid((i=s.data)==null?void 0:i.version,{loose:!0})&&nt.gt((n=s.data)==null?void 0:n.remote_version,(a=s.data)==null?void 0:a.version,{loose:!0}))})}openCommitHistory(s){this.showCommitsRepo=s,this.boolShowCommitHistory=!0}closeDialog(){this.$emit("close-dialog")}updateAll(){this.$emit("update-all")}};Ky([w({required:!0})],Lc.prototype,"boolShowDialog",2);Lc=Ky([S({components:{GitCommitsListDay:uo,Panel:U,UpdateHintAlert:sd}})],Lc);var GW=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(le,{attrs:{persistent:"","max-width":"600"},model:{value:e.boolShowDialog,callback:function(r){e.boolShowDialog=r},expression:"boolShowDialog"}},[t(U,{attrs:{title:e.$t("Machine.UpdatePanel.AreYouSure"),icon:e.mdiProgressQuestion,"margin-bottom":!1,"card-class":"machine-update-hint-dialog"},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:e.closeDialog}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(x,[t(b,[e._l(e.filteredModules,function(r){return t(sd,{key:r.name,attrs:{repo:r.data,"bool-title":!0},on:{"open-commit-history":function(i){return e.openCommitHistory(r.data)}}})}),t("div",[t(ge,{attrs:{label:e.$t("Machine.UpdatePanel.IUnderstandTheRisks"),"hide-details":""},model:{value:e.checkboxUpdateQuestion,callback:function(r){e.checkboxUpdateQuestion=r},expression:"checkboxUpdateQuestion"}})],1)],2)],1)],1),t(I),t(oe,[t(ae),t(g,{attrs:{text:""},on:{click:e.closeDialog}},[e._v(e._s(e.$t("Machine.UpdatePanel.Abort")))]),t(g,{attrs:{text:"",color:"primary",disabled:!e.checkboxUpdateQuestion},on:{click:e.updateAll}},[e._v(" "+e._s(e.$t("Machine.UpdatePanel.StartUpdate"))+" ")])],1)],1),t(sg,{attrs:{"bool-show-dialog":e.boolShowCommitHistory,repo:e.showCommitsRepo},on:{"close-dialog":function(r){e.boolShowCommitHistory=!1}}})],1)},ZW=[],qW=E(Lc,GW,ZW,!1,null,null);const Qy=qW.exports;var XW=Object.getOwnPropertyDescriptor,YW=(s,e,t,r)=>{for(var i=r>1?void 0:r?XW(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Gh=class extends k(L){constructor(){super(...arguments),this.mdiProgressUpload=ll,this.boolShowDialog=!1}get hideUpdateWarning(){var e;return(e=this.$store.state.gui.uiSettings.hideUpdateWarnings)!=null?e:!1}clickUpdate(){if(this.hideUpdateWarning){this.updateAll();return}this.boolShowDialog=!0}updateAll(){this.$socket.emit("machine.update.full",{})}};Gh=YW([S({components:{UpdateHintAll:Qy}})],Gh);var JW=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(x,{staticClass:"pt-3"},[t(b,{staticClass:"text-center"},[t(g,{attrs:{text:"",color:"primary",small:"",disabled:["printing","paused"].includes(e.printer_state)},on:{click:e.clickUpdate}},[t(_,{attrs:{left:""}},[e._v(e._s(e.mdiProgressUpload))]),e._v(" "+e._s(e.$t("Machine.UpdatePanel.UpdateAll"))+" ")],1)],1)],1),t(Qy,{attrs:{"bool-show-dialog":e.boolShowDialog},on:{"close-dialog":function(r){e.boolShowDialog=!1},"update-all":e.updateAll}})],1)},KW=[],QW=E(Gh,JW,KW,!1,null,"8d21c134");const ez=QW.exports;var tz=Object.getOwnPropertyDescriptor,sz=(s,e,t,r)=>{for(var i=r>1?void 0:r?tz(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Zh=class extends k(L){constructor(){super(...arguments),this.mdiRefresh=an,this.mdiInformation=Ht,this.mdiCloseThick=pe,this.mdiUpdate=Xa}get enableUpdateManager(){return this.$store.state.server.components.includes("update_manager")}get modules(){var s;return(s=this.$store.getters["server/updateManager/getUpdateManagerList"])!=null?s:[]}get existsSystemModul(){return"system"in this.$store.state.server.updateManager}get systemPackagesCount(){var s,e,t;return(t=(e=(s=this.$store.state.server.updateManager)==null?void 0:s.system)==null?void 0:e.package_count)!=null?t:0}get checkInitState(){return this.modules.filter(e=>e.data.remote_version!=="?").length>0}get showUpdateAll(){let s=0;return this.modules.forEach(e=>{var t,r,i,n,a,o;if(e.type==="git"&&((r=(t=e.data)==null?void 0:t.commits_behind)!=null&&r.length)){s++;return}if(e.type==="web"&&nt.valid((i=e.data)==null?void 0:i.remote_version,{loose:!0})&&nt.valid((n=e.data)==null?void 0:n.version,{loose:!0})&&nt.gt((a=e.data)==null?void 0:a.remote_version,(o=e.data)==null?void 0:o.version,{loose:!0})){s++;return}}),this.systemPackagesCount>0&&s++,s>1}btnSync(){this.$socket.emit("machine.update.status",{refresh:!0},{action:"server/updateManager/onUpdateStatus",loading:"loadingBtnSyncUpdateManager"})}};Zh=sz([S({components:{Panel:U,UpdatePanelEntry:kW,UpdatePanelEntrySystem:UW,UpdatePanelEntryAll:ez}})],Zh);var rz=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.enableUpdateManager?t(U,{attrs:{title:e.$t("Machine.UpdatePanel.UpdateManager"),icon:e.mdiUpdate,"card-class":"machine-update-panel",collapsible:!0},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({attrs:{icon:"",tile:"",color:"primary",ripple:!0,loading:e.loadings.includes("loadingBtnSyncUpdateManager"),disabled:["printing","paused"].includes(e.printer_state)},on:{click:e.btnSync}},"v-btn",i,!1),r),[t(_,[e._v(e._s(e.mdiRefresh))])],1)]}}],null,!1,3363156462)},[t("span",[e._v(e._s(e.$t("Machine.UpdatePanel.CheckForUpdates")))])])]},proxy:!0}],null,!1,150962712)},[t(Z,{staticClass:"px-0 py-0 update-manager-list"},[e.checkInitState?[e._l(e.modules,function(r,i){return[i?t(I,{key:"divider_"+r.name,staticClass:"my-0"}):e._e(),t("update-panel-entry",{key:r.name,attrs:{repo:r.data}})]}),e.existsSystemModul?[e.modules.length?t(I,{staticClass:"my-0"}):e._e(),t("update-panel-entry-system")]:e._e(),e.showUpdateAll?[t(I,{staticClass:"mb-0 mt-2 border-top-2"}),t("update-panel-entry-all")]:e._e()]:[t(x,{staticClass:"mt-0 mb-0"},[t(b,{staticClass:"px-6"},[t(it,{staticClass:"mb-0",attrs:{text:"",dense:"",type:"info",border:"left"}},[e._v(" "+e._s(e.$t("Machine.UpdatePanel.InitUpdateManager"))+" ")])],1)],1)]],2)],1):e._e()],1)},iz=[],nz=E(Zh,rz,iz,!1,null,"7d04e052");const e2=nz.exports;var az=Object.getOwnPropertyDescriptor,oz=(s,e,t,r)=>{for(var i=r>1?void 0:r?az(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let qh=class extends k(L){constructor(){super(...arguments),this.formatFilesize=Xe,this.mdiCloseThick=pe,this.mdiTextBoxSearchOutline=Pv,this.hostDetailsDialog=!1}get hostStats(){var s;return(s=this.$store.getters["server/getHostStats"])!=null?s:null}get systemInfo(){var s,e;return(e=(s=this.$store.state.server)==null?void 0:s.system_info)!=null?e:{}}get releaseName(){var e,t,r,i;let s=(t=(e=this.hostStats.release_info)==null?void 0:e.name)!=null?t:"";return s.startsWith("#")?(i=(r=this.hostStats.release_info)==null?void 0:r.id)!=null?i:null:s.startsWith("0.")?null:s}get directory(){return this.$store.getters["files/getDirectory"]("gcodes")}get disk_usage(){var s,e;return(e=(s=this.directory)==null?void 0:s.disk_usage)!=null?e:{used:0,free:0,total:0}}get cpuUsage(){var s;return(s=this.$store.getters["server/getCpuUsage"])!=null?s:null}get cpuUsageColor(){let s="primary";return this.cpuUsage>95?s="error":this.cpuUsage>80&&(s="warning"),s}get networkInterfaces(){var s;return(s=this.$store.getters["server/getNetworkInterfaces"])!=null?s:null}getIpAddress(s){const e=s.find(r=>r.family==="ipv4");if(e)return" (".concat(e.address,")");const t=s.find(r=>r.family==="ipv6");return t?" (".concat(t.address,")"):null}get cpuDesc(){return this.hostStats.cpuDesc}get cpuName(){let s=this.hostStats.cpuName;return this.hostStats.bits&&(s+=", ".concat(this.hostStats.bits)),s}};qh=oz([S({components:{Panel:U}})],qh);var lz=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(x,{staticClass:"py-0 pr-4"},[t(b,{staticClass:"pl-6"},[t("strong",{staticStyle:{cursor:"pointer"},on:{click:function(r){e.hostDetailsDialog=!0}}},[e._v("Host")]),t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[e.hostStats.cpuName?t("small",e._g(e._b({staticClass:"ml-2"},"small",i,!1),r),[e._v("("+e._s(e.cpuName)+")")]):e._e()]}}])},[t("span",[e._v(e._s(e.cpuDesc))])]),t("br"),t("div",{staticClass:"text-body-2"},[e.hostStats.version?t("div",[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Version",{version:e.hostStats.version}))+" ")]):e._e(),e.hostStats.os?t("div",[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Os",{os:e.hostStats.os}))+" ")]):e._e(),e.releaseName?t("div",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Distro",{name:e.releaseName,version_id:e.hostStats.release_info.version_id}))+" "),e.hostStats.release_info.codename?[e._v(" ("+e._s(e.hostStats.release_info.codename)+") ")]:e._e()],2):e._e(),t("div",[t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Load",{load:e.hostStats.load}))+", ")]),e.hostStats.memoryFormat?t("span",{staticClass:"d-inline-block text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Memory",{memory:e.hostStats.memoryFormat}))+" ")]):e._e(),t("span",{staticClass:"text-no-wrap"},[e.hostStats.tempSensor?[e.hostStats.tempSensor.measured_min_temp!==null&&e.hostStats.tempSensor.measured_max_temp!==null?[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("span",e._g(e._b({},"span",i,!1),r),[e._v(" , "+e._s(e.$t("Machine.SystemPanel.Values.Temp",{temp:e.hostStats.tempSensor.temperature}))+" ")])]}}],null,!1,2813579108)},[t("span",[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.TempMax",{temp:e.hostStats.tempSensor.measured_max_temp}))+" "),t("br"),e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.TempMin",{temp:e.hostStats.tempSensor.measured_min_temp}))+" ")])])]:t("span",[e._v(" , "+e._s(e.$t("Machine.SystemPanel.Values.Temp",{temp:e.hostStats.tempSensor.temperature}))+" ")])]:e._e()],2)]),e.networkInterfaces?e._l(e.networkInterfaces,function(r,i){return t("div",{key:i},[t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(i)+" "),"details"in r?[e._v(" "+e._s(e.getIpAddress(r.details.ip_addresses))+" ")]:e._e(),e._v(" : ")],2),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Bandwidth",{bandwidth:e.formatFilesize(r.bandwidth)}))+" ")]),e._v(" , "),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Received",{received:e.formatFilesize(r.rx_bytes)}))+" ")]),e._v(" , "),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Transmitted",{transmitted:e.formatFilesize(r.tx_bytes)}))+" ")])])}):e._e()],2)],1),e.cpuUsage!==null?t(b,{staticClass:"px-2 col-auto d-flex flex-column justify-center align-center"},[t(ot,{attrs:{rotate:-90,size:55,width:7,value:e.cpuUsage,color:e.cpuUsageColor}},[e._v(" "+e._s(e.cpuUsage)+" ")]),t("span",{staticClass:"mt-2"},[e._v(e._s(e.$t("Machine.SystemPanel.Cpu")))])],1):t(b,{staticClass:"px-2 col-auto d-flex flex-column justify-center align-center"},[t(ot,{attrs:{rotate:-90,size:55,width:7,value:e.hostStats.loadPercent,color:e.hostStats.loadProgressColor}},[e._v(" "+e._s(e.hostStats.loadPercent)+" ")]),t("span",{staticClass:"mt-2"},[e._v(e._s(e.$t("Machine.SystemPanel.Load")))])],1),e.hostStats.memUsage!==null?t(b,{staticClass:"px-2 col-auto d-flex flex-column justify-center align-center"},[t(ot,{attrs:{rotate:-90,size:55,width:7,value:e.hostStats.memUsage,color:e.hostStats.memUsageColor}},[e._v(" "+e._s(e.hostStats.memUsage)+" ")]),t("span",{staticClass:"mt-2"},[e._v(e._s(e.$t("Machine.SystemPanel.Memory")))])],1):e._e()],1),t(le,{attrs:{"max-width":600,"max-height":500,scrollable:""},model:{value:e.hostDetailsDialog,callback:function(r){e.hostDetailsDialog=r},expression:"hostDetailsDialog"}},[t(U,{attrs:{title:e.$t("Machine.SystemPanel.HostDetails"),icon:e.mdiTextBoxSearchOutline,"card-class":"machine-systemload-host-details-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.hostDetailsDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"pt-5 px-0"},[t("overlay-scrollbars",{staticClass:"px-6",staticStyle:{height:"350px"}},[Object.keys(e.systemInfo).length?e._l(e.systemInfo,function(r,i,n){return t("div",{key:i},[i!=="available_services"?[t(x,{class:n?"mt-5":""},[t(b,[t("span",{staticClass:"headline"},[e._v(e._s(i))])])],1),e._l(r,function(a,o,l){return t("div",{key:o},[l?t(I,{staticClass:"my-3"}):e._e(),t(x,[t(b,[e._v(e._s(o))]),t(b,{staticClass:"text-right"},[e._v(e._s(a))])],1)],1)})]:e._e()],2)}):[t(x,{staticClass:"mt-5"},[t(b,[t("p",[e._v(e._s(e.$t("Machine.SystemPanel.NoMoreInfos")))])])],1)]],2)],1)],1)],1)],1)},cz=[],uz=E(qh,lz,cz,!1,null,"e5f7e7ba");const t2=uz.exports;var dz=Object.defineProperty,mz=Object.getOwnPropertyDescriptor,s2=(s,e,t,r)=>{for(var i=r>1?void 0:r?mz(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&dz(e,t,i),i};let Ac=class extends k(L){constructor(){super(...arguments),this.formatFilesize=Xe,this.mdiCloseThick=pe,this.mcuDetailsDialog=!1}};s2([w({required:!0})],Ac.prototype,"mcu",2);Ac=s2([S({components:{Panel:U}})],Ac);var hz=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(x,{staticClass:"py-0 pr-4"},[t(b,{staticClass:"pl-6"},[t("strong",{staticStyle:{cursor:"pointer"},on:{click:function(r){e.mcuDetailsDialog=!0}}},[e._v(e._s(e.mcu.name))]),e.mcu.chip?t("small",{staticClass:"ml-2"},[e._v("("+e._s(e.mcu.chip)+")")]):e._e(),t("br"),t("div",{staticClass:"text-body-2"},[t("div",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Version",{version:e.mcu.version}))+" ")]),t("div",[t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Load",{load:e.mcu.load}))+", ")]),t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Awake",{awake:e.mcu.awake}))+", ")]),e.mcu.freq!==null?t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Frequency",{frequency:e.mcu.freqFormat}))+", ")]):e._e(),e.mcu.tempSensor?[e.mcu.tempSensor.measured_min_temp!==null&&e.mcu.tempSensor.measured_max_temp!==null?[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t("span",e._g(e._b({},"span",i,!1),r),[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Temp",{temp:e.mcu.tempSensor.temperature}))+" ")])]}}],null,!1,1093946258)},[t("span",[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.TempMax",{temp:e.mcu.tempSensor.measured_max_temp}))+" "),t("br"),e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.TempMin",{temp:e.mcu.tempSensor.measured_min_temp}))+" ")])])]:t("span",{staticClass:"text-no-wrap"},[e._v(" "+e._s(e.$t("Machine.SystemPanel.Values.Temp",{temp:e.mcu.tempSensor.temperature}))+" ")])]:e._e()],2)])]),t(b,{staticClass:"px-2 col-auto d-flex justify-center align-center"},[t(ot,{attrs:{rotate:-90,size:55,width:7,value:e.mcu.loadPercent,color:e.mcu.loadProgressColor}},[e._v(" "+e._s(e.mcu.loadPercent)+" ")])],1)],1),t(le,{attrs:{"max-width":400,"max-height":500,scrollable:""},model:{value:e.mcuDetailsDialog,callback:function(r){e.mcuDetailsDialog=r},expression:"mcuDetailsDialog"}},[t(U,{attrs:{title:e.mcu.name,icon:"mdi-text-box-search-outline","card-class":"machine-systemload-mcu-details-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.mcuDetailsDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,{staticClass:"pt-5 px-0"},[t("overlay-scrollbars",{staticClass:"px-6",staticStyle:{height:"350px"}},[e.mcu.mcu_constants?[t(x,[t(b,[t("span",{staticClass:"headline"},[e._v(e._s(e.$t("Machine.SystemPanel.Constants")))])])],1),e._l(e.mcu.mcu_constants,function(r,i,n){return t("div",{key:i},[n?t(I,{staticClass:"my-3"}):e._e(),t(x,[t(b,[e._v(e._s(i))]),t(b,{staticClass:"text-right"},[e._v(e._s(r))])],1)],1)})]:e._e(),e.mcu.last_stats?[t(x,{staticClass:"mt-5"},[t(b,[t("span",{staticClass:"headline"},[e._v(e._s(e.$t("Machine.SystemPanel.LastStats")))])])],1),e._l(e.mcu.last_stats,function(r,i,n){return t("div",{key:i},[n?t(I,{staticClass:"my-3"}):e._e(),t(x,[t(b,[e._v(e._s(i))]),t(b,{staticClass:"text-right"},[e._v(e._s(r))])],1)],1)})]:e._e()],2)],1)],1)],1)],1)},pz=[],fz=E(Ac,hz,pz,!1,null,null);const r2=fz.exports;var gz=Object.getOwnPropertyDescriptor,_z=(s,e,t,r)=>{for(var i=r>1?void 0:r?gz(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let Xh=class extends k(L){constructor(){super(...arguments),this.mdiCloseThick=pe,this.mdiMemory=dv,this.mdiUsb=Jp,this.dialogDevices=!1}get mcus(){var e;if(!this.klipperReadyForGui)return[];const s=(e=this.$store.getters["printer/getMcus"])!=null?e:[];return Ft(s,"name")}get hostStats(){var s;return(s=this.$store.getters["server/getHostStats"])!=null?s:null}get showPanel(){return this.mcus.length>0||this.hostStats}};Xh=_z([S({components:{SystemPanelMcu:r2,SystemPanelHost:t2,Panel:U}})],Xh);var vz=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.showPanel?t(U,{attrs:{title:e.$t("Machine.SystemPanel.SystemLoad"),icon:e.mdiMemory,"card-class":"machine-systemload-panel",collapsible:!0},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{staticClass:"d-none d-md-flex",attrs:{text:"",tile:""},on:{click:function(r){e.dialogDevices=!0}}},[t(_,{staticClass:"mr-1",attrs:{small:""}},[e._v(e._s(e.mdiUsb))]),e._v(" "+e._s(e.$t("Editor.DeviceDialog"))+" ")],1)]},proxy:!0}],null,!1,3386324002)},[t(Z,{staticClass:"px-0 py-2"},[e._l(e.mcus,function(r,i){return t("div",{key:r.name},[i?t(I,{staticClass:"my-2"}):e._e(),t(r2,{attrs:{mcu:r}})],1)}),e.hostStats?t("div",[e.mcus.length?t(I,{staticClass:"my-2"}):e._e(),t(t2)],1):e._e()],2),t(of,{attrs:{"show-dialog":e.dialogDevices},on:{close:function(r){e.dialogDevices=!1}}})],1):e._e()},bz=[],yz=E(Xh,vz,bz,!1,null,"6f940e6d");const i2=yz.exports;function n2(s,e){return function(){return s.apply(e,arguments)}}const{toString:Cz}=Object.prototype,{getPrototypeOf:mg}=Object,ld=(s=>e=>{const t=Cz.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),gs=s=>(s=s.toLowerCase(),e=>ld(e)===s),cd=s=>e=>typeof e===s,{isArray:gn}=Array,ja=cd("undefined");function $z(s){return s!==null&&!ja(s)&&s.constructor!==null&&!ja(s.constructor)&&zt(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const a2=gs("ArrayBuffer");function xz(s){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(s):e=s&&s.buffer&&a2(s.buffer),e}const wz=cd("string"),zt=cd("function"),o2=cd("number"),ud=s=>s!==null&&typeof s=="object",Sz=s=>s===!0||s===!1,Go=s=>{if(ld(s)!=="object")return!1;const e=mg(s);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},Pz=gs("Date"),Dz=gs("File"),Tz=gs("Blob"),Oz=gs("FileList"),Mz=s=>ud(s)&&zt(s.pipe),kz=s=>{let e;return s&&(typeof FormData=="function"&&s instanceof FormData||zt(s.append)&&((e=ld(s))==="formdata"||e==="object"&&zt(s.toString)&&s.toString()==="[object FormData]"))},Ez=gs("URLSearchParams"),[Lz,Az,Fz,Rz]=["ReadableStream","Request","Response","Headers"].map(gs),Hz=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ho(s,e,{allOwnKeys:t=!1}={}){if(s===null||typeof s>"u")return;let r,i;if(typeof s!="object"&&(s=[s]),gn(s))for(r=0,i=s.length;r0;)if(i=t[r],e===i.toLowerCase())return i;return null}const Er=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,c2=s=>!ja(s)&&s!==Er;function Yh(){const{caseless:s}=c2(this)&&this||{},e={},t=(r,i)=>{const n=s&&l2(e,i)||i;Go(e[n])&&Go(r)?e[n]=Yh(e[n],r):Go(r)?e[n]=Yh({},r):gn(r)?e[n]=r.slice():e[n]=r};for(let r=0,i=arguments.length;r(ho(e,(i,n)=>{t&&zt(i)?s[n]=n2(i,t):s[n]=i},{allOwnKeys:r}),s),Iz=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),Nz=(s,e,t,r)=>{s.prototype=Object.create(e.prototype,r),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:e.prototype}),t&&Object.assign(s.prototype,t)},Vz=(s,e,t,r)=>{let i,n,a;const o={};if(e=e||{},s==null)return e;do{for(i=Object.getOwnPropertyNames(s),n=i.length;n-- >0;)a=i[n],(!r||r(a,s,e))&&!o[a]&&(e[a]=s[a],o[a]=!0);s=t!==!1&&mg(s)}while(s&&(!t||t(s,e))&&s!==Object.prototype);return e},Bz=(s,e,t)=>{s=String(s),(t===void 0||t>s.length)&&(t=s.length),t-=e.length;const r=s.indexOf(e,t);return r!==-1&&r===t},Uz=s=>{if(!s)return null;if(gn(s))return s;let e=s.length;if(!o2(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=s[e];return t},Wz=(s=>e=>s&&e instanceof s)(typeof Uint8Array<"u"&&mg(Uint8Array)),zz=(s,e)=>{const r=(s&&s[Symbol.iterator]).call(s);let i;for(;(i=r.next())&&!i.done;){const n=i.value;e.call(s,n[0],n[1])}},Gz=(s,e)=>{let t;const r=[];for(;(t=s.exec(e))!==null;)r.push(t);return r},Zz=gs("HTMLFormElement"),qz=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,i){return r.toUpperCase()+i}),R1=(({hasOwnProperty:s})=>(e,t)=>s.call(e,t))(Object.prototype),Xz=gs("RegExp"),u2=(s,e)=>{const t=Object.getOwnPropertyDescriptors(s),r={};ho(t,(i,n)=>{let a;(a=e(i,n,s))!==!1&&(r[n]=a||i)}),Object.defineProperties(s,r)},Yz=s=>{u2(s,(e,t)=>{if(zt(s)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const r=s[t];if(zt(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Jz=(s,e)=>{const t={},r=i=>{i.forEach(n=>{t[n]=!0})};return gn(s)?r(s):r(String(s).split(e)),t},Kz=()=>{},Qz=(s,e)=>s!=null&&Number.isFinite(s=+s)?s:e;function eG(s){return!!(s&&zt(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const tG=s=>{const e=new Array(10),t=(r,i)=>{if(ud(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const n=gn(r)?[]:{};return ho(r,(a,o)=>{const l=t(a,i+1);!ja(l)&&(n[o]=l)}),e[i]=void 0,n}}return r};return t(s,0)},sG=gs("AsyncFunction"),rG=s=>s&&(ud(s)||zt(s))&&zt(s.then)&&zt(s.catch),d2=((s,e)=>s?setImmediate:e?((t,r)=>(Er.addEventListener("message",({source:i,data:n})=>{i===Er&&n===t&&r.length&&r.shift()()},!1),i=>{r.push(i),Er.postMessage(t,"*")}))("axios@".concat(Math.random()),[]):t=>setTimeout(t))(typeof setImmediate=="function",zt(Er.postMessage)),iG=typeof queueMicrotask<"u"?queueMicrotask.bind(Er):typeof process<"u"&&process.nextTick||d2,Y={isArray:gn,isArrayBuffer:a2,isBuffer:$z,isFormData:kz,isArrayBufferView:xz,isString:wz,isNumber:o2,isBoolean:Sz,isObject:ud,isPlainObject:Go,isReadableStream:Lz,isRequest:Az,isResponse:Fz,isHeaders:Rz,isUndefined:ja,isDate:Pz,isFile:Dz,isBlob:Tz,isRegExp:Xz,isFunction:zt,isStream:Mz,isURLSearchParams:Ez,isTypedArray:Wz,isFileList:Oz,forEach:ho,merge:Yh,extend:jz,trim:Hz,stripBOM:Iz,inherits:Nz,toFlatObject:Vz,kindOf:ld,kindOfTest:gs,endsWith:Bz,toArray:Uz,forEachEntry:zz,matchAll:Gz,isHTMLForm:Zz,hasOwnProperty:R1,hasOwnProp:R1,reduceDescriptors:u2,freezeMethods:Yz,toObjectSet:Jz,toCamelCase:qz,noop:Kz,toFiniteNumber:Qz,findKey:l2,global:Er,isContextDefined:c2,isSpecCompliantForm:eG,toJSONObject:tG,isAsyncFn:sG,isThenable:rG,setImmediate:d2,asap:iG};function xe(s,e,t,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Y.inherits(xe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Y.toJSONObject(this.config),code:this.code,status:this.status}}});const m2=xe.prototype,h2={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{h2[s]={value:s}});Object.defineProperties(xe,h2);Object.defineProperty(m2,"isAxiosError",{value:!0});xe.from=(s,e,t,r,i,n)=>{const a=Object.create(m2);return Y.toFlatObject(s,a,function(l){return l!==Error.prototype},o=>o!=="isAxiosError"),xe.call(a,s.message,e,t,r,i),a.cause=s,a.name=s.name,n&&Object.assign(a,n),a};const nG=null;function Jh(s){return Y.isPlainObject(s)||Y.isArray(s)}function p2(s){return Y.endsWith(s,"[]")?s.slice(0,-2):s}function H1(s,e,t){return s?s.concat(e).map(function(i,n){return i=p2(i),!t&&n?"["+i+"]":i}).join(t?".":""):e}function aG(s){return Y.isArray(s)&&!s.some(Jh)}const oG=Y.toFlatObject(Y,{},null,function(e){return/^is[A-Z]/.test(e)});function dd(s,e,t){if(!Y.isObject(s))throw new TypeError("target must be an object");e=e||new FormData,t=Y.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,v){return!Y.isUndefined(v[p])});const r=t.metaTokens,i=t.visitor||c,n=t.dots,a=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&Y.isSpecCompliantForm(e);if(!Y.isFunction(i))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(Y.isDate(f))return f.toISOString();if(!l&&Y.isBlob(f))throw new xe("Blob is not supported. Use a Buffer instead.");return Y.isArrayBuffer(f)||Y.isTypedArray(f)?l&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function c(f,p,v){let C=f;if(f&&!v&&typeof f=="object"){if(Y.endsWith(p,"{}"))p=r?p:p.slice(0,-2),f=JSON.stringify(f);else if(Y.isArray(f)&&aG(f)||(Y.isFileList(f)||Y.endsWith(p,"[]"))&&(C=Y.toArray(f)))return p=p2(p),C.forEach(function(M,F){!(Y.isUndefined(M)||M===null)&&e.append(a===!0?H1([p],F,n):a===null?p:p+"[]",u(M))}),!1}return Jh(f)?!0:(e.append(H1(v,p,n),u(f)),!1)}const d=[],m=Object.assign(oG,{defaultVisitor:c,convertValue:u,isVisitable:Jh});function h(f,p){if(!Y.isUndefined(f)){if(d.indexOf(f)!==-1)throw Error("Circular reference detected in "+p.join("."));d.push(f),Y.forEach(f,function(C,P){(!(Y.isUndefined(C)||C===null)&&i.call(e,C,Y.isString(P)?P.trim():P,p,m))===!0&&h(C,p?p.concat(P):[P])}),d.pop()}}if(!Y.isObject(s))throw new TypeError("data must be an object");return h(s),e}function j1(s){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function hg(s,e){this._pairs=[],s&&dd(s,this,e)}const f2=hg.prototype;f2.append=function(e,t){this._pairs.push([e,t])};f2.toString=function(e){const t=e?function(r){return e.call(this,r,j1)}:j1;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function lG(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function g2(s,e,t){if(!e)return s;const r=t&&t.encode||lG;Y.isFunction(t)&&(t={serialize:t});const i=t&&t.serialize;let n;if(i?n=i(e,t):n=Y.isURLSearchParams(e)?e.toString():new hg(e,t).toString(r),n){const a=s.indexOf("#");a!==-1&&(s=s.slice(0,a)),s+=(s.indexOf("?")===-1?"?":"&")+n}return s}class I1{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Y.forEach(this.handlers,function(r){r!==null&&e(r)})}}const _2={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},cG=typeof URLSearchParams<"u"?URLSearchParams:hg,uG=typeof FormData<"u"?FormData:null,dG=typeof Blob<"u"?Blob:null,mG={isBrowser:!0,classes:{URLSearchParams:cG,FormData:uG,Blob:dG},protocols:["http","https","file","blob","url","data"]},pg=typeof window<"u"&&typeof document<"u",Kh=typeof navigator=="object"&&navigator||void 0,hG=pg&&(!Kh||["ReactNative","NativeScript","NS"].indexOf(Kh.product)<0),pG=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",fG=pg&&window.location.href||"http://localhost",gG=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pg,hasStandardBrowserEnv:hG,hasStandardBrowserWebWorkerEnv:pG,navigator:Kh,origin:fG},Symbol.toStringTag,{value:"Module"})),ft={...gG,...mG};function _G(s,e){return dd(s,new ft.classes.URLSearchParams,Object.assign({visitor:function(t,r,i,n){return ft.isNode&&Y.isBuffer(t)?(this.append(r,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}function vG(s){return Y.matchAll(/\w+|\[(\w*)]/g,s).map(e=>e[0]==="[]"?"":e[1]||e[0])}function bG(s){const e={},t=Object.keys(s);let r;const i=t.length;let n;for(r=0;r=t.length;return a=!a&&Y.isArray(i)?i.length:a,l?(Y.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!o):((!i[a]||!Y.isObject(i[a]))&&(i[a]=[]),e(t,r,i[a],n)&&Y.isArray(i[a])&&(i[a]=bG(i[a])),!o)}if(Y.isFormData(s)&&Y.isFunction(s.entries)){const t={};return Y.forEachEntry(s,(r,i)=>{e(vG(r),i,t,0)}),t}return null}function yG(s,e,t){if(Y.isString(s))try{return(e||JSON.parse)(s),Y.trim(s)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(s)}const po={transitional:_2,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",i=r.indexOf("application/json")>-1,n=Y.isObject(e);if(n&&Y.isHTMLForm(e)&&(e=new FormData(e)),Y.isFormData(e))return i?JSON.stringify(v2(e)):e;if(Y.isArrayBuffer(e)||Y.isBuffer(e)||Y.isStream(e)||Y.isFile(e)||Y.isBlob(e)||Y.isReadableStream(e))return e;if(Y.isArrayBufferView(e))return e.buffer;if(Y.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(n){if(r.indexOf("application/x-www-form-urlencoded")>-1)return _G(e,this.formSerializer).toString();if((o=Y.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return dd(o?{"files[]":e}:e,l&&new l,this.formSerializer)}}return n||i?(t.setContentType("application/json",!1),yG(e)):e}],transformResponse:[function(e){const t=this.transitional||po.transitional,r=t&&t.forcedJSONParsing,i=this.responseType==="json";if(Y.isResponse(e)||Y.isReadableStream(e))return e;if(e&&Y.isString(e)&&(r&&!this.responseType||i)){const a=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(o){if(a)throw o.name==="SyntaxError"?xe.from(o,xe.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ft.classes.FormData,Blob:ft.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch"],s=>{po.headers[s]={}});const CG=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),$G=s=>{const e={};let t,r,i;return s&&s.split("\n").forEach(function(a){i=a.indexOf(":"),t=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!t||e[t]&&CG[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e},N1=Symbol("internals");function Dn(s){return s&&String(s).trim().toLowerCase()}function Zo(s){return s===!1||s==null?s:Y.isArray(s)?s.map(Zo):String(s)}function xG(s){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=t.exec(s);)e[r[1]]=r[2];return e}const wG=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function tm(s,e,t,r,i){if(Y.isFunction(r))return r.call(this,e,t);if(i&&(e=t),!!Y.isString(e)){if(Y.isString(r))return e.indexOf(r)!==-1;if(Y.isRegExp(r))return r.test(e)}}function SG(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function PG(s,e){const t=Y.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(s,r+t,{value:function(i,n,a){return this[r].call(this,e,i,n,a)},configurable:!0})})}let Lt=class{constructor(e){e&&this.set(e)}set(e,t,r){const i=this;function n(o,l,u){const c=Dn(l);if(!c)throw new Error("header name must be a non-empty string");const d=Y.findKey(i,c);(!d||i[d]===void 0||u===!0||u===void 0&&i[d]!==!1)&&(i[d||l]=Zo(o))}const a=(o,l)=>Y.forEach(o,(u,c)=>n(u,c,l));if(Y.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Y.isString(e)&&(e=e.trim())&&!wG(e))a($G(e),t);else if(Y.isHeaders(e))for(const[o,l]of e.entries())n(l,o,r);else e!=null&&n(t,e,r);return this}get(e,t){if(e=Dn(e),e){const r=Y.findKey(this,e);if(r){const i=this[r];if(!t)return i;if(t===!0)return xG(i);if(Y.isFunction(t))return t.call(this,i,r);if(Y.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Dn(e),e){const r=Y.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||tm(this,this[r],r,t)))}return!1}delete(e,t){const r=this;let i=!1;function n(a){if(a=Dn(a),a){const o=Y.findKey(r,a);o&&(!t||tm(r,r[o],o,t))&&(delete r[o],i=!0)}}return Y.isArray(e)?e.forEach(n):n(e),i}clear(e){const t=Object.keys(this);let r=t.length,i=!1;for(;r--;){const n=t[r];(!e||tm(this,this[n],n,e,!0))&&(delete this[n],i=!0)}return i}normalize(e){const t=this,r={};return Y.forEach(this,(i,n)=>{const a=Y.findKey(r,n);if(a){t[a]=Zo(i),delete t[n];return}const o=e?SG(n):String(n).trim();o!==n&&delete t[n],t[o]=Zo(i),r[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Y.forEach(this,(r,i)=>{r!=null&&r!==!1&&(t[i]=e&&Y.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[N1]=this[N1]={accessors:{}}).accessors,i=this.prototype;function n(a){const o=Dn(a);r[o]||(PG(i,a),r[o]=!0)}return Y.isArray(e)?e.forEach(n):n(e),this}};Lt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Y.reduceDescriptors(Lt.prototype,({value:s},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>s,set(r){this[t]=r}}});Y.freezeMethods(Lt);function sm(s,e){const t=this||po,r=e||t,i=Lt.from(r.headers);let n=r.data;return Y.forEach(s,function(o){n=o.call(t,n,i.normalize(),e?e.status:void 0)}),i.normalize(),n}function b2(s){return!!(s&&s.__CANCEL__)}function _n(s,e,t){xe.call(this,s==null?"canceled":s,xe.ERR_CANCELED,e,t),this.name="CanceledError"}Y.inherits(_n,xe,{__CANCEL__:!0});function y2(s,e,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?s(t):e(new xe("Request failed with status code "+t.status,[xe.ERR_BAD_REQUEST,xe.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function DG(s){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return e&&e[1]||""}function TG(s,e){s=s||10;const t=new Array(s),r=new Array(s);let i=0,n=0,a;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),c=r[n];a||(a=u),t[i]=l,r[i]=u;let d=n,m=0;for(;d!==i;)m+=t[d++],d=d%s;if(i=(i+1)%s,i===n&&(n=(n+1)%s),u-a{t=c,i=null,n&&(clearTimeout(n),n=null),s.apply(null,u)};return[(...u)=>{const c=Date.now(),d=c-t;d>=r?a(u,c):(i=u,n||(n=setTimeout(()=>{n=null,a(i)},r-d)))},()=>i&&a(i)]}const Fc=(s,e,t=3)=>{let r=0;const i=TG(50,250);return OG(n=>{const a=n.loaded,o=n.lengthComputable?n.total:void 0,l=a-r,u=i(l),c=a<=o;r=a;const d={loaded:a,total:o,progress:o?a/o:void 0,bytes:l,rate:u||void 0,estimated:u&&o&&c?(o-a)/u:void 0,event:n,lengthComputable:o!=null,[e?"download":"upload"]:!0};s(d)},t)},V1=(s,e)=>{const t=s!=null;return[r=>e[0]({lengthComputable:t,total:s,loaded:r}),e[1]]},B1=s=>(...e)=>Y.asap(()=>s(...e)),MG=ft.hasStandardBrowserEnv?((s,e)=>t=>(t=new URL(t,ft.origin),s.protocol===t.protocol&&s.host===t.host&&(e||s.port===t.port)))(new URL(ft.origin),ft.navigator&&/(msie|trident)/i.test(ft.navigator.userAgent)):()=>!0,kG=ft.hasStandardBrowserEnv?{write(s,e,t,r,i,n){const a=[s+"="+encodeURIComponent(e)];Y.isNumber(t)&&a.push("expires="+new Date(t).toGMTString()),Y.isString(r)&&a.push("path="+r),Y.isString(i)&&a.push("domain="+i),n===!0&&a.push("secure"),document.cookie=a.join("; ")},read(s){const e=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(s){this.write(s,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function EG(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function LG(s,e){return e?s.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):s}function C2(s,e,t){let r=!EG(e);return s&&r||t==!1?LG(s,e):e}const U1=s=>s instanceof Lt?{...s}:s;function Kr(s,e){e=e||{};const t={};function r(u,c,d,m){return Y.isPlainObject(u)&&Y.isPlainObject(c)?Y.merge.call({caseless:m},u,c):Y.isPlainObject(c)?Y.merge({},c):Y.isArray(c)?c.slice():c}function i(u,c,d,m){if(Y.isUndefined(c)){if(!Y.isUndefined(u))return r(void 0,u,d,m)}else return r(u,c,d,m)}function n(u,c){if(!Y.isUndefined(c))return r(void 0,c)}function a(u,c){if(Y.isUndefined(c)){if(!Y.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function o(u,c,d){if(d in e)return r(u,c);if(d in s)return r(void 0,u)}const l={url:n,method:n,data:n,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(u,c,d)=>i(U1(u),U1(c),d,!0)};return Y.forEach(Object.keys(Object.assign({},s,e)),function(c){const d=l[c]||i,m=d(s[c],e[c],c);Y.isUndefined(m)&&d!==o||(t[c]=m)}),t}const $2=s=>{const e=Kr({},s);let{data:t,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:n,headers:a,auth:o}=e;e.headers=a=Lt.from(a),e.url=g2(C2(e.baseURL,e.url,e.allowAbsoluteUrls),s.params,s.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let l;if(Y.isFormData(t)){if(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[u,...c]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...c].join("; "))}}if(ft.hasStandardBrowserEnv&&(r&&Y.isFunction(r)&&(r=r(e)),r||r!==!1&&MG(e.url))){const u=i&&n&&kG.read(n);u&&a.set(i,u)}return e},AG=typeof XMLHttpRequest<"u",FG=AG&&function(s){return new Promise(function(t,r){const i=$2(s);let n=i.data;const a=Lt.from(i.headers).normalize();let{responseType:o,onUploadProgress:l,onDownloadProgress:u}=i,c,d,m,h,f;function p(){h&&h(),f&&f(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function C(){if(!v)return;const M=Lt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),O={data:!o||o==="text"||o==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:M,config:s,request:v};y2(function(D){t(D),p()},function(D){r(D),p()},O),v=null}"onloadend"in v?v.onloadend=C:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(C)},v.onabort=function(){v&&(r(new xe("Request aborted",xe.ECONNABORTED,s,v)),v=null)},v.onerror=function(){r(new xe("Network Error",xe.ERR_NETWORK,s,v)),v=null},v.ontimeout=function(){let F=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const O=i.transitional||_2;i.timeoutErrorMessage&&(F=i.timeoutErrorMessage),r(new xe(F,O.clarifyTimeoutError?xe.ETIMEDOUT:xe.ECONNABORTED,s,v)),v=null},n===void 0&&a.setContentType(null),"setRequestHeader"in v&&Y.forEach(a.toJSON(),function(F,O){v.setRequestHeader(O,F)}),Y.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),o&&o!=="json"&&(v.responseType=i.responseType),u&&([m,f]=Fc(u,!0),v.addEventListener("progress",m)),l&&v.upload&&([d,h]=Fc(l),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(c=M=>{v&&(r(!M||M.type?new _n(null,s,v):M),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const P=DG(i.url);if(P&&ft.protocols.indexOf(P)===-1){r(new xe("Unsupported protocol "+P+":",xe.ERR_BAD_REQUEST,s));return}v.send(n||null)})},RG=(s,e)=>{const{length:t}=s=s?s.filter(Boolean):[];if(e||t){let r=new AbortController,i;const n=function(u){if(!i){i=!0,o();const c=u instanceof Error?u:this.reason;r.abort(c instanceof xe?c:new _n(c instanceof Error?c.message:c))}};let a=e&&setTimeout(()=>{a=null,n(new xe("timeout ".concat(e," of ms exceeded"),xe.ETIMEDOUT))},e);const o=()=>{s&&(a&&clearTimeout(a),a=null,s.forEach(u=>{u.unsubscribe?u.unsubscribe(n):u.removeEventListener("abort",n)}),s=null)};s.forEach(u=>u.addEventListener("abort",n));const{signal:l}=r;return l.unsubscribe=()=>Y.asap(o),l}},HG=function*(s,e){let t=s.byteLength;if(t{const i=jG(s,e);let n=0,a,o=l=>{a||(a=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await i.next();if(u){o(),l.close();return}let d=c.byteLength;if(t){let m=n+=d;t(m)}l.enqueue(new Uint8Array(c))}catch(u){throw o(u),u}},cancel(l){return o(l),i.return()}},{highWaterMark:2})},md=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",x2=md&&typeof ReadableStream=="function",NG=md&&(typeof TextEncoder=="function"?(s=>e=>s.encode(e))(new TextEncoder):async s=>new Uint8Array(await new Response(s).arrayBuffer())),w2=(s,...e)=>{try{return!!s(...e)}catch{return!1}},VG=x2&&w2(()=>{let s=!1;const e=new Request(ft.origin,{body:new ReadableStream,method:"POST",get duplex(){return s=!0,"half"}}).headers.has("Content-Type");return s&&!e}),z1=64*1024,Qh=x2&&w2(()=>Y.isReadableStream(new Response("").body)),Rc={stream:Qh&&(s=>s.body)};md&&(s=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Rc[e]&&(Rc[e]=Y.isFunction(s[e])?t=>t[e]():(t,r)=>{throw new xe("Response type '".concat(e,"' is not supported"),xe.ERR_NOT_SUPPORT,r)})})})(new Response);const BG=async s=>{if(s==null)return 0;if(Y.isBlob(s))return s.size;if(Y.isSpecCompliantForm(s))return(await new Request(ft.origin,{method:"POST",body:s}).arrayBuffer()).byteLength;if(Y.isArrayBufferView(s)||Y.isArrayBuffer(s))return s.byteLength;if(Y.isURLSearchParams(s)&&(s=s+""),Y.isString(s))return(await NG(s)).byteLength},UG=async(s,e)=>{const t=Y.toFiniteNumber(s.getContentLength());return t==null?BG(e):t},WG=md&&(async s=>{let{url:e,method:t,data:r,signal:i,cancelToken:n,timeout:a,onDownloadProgress:o,onUploadProgress:l,responseType:u,headers:c,withCredentials:d="same-origin",fetchOptions:m}=$2(s);u=u?(u+"").toLowerCase():"text";let h=RG([i,n&&n.toAbortSignal()],a),f;const p=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let v;try{if(l&&VG&&t!=="get"&&t!=="head"&&(v=await UG(c,r))!==0){let O=new Request(e,{method:"POST",body:r,duplex:"half"}),$;if(Y.isFormData(r)&&($=O.headers.get("content-type"))&&c.setContentType($),O.body){const[D,V]=V1(v,Fc(B1(l)));r=W1(O.body,z1,D,V)}}Y.isString(d)||(d=d?"include":"omit");const C="credentials"in Request.prototype;f=new Request(e,{...m,signal:h,method:t.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:C?d:void 0});let P=await fetch(f);const M=Qh&&(u==="stream"||u==="response");if(Qh&&(o||M&&p)){const O={};["status","statusText","headers"].forEach(N=>{O[N]=P[N]});const $=Y.toFiniteNumber(P.headers.get("content-length")),[D,V]=o&&V1($,Fc(B1(o),!0))||[];P=new Response(W1(P.body,z1,D,()=>{V&&V(),p&&p()}),O)}u=u||"text";let F=await Rc[Y.findKey(Rc,u)||"text"](P,s);return!M&&p&&p(),await new Promise((O,$)=>{y2(O,$,{data:F,headers:Lt.from(P.headers),status:P.status,statusText:P.statusText,config:s,request:f})})}catch(C){throw p&&p(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new xe("Network Error",xe.ERR_NETWORK,s,f),{cause:C.cause||C}):xe.from(C,C&&C.code,s,f)}}),ep={http:nG,xhr:FG,fetch:WG};Y.forEach(ep,(s,e)=>{if(s){try{Object.defineProperty(s,"name",{value:e})}catch{}Object.defineProperty(s,"adapterName",{value:e})}});const G1=s=>"- ".concat(s),zG=s=>Y.isFunction(s)||s===null||s===!1,S2={getAdapter:s=>{s=Y.isArray(s)?s:[s];const{length:e}=s;let t,r;const i={};for(let n=0;n"adapter ".concat(o," ")+(l===!1?"is not supported by the environment":"is not available in the build"));let a=e?n.length>1?"since :\n"+n.map(G1).join("\n"):" "+G1(n[0]):"as no adapter specified";throw new xe("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:ep};function rm(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new _n(null,s)}function Z1(s){return rm(s),s.headers=Lt.from(s.headers),s.data=sm.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),S2.getAdapter(s.adapter||po.adapter)(s).then(function(r){return rm(s),r.data=sm.call(s,s.transformResponse,r),r.headers=Lt.from(r.headers),r},function(r){return b2(r)||(rm(s),r&&r.response&&(r.response.data=sm.call(s,s.transformResponse,r.response),r.response.headers=Lt.from(r.response.headers))),Promise.reject(r)})}const P2="1.8.3",hd={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{hd[s]=function(r){return typeof r===s||"a"+(e<1?"n ":" ")+s}});const q1={};hd.transitional=function(e,t,r){function i(n,a){return"[Axios v"+P2+"] Transitional option '"+n+"'"+a+(r?". "+r:"")}return(n,a,o)=>{if(e===!1)throw new xe(i(a," has been removed"+(t?" in "+t:"")),xe.ERR_DEPRECATED);return t&&!q1[a]&&(q1[a]=!0,console.warn(i(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(n,a,o):!0}};hd.spelling=function(e){return(t,r)=>(console.warn("".concat(r," is likely a misspelling of ").concat(e)),!0)};function GG(s,e,t){if(typeof s!="object")throw new xe("options must be an object",xe.ERR_BAD_OPTION_VALUE);const r=Object.keys(s);let i=r.length;for(;i-- >0;){const n=r[i],a=e[n];if(a){const o=s[n],l=o===void 0||a(o,n,s);if(l!==!0)throw new xe("option "+n+" must be "+l,xe.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new xe("Unknown option "+n,xe.ERR_BAD_OPTION)}}const qo={assertOptions:GG,validators:hd},ys=qo.validators;let Rr=class{constructor(e){this.defaults=e,this.interceptors={request:new I1,response:new I1}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const n=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?n&&!String(r.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(r.stack+="\n"+n):r.stack=n}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Kr(this.defaults,t);const{transitional:r,paramsSerializer:i,headers:n}=t;r!==void 0&&qo.assertOptions(r,{silentJSONParsing:ys.transitional(ys.boolean),forcedJSONParsing:ys.transitional(ys.boolean),clarifyTimeoutError:ys.transitional(ys.boolean)},!1),i!=null&&(Y.isFunction(i)?t.paramsSerializer={serialize:i}:qo.assertOptions(i,{encode:ys.function,serialize:ys.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),qo.assertOptions(t,{baseUrl:ys.spelling("baseURL"),withXsrfToken:ys.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=n&&Y.merge(n.common,n[t.method]);n&&Y.forEach(["delete","get","head","post","put","patch","common"],f=>{delete n[f]}),t.headers=Lt.concat(a,n);const o=[];let l=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(t)===!1||(l=l&&p.synchronous,o.unshift(p.fulfilled,p.rejected))});const u=[];this.interceptors.response.forEach(function(p){u.push(p.fulfilled,p.rejected)});let c,d=0,m;if(!l){const f=[Z1.bind(this),void 0];for(f.unshift.apply(f,o),f.push.apply(f,u),m=f.length,c=Promise.resolve(t);d{if(!r._listeners)return;let n=r._listeners.length;for(;n-- >0;)r._listeners[n](i);r._listeners=null}),this.promise.then=i=>{let n;const a=new Promise(o=>{r.subscribe(o),n=o}).then(i);return a.cancel=function(){r.unsubscribe(n)},a},e(function(n,a,o){r.reason||(r.reason=new _n(n,a,o),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=r=>{e.abort(r)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new D2(function(i){e=i}),cancel:e}}};function qG(s){return function(t){return s.apply(null,t)}}function XG(s){return Y.isObject(s)&&s.isAxiosError===!0}const tp={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(tp).forEach(([s,e])=>{tp[e]=s});function T2(s){const e=new Rr(s),t=n2(Rr.prototype.request,e);return Y.extend(t,Rr.prototype,e,{allOwnKeys:!0}),Y.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return T2(Kr(s,i))},t}const Le=T2(po);Le.Axios=Rr;Le.CanceledError=_n;Le.CancelToken=ZG;Le.isCancel=b2;Le.VERSION=P2;Le.toFormData=dd;Le.AxiosError=xe;Le.Cancel=Le.CanceledError;Le.all=function(e){return Promise.all(e)};Le.spread=qG;Le.isAxiosError=XG;Le.mergeConfig=Kr;Le.AxiosHeaders=Lt;Le.formToJSON=s=>v2(Y.isHTMLForm(s)?new FormData(s):s);Le.getAdapter=S2.getAdapter;Le.HttpStatusCode=tp;Le.default=Le;const{Axios:Nse,AxiosError:Vse,CanceledError:Bse,isCancel:Use,CancelToken:Wse,VERSION:zse,all:Gse,Cancel:Zse,isAxiosError:qse,spread:Xse,toFormData:Yse,AxiosHeaders:Jse,HttpStatusCode:Kse,formToJSON:Qse,getAdapter:ere,mergeConfig:tre}=Le;var YG=Object.getOwnPropertyDescriptor,JG=(s,e,t,r)=>{for(var i=r>1?void 0:r?YG(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let sp=class extends k(L,vt){constructor(){super(...arguments),this.mdiInformation=Ht,this.mdiClose=Ba,this.mdiCog=ss,this.mdiFolder=Np,this.mdiFolderUpload=Bp,this.mdiFileDocumentEditOutline=za,this.mdiFile=Bs,this.mdiCloudDownload=Kn,this.mdiRenameBox=vu,this.mdiDelete=Ue,this.mdiCloseThick=pe,this.mdiLockOutline=fu,this.mdiContentCopy=Fp,this.sortFiles=rf,this.formatFilesize=Xe,this.currentPage=1,this.contextMenu={shown:!1,isDirectory:!1,touchTimer:null,x:0,y:0,item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogImage={show:!1,item:{name:null,url:null,svg:null}},this.dialogCreateFile={show:!1,name:""},this.dialogRenameFile={show:!1,newName:"",item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogDuplicateFile={show:!1,newName:"",item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogCreateDirectory={show:!1,name:""},this.dialogRenameDirectory={show:!1,newName:"",item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.dialogDeleteDirectory={show:!1,item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.uploadSnackbar={status:!1,filename:"",percent:0,speed:0,total:0,number:0,max:0,cancelTokenSource:{}},this.draggingFile={item:{isDirectory:!1,filename:"",permissions:"",modified:new Date}},this.deleteDialog=!1,this.deleteSelectedDialog=!1,this.isInvalidName=!0,this.nameInputRules=[s=>!!s||this.$t("Files.InvalidNameEmpty"),s=>!this.existsFilename(s)||this.$t("Files.InvalidNameAlreadyExists")]}existsFilename(s){return this.files.findIndex(e=>e.filename===s)>=0}get blockFileUpload(){var s;return(s=this.$store.state.gui.view.blockFileUpload)!=null?s:!1}set blockFileUpload(s){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.blockFileUpload",value:s})}get toolbarButtons(){return[{text:this.$t("Machine.ConfigFilesPanel.Download"),color:"primary",icon:Kn,loadingName:"configDownloadZip",onlyWriteable:!1,condition:this.selectedFiles.length>0,click:()=>{this.downloadSelectedFiles()}},{text:this.$t("Machine.ConfigFilesPanel.Delete"),color:"error",icon:Ue,loadingName:null,onlyWriteable:!0,condition:this.selectedFiles.length>0,click:()=>{this.deleteSelectedDialog=!0}},{text:this.$t("Machine.ConfigFilesPanel.UploadFile"),color:this.machineButtonCol,icon:rv,loadingName:null,onlyWriteable:!0,condition:!0,click:this.uploadFileButton},{text:this.$t("Machine.ConfigFilesPanel.CreateFile"),color:this.machineButtonCol,icon:zw,loadingName:null,onlyWriteable:!0,condition:!0,click:this.createFile},{text:this.$t("Machine.ConfigFilesPanel.CreateDirectory"),color:this.machineButtonCol,icon:Vp,loadingName:null,onlyWriteable:!0,condition:!0,click:this.createDirectory},{text:this.$t("Machine.ConfigFilesPanel.RefreshDirectory"),color:this.machineButtonCol,icon:an,loadingName:null,onlyWriteable:!1,condition:!0,click:this.refreshFileList}].filter(s=>s.condition)}get filteredToolbarButtons(){return this.toolbarButtons.filter(s=>this.directoryPermissions.includes("w")&&s.onlyWriteable||!s.onlyWriteable)}get absolutePath(){let s="/"+this.root;return this.currentPath&&(s+=this.currentPath),s}get directory(){return this.$store.getters["files/getDirectory"](this.absolutePath)}get disk_usage(){var s,e;return(e=(s=this.directory)==null?void 0:s.disk_usage)!=null?e:{used:0,free:0,total:0}}get directoryPermissions(){var s,e;return(e=(s=this.directory)==null?void 0:s.permissions)!=null?e:"r"}get files(){var e,t;let s=[...(t=(e=this.directory)==null?void 0:e.childrens)!=null?t:[]];if(this.showHiddenFiles||(s=s.filter(r=>r.filename.slice(0,1)!==".")),this.hideBackupFiles){const r=/^printer-\d{8}_\d{6}\.cfg$/,i=/^crowsnest\.conf\.\d{4}-\d{2}-\d{2}-\d{4}$/;s=s.filter(n=>!n.filename.match(r)&&!n.filename.match(i)&&!n.filename.endsWith(".bkp"))}return s}get headers(){return[{text:"",value:"",sortable:!1},{text:this.$t("Machine.ConfigFilesPanel.Name"),value:"filename"},{text:this.$t("Machine.ConfigFilesPanel.Filesize"),value:"size",align:"right"},{text:this.$t("Machine.ConfigFilesPanel.LastModified"),value:"modified",align:"right"}]}get selectedFiles(){var s;return(s=this.$store.state.gui.view.configfiles.selectedFiles)!=null?s:[]}set selectedFiles(s){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.configfiles.selectedFiles",value:s})}get countPerPage(){return this.$store.state.gui.view.configfiles.countPerPage}set countPerPage(s){this.$store.dispatch("gui/saveSetting",{name:"view.configfiles.countPerPage",value:s})}get showHiddenFiles(){return this.$store.state.gui.view.configfiles.showHiddenFiles}set showHiddenFiles(s){this.$store.dispatch("gui/saveSetting",{name:"view.configfiles.showHiddenFiles",value:s})}get hideBackupFiles(){return this.$store.state.gui.view.configfiles.hideBackupFiles}set hideBackupFiles(s){this.$store.dispatch("gui/saveSetting",{name:"view.configfiles.hideBackupFiles",value:s})}get sortBy(){return this.$store.state.gui.view.configfiles.sortBy}set sortBy(s){s===void 0&&(s="filename"),this.$store.dispatch("gui/saveSetting",{name:"view.configfiles.sortBy",value:s})}get sortDesc(){return this.$store.state.gui.view.configfiles.sortDesc}set sortDesc(s){s===void 0&&(s=!1),this.$store.dispatch("gui/saveSetting",{name:"view.configfiles.sortDesc",value:s})}get registeredDirectories(){var s;return(s=this.$store.state.server.registered_directories)!=null?s:[]}get existConfigRoot(){return this.registeredDirectories.findIndex(s=>s==="config")!==-1}get showMissingConfigRootWarning(){return this.absolutePath.startsWith("/config")&&!this.absolutePath.startsWith("/config_example")&&!this.existConfigRoot}get registeredDirectoriesSelectItems(){const s=this.registeredDirectories.filter(e=>!aw.includes(e)).sort();return this.existConfigRoot||s.push("config"),s}get root(){return this.$store.state.gui.view.configfiles.rootPath}set root(s){this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.configfiles.rootPath",value:s})}get currentPath(){return this.$store.state.gui.view.configfiles.currentPath}set currentPath(s){this.selectedFiles=[],this.$store.dispatch("gui/saveSettingWithoutUpload",{name:"view.configfiles.currentPath",value:s})}refreshFileList(){this.$socket.emit("server.files.get_directory",{path:this.absolutePath.substring(1)},{action:"files/getDirectory"})}changeRoot(){this.currentPath=""}clickRow(s,e=!1){var t,r,i,n;if(!this.contextMenu.shown||e)if(e&&(this.contextMenu.shown=!1),s.isDirectory)this.currentPath+="/"+s.filename,this.currentPage=1;else if(["png","jpeg","jpg","gif","bmp","tif","svg"].includes((r=(t=s.filename.split(".").pop())==null?void 0:t.toLowerCase())!=null?r:"")){const a="".concat(this.apiUrl,"/server/files").concat(this.absolutePath,"/").concat(s.filename,"?t=").concat(Date.now());this.dialogImage.item.name=s.filename,["svg"].includes((n=(i=s.filename.split(".").pop())==null?void 0:i.toLowerCase())!=null?n:"")?fetch(a).then(o=>o.text()).then(o=>{this.dialogImage.show=!0,this.dialogImage.item.svg=o}):(this.dialogImage.show=!0,this.dialogImage.item.url=a)}else this.$store.dispatch("editor/openFile",{root:this.root,path:this.currentPath,filename:s.filename,size:s.size,permissions:s.permissions})}clickRowGoBack(){this.currentPath=this.currentPath.slice(0,this.currentPath.lastIndexOf("/"))}clickPathNavGoToDirectory(s){this.currentPath=s.location}showContextMenu(s,e){this.contextMenu.shown||(s==null||s.preventDefault(),this.contextMenu.shown=!0,this.contextMenu.x=(s==null?void 0:s.clientX)||(s==null?void 0:s.pageX)||window.screenX/2,this.contextMenu.y=(s==null?void 0:s.clientY)||(s==null?void 0:s.pageY)||window.screenY/2,this.contextMenu.item=e,this.$nextTick(()=>{this.contextMenu.shown=!0}))}downloadFile(){const s=this.absolutePath+"/"+this.contextMenu.item.filename,e="".concat(this.apiUrl,"/server/files").concat(Ie(s));window.open(e)}async downloadSelectedFiles(){let s=[];const e=async(u,c)=>{for(const d of c){const m="".concat(u,"/").concat(d.filename);if(d.isDirectory&&d.childrens){await e(m,d.childrens);continue}s.push(m)}};await e(this.absolutePath,this.selectedFiles);const t=new Date,r=(t.getMonth()+1).toString().padStart(2,"0"),i=t.getDate().toString().padStart(2,"0"),n=t.getHours().toString().padStart(2,"0"),a=t.getMinutes().toString().padStart(2,"0"),o=t.getSeconds().toString().padStart(2,"0"),l="".concat(t.getFullYear()).concat(r).concat(i,"-").concat(n).concat(a).concat(o);this.$socket.emit("server.files.zip",{items:s,dest:"config/".concat(this.root,"-").concat(l,".zip")},{action:"files/downloadZip",loading:"configDownloadZip"}),this.selectedFiles=[]}createDirectory(){this.dialogCreateDirectory.name="",this.dialogCreateDirectory.show=!0,setTimeout(()=>{var s;(s=this.$refs.inputDialogCreateDirectoryName)==null||s.focus()},200)}createDirectoryAction(){this.dialogCreateDirectory.show=!1,this.$socket.emit("server.files.post_directory",{path:this.absolutePath.substring(1)+"/"+this.dialogCreateDirectory.name},{action:"files/getCreateDir"})}renameDirectory(s){this.dialogRenameDirectory.item=s,this.dialogRenameDirectory.newName=s.filename,this.dialogRenameDirectory.show=!0,setTimeout(()=>{var e;(e=this.$refs.inputDialogRenameDirectoryName)==null||e.focus()},200)}renameDirectoryAction(){this.dialogRenameDirectory.show=!1,this.$socket.emit("server.files.move",{source:(this.absolutePath+"/"+this.dialogRenameDirectory.item.filename).slice(1),dest:(this.absolutePath+"/"+this.dialogRenameDirectory.newName).slice(1)},{action:"files/getMove"})}deleteDirectory(s){this.dialogDeleteDirectory.item=s,this.dialogDeleteDirectory.show=!0}deleteDirectoryAction(){this.dialogDeleteDirectory.show=!1,this.$socket.emit("server.files.delete_directory",{path:this.absolutePath+"/"+this.dialogDeleteDirectory.item.filename,force:!0},{action:"files/getDeleteDir"})}createFile(){this.dialogCreateFile.name="",this.dialogCreateFile.show=!0,setTimeout(()=>{var s;(s=this.$refs.inputDialogCreateFileName)==null||s.focus()},200)}createFileAction(){const s=new File([""],this.dialogCreateFile.name);let e=new FormData;e.append("file",s),e.append("root",this.root),this.currentPath.length&&e.append("path",this.currentPath.slice(1)),Le.post(this.apiUrl+"/server/files/upload",e,{headers:{"Content-Type":"multipart/form-data"}}).then(()=>{this.$toast.success(this.$t("Files.SuccessfullyCreated",{filename:this.dialogCreateFile.name}).toString()),this.dialogCreateFile.show=!1,this.dialogCreateFile.name=""}).catch(()=>{window.console.error("Error create file: "+this.dialogCreateFile.name)})}renameFile(s){this.dialogRenameFile.item=s,this.dialogRenameFile.newName=s.filename,this.dialogRenameFile.show=!0,setTimeout(()=>{var e;(e=this.$refs.inputDialogRenameFileName)==null||e.focus()},200)}renameFileAction(){this.dialogRenameFile.show=!1,this.$socket.emit("server.files.move",{source:(this.absolutePath+"/"+this.dialogRenameFile.item.filename).slice(1),dest:(this.absolutePath+"/"+this.dialogRenameFile.newName).slice(1)},{action:"files/getMove"})}duplicateFile(s){this.dialogDuplicateFile.item=s,this.dialogDuplicateFile.newName=s.filename,this.dialogDuplicateFile.show=!0,setTimeout(()=>{var e;(e=this.$refs.inputDialogDuplicateFileName)==null||e.focus()},200)}duplicateFileAction(){this.dialogDuplicateFile.show=!1,this.$socket.emit("server.files.copy",{source:(this.absolutePath+"/"+this.dialogDuplicateFile.item.filename).slice(1),dest:(this.absolutePath+"/"+this.dialogDuplicateFile.newName).slice(1)})}removeFile(){this.$socket.emit("server.files.delete_file",{path:this.absolutePath+"/"+this.contextMenu.item.filename},{action:"files/getDeleteFile"}),this.deleteDialog=!1}deleteSelectedFiles(){this.selectedFiles.forEach(s=>{s.isDirectory?this.$socket.emit("server.files.delete_directory",{path:this.absolutePath+"/"+s.filename,force:!0},{action:"files/getDeleteDir"}):this.$socket.emit("server.files.delete_file",{path:this.absolutePath+"/"+s.filename},{action:"files/getDeleteFile"})}),this.selectedFiles=[],this.deleteSelectedDialog=!1}uploadFileButton(){this.$refs.fileUpload.click()}async uploadFile(){var s;if((s=this.$refs.fileUpload.files)!=null&&s.length){const e=[...this.$refs.fileUpload.files];this.$refs.fileUpload.value="",await this.$store.dispatch("socket/addLoading",{name:"configFileUpload"}),await this.$store.dispatch("files/uploadSetCurrentNumber",0),await this.$store.dispatch("files/uploadSetMaxNumber",this.$refs.fileUpload.files.length);for(const t of e){await this.$store.dispatch("files/uploadIncrementCurrentNumber");const r=this.currentPath.slice(0,1)==="/"?this.currentPath.slice(1):this.currentPath,i=await this.$store.dispatch("files/uploadFile",{file:t,path:r,root:"config"});i!==!1&&this.$toast.success(this.$t("Files.SuccessfullyUploaded",{filename:i}).toString())}await this.$store.dispatch("socket/removeLoading",{name:"configFileUpload"})}}cancelUpload(){this.uploadSnackbar.cancelTokenSource.cancel(),this.uploadSnackbar.status=!1}dragFile(s,e){s.preventDefault(),this.blockFileUpload=!0,this.draggingFile.item=e}dragendFile(s){s.preventDefault(),this.blockFileUpload=!1,this.draggingFile.item={isDirectory:!1,filename:"",permissions:"",modified:new Date}}dragOverFilelist(s,e){this.blockFileUpload&&(s.preventDefault(),e.isDirectory&&(s.target.parentElement.style.backgroundColor="#43A04720"))}dragLeaveFilelist(s){this.blockFileUpload&&(s.preventDefault(),s.stopPropagation(),s.target.parentElement.style.backgroundColor="transparent")}async dragDropFilelist(s,e){if(this.blockFileUpload){s.preventDefault(),s.target.parentElement.style.backgroundColor="transparent";let t;e.filename===".."?t=this.absolutePath.slice(1,this.absolutePath.lastIndexOf("/")+1)+this.draggingFile.item.filename:t=this.absolutePath+"/"+e.filename+"/"+this.draggingFile.item.filename,this.$socket.emit("server.files.move",{source:this.absolutePath.slice(1)+"/"+this.draggingFile.item.filename,dest:t},{action:"files/getMove"})}}};sp=JG([S({components:{Panel:U,PathNavigation:hn}})],sp);var KG=function(){var r;var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(U,{attrs:{title:e.$t("Machine.ConfigFilesPanel.ConfigFiles"),"card-class":"machine-configfiles-panel",icon:e.mdiInformation,collapsible:!0}},[t(Z,[t(x,[t(b,{staticClass:"col-12 col-lg pr-lg-0"},[t(ke,{staticClass:"machine-configfiles-panel__root-select",attrs:{items:e.registeredDirectoriesSelectItems,label:e.$t("Machine.ConfigFilesPanel.Root"),outlined:"","hide-details":"",dense:"",attach:".machine-configfiles-panel__root-select"},on:{change:e.changeRoot},model:{value:e.root,callback:function(i){e.root=i},expression:"root"}})],1),t(b,{staticClass:"col col-lg-auto pl-lg-0 text-right"},[t("input",{ref:"fileUpload",staticStyle:{display:"none"},attrs:{type:"file",multiple:""},on:{change:e.uploadFile}}),e._l(e.filteredToolbarButtons,function(i){return t(g,{key:i.loadingName,staticClass:"px-2 minwidth-0 ml-3",attrs:{color:i.color,loading:i.loadingName!==null&&e.loadings.includes(i.loadingName)},on:{click:i.click}},[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:a}){return[t(_,e._g(e._b({},"v-icon",a,!1),n),[e._v(e._s(i.icon))])]}}],null,!0)},[t("span",[e._v(e._s(i.text))])])],1)}),t(ye,{attrs:{"offset-y":"",left:"",title:e.$t("Machine.ConfigFilesPanel.SetupCurrentList")},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:n}){return[t(g,e._g(e._b({staticClass:"px-2 minwidth-0 ml-3"},"v-btn",n,!1),i),[t(_,{staticClass:"machine-configfiles-panel__settings-icon"},[e._v(e._s(e.mdiCog))])],1)]}}])},[t(Me,[t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Machine.ConfigFilesPanel.HiddenFiles")},model:{value:e.showHiddenFiles,callback:function(i){e.showHiddenFiles=i},expression:"showHiddenFiles"}})],1),t(J,{staticClass:"minHeight36"},[t(ge,{staticClass:"mt-0",attrs:{"hide-details":"",label:e.$t("Machine.ConfigFilesPanel.HideBackupFiles")},model:{value:e.hideBackupFiles,callback:function(i){e.hideBackupFiles=i},expression:"hideBackupFiles"}})],1)],1)],1)],2)],1)],1),t(Z,[t(x,[t(b,{staticClass:"col-12 py-2 d-flex align-center"},[t("span",[t("b",{staticClass:"mr-1"},[e._v(e._s(e.$t("Machine.ConfigFilesPanel.CurrentPath"))+":")]),t(hn,{attrs:{path:e.currentPath,"base-directory-label":"/".concat(e.root),"on-segment-click":e.clickPathNavGoToDirectory}})],1),t(ae),e.disk_usage!==null&&!e.showMissingConfigRootWarning?[t(de,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:n}){return[t("span",e._g(e._b({},"span",n,!1),i),[t("b",[e._v(e._s(e.$t("Machine.ConfigFilesPanel.FreeDisk"))+":")]),e._v(" "+e._s(e.formatFilesize(e.disk_usage.free))+" ")])]}}],null,!1,3140322967)},[t("span",[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Used"))+": "+e._s(e.formatFilesize(e.disk_usage.used))+" "),t("br"),e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Free"))+": "+e._s(e.formatFilesize(e.disk_usage.free))+" "),t("br"),e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Total"))+": "+e._s(e.formatFilesize(e.disk_usage.total))+" ")])])]:e._e()],2)],1)],1),t(I),e.showMissingConfigRootWarning?t(Z,[t(x,[t(b,{staticClass:"col-12 col-lg pr-lg-0"},[t(it,{staticClass:"mx-auto mt-6",attrs:{dense:"",text:"",type:"warning",elevation:"2","max-width":"500",icon:e.mdiLockOutline}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.ConfigRootDirectoryDoesntExists"))+" ")])],1)],1)],1):t(Qr,{staticClass:"files-table",attrs:{items:e.files,headers:e.headers,page:e.currentPage,"custom-sort":e.sortFiles,"sort-by":e.sortBy,"sort-desc":e.sortDesc,"items-per-page":e.countPerPage,"footer-props":{itemsPerPageText:e.$t("Machine.ConfigFilesPanel.Files"),itemsPerPageAllText:e.$t("Machine.ConfigFilesPanel.AllFiles"),itemsPerPageOptions:[10,25,50,100,-1]},"mobile-breakpoint":"0","item-key":"filename","show-select":""},on:{"update:page":function(i){e.currentPage=i},"update:sortBy":function(i){e.sortBy=i},"update:sort-by":function(i){e.sortBy=i},"update:sortDesc":function(i){e.sortDesc=i},"update:sort-desc":function(i){e.sortDesc=i},"update:itemsPerPage":function(i){e.countPerPage=i},"update:items-per-page":function(i){e.countPerPage=i}},scopedSlots:e._u([{key:"no-data",fn:function(){return[t("div",{staticClass:"text-center"},[e._v(e._s(e.$t("Machine.ConfigFilesPanel.Empty")))])]},proxy:!0},{key:"item",fn:function({index:i,item:n,isSelected:a,select:o}){return[t("tr",{directives:[{name:"longpress",rawName:"v-longpress:600",value:l=>e.showContextMenu(l,n),expression:"(e) => showContextMenu(e, item)",arg:"600"}],key:"".concat(i," ").concat(n.filename),staticClass:"file-list-cursor user-select-none",attrs:{"data-name":n.filename,draggable:"true"},on:{contextmenu:function(l){return e.showContextMenu(l,n)},click:function(l){return e.clickRow(n)},drag:function(l){return e.dragFile(l,n)},dragend:function(l){return e.dragendFile(l)},dragover:function(l){return e.dragOverFilelist(l,n)},dragleave:e.dragLeaveFilelist,drop:function(l){return l.preventDefault(),l.stopPropagation(),e.dragDropFilelist(l,n)}}},[t("td",{staticClass:"file-list__select-td pr-0"},[t(jr,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{value:a},on:{click:function(l){return l.stopPropagation(),o(!a)}}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[n.isDirectory?t(_,[e._v(e._s(e.mdiFolder))]):e._e(),n.isDirectory?e._e():t(_,[e._v(e._s(e.mdiFile))])],1),t("td",{staticClass:""},[e._v(e._s(n.filename))]),t("td",{staticClass:"text-no-wrap text-right"},[e._v(" "+e._s(n.isDirectory?"--":e.formatFilesize(n.size))+" ")]),t("td",{staticClass:"text-right"},[e._v(e._s(e.formatDateTime(n.modified)))])])]}}],null,!1,1962952882),model:{value:e.selectedFiles,callback:function(i){e.selectedFiles=i},expression:"selectedFiles"}},[e.currentPath!==""?t("template",{slot:"body.prepend"},[t("tr",{staticClass:"file-list-cursor",on:{click:e.clickRowGoBack,dragover:function(i){return e.dragOverFilelist(i,{isDirectory:!0,filename:".."})},dragleave:e.dragLeaveFilelist,drop:function(i){return i.preventDefault(),i.stopPropagation(),e.dragDropFilelist(i,{isDirectory:!0,filename:".."})}}},[t("td",{staticClass:"file-list__select-td pr-0"},[t(jr,{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"pa-0 mr-0",attrs:{disabled:""}})],1),t("td",{staticClass:"px-0 text-center",staticStyle:{width:"32px"}},[t(_,[e._v(e._s(e.mdiFolderUpload))])],1),t("td",{staticClass:"",attrs:{colspan:"4"}},[e._v("..")])])]):e._e()],2)],1),t(ye,{attrs:{"position-x":e.contextMenu.x,"position-y":e.contextMenu.y,absolute:"","offset-y":""},model:{value:e.contextMenu.shown,callback:function(i){e.$set(e.contextMenu,"shown",i)},expression:"contextMenu.shown"}},[t(Me,[e.contextMenu.item.isDirectory?e._e():t(J,{on:{click:function(i){return e.clickRow(e.contextMenu.item,!0)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiFileDocumentEditOutline))]),e._v(" "+e._s(e.contextMenu.item.permissions.includes("w")?e.$t("Machine.ConfigFilesPanel.EditFile"):e.$t("Machine.ConfigFilesPanel.ShowFile"))+" ")],1),e.contextMenu.item.isDirectory?e._e():t(J,{on:{click:e.downloadFile}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiCloudDownload))]),e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Download"))+" ")],1),!e.contextMenu.item.isDirectory&&e.contextMenu.item.permissions.includes("w")?t(J,{on:{click:function(i){return e.renameFile(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiRenameBox))]),e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Rename"))+" ")],1):e._e(),e.contextMenu.item.isDirectory?e._e():t(J,{on:{click:function(i){return e.duplicateFile(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiContentCopy))]),e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Duplicate"))+" ")],1),e.contextMenu.item.isDirectory&&e.contextMenu.item.permissions.includes("w")?t(J,{on:{click:function(i){return e.renameDirectory(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1"},[e._v(e._s(e.mdiRenameBox))]),e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Rename"))+" ")],1):e._e(),!e.contextMenu.item.isDirectory&&e.contextMenu.item.permissions.includes("w")?t(J,{staticClass:"red--text",on:{click:function(i){e.deleteDialog=!0}}},[t(_,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Delete"))+" ")],1):e._e(),e.contextMenu.item.isDirectory&&e.contextMenu.item.permissions.includes("w")?t(J,{staticClass:"red--text",on:{click:function(i){return e.deleteDirectory(e.contextMenu.item)}}},[t(_,{staticClass:"mr-1",attrs:{color:"error"}},[e._v(e._s(e.mdiDelete))]),e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Delete"))+" ")],1):e._e()],1)],1),t(le,{staticClass:"fill-height",attrs:{"hide-overlay":"",fullscreen:""},on:{keydown:function(i){if(!i.type.indexOf("key")&&e._k(i.keyCode,"esc",27,i.key,["Esc","Escape"]))return null;e.dialogImage.show=!1,e.dialogImage.item.url=null,e.dialogImage.item.svg=null}},model:{value:e.dialogImage.show,callback:function(i){e.$set(e.dialogImage,"show",i)},expression:"dialogImage.show"}},[t(U,{staticStyle:{position:"relative"},attrs:{title:(r=e.dialogImage.item.name)!=null?r:"","card-class":"maschine-configfiles-imageviewer-dialog"},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(i){e.dialogImage.show=!1,e.dialogImage.item.url=null,e.dialogImage.item.svg=null}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t("div",{staticClass:"d-flex justify-center",staticStyle:{"max-height":"calc(var(--app-height) - 64px)",overflow:"auto"}},[e.dialogImage.item.url?t("img",{staticStyle:{"max-height":"100%",width:"auto","max-width":"100%","object-fit":"contain"},attrs:{src:e.dialogImage.item.url,alt:"image"}}):e.dialogImage.item.svg?t("div",{staticClass:"fill-width",domProps:{innerHTML:e._s(e.dialogImage.item.svg)}}):e._e()])])],1),t(le,{attrs:{"max-width":"400"},model:{value:e.dialogCreateFile.show,callback:function(i){e.$set(e.dialogCreateFile,"show",i)},expression:"dialogCreateFile.show"}},[t(U,{attrs:{title:e.$t("Machine.ConfigFilesPanel.CreateFile"),"card-class":"maschine-configfiles-create-file-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(i){e.dialogCreateFile.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputDialogCreateFileName",attrs:{label:e.$t("Machine.ConfigFilesPanel.Name"),required:"",rules:e.nameInputRules},on:{"update:error":i=>e.isInvalidName=i,keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.createFileAction.apply(null,arguments)}},model:{value:e.dialogCreateFile.name,callback:function(i){e.$set(e.dialogCreateFile,"name",i)},expression:"dialogCreateFile.name"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(i){e.dialogCreateFile.show=!1}}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.createFileAction}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Create"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.dialogRenameFile.show,callback:function(i){e.$set(e.dialogRenameFile,"show",i)},expression:"dialogRenameFile.show"}},[t(U,{attrs:{title:e.$t("Machine.ConfigFilesPanel.RenameFile"),"card-class":"maschine-configfiles-rename-file-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(i){e.dialogRenameFile.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputDialogRenameFileName",attrs:{label:e.$t("Machine.ConfigFilesPanel.Name"),required:"",rules:e.nameInputRules},on:{"update:error":i=>e.isInvalidName=i,keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.renameFileAction.apply(null,arguments)}},model:{value:e.dialogRenameFile.newName,callback:function(i){e.$set(e.dialogRenameFile,"newName",i)},expression:"dialogRenameFile.newName"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(i){e.dialogRenameFile.show=!1}}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.renameFileAction}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Rename"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.dialogDuplicateFile.show,callback:function(i){e.$set(e.dialogDuplicateFile,"show",i)},expression:"dialogDuplicateFile.show"}},[t(U,{attrs:{title:e.$t("Machine.ConfigFilesPanel.DuplicateFile"),"card-class":"maschine-configfiles-duplicate-file-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(i){e.dialogDuplicateFile.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputDialoDuplicateFileName",attrs:{label:e.$t("Machine.ConfigFilesPanel.Name"),required:"",rules:e.nameInputRules},on:{"update:error":i=>e.isInvalidName=i,keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.duplicateFileAction.apply(null,arguments)}},model:{value:e.dialogDuplicateFile.newName,callback:function(i){e.$set(e.dialogDuplicateFile,"newName",i)},expression:"dialogDuplicateFile.newName"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(i){e.dialogDuplicateFile.show=!1}}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.duplicateFileAction}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Duplicate"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.dialogCreateDirectory.show,callback:function(i){e.$set(e.dialogCreateDirectory,"show",i)},expression:"dialogCreateDirectory.show"}},[t(U,{attrs:{title:e.$t("Machine.ConfigFilesPanel.CreateDirectory"),"card-class":"maschine-configfiles-create-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(i){e.dialogCreateDirectory.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputDialogCreateDirectoryName",attrs:{label:e.$t("Machine.ConfigFilesPanel.Name"),required:"",rules:e.nameInputRules},on:{"update:error":i=>e.isInvalidName=i,keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.createDirectoryAction.apply(null,arguments)}},model:{value:e.dialogCreateDirectory.name,callback:function(i){e.$set(e.dialogCreateDirectory,"name",i)},expression:"dialogCreateDirectory.name"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(i){e.dialogCreateDirectory.show=!1}}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.createDirectoryAction}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Create"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.dialogRenameDirectory.show,callback:function(i){e.$set(e.dialogRenameDirectory,"show",i)},expression:"dialogRenameDirectory.show"}},[t(U,{attrs:{title:e.$t("Machine.ConfigFilesPanel.RenameDirectory"),"card-class":"maschine-configfiles-rename-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(i){e.dialogRenameDirectory.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t(se,{ref:"inputDialogRenameDirectoryName",attrs:{label:e.$t("Machine.ConfigFilesPanel.Name"),required:"",rules:e.nameInputRules},on:{"update:error":i=>e.isInvalidName=i,keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.renameDirectoryAction.apply(null,arguments)}},model:{value:e.dialogRenameDirectory.newName,callback:function(i){e.$set(e.dialogRenameDirectory,"newName",i)},expression:"dialogRenameDirectory.newName"}})],1),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(i){e.dialogRenameDirectory.show=!1}}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),t(g,{attrs:{disabled:e.isInvalidName,color:"primary",text:""},on:{click:e.renameDirectoryAction}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Rename"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.dialogDeleteDirectory.show,callback:function(i){e.$set(e.dialogDeleteDirectory,"show",i)},expression:"dialogDeleteDirectory.show"}},[t(U,{attrs:{title:e.$t("Machine.ConfigFilesPanel.DeleteDirectory"),"card-class":"maschine-configfiles-delete-directory-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(i){e.dialogDeleteDirectory.show=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.DeleteDirectoryQuestion",{name:e.dialogDeleteDirectory.item.filename}))+" ")])]),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(i){e.dialogDeleteDirectory.show=!1}}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteDirectoryAction}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Delete"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.deleteDialog,callback:function(i){e.deleteDialog=i},expression:"deleteDialog"}},[t(U,{attrs:{title:e.$t("Machine.ConfigFilesPanel.Delete"),"card-class":"maschine-configfiles-delete-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(i){e.deleteDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.DeleteSingleFileQuestion",{name:e.contextMenu.item.filename}))+" ")])]),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(i){e.deleteDialog=!1}}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),t(g,{attrs:{color:"error",text:""},on:{click:e.removeFile}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Delete"))+" ")])],1)],1)],1),t(le,{attrs:{"max-width":"400"},model:{value:e.deleteSelectedDialog,callback:function(i){e.deleteSelectedDialog=i},expression:"deleteSelectedDialog"}},[t(U,{attrs:{title:e.$t("Machine.ConfigFilesPanel.Delete"),"card-class":"maschine-configfiles-delete-selected-dialog","margin-bottom":!1},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(i){e.deleteSelectedDialog=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[t(Z,[e.selectedFiles.length===1?t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.DeleteSingleFileQuestion",{name:e.selectedFiles[0].filename}))+" ")]):t("p",{staticClass:"mb-0"},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.DeleteSelectedQuestion",{count:e.selectedFiles.length}))+" ")])]),t(oe,[t(ae),t(g,{attrs:{color:"",text:""},on:{click:function(i){e.deleteSelectedDialog=!1}}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Cancel"))+" ")]),t(g,{attrs:{color:"error",text:""},on:{click:e.deleteSelectedFiles}},[e._v(" "+e._s(e.$t("Machine.ConfigFilesPanel.Delete"))+" ")])],1)],1)],1),t(xi,{attrs:{timeout:-1,value:!0,fixed:"",right:"",bottom:""},scopedSlots:e._u([{key:"action",fn:function({attrs:i}){return[t(g,e._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:""},on:{click:e.cancelUpload}},"v-btn",i,!1),[t(_,{staticClass:"0"},[e._v(e._s(e.mdiClose))])],1)]}}]),model:{value:e.uploadSnackbar.status,callback:function(i){e.$set(e.uploadSnackbar,"status",i)},expression:"uploadSnackbar.status"}},[e.uploadSnackbar.max>1?t("span",{staticClass:"mr-1"},[e._v(" ("+e._s(e.uploadSnackbar.number)+"/"+e._s(e.uploadSnackbar.max)+") ")]):e._e(),t("strong",[e._v(e._s(e.$t("Machine.ConfigFilesPanel.Uploading"))+" "+e._s(e.uploadSnackbar.filename))]),t("br"),e._v(" "+e._s(Math.round(e.uploadSnackbar.percent))+" % @ "+e._s(e.formatFilesize(Math.round(e.uploadSnackbar.speed)))+"/s "),t("br"),t(Ss,{staticClass:"mt-2",attrs:{value:e.uploadSnackbar.percent}})],1)],1)},QG=[],eZ=E(sp,KG,QG,!1,null,null);const O2=eZ.exports;var tZ=Object.getOwnPropertyDescriptor,sZ=(s,e,t,r)=>{for(var i=r>1?void 0:r?tZ(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let rp=class extends k(L){};rp=sZ([S({components:{SystemPanel:i2,ConfigFilesPanel:O2,EndstopPanel:Vy,LogfilesPanel:Iy,UpdatePanel:e2,KlippyStatePanel:so}})],rp);var rZ=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(Ee,{attrs:{fluid:"","py-0":"","px-0":""}},[t(x,[t(b,{staticClass:"col-12 col-md-6 pb-0 pb-md-3"},[t(O2)],1),t(b,{staticClass:"col-12 col-md-6 pt-0 pt-md-3"},[t(so),t(i2),t(e2),t(x,[e.klipperState==="ready"?t(b,{staticClass:"col-12 col-sm-6 pb-0 pb-md-3"},[t(Vy)],1):e._e(),t(b,{class:e.klipperState!=="ready"?"col-12":"col-12 col-sm-6 pt-0 pt-sm-3"},[t(Iy)],1)],1)],1)],1)],1)},iZ=[],nZ=E(rp,rZ,iZ,!1,null,null);const aZ=nZ.exports,M2=[{name:"dashboard",title:"Dashboard",path:"/",icon:Gp,component:jR,alwaysShow:!0,showInNavi:!0,position:10},{name:"farm",title:"Printers",path:"/allPrinters",component:aH,alwaysShow:!1,showInNavi:!1},{name:"webcam",title:"Webcam",path:"/cam",icon:on,component:WR,alwaysShow:!0,showInNavi:!0,position:20,fullscreen:!0},{name:"console",title:"Console",path:"/console",icon:Ua,component:mH,alwaysShow:!0,showInNavi:!0,klipperIsConnected:!0,position:30},{name:"heightmap",title:"Heightmap",path:"/heightmap",icon:hu,component:()=>fe(()=>import("./Heightmap-1ReT1M6e.js"),__vite__mapDeps([30,2,3,4,5,6,31])),alwaysShow:!1,showInNavi:!0,klipperComponent:"bed_mesh",position:40},{name:"gcodefiles",title:"G-Code Files",path:"/files",icon:Ga,component:jH,alwaysShow:!0,showInNavi:!0,registeredDirectory:"gcodes",position:50,fullscreen:!0},{name:"gcodeviewer",title:"G-Code Viewer",path:"/viewer",icon:yu,component:()=>fe(()=>import("./Viewer-DVCEMRp5.js").then(s=>s.i),__vite__mapDeps([32,2,3,4,5,1,33])),alwaysShow:!0,showInNavi:!0,position:60,fullscreen:!0},{name:"history",title:"History",path:"/history",icon:nv,component:mN,alwaysShow:!0,showInNavi:!0,moonrakerComponent:"history",position:70},{name:"timelapse",title:"Timelapse",path:"/timelapse",icon:Tv,component:FN,alwaysShow:!0,showInNavi:!0,moonrakerComponent:"timelapse",position:80},{name:"machine",title:"Machine",path:"/config",icon:FS,component:aZ,alwaysShow:!0,showInNavi:!0,position:90},{title:null,component:null,alwaysShow:!1,showInNavi:!1,path:"/settings/machine",redirect:"/config"}];var oZ=Object.defineProperty,lZ=Object.getOwnPropertyDescriptor,k2=(s,e,t,r)=>{for(var i=r>1?void 0:r?lZ(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&oZ(e,t,i),i};let Xi=class extends k(L){constructor(){super(...arguments),this.customNaviLinks=[]}get countPrinters(){return this.$store.getters["farm/countPrinters"]}get routesNaviPoints(){const s=[];return this.countPrinters&&s.push({title:this.$t("App.Printers"),icon:LS,to:"/allPrinters",position:0,visible:!0}),M2.filter(e=>e.showInNavi&&this.showInNavi(e)).forEach(e=>{var i,n;const[t,r]=this.getUiSettings({type:"route",title:(i=e.title)!=null?i:"unknown",visible:!0,position:(n=e.position)!=null?n:999});s.push({type:"route",title:this.$t("Router.".concat(e.title)),orgTitle:e.title,icon:e.icon,to:e.path,position:t,visible:r})}),this.customNaviLinks.length&&this.customNaviLinks.forEach(e=>{var i,n,a;const[t,r]=this.getUiSettings({type:"link",title:(i=e.title)!=null?i:"unknown",visible:(n=e.visible)!=null?n:!0,position:(a=e.position)!=null?a:999});s.push({type:"link",title:e.title,icon:e.icon,href:e.href,target:e.target,position:t,visible:r})}),s}get naviPoints(){return this.routesNaviPoints.sort((s,e)=>s.position-e.position)}get visibleNaviPoints(){return this.naviPoints.filter(s=>s.visible)}get uiSettings(){return this.$store.state.gui.navigation.entries}get klippy_state(){return this.$store.state.server.klippy_state}get boolNaviWebcam(){return this.$store.state.gui.uiSettings.boolWebcamNavi}get moonrakerComponents(){return this.$store.state.server.components}get registeredDirectories(){return this.$store.state.server.registered_directories}get klipperConfigfileSettings(){var s,e;return(e=(s=this.$store.state.printer.configfile)==null?void 0:s.settings)!=null?e:{}}get sidebarNaviFile(){return this.$store.getters["files/getCustomNaviPoints"]}get webcamCount(){return this.$store.getters["gui/webcams/getWebcams"].length}async sidebarNaviFileChanged(s){if(this.customNaviLinks=[],!s)return;(await fetch(s).then(t=>t.json()).catch(t=>{throw window.console.error("Unable to parse .theme/navi.json."),t})).forEach(t=>{var r,i,n,a,o;this.customNaviLinks.push({title:(r=t.title)!=null?r:"Unknown",icon:(i=t.icon)!=null?i:cv,href:(n=t.href)!=null?n:"#",target:(a=t.target)!=null?a:void 0,position:(o=t.position)!=null?o:999})})}showInNavi(s){return["shutdown","error","disconnected"].includes(this.klippy_state)&&!s.alwaysShow||s.title==="Webcam"&&this.webcamCount===0||s.moonrakerComponent&&!this.moonrakerComponents.includes(s.moonrakerComponent)||s.registeredDirectory&&!this.registeredDirectories.includes(s.registeredDirectory)||s.klipperComponent&&!(s.klipperComponent in this.klipperConfigfileSettings)?!1:!(s.klipperIsConnected&&!this.klippyIsConnected)}getUiSettings(s){const e=this.uiSettings.findIndex(t=>t.title===s.title&&t.type===s.type);return e===-1?[s.position,s.visible]:[this.uiSettings[e].position,this.uiSettings[e].visible]}};k2([he("sidebarNaviFile",{immediate:!0})],Xi.prototype,"sidebarNaviFileChanged",1);Xi=k2([S],Xi);var cZ=Object.defineProperty,uZ=Object.getOwnPropertyDescriptor,E2=(s,e,t,r)=>{for(var i=r>1?void 0:r?uZ(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&cZ(e,t,i),i};let Hc=class extends k(Xi,L,vt){constructor(){super(...arguments),this.mdiDragVertical=Wa}get title(){return this.naviPoint.title}get subtitle(){var e;if(this.naviPoint.type==="link")return"URL: ".concat((e=this.naviPoint.href)!=null?e:"Unknown")}get checkboxColor(){return this.naviPoint.visible?"primary":"grey lighten-1"}get checkboxIcon(){return this.naviPoint.visible?Lp:Ep}changeVisibility(){this.$store.dispatch("gui/navigation/changeVisibility",this.naviPoint)}};E2([w({type:Object,required:!0})],Hc.prototype,"naviPoint",2);Hc=E2([S({components:{SettingsRow:j,draggable:si}})],Hc);var dZ=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(x,{staticClass:"my-2 mx-0",style:e.draggableBgStyle},[t(b,{staticClass:"col-auto pr-0 d-flex py-2"},[t(_,{staticClass:"handle"},[e._v(e._s(e.mdiDragVertical))])],1),t(b,{staticClass:"py-2"},[t(j,{attrs:{title:e.title,"sub-title":e.subtitle,"dynamic-slot-width":!0}},[t(_,{attrs:{color:e.checkboxColor},domProps:{innerHTML:e._s(e.checkboxIcon)},on:{click:e.changeVisibility}})],1)],1)],1)},mZ=[],hZ=E(Hc,dZ,mZ,!1,null,null);const L2=hZ.exports;var pZ=Object.getOwnPropertyDescriptor,fZ=(s,e,t,r)=>{for(var i=r>1?void 0:r?pZ(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let ip=class extends k(Xi,L,vt){get sortableNaviPoints(){return this.naviPoints.filter(e=>e.position>0)}set sortableNaviPoints(e){e.forEach((t,r)=>{var i;this.$store.dispatch("gui/navigation/updatePos",{type:t.type,title:(i=t.orgTitle)!=null?i:t.title,visible:t.visible,position:r+1})}),this.$store.dispatch("gui/navigation/upload")}};ip=fZ([S({components:{SettingsNavigationTabItem:L2,SettingsRow:j,draggable:si}})],ip);var gZ=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.NavigationTab.Navigation")))]),t("draggable",{attrs:{handle:".handle","ghost-class":"ghost",group:"navigation-points"},model:{value:e.sortableNaviPoints,callback:function(r){e.sortableNaviPoints=r},expression:"sortableNaviPoints"}},e._l(e.sortableNaviPoints,function(r,i){return t(L2,{key:i,staticClass:"my-2 mx-0",style:e.draggableBgStyle,attrs:{"navi-point":r}})}),1)],1)],1)},_Z=[],vZ=E(ip,gZ,_Z,!1,null,null);const bZ=vZ.exports;var yZ=Object.defineProperty,CZ=Object.getOwnPropertyDescriptor,pd=(s,e,t,r)=>{for(var i=r>1?void 0:r?CZ(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&yZ(e,t,i),i};let Yi=class extends k(L){constructor(){super(...arguments),this.mdiDelete=Ue,this.mdiPencil=bt,this.convertName=Ye,this.boolForm=!1,this.form={id:null,name:"",red:null,green:null,blue:null,white:null},this.rules={required:s=>s!==""||"required",presetUnique:s=>!this.existsPresetName(s)||"Name already exists",min:s=>s>=0||"Must be minimum 0",max:s=>s<=255||"Must be smaller then 256"}}get entry(){var s,e;return this.$store.getters["gui/miscellaneous/getEntry"]({type:(s=this.light)==null?void 0:s.type,name:(e=this.light)==null?void 0:e.name})}get presets(){if(!this.entry)return[];const s=[];return Object.entries(this.entry.presets).forEach(([e,t])=>{s.push({...t,id:e})}),window.console.log("getEntryPresets",s),Ft(s,"name")}get existRed(){var s;return((s=this.light)==null?void 0:s.colorOrder.indexOf("R"))!==-1}get existGreen(){var s;return((s=this.light)==null?void 0:s.colorOrder.indexOf("G"))!==-1}get existBlue(){var s;return((s=this.light)==null?void 0:s.colorOrder.indexOf("B"))!==-1}get existWhite(){var s;return((s=this.light)==null?void 0:s.colorOrder.indexOf("W"))!==-1}get colorRGB(){var s,e,t;return"rgb(".concat(Math.round((s=this.form.red)!=null?s:0),", ").concat(Math.round((e=this.form.green)!=null?e:0),", ").concat(Math.round((t=this.form.blue)!=null?t:0),")")}get colorRGBW(){var s;return"rgba(255, 255, 255, ".concat(((s=this.form.white)!=null?s:0)/255,")")}get redInt(){var s;return Math.round((s=this.form.red)!=null?s:0)}get greenInt(){var s;return Math.round((s=this.form.green)!=null?s:0)}get blueInt(){var s;return Math.round((s=this.form.blue)!=null?s:0)}get whiteInt(){var s;return Math.round((s=this.form.white)!=null?s:0)}get colorPickerOptions(){let s={width:200,margin:15,layout:[]};return this.existRed&&(s==null||s.layout.push({component:Ut.ui.Slider,options:{sliderType:"red"}})),this.existGreen&&(s==null||s.layout.push({component:Ut.ui.Slider,options:{sliderType:"green"}})),this.existBlue&&(s==null||s.layout.push({component:Ut.ui.Slider,options:{sliderType:"blue"}})),this.existRed&&this.existGreen&&this.existBlue&&(s.layout=[{component:Ut.ui.Wheel},{component:Ut.ui.Slider,options:{sliderType:"value"}}]),s}get colorPickerWhiteOptions(){return{width:200,margin:15,layout:[{component:Ut.ui.Slider,options:{sliderType:"alpha"}}]}}entryDescriptionText(s){var t,r,i,n;let e=[];return(t=this.light)!=null&&t.colorOrder.includes("R")&&e.push("R: ".concat(s.red)),(r=this.light)!=null&&r.colorOrder.includes("G")&&e.push("G: ".concat(s.green)),(i=this.light)!=null&&i.colorOrder.includes("B")&&e.push("B: ".concat(s.blue)),(n=this.light)!=null&&n.colorOrder.includes("W")&&e.push("W: ".concat(s.white)),e.join(", ")}createPreset(){var s,e,t,r;this.form.id=null,this.form.name="",this.form.red=((s=this.light)==null?void 0:s.colorOrder.indexOf("R"))!=-1?0:null,this.form.green=((e=this.light)==null?void 0:e.colorOrder.indexOf("G"))!=-1?0:null,this.form.blue=((t=this.light)==null?void 0:t.colorOrder.indexOf("B"))!=-1?0:null,this.form.white=((r=this.light)==null?void 0:r.colorOrder.indexOf("W"))!=-1?0:null,this.boolForm=!0}editPreset(s){var e,t,r,i,n;this.form.id=(e=s.id)!=null?e:null,this.form.name=s.name,this.form.red=((t=this.light)==null?void 0:t.colorOrder.indexOf("R"))!=-1?s.red:null,this.form.green=((r=this.light)==null?void 0:r.colorOrder.indexOf("G"))!=-1?s.green:null,this.form.blue=((i=this.light)==null?void 0:i.colorOrder.indexOf("B"))!=-1?s.blue:null,this.form.white=((n=this.light)==null?void 0:n.colorOrder.indexOf("W"))!=-1?s.white:null,this.boolForm=!0}closeForm(){this.boolForm=!1}storePreset(){this.$store.dispatch("gui/miscellaneous/storePreset",{entry:this.light,preset:this.form}),this.boolForm=!1}updatePreset(){this.$store.dispatch("gui/miscellaneous/updatePreset",{entry:this.light,preset:this.form}),this.boolForm=!1}deletePreset(s){this.$store.dispatch("gui/miscellaneous/deletePreset",{entry:this.light,presetId:s})}existsPresetName(s){return this.presets.findIndex(e=>e.name===s&&e.id!=this.form.id)>=0}onColorRGBChanged(s){const e={red:s.red,green:s.green,blue:s.blue,white:this.form.white};this.colorChanged(e)}onColorWhiteChanged(s){const e={red:this.form.red,green:this.form.green,blue:this.form.blue,white:this.form.white};e.white=s.alpha*255,this.colorChanged(e)}onColorInput(s){const e={red:this.form.red,green:this.form.green,blue:this.form.blue,white:this.form.white};e[s.name]=s.value,this.colorChanged(e)}colorChanged(s){this.form.red=s.red,this.form.green=s.green,this.form.blue=s.blue,this.form.white=s.white}};pd([w({type:Object,default:null})],Yi.prototype,"light",2);pd([Ke({time:250})],Yi.prototype,"onColorRGBChanged",1);pd([Ke({time:250})],Yi.prototype,"onColorWhiteChanged",1);Yi=pd([S({components:{SettingsRow:j}})],Yi);var $Z=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.boolForm?[t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.CreatePreset")))]),t(j,{attrs:{title:e.$t("Settings.MiscellaneousTab.Name").toString()}},[t(se,{attrs:{"hide-details":"auto",rules:[e.rules.required,e.rules.presetUnique],dense:"",outlined:""},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.MiscellaneousTab.Color").toString()}},[t(x,[t(b,{staticClass:"text-center"},[t(_a,{attrs:{color:e.colorRGB,options:e.colorPickerOptions},on:{"update:color":e.onColorRGBChanged}}),e.existWhite?t(_a,{staticClass:"mt-3",attrs:{color:e.colorRGBW,options:e.colorPickerWhiteOptions},on:{"update:color":e.onColorWhiteChanged}}):e._e()],1),t(b,[e.existRed?t(x,[t(b,[t(He,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.Red"),param:"red",target:e.redInt,min:0,max:255,dec:1,step:1,"output-error-msg":!0,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e(),e.existGreen?t(x,[t(b,[t(He,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.Green"),param:"green",target:e.greenInt,min:0,max:255,dec:1,step:1,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e(),e.existBlue?t(x,[t(b,[t(He,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.Blue"),param:"blue",target:e.blueInt,min:0,max:255,dec:1,step:1,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e(),e.existWhite?t(x,[t(b,[t(He,{attrs:{label:e.$t("Panels.MiscellaneousPanel.Light.White"),param:"white",target:e.whiteInt,min:0,max:255,dec:1,step:1,"has-spinner":!0},on:{submit:e.onColorInput}})],1)],1):e._e()],1)],1)],1)],1),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:e.closeForm}},[e._v(e._s(e.$t("Settings.Cancel")))]),e.form.id!==null?t(g,{attrs:{text:"",color:"primary"},on:{click:e.updatePreset}},[e._v(" "+e._s(e.$t("Settings.Update"))+" ")]):t(g,{attrs:{text:"",color:"primary"},on:{click:e.storePreset}},[e._v(e._s(e.$t("Settings.Store")))])],1)]:[t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.LightPresets",{name:e.light.name})))]),e.light?[e.presets.length?e._l(e.presets,function(r,i){return t("div",{key:r.id},[i?t(I,{staticClass:"my-2"}):e._e(),t(j,{attrs:{title:r.name,"sub-title":e.entryDescriptionText(r),"dynamic-slot-width":!0}},[t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(n){return e.editPreset(r)}}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:function(n){return e.deletePreset(r.id)}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)],1)],1)}):[t(x,[t(b,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.NoPresetFound"))+" ")])])],1)]]:[t(x,[t(b,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.UnableToLoadPreset"))+" ")])])],1)]],2),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:function(r){return e.$emit("close")}}},[e._v(e._s(e.$t("Settings.Close")))]),t(g,{attrs:{text:"",color:"primary"},on:{click:e.createPreset}},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.AddPreset"))+" ")])],1)]],2)},xZ=[],wZ=E(Yi,$Z,xZ,!1,null,"fb8b76be");const A2=wZ.exports;var SZ=Object.defineProperty,PZ=Object.getOwnPropertyDescriptor,F2=(s,e,t,r)=>{for(var i=r>1?void 0:r?PZ(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&SZ(e,t,i),i};let jc=class extends k(L){constructor(){super(...arguments),this.mdiDelete=Ue,this.mdiPalette=_u,this.mdiPencil=bt,this.convertName=Ye,this.boolForm=!1,this.form={id:null,name:"",start:1,end:1},this.rules={required:s=>s!==""||"required",groupUnique:s=>!this.existsGroupName(s)||"Name already exists",minStart:s=>s>0||"smaller than 1",minEnd:s=>s>=this.form.start||"smaller than start value",max:s=>{var e,t;return s<=((t=(e=this.light)==null?void 0:e.chainCount)!=null?t:1)||"higher than chain_count"}}}get entry(){var s,e;return this.$store.getters["gui/miscellaneous/getEntry"]({type:(s=this.light)==null?void 0:s.type,name:(e=this.light)==null?void 0:e.name})}get groups(){if(!this.entry)return[];const s=[];return Object.entries(this.entry.lightgroups).forEach(([e,t])=>{s.push({name:t.name,start:t.start,end:t.end,id:e})}),window.console.log("getEntryLightgroups",s),Ft(s,"name")}createGroup(){var s,e;this.form.id=null,this.form.name="",this.form.start=1,this.form.end=(e=(s=this.light)==null?void 0:s.chainCount)!=null?e:1,this.boolForm=!0}editGroup(s){var e;this.form.id=(e=s.id)!=null?e:null,this.form.name=s.name,this.form.start=s.start,this.form.end=s.end,this.boolForm=!0}closeForm(){this.boolForm=!1}storeGroup(){this.$store.dispatch("gui/miscellaneous/storeLightgroup",{entry:this.light,lightgroup:this.form}),this.boolForm=!1}updateGroup(){this.$store.dispatch("gui/miscellaneous/updateLightgroup",{entry:this.light,lightgroup:this.form}),this.boolForm=!1}deleteGroup(s){this.$store.dispatch("gui/miscellaneous/deleteLightgroup",{entry:this.light,lightgroupId:s})}existsGroupName(s){return this.groups.findIndex(e=>e.name===s&&e.id!=this.form.id)>=0}};F2([w({type:Object,default:null})],jc.prototype,"light",2);jc=F2([S({components:{SettingsRow:j}})],jc);var DZ=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.boolForm?[t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.CreateGroup")))]),t(j,{attrs:{title:e.$t("Settings.MiscellaneousTab.Name").toString()}},[t(se,{attrs:{"hide-details":"auto",rules:[e.rules.required,e.rules.groupUnique],dense:"",outlined:""},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.MiscellaneousTab.Start").toString(),"sub-title":e.$t("Settings.MiscellaneousTab.StartDescription").toString()}},[t(se,{attrs:{"hide-details":"auto",type:"number",step:"1",rules:[e.rules.minStart,e.rules.max],dense:"",outlined:""},model:{value:e.form.start,callback:function(r){e.$set(e.form,"start",r)},expression:"form.start"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.MiscellaneousTab.End").toString(),"sub-title":e.$t("Settings.MiscellaneousTab.EndDescription").toString()}},[t(se,{attrs:{"hide-details":"auto",type:"number",step:"1",rules:[e.rules.minEnd,e.rules.max],dense:"",outlined:""},model:{value:e.form.end,callback:function(r){e.$set(e.form,"end",r)},expression:"form.end"}})],1)],1),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:e.closeForm}},[e._v(e._s(e.$t("Settings.Cancel")))]),e.form.id!==null?t(g,{attrs:{text:"",color:"primary"},on:{click:e.updateGroup}},[e._v(" "+e._s(e.$t("Settings.Update"))+" ")]):t(g,{attrs:{text:"",color:"primary"},on:{click:e.storeGroup}},[e._v(e._s(e.$t("Settings.Store")))])],1)]:[t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.LightGroups",{name:e.light.name})))]),e.light?[e.groups.length?e._l(e.groups,function(r,i){return t("div",{key:r.id},[i?t(I,{staticClass:"my-2"}):e._e(),t(j,{attrs:{title:r.name,"sub-title":e.$t("Settings.MiscellaneousTab.GroupSubTitle",{start:r.start,end:r.end}).toString(),"dynamic-slot-width":!0}},[t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(n){return e.editGroup(r)}}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.Edit"))+" ")],1),t(g,{staticClass:"ml-3 minwidth-0 px-2",attrs:{small:"",outlined:"",color:"error"},on:{click:function(n){return e.deleteGroup(r.id)}}},[t(_,{attrs:{small:""}},[e._v(e._s(e.mdiDelete))])],1)],1)],1)}):[t(x,[t(b,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.NoGroupFound"))+" ")])])],1)]]:[t(x,[t(b,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.UnableToLoadLight"))+" ")])])],1)]],2),t(oe,{staticClass:"d-flex justify-end"},[t(g,{attrs:{text:""},on:{click:function(r){return e.$emit("close")}}},[e._v(e._s(e.$t("Settings.Close")))]),t(g,{attrs:{text:"",color:"primary"},on:{click:e.createGroup}},[e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.AddGroup"))+" ")])],1)]],2)},TZ=[],OZ=E(jc,DZ,TZ,!1,null,"c53ad212");const R2=OZ.exports;var MZ=Object.getOwnPropertyDescriptor,kZ=(s,e,t,r)=>{for(var i=r>1?void 0:r?MZ(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let np=class extends k(L){constructor(){super(...arguments),this.mdiDelete=Ue,this.mdiPalette=_u,this.mdiPencil=bt,this.convertName=Ye,this.editLightGroupObject=null,this.editLightPresetObject=null}get lights(){var e;return(e=this.$store.getters["printer/getLights"])!=null?e:[]}get filteredLights(){return this.lights.filter(e=>e.colorOrder.length>1)}};np=kZ([S({components:{SettingsRow:j,SettingsMiscellaneousTabLightGroups:R2,SettingsMiscellaneousTabLightPresets:A2}})],np);var EZ=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[e.editLightGroupObject?t(R2,{attrs:{light:e.editLightGroupObject},on:{close:function(r){e.editLightGroupObject=null}}}):e.editLightPresetObject?t(A2,{attrs:{light:e.editLightPresetObject},on:{close:function(r){e.editLightPresetObject=null}}}):t(Z,[t("h3",{staticClass:"text-h5 mb-3"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.Miscellaneous")))]),e.filteredLights.length?e._l(e.filteredLights,function(r,i){return t("div",{key:i},[i?t(I,{staticClass:"my-2"}):e._e(),t(j,{attrs:{title:e.convertName(r.name),"dynamic-slot-width":!0}},[r.chainCount>1?t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(n){e.editLightGroupObject=r}}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPencil))]),e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.Groups"))+" ")],1):e._e(),t(g,{staticClass:"ml-3",attrs:{small:"",outlined:""},on:{click:function(n){e.editLightPresetObject=r}}},[t(_,{attrs:{left:"",small:""}},[e._v(e._s(e.mdiPalette))]),e._v(" "+e._s(e.$t("Settings.MiscellaneousTab.Presets"))+" ")],1)],1)],1)}):[t(x,[t(b,[t("p",{staticClass:"mb-0 text-center font-italic"},[e._v(e._s(e.$t("Settings.MiscellaneousTab.NoDevicesFound")))])])],1)]],2)],1)},LZ=[],AZ=E(np,EZ,LZ,!1,null,"0d286071");const FZ=AZ.exports;var RZ=Object.defineProperty,HZ=Object.getOwnPropertyDescriptor,H2=(s,e,t,r)=>{for(var i=r>1?void 0:r?HZ(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&RZ(e,t,i),i};let Ic=class extends k(L){constructor(){super(...arguments),this.mdiGrid=hu}get availableOrientations(){return[{text:this.$t("Settings.HeightmapTab.Orientations.RightFront"),value:"rightFront"},{text:this.$t("Settings.HeightmapTab.Orientations.LeftFront"),value:"leftFront"},{text:this.$t("Settings.HeightmapTab.Orientations.Front"),value:"front"},{text:this.$t("Settings.HeightmapTab.Orientations.Top"),value:"top"}]}get defaultOrientation(){return this.$store.state.gui.heightmap.defaultOrientation}set defaultOrientation(e){this.$store.dispatch("gui/heightmap/saveSetting",{name:"defaultOrientation",value:e})}get availableColorSchemes(){return[{text:this.$t("Settings.HeightmapTab.Schemes.Portland")+" "+this.$t("Settings.HeightmapTab.IsDefault"),value:"portland"},{text:this.$t("Settings.HeightmapTab.Schemes.Spring"),value:"spring"},{text:this.$t("Settings.HeightmapTab.Schemes.Hot"),value:"hot"},{text:this.$t("Settings.HeightmapTab.Schemes.Hsv"),value:"hsv"},{text:this.$t("Settings.HeightmapTab.Schemes.GrayScale"),value:"grayScale"}]}get colorScheme(){return this.$store.state.gui.heightmap.activecolorscheme}set colorScheme(e){this.$store.dispatch("gui/heightmap/saveSetting",{name:"activecolorscheme",value:e})}colorSchemeChanged(e){this.colorScheme=e}};H2([he("colorScheme")],Ic.prototype,"colorSchemeChanged",1);Ic=H2([S({components:{Panel:U,SettingsRow:j}})],Ic);var jZ=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(Pe,{attrs:{flat:""}},[t(Z,[t("div",{staticClass:"d-flex align-center"},[t(_,{staticStyle:{opacity:"0.7"}},[e._v(e._s(e.mdiGrid))]),t(gt,{staticClass:"mx-n2"},[e._v(" "+e._s(e.$t("Settings.HeightmapTab.Heightmap"))+" ")]),t(I,{staticClass:"ml-3"})],1),t(j,{attrs:{title:e.$t("Settings.HeightmapTab.DefaultOrientation"),"sub-title":e.$t("Settings.HeightmapTab.DefaultOrientationDescription")}},[t(ke,{attrs:{items:e.availableOrientations,"hide-details":"",outlined:"",dense:""},model:{value:e.defaultOrientation,callback:function(r){e.defaultOrientation=r},expression:"defaultOrientation"}})],1),t(I,{staticClass:"my-2"}),t(j,{attrs:{title:e.$t("Settings.HeightmapTab.ColorSchemes")}},[t(ke,{attrs:{items:e.availableColorSchemes,"hide-details":"",outlined:"",dense:""},model:{value:e.colorScheme,callback:function(r){e.colorScheme=r},expression:"colorScheme"}})],1)],1)],1)],1)},IZ=[],NZ=E(Ic,jZ,IZ,!1,null,null);const VZ=NZ.exports;var BZ=Object.defineProperty,UZ=Object.getOwnPropertyDescriptor,j2=(s,e,t,r)=>{for(var i=r>1?void 0:r?UZ(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&BZ(e,t,i),i};let Nc=class extends k(L){constructor(){super(...arguments),this.showSettings=!1,this.activeTab="general",this.mdiCloseThick=pe,this.mdiCogs=Lw}get tabTitles(){const s=[{icon:ss,name:"general",title:this.$t("Settings.GeneralTab.General")},{icon:_u,name:"ui-settings",title:this.$t("Settings.UiSettingsTab.UiSettings")},{icon:Gp,name:"dashboard",title:this.$t("Settings.DashboardTab.Dashboard")},{icon:on,name:"webcams",title:this.$t("Settings.WebcamsTab.Webcams")},{icon:Qn,name:"macros",title:this.$t("Settings.MacrosTab.Macros")},{icon:kS,name:"control",title:this.$t("Settings.ControlTab.Control")},{icon:Ua,name:"console",title:this.$t("Settings.ConsoleTab.Console")},{icon:sn,name:"presets",title:this.$t("Settings.PresetsTab.PreheatPresets")},{icon:qa,name:"remote-printers",title:this.$t("Settings.RemotePrintersTab.RemotePrinters")},{icon:yu,name:"g-code-viewer",title:this.$t("Settings.GCodeViewerTab.GCodeViewer")},{icon:za,name:"editor",title:this.$t("Settings.EditorTab.Editor")},{icon:Hp,name:"miscellaneous",title:this.$t("Settings.MiscellaneousTab.Miscellaneous")},{icon:tS,name:"navigation",title:this.$t("Settings.NavigationTab.Navigation")},{icon:hu,name:"heightmap",title:this.$t("Settings.HeightmapTab.Heightmap")}];return this.moonrakerComponents.includes("timelapse")&&s.push({icon:Tv,name:"timelapse",title:this.$t("Settings.TimelapseTab.Timelapse")}),s.sort((e,t)=>{if(e.name==="general")return-1;if(t.name==="general")return 1;const r=e.title.toString().toLowerCase(),i=t.title.toString().toLowerCase();return ri?1:0})}activeTabWatch(){this.scrollToTop()}scrollToTop(){if(this.$refs.settingsScroll){const s=this.$refs.settingsScroll.osInstance();s==null||s.scroll({y:"0%"})}}};j2([he("activeTab")],Nc.prototype,"activeTabWatch",1);Nc=j2([S({components:{Panel:U,SettingsUiSettingsTab:nM,SettingsRemotePrintersTab:Q4,SettingsPresetsTab:Z4,SettingsConsoleTab:y4,SettingsControlTab:p4,SettingsMacrosTab:a4,SettingsWebcamsTab:KT,SettingsGeneralTab:xT,SettingsDashboardTab:qM,SettingsGCodeViewerTab:e6,SettingsEditorTab:a6,SettingsTimelapseTab:m6,SettingsMiscellaneousTab:FZ,SettingsNavigationTab:bZ,SettingsHeightmapTab:VZ}})],Nc);var WZ=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.showSettings=!0}}},[t(_,[e._v(e._s(e.mdiCogs))])],1),t(le,{attrs:{width:"900",persistent:"",fullscreen:e.isMobile,scrollable:""},on:{keydown:function(r){if(!r.type.indexOf("key")&&e._k(r.keyCode,"esc",27,r.key,["Esc","Escape"]))return null;e.showSettings=!1}},model:{value:e.showSettings,callback:function(r){e.showSettings=r},expression:"showSettings"}},[t(U,{staticStyle:{overflow:"hidden"},attrs:{title:e.$t("Settings.InterfaceSettings"),icon:e.mdiCogs,"card-class":"settings-menu-dialog","margin-bottom":!1,height:e.isMobile?0:548},scopedSlots:e._u([{key:"buttons",fn:function(){return[t(g,{attrs:{icon:"",tile:""},on:{click:function(r){e.showSettings=!1}}},[t(_,[e._v(e._s(e.mdiCloseThick))])],1)]},proxy:!0}])},[e.isMobile?[t(rl,{attrs:{"center-active":!0,"show-arrows":!0},model:{value:e.activeTab,callback:function(r){e.activeTab=r},expression:"activeTab"}},e._l(e.tabTitles,function(r,i){return t(Dr,{key:i,staticClass:"justify-start",attrs:{href:"#"+r.name}},[t(_,{attrs:{left:""},domProps:{innerHTML:e._s(r.icon)}}),e._v(" "+e._s(r.title)+" ")],1)}),1)]:e._e(),t(x,{staticClass:"flex-row flex-nowrap"},[e.isMobile?e._e():t(b,{staticClass:"col-auto pr-0"},[t("overlay-scrollbars",{ref:"settingsTabsScroll",staticClass:"settings-tabs-bar height500"},[t(rl,{attrs:{vertical:!0},model:{value:e.activeTab,callback:function(r){e.activeTab=r},expression:"activeTab"}},e._l(e.tabTitles,function(r,i){return t(Dr,{key:i,staticClass:"justify-start",staticStyle:{width:"200px"},attrs:{href:"#"+r.name}},[t(_,{attrs:{left:""},domProps:{innerHTML:e._s(r.icon)}}),t("span",{staticClass:"text-truncate"},[e._v(e._s(r.title))])],1)}),1)],1)],1),t(b,{class:e.isMobile?"":"pl-0",style:e.isMobile?"":"min-width: 500px;"},[t("overlay-scrollbars",{ref:"settingsScroll",class:"settings-tabs "+(e.isMobile?"":"height500"),attrs:{options:{overflowBehavior:{x:"hidden"}}}},[t("settings-"+e.activeTab+"-tab",{tag:"component",on:{scrollToTop:e.scrollToTop}})],1)],1)],1)],2)],1)],1)},zZ=[],GZ=E(Nc,WZ,zZ,!1,null,"a3a673cb");const I2=GZ.exports;var ZZ=Object.defineProperty,qZ=Object.getOwnPropertyDescriptor,fd=(s,e,t,r)=>{for(var i=r>1?void 0:r?qZ(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&ZZ(e,t,i),i};let Ji=class extends k(L){constructor(){super(...arguments),this.mdiClose=Ba,this.mdiLinkVariant=cv,this.mdiBellOffOutline=vw,this.expand=!1,this.showMaintenanceDetails=!1}get formatedText(){return this.entry.description.replace(/(\bhttps?:\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/gim,'$1')}get alertColor(){return this.entry.priority==="critical"?"error":this.entry.priority==="high"?"warning":"info"}get entryType(){const s=this.entry.id.indexOf("/");return s===-1?"":this.entry.id.slice(0,s)}get maintenanceEntry(){if(this.entryType!=="maintenance")return null;const s=this.entry.id.replace("maintenance/","");return this.$store.getters["gui/maintenance/getEntries"].find(t=>t.id===s)}get reminderTimes(){let s=[{text:this.$t("App.Notifications.NextReboot"),clickFunction:()=>this.dismiss("reboot",null)},{text:this.$t("App.Notifications.Never"),clickFunction:()=>this.close()}];return["announcement","maintenance"].includes(this.entryType)&&(s=[],s.push({text:this.$t("App.Notifications.OneHourShort"),clickFunction:()=>this.dismiss("time",60*60)}),s.push({text:this.$t("App.Notifications.OneDayShort"),clickFunction:()=>this.dismiss("time",60*60*24)}),s.push({text:this.$t("App.Notifications.OneWeekShort"),clickFunction:()=>this.dismiss("time",60*60*24*7)})),s}xButtonAction(){if(this.entryType==="announcement")return this.close();this.dismiss("reboot",null)}close(){this.$store.dispatch("gui/notifications/close",{id:this.entry.id})}dismiss(s,e){this.$store.dispatch("gui/notifications/dismiss",{id:this.entry.id,type:s,time:e})}parentStateUpdate(s){s||(this.expand=!1)}};fd([w({required:!0})],Ji.prototype,"entry",2);fd([w({default:!0})],Ji.prototype,"parentState",2);fd([he("parentState")],Ji.prototype,"parentStateUpdate",1);Ji=fd([S({components:{}})],Ji);var XZ=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(it,{class:"notification-menu-entry--priority-".concat(e.entry.priority),attrs:{text:"",color:e.alertColor,border:"left"}},[t(x,{staticClass:"flex-nowrap",attrs:{align:"start"}},[t(b,{staticClass:"grow pb-2"},[t("div",{staticClass:"notification-menu-entry__headline mb-1 text-subtitle-1"},["url"in e.entry?t("a",{class:"text-decoration-none ".concat(e.alertColor,"--text "),attrs:{href:e.entry.url,target:"_blank"}},[t(_,{class:"".concat(e.alertColor,"--text pb-1"),attrs:{small:""}},[e._v(" "+e._s(e.mdiLinkVariant)+" ")]),e._v(" "+e._s(e.entry.title)+" ")],1):t("span",{class:"".concat(e.alertColor,"--text")},[e._v(e._s(e.entry.title))])]),t("p",{staticClass:"notification-menu-entry__description text-body-2 mb-0 text--disabled font-weight-light",domProps:{innerHTML:e._s(e.formatedText)}}),e.entryType==="maintenance"?t(g,{staticClass:"mt-3 mb-0 w-100",attrs:{outlined:"",small:"",color:e.alertColor},on:{click:function(r){e.showMaintenanceDetails=!0}}},[e._v(" "+e._s(e.$t("App.Notifications.ShowDetails"))+" ")]):e._e()],1),e.entry.priority!=="critical"?t(b,{staticClass:"shrink pl-0 pb-1 pt-1 pr-2 d-flex flex-column align-self-stretch justify-space-between"},[e.entryType!=="maintenance"?t(g,{staticClass:"mb-2",attrs:{icon:"",plain:"",color:e.alertColor},on:{click:e.xButtonAction}},[t(_,[e._v(e._s(e.mdiClose))])],1):e._e(),t(ae),t(g,{attrs:{icon:"",plain:"","retain-focus-on-click":"",color:e.alertColor},on:{click:function(r){e.expand=!e.expand}}},[t(_,[e._v(e._s(e.mdiBellOffOutline))])],1)],1):e._e()],1),e.entry.priority!=="critical"?t(x,[t(iu,[t("div",{directives:[{name:"show",rawName:"v-show",value:e.expand,expression:"expand"}],staticClass:"pt-1 w-100"},[t(I,{staticClass:"pb-1 ml-2"}),t("div",{staticClass:"text-right py-1",staticStyle:{"font-size":"0.875rem"}},[t("span",{staticClass:"text--disabled text-caption font-weight-light"},[e._v(" "+e._s(e.$t("App.Notifications.Remind"))+" ")]),e._l(e.reminderTimes,function(r){return t(g,{key:r.text,staticClass:"mx-1",attrs:{color:e.alertColor,"x-small":"",plain:"",text:"",outlined:""},on:{click:r.clickFunction}},[e._v(" "+e._s(r.text)+" ")])})],2)],1)])],1):e._e(),e.entryType==="maintenance"?t(Uf,{attrs:{show:e.showMaintenanceDetails,item:e.maintenanceEntry},on:{close:function(r){e.showMaintenanceDetails=!1}}}):e._e()],1)},YZ=[],JZ=E(Ji,XZ,YZ,!1,null,"bbbb3459");const N2=JZ.exports;var KZ=Object.getOwnPropertyDescriptor,QZ=(s,e,t,r)=>{for(var i=r>1?void 0:r?KZ(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let ap=class extends k(L){constructor(){super(...arguments),this.mdiBell=_w,this.mdiBellOutline=bw,this.mdiCloseBoxMultipleOutline=Mw,this.boolMenu=!1}get notifications(){var s;return(s=this.$store.getters["gui/notifications/getNotifications"])!=null?s:[]}get existsCriticalAnnouncements(){return this.notifications.filter(s=>s.priority==="critical").length>0}get existsHighAnnouncements(){return this.notifications.filter(s=>s.priority==="high").length>0}get countNormalAnnouncements(){return this.notifications.filter(s=>s.priority==="normal").length}get colorBadge(){return this.existsCriticalAnnouncements?"error":this.existsHighAnnouncements?"warning":"primary"}dismissAll(){this.notifications.forEach(async s=>{s.id.startsWith("announcement")&&await this.$store.dispatch("gui/notifications/close",{id:s.id}),await this.$store.dispatch("gui/notifications/dismiss",{id:s.id,type:"reboot",time:null})})}};ap=QZ([S({components:{NotificationMenuEntry:N2}})],ap);var eq=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(ye,{attrs:{bottom:"",left:!e.isMobile,"offset-y":"","close-on-click":!0,"close-on-content-click":!1,origin:"center center",transition:"slide-y-transition","min-width":e.isMobile?"100%":null},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(g,e._g(e._b({staticClass:"minwidth-0",attrs:{icon:"",tile:""}},"v-btn",i,!1),r),[t(O_,{attrs:{content:e.notifications.length<=9?e.notifications.length:"9+",value:e.notifications.length>0,color:e.colorBadge,overlap:""}},[t(_,[e._v(e._s(i["aria-expanded"]==="false"?e.mdiBellOutline:e.mdiBell))])],1)],1)]}}]),model:{value:e.boolMenu,callback:function(r){e.boolMenu=r},expression:"boolMenu"}},[t(Pe,{attrs:{flat:"","min-width":300,"max-width":e.isMobile?null:400}},[e.notifications.length?[t("overlay-scrollbars",{staticClass:"announcement-menu__scrollbar"},[t(Z,[e._l(e.notifications,function(r,i){return[t(N2,{key:r.id,class:i1?[t(I),t(oe,[t(ae),t(g,{staticClass:"mr-2",attrs:{text:"",color:"primary"},on:{click:e.dismissAll}},[t(_,{attrs:{left:""}},[e._v(e._s(e.mdiCloseBoxMultipleOutline))]),e._v(" "+e._s(e.$t("App.Notifications.DismissAll"))+" ")],1)],1)]:e._e()]:t(Z,{staticClass:"text-center"},[t("span",{staticClass:"text-disabled"},[e._v(e._s(e.$t("App.Notifications.NoNotification")))])])],2)],1)},tq=[],sq=E(ap,eq,tq,!1,null,"19169a29");const V2=sq.exports;/*! + * vue-router v3.6.5 + * (c) 2022 Evan You + * @license MIT + */function ls(s,e){for(var t in e)s[t]=e[t];return s}var rq=/[!'()*]/g,iq=function(s){return"%"+s.charCodeAt(0).toString(16)},nq=/%2C/g,mi=function(s){return encodeURIComponent(s).replace(rq,iq).replace(nq,",")};function op(s){try{return decodeURIComponent(s)}catch{}return s}function aq(s,e,t){e===void 0&&(e={});var r=t||oq,i;try{i=r(s||"")}catch{i={}}for(var n in e){var a=e[n];i[n]=Array.isArray(a)?a.map(X1):X1(a)}return i}var X1=function(s){return s==null||typeof s=="object"?s:String(s)};function oq(s){var e={};return s=s.trim().replace(/^(\?|#|&)/,""),s&&s.split("&").forEach(function(t){var r=t.replace(/\+/g," ").split("="),i=op(r.shift()),n=r.length>0?op(r.join("=")):null;e[i]===void 0?e[i]=n:Array.isArray(e[i])?e[i].push(n):e[i]=[e[i],n]}),e}function lq(s){var e=s?Object.keys(s).map(function(t){var r=s[t];if(r===void 0)return"";if(r===null)return mi(t);if(Array.isArray(r)){var i=[];return r.forEach(function(n){n!==void 0&&(n===null?i.push(mi(t)):i.push(mi(t)+"="+mi(n)))}),i.join("&")}return mi(t)+"="+mi(r)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var Vc=/\/?$/;function Bc(s,e,t,r){var i=r&&r.options.stringifyQuery,n=e.query||{};try{n=lp(n)}catch{}var a={name:e.name||s&&s.name,meta:s&&s.meta||{},path:e.path||"/",hash:e.hash||"",query:n,params:e.params||{},fullPath:Y1(e,i),matched:s?cq(s):[]};return t&&(a.redirectedFrom=Y1(t,i)),Object.freeze(a)}function lp(s){if(Array.isArray(s))return s.map(lp);if(s&&typeof s=="object"){var e={};for(var t in s)e[t]=lp(s[t]);return e}else return s}var yr=Bc(null,{path:"/"});function cq(s){for(var e=[];s;)e.unshift(s),s=s.parent;return e}function Y1(s,e){var t=s.path,r=s.query;r===void 0&&(r={});var i=s.hash;i===void 0&&(i="");var n=e||lq;return(t||"/")+n(r)+i}function B2(s,e,t){return e===yr?s===e:e?s.path&&e.path?s.path.replace(Vc,"")===e.path.replace(Vc,"")&&(t||s.hash===e.hash&&Xo(s.query,e.query)):s.name&&e.name?s.name===e.name&&(t||s.hash===e.hash&&Xo(s.query,e.query)&&Xo(s.params,e.params)):!1:!1}function Xo(s,e){if(s===void 0&&(s={}),e===void 0&&(e={}),!s||!e)return s===e;var t=Object.keys(s).sort(),r=Object.keys(e).sort();return t.length!==r.length?!1:t.every(function(i,n){var a=s[i],o=r[n];if(o!==i)return!1;var l=e[i];return a==null||l==null?a===l:typeof a=="object"&&typeof l=="object"?Xo(a,l):String(a)===String(l)})}function uq(s,e){return s.path.replace(Vc,"/").indexOf(e.path.replace(Vc,"/"))===0&&(!e.hash||s.hash===e.hash)&&dq(s.query,e.query)}function dq(s,e){for(var t in e)if(!(t in s))return!1;return!0}function U2(s){for(var e=0;e=0&&(e=s.slice(r),s=s.slice(0,r));var i=s.indexOf("?");return i>=0&&(t=s.slice(i+1),s=s.slice(0,i)),{path:s,query:t,hash:e}}function rr(s){return s.replace(/\/(?:\s*\/)+/g,"/")}var Uc=Array.isArray||function(s){return Object.prototype.toString.call(s)=="[object Array]"},vn=Z2,fq=fg,gq=yq,_q=z2,vq=G2,bq=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function fg(s,e){for(var t=[],r=0,i=0,n="",a=e&&e.delimiter||"/",o;(o=bq.exec(s))!=null;){var l=o[0],u=o[1],c=o.index;if(n+=s.slice(i,c),i=c+l.length,u){n+=u[1];continue}var d=s[i],m=o[2],h=o[3],f=o[4],p=o[5],v=o[6],C=o[7];n&&(t.push(n),n="");var P=m!=null&&d!=null&&d!==m,M=v==="+"||v==="*",F=v==="?"||v==="*",O=o[2]||a,$=f||p;t.push({name:h||r++,prefix:m||"",delimiter:O,optional:F,repeat:M,partial:P,asterisk:!!C,pattern:$?xq($):C?".*":"[^"+Yo(O)+"]+?"})}return i1||!O.length)return O.length===0?e():e("span",{},O)}if(this.tag==="a")F.on=M,F.attrs={href:l,"aria-current":C};else{var $=q2(this.$slots.default);if($){$.isStatic=!1;var D=$.data=ls({},$.data);D.on=D.on||{};for(var V in D.on){var N=D.on[V];V in M&&(D.on[V]=Array.isArray(N)?N:[N])}for(var W in M)W in D.on?D.on[W].push(M[W]):D.on[W]=P;var G=$.data.attrs=ls({},$.data.attrs);G.href=l,G["aria-current"]=C}else F.on=M}return e(this.tag,F,this.$slots.default)}};function e_(s){if(!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)&&!s.defaultPrevented&&!(s.button!==void 0&&s.button!==0)){if(s.currentTarget&&s.currentTarget.getAttribute){var e=s.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return s.preventDefault&&s.preventDefault(),!0}}function q2(s){if(s){for(var e,t=0;t-1&&(v.params[F]=f.params[F]);return v.path=Jo(P.path,v.params),m(P,v,p)}else if(v.path){v.params={};for(var O=0;O-1}function vd(s,e){return Gc(s)&&s._isRouter&&(e==null||s.type===e)}function a_(s,e,t){var r=function(i){i>=s.length?t():s[i]?e(s[i],function(){r(i+1)}):r(i+1)};r(0)}function zq(s){return function(e,t,r){var i=!1,n=0,a=null;tC(s,function(o,l,u,c){if(typeof o=="function"&&o.cid===void 0){i=!0,n++;var d=o_(function(p){Zq(p)&&(p=p.default),o.resolved=typeof p=="function"?p:Wc.extend(p),u.components[c]=p,n--,n<=0&&r()}),m=o_(function(p){var v="Failed to resolve async component "+c+": "+p;a||(a=Gc(p)?p:new Error(v),r(a))}),h;try{h=o(d,m)}catch(p){m(p)}if(h)if(typeof h.then=="function")h.then(d,m);else{var f=h.component;f&&typeof f.then=="function"&&f.then(d,m)}}}),i||r()}}function tC(s,e){return sC(s.map(function(t){return Object.keys(t.components).map(function(r){return e(t.components[r],t.instances[r],t,r)})}))}function sC(s){return Array.prototype.concat.apply([],s)}var Gq=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Zq(s){return s.__esModule||Gq&&s[Symbol.toStringTag]==="Module"}function o_(s){var e=!1;return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(!e)return e=!0,s.apply(this,t)}}var _s=function(e,t){this.router=e,this.base=qq(t),this.current=yr,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};_s.prototype.listen=function(e){this.cb=e};_s.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))};_s.prototype.onError=function(e){this.errorCbs.push(e)};_s.prototype.transitionTo=function(e,t,r){var i=this,n;try{n=this.router.match(e,this.current)}catch(o){throw this.errorCbs.forEach(function(l){l(o)}),o}var a=this.current;this.confirmTransition(n,function(){i.updateRoute(n),t&&t(n),i.ensureURL(),i.router.afterHooks.forEach(function(o){o&&o(n,a)}),i.ready||(i.ready=!0,i.readyCbs.forEach(function(o){o(n)}))},function(o){r&&r(o),o&&!i.ready&&(!vd(o,ni.redirected)||a!==yr)&&(i.ready=!0,i.readyErrorCbs.forEach(function(l){l(o)}))})};_s.prototype.confirmTransition=function(e,t,r){var i=this,n=this.current;this.pending=e;var a=function(p){!vd(p)&&Gc(p)&&(i.errorCbs.length?i.errorCbs.forEach(function(v){v(p)}):console.error(p)),r&&r(p)},o=e.matched.length-1,l=n.matched.length-1;if(B2(e,n)&&o===l&&e.matched[o]===n.matched[l])return this.ensureURL(),e.hash&&ir(this.router,n,e,!1),a(Vq(n,e));var u=Xq(this.current.matched,e.matched),c=u.updated,d=u.deactivated,m=u.activated,h=[].concat(Jq(d),this.router.beforeHooks,Kq(c),m.map(function(p){return p.beforeEnter}),zq(m)),f=function(p,v){if(i.pending!==e)return a(n_(n,e));try{p(e,n,function(C){C===!1?(i.ensureURL(!0),a(Bq(n,e))):Gc(C)?(i.ensureURL(!0),a(C)):typeof C=="string"||typeof C=="object"&&(typeof C.path=="string"||typeof C.name=="string")?(a(Nq(n,e)),typeof C=="object"&&C.replace?i.replace(C):i.push(C)):v(C)})}catch(C){a(C)}};a_(h,f,function(){var p=Qq(m),v=p.concat(i.router.resolveHooks);a_(v,f,function(){if(i.pending!==e)return a(n_(n,e));i.pending=null,t(e),i.router.app&&i.router.app.$nextTick(function(){U2(e)})})})};_s.prototype.updateRoute=function(e){this.current=e,this.cb&&this.cb(e)};_s.prototype.setupListeners=function(){};_s.prototype.teardown=function(){this.listeners.forEach(function(e){e()}),this.listeners=[],this.current=yr,this.pending=null};function qq(s){if(!s)if(fo){var e=document.querySelector("base");s=e&&e.getAttribute("href")||"/",s=s.replace(/^https?:\/\/[^\/]+/,"")}else s="/";return s.charAt(0)!=="/"&&(s="/"+s),s.replace(/\/$/,"")}function Xq(s,e){var t,r=Math.max(s.length,e.length);for(t=0;t0)){var i=this.router,n=i.options.scrollBehavior,a=nr&&n;a&&this.listeners.push(Q2());var o=function(){var l=r.current,u=In(r.base);r.current===yr&&u===r._startLocation||r.transitionTo(u,function(c){a&&ir(i,c,l,!0)})};window.addEventListener("popstate",o),this.listeners.push(function(){window.removeEventListener("popstate",o)})}},e.prototype.go=function(r){window.history.go(r)},e.prototype.push=function(r,i,n){var a=this,o=this,l=o.current;this.transitionTo(r,function(u){zc(rr(a.base+u.fullPath)),ir(a.router,u,l,!1),i&&i(u)},n)},e.prototype.replace=function(r,i,n){var a=this,o=this,l=o.current;this.transitionTo(r,function(u){dp(rr(a.base+u.fullPath)),ir(a.router,u,l,!1),i&&i(u)},n)},e.prototype.ensureURL=function(r){if(In(this.base)!==this.current.fullPath){var i=rr(this.base+this.current.fullPath);r?zc(i):dp(i)}},e.prototype.getCurrentLocation=function(){return In(this.base)},e}(_s);function In(s){var e=window.location.pathname,t=e.toLowerCase(),r=s.toLowerCase();return s&&(t===r||t.indexOf(rr(r+"/"))===0)&&(e=e.slice(s.length)),(e||"/")+window.location.search+window.location.hash}var nC=function(s){function e(t,r,i){s.call(this,t,r),!(i&&tX(this.base))&&l_()}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var r=this;if(!(this.listeners.length>0)){var i=this.router,n=i.options.scrollBehavior,a=nr&&n;a&&this.listeners.push(Q2());var o=function(){var u=r.current;l_()&&r.transitionTo(Ko(),function(c){a&&ir(r.router,c,u,!0),nr||Qo(c.fullPath)})},l=nr?"popstate":"hashchange";window.addEventListener(l,o),this.listeners.push(function(){window.removeEventListener(l,o)})}},e.prototype.push=function(r,i,n){var a=this,o=this,l=o.current;this.transitionTo(r,function(u){c_(u.fullPath),ir(a.router,u,l,!1),i&&i(u)},n)},e.prototype.replace=function(r,i,n){var a=this,o=this,l=o.current;this.transitionTo(r,function(u){Qo(u.fullPath),ir(a.router,u,l,!1),i&&i(u)},n)},e.prototype.go=function(r){window.history.go(r)},e.prototype.ensureURL=function(r){var i=this.current.fullPath;Ko()!==i&&(r?c_(i):Qo(i))},e.prototype.getCurrentLocation=function(){return Ko()},e}(_s);function tX(s){var e=In(s);if(!/^\/#/.test(e))return window.location.replace(rr(s+"/#"+e)),!0}function l_(){var s=Ko();return s.charAt(0)==="/"?!0:(Qo("/"+s),!1)}function Ko(){var s=window.location.href,e=s.indexOf("#");return e<0?"":(s=s.slice(e+1),s)}function mp(s){var e=window.location.href,t=e.indexOf("#"),r=t>=0?e.slice(0,t):e;return r+"#"+s}function c_(s){nr?zc(mp(s)):window.location.hash=s}function Qo(s){nr?dp(mp(s)):window.location.replace(mp(s))}var sX=function(s){function e(t,r){s.call(this,t,r),this.stack=[],this.index=-1}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.push=function(r,i,n){var a=this;this.transitionTo(r,function(o){a.stack=a.stack.slice(0,a.index+1).concat(o),a.index++,i&&i(o)},n)},e.prototype.replace=function(r,i,n){var a=this;this.transitionTo(r,function(o){a.stack=a.stack.slice(0,a.index).concat(o),i&&i(o)},n)},e.prototype.go=function(r){var i=this,n=this.index+r;if(!(n<0||n>=this.stack.length)){var a=this.stack[n];this.confirmTransition(a,function(){var o=i.current;i.index=n,i.updateRoute(a),i.router.afterHooks.forEach(function(l){l&&l(a,o)})},function(o){vd(o,ni.duplicated)&&(i.index=n)})}},e.prototype.getCurrentLocation=function(){var r=this.stack[this.stack.length-1];return r?r.fullPath:"/"},e.prototype.ensureURL=function(){},e}(_s),je=function(e){e===void 0&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Eq(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback=t==="history"&&!nr&&e.fallback!==!1,this.fallback&&(t="hash"),fo||(t="abstract"),this.mode=t,t){case"history":this.history=new iC(this,e.base);break;case"hash":this.history=new nC(this,e.base,this.fallback);break;case"abstract":this.history=new sX(this,e.base);break}},aC={currentRoute:{configurable:!0}};je.prototype.match=function(e,t,r){return this.matcher.match(e,t,r)};aC.currentRoute.get=function(){return this.history&&this.history.current};je.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",function(){var a=t.apps.indexOf(e);a>-1&&t.apps.splice(a,1),t.app===e&&(t.app=t.apps[0]||null),t.app||t.history.teardown()}),!this.app){this.app=e;var r=this.history;if(r instanceof iC||r instanceof nC){var i=function(a){var o=r.current,l=t.options.scrollBehavior,u=nr&&l;u&&"fullPath"in a&&ir(t,a,o,!1)},n=function(a){r.setupListeners(),i(a)};r.transitionTo(r.getCurrentLocation(),n,n)}r.listen(function(a){t.apps.forEach(function(o){o._route=a})})}};je.prototype.beforeEach=function(e){return yg(this.beforeHooks,e)};je.prototype.beforeResolve=function(e){return yg(this.resolveHooks,e)};je.prototype.afterEach=function(e){return yg(this.afterHooks,e)};je.prototype.onReady=function(e,t){this.history.onReady(e,t)};je.prototype.onError=function(e){this.history.onError(e)};je.prototype.push=function(e,t,r){var i=this;if(!t&&!r&&typeof Promise<"u")return new Promise(function(n,a){i.history.push(e,n,a)});this.history.push(e,t,r)};je.prototype.replace=function(e,t,r){var i=this;if(!t&&!r&&typeof Promise<"u")return new Promise(function(n,a){i.history.replace(e,n,a)});this.history.replace(e,t,r)};je.prototype.go=function(e){this.history.go(e)};je.prototype.back=function(){this.go(-1)};je.prototype.forward=function(){this.go(1)};je.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map(function(r){return Object.keys(r.components).map(function(i){return r.components[i]})})):[]};je.prototype.resolve=function(e,t,r){t=t||this.history.current;var i=vg(e,t,r,this),n=this.match(i,t),a=n.redirectedFrom||n.fullPath,o=this.history.base,l=rX(o,a,this.mode);return{location:i,route:n,href:l,normalizedTo:i,resolved:n}};je.prototype.getRoutes=function(){return this.matcher.getRoutes()};je.prototype.addRoute=function(e,t){this.matcher.addRoute(e,t),this.history.current!==yr&&this.history.transitionTo(this.history.getCurrentLocation())};je.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==yr&&this.history.transitionTo(this.history.getCurrentLocation())};Object.defineProperties(je.prototype,aC);var oC=je;function yg(s,e){return s.push(e),function(){var t=s.indexOf(e);t>-1&&s.splice(t,1)}}function rX(s,e,t){var r=t==="hash"?"#"+e:e;return s?rr(s+"/"+r):r}je.install=cp;je.version="3.6.5";je.isNavigationFailure=vd;je.NavigationFailureType=ni;je.START_LOCATION=yr;fo&&window.Vue&&window.Vue.use(je);y.use(oC);const Ia=new oC({base:"/",mode:"history",routes:M2});var iX=Object.getOwnPropertyDescriptor,nX=(s,e,t,r)=>{for(var i=r>1?void 0:r?iX(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let hp=class extends k(L){constructor(){super(...arguments),this.mdiChevronDown=fr}get displayMenuPoint(){return this.instancesDB!=="moonraker"&&this.countPrinters>1||this.instancesDB==="moonraker"&&this.countPrinters}get printers(){return this.$store.getters["farm/getPrinters"]}get countPrinters(){return this.$store.getters["farm/countPrinters"]}get currentPage(){return this.$route.fullPath}switchToPrinters(){Ia.push("/allPrinters")}getPrinterName(s){return this.$store.getters["farm/"+s+"/getPrinterName"]}getPrinterDescription(s){return this.$store.getters["farm/"+s._namespace+"/getStatus"]}changePrinter(s){s.socket.isConnected&&this.$store.dispatch("changePrinter",{printer:s._namespace})}};hp=nX([S],hp);var aX=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(ye,{attrs:{bottom:"","offset-x":!0},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(_,e._g(e._b({staticClass:"nav-arrow right"},"v-icon",i,!1),r),[e._v(e._s(e.mdiChevronDown))])]}}])},[t(Me,{attrs:{dense:""}},e._l(e.printers,function(r){return t(J,{key:r._namespace,attrs:{"two-line":"",disabled:!r.socket.isConnected,link:""},on:{click:function(i){return e.changePrinter(r)}}},[t(_t,[t(Ze,[e._v(e._s(e.getPrinterName(r._namespace)))]),t(Va,[e._v(e._s(e.getPrinterDescription(r)))])],1)],1)}),1)],1)},oX=[],lX=E(hp,aX,oX,!1,null,"e755d818");const lC=lX.exports,Tn={};function cX(s){return Object.keys(s).reduce((e,t)=>(s[t]!==!1&&s[t]!==null&&s[t]!==void 0&&(e[t]=s[t]),e),{})}const uX={name:"InlineSvg",inheritAttrs:!1,render(s){return this.svgElSource?s("svg",{on:this.$listeners,attrs:Object.assign(this.getSvgAttrs(this.svgElSource),cX(this.$attrs)),domProps:{innerHTML:this.getSvgContent(this.svgElSource)}}):null},props:{src:{type:String,required:!0},title:{type:String},transformSource:{type:Function,default:s=>s},keepDuringLoading:{type:Boolean,default:!0}},data(){return{svgElSource:null}},watch:{src(s){this.getSource(s)}},mounted(){this.getSource(this.src)},methods:{getSvgAttrs(s){let e={};const t=s.attributes;if(!t)return e;for(let r=t.length-1;r>=0;r--)e[t[r].name]=t[r].value;return e},getSvgContent(s){return s=s.cloneNode(!0),s=this.transformSource(s),this.title&&dX(s,this.title),s.innerHTML},getSource(s){Tn[s]||(Tn[s]=this.download(s)),this.svgElSource&&Tn[s].getIsPending()&&!this.keepDuringLoading&&(this.svgElSource=null,this.$emit("unloaded")),Tn[s].then(e=>{this.svgElSource=e,this.$nextTick(()=>{this.$emit("loaded",this.$el)})}).catch(e=>{this.svgElSource&&(this.svgElSource=null,this.$emit("unloaded")),delete Tn[s],this.$emit("error",e)})},download(s){return mX(new Promise((e,t)=>{const r=new XMLHttpRequest;r.open("GET",s,!0),r.onload=()=>{if(r.status>=200&&r.status<400)try{let a=new DOMParser().parseFromString(r.responseText,"text/xml").getElementsByTagName("svg")[0];a?e(a):t(new Error('Loaded file is not valid SVG"'))}catch(i){t(i)}else t(new Error("Error loading SVG"))},r.onerror=t,r.send()}))}}};function dX(s,e){const t=s.getElementsByTagName("title");if(t.length)t[0].textContent=e;else{const r=document.createElementNS("http://www.w3.org/2000/svg","title");r.textContent=e,s.insertBefore(r,s.firstChild)}}function mX(s){if(s.getIsPending)return s;let e=!0,t=s.then(r=>(e=!1,r),r=>{throw e=!1,r});return t.getIsPending=function(){return e},t}var hX=Object.getOwnPropertyDescriptor,pX=(s,e,t,r)=>{for(var i=r>1?void 0:r?hX(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let pp=class extends k(L,vt){constructor(){super(...arguments),this.mdiAlertOctagonOutline=W_,this.mdiContentSave=Rp,this.mdiFileUpload=rv,this.mdiClose=Ba,this.mdiCloseThick=pe,this.topbarHeight=Vn,this.showEmergencyStopDialog=!1,this.uploadSnackbar={status:!1,filename:"",percent:0,speed:0,total:0,cancelTokenSource:null},this.formatFilesize=Xe}get gcodeInputFileAccept(){return this.isIOS?[]:Pi}get naviDrawer(){return this.$store.state.naviDrawer}set naviDrawer(s){this.$store.dispatch("setNaviDrawer",s)}get currentPage(){return this.$route.fullPath}get saveConfigPending(){var s,e;return(e=(s=this.$store.state.printer.configfile)==null?void 0:s.save_config_pending)!=null?e:!1}get hideSaveConfigForBedMash(){var s;return(s=this.$store.state.gui.uiSettings.hideSaveConfigForBedMash)!=null?s:!1}get showSaveConfigButton(){var e,t;if(!this.klipperReadyForGui)return!1;if(!this.hideSaveConfigForBedMash)return this.saveConfigPending;let s=Object.keys((t=(e=this.$store.state.printer.configfile)==null?void 0:e.save_config_pending_items)!=null?t:{});return s=s.filter(r=>!r.startsWith("bed_mesh ")),s.length>0}get printerName(){return this.$store.state.gui.general.printername.length?this.$store.state.gui.general.printername:this.$store.state.printer.hostname}get countPrinters(){return this.$store.getters["farm/countPrinters"]}get boolHideUploadAndPrintButton(){var s;return(s=this.$store.state.gui.uiSettings.boolHideUploadAndPrintButton)!=null?s:!1}get isSvgLogo(){return this.sidebarLogo.includes(".svg?timestamp=")||this.sidebarLogo.endsWith(".svg")}get logoColor(){return this.$store.state.gui.uiSettings.logo}get logoClasses(){return["nav-logo","ml-2","mr-1","d-none","d-sm-flex"]}get boolShowUploadAndPrint(){return this.klippyIsConnected&&this.existGcodesRootDirectory&&["standby","complete","cancelled"].includes(this.printer_state)&&!this.boolHideUploadAndPrintButton}get defaultNavigationStateSetting(){var s,e,t;return(t=(e=(s=this.$store.state.gui)==null?void 0:s.uiSettings)==null?void 0:e.defaultNavigationStateSetting)!=null?t:"alwaysOpen"}mounted(){var s;switch(this.defaultNavigationStateSetting){case"alwaysClosed":this.naviDrawer=!1;break;case"lastState":this.naviDrawer=((s=localStorage.getItem("naviDrawer"))!=null?s:"true")==="true";break;default:this.naviDrawer=this.$vuetify.breakpoint.lgAndUp}}btnEmergencyStop(){if(this.$store.state.gui.uiSettings.confirmOnEmergencyStop){this.showEmergencyStopDialog=!0;return}this.emergencyStop()}emergencyStop(){this.showEmergencyStopDialog=!1,this.$socket.emit("printer.emergency_stop",{},{loading:"topbarEmergencyStop"})}saveConfig(){this.$store.dispatch("server/addEvent",{message:"SAVE_CONFIG",type:"command"}),this.$socket.emit("printer.gcode.script",{script:"SAVE_CONFIG"},{loading:"topbarSaveConfig"})}btnUploadAndStart(){this.$refs.fileUploadAndStart.click()}async uploadAndStart(){var s,e;if((s=this.$refs.fileUploadAndStart)!=null&&s.files.length){await this.$store.dispatch("socket/addLoading",{name:"btnUploadAndStart"});let t=[];for(const r of((e=this.$refs.fileUploadAndStart)==null?void 0:e.files)||[]){const i=await this.doUploadAndStart(r);t.push(i)}await this.$store.dispatch("socket/removeLoading",{name:"btnUploadAndStart"});for(const r of t){const i=this.$t("App.TopBar.UploadOfFileSuccessful",{file:r}).toString();this.$toast.success(i)}this.$refs.fileUploadAndStart.value="",this.currentPage!=="/"&&await this.$router.push("/")}}doUploadAndStart(s){const e=new FormData,t=s.name;return this.uploadSnackbar.filename=t,this.uploadSnackbar.status=!0,this.uploadSnackbar.percent=0,this.uploadSnackbar.speed=0,e.append("file",s,t),e.append("print","true"),new Promise(r=>{this.uploadSnackbar.cancelTokenSource=Le.CancelToken.source(),Le.post(this.apiUrl+"/server/files/upload",e,{cancelToken:this.uploadSnackbar.cancelTokenSource.token,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:i=>{var n,a,o;this.uploadSnackbar.percent=((n=i.progress)!=null?n:0)*100,this.uploadSnackbar.speed=(a=i.rate)!=null?a:0,this.uploadSnackbar.total=(o=i.total)!=null?o:0}}).then(i=>{this.uploadSnackbar.status=!1,r(i.data.result)}).catch(()=>{this.uploadSnackbar.status=!1,this.$store.dispatch("socket/removeLoading",{name:"btnUploadAndStart"});const i=this.$t("App.TopBar.CannotUploadTheFile").toString();this.$toast.error(i)})})}cancelUpload(){this.uploadSnackbar.cancelTokenSource.cancel(),this.uploadSnackbar.status=!1}};pp=pX([S({components:{EmergencyStopDialog:pb,InlineSvg:uX,Panel:U,TheSettingsMenu:I2,TheTopCornerMenu:_b,PrinterSelector:lC,MainsailLogo:mn,TheNotificationMenu:V2}})],pp);var fX=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(L$,{staticClass:"topbar pa-0",attrs:{app:"","elevate-on-scroll":"",height:e.topbarHeight,"clipped-left":""}},[t(A$,{attrs:{tile:""},on:{click:function(r){r.stopPropagation(),e.naviDrawer=!e.naviDrawer}}}),t("router-link",{attrs:{to:"/"}},[e.sidebarLogo&&e.isSvgLogo?t("inline-svg",{class:e.logoClasses,attrs:{src:e.sidebarLogo}}):e.sidebarLogo?t("img",{class:e.logoClasses,attrs:{src:e.sidebarLogo,alt:"Logo"}}):t(mn,{class:e.logoClasses,attrs:{color:e.logoColor,router:"",to:"/",ripple:!1}})],1),t(ru,{staticClass:"text-no-wrap ml-0 pl-2 mr-2"},[e._v(e._s(e.printerName))]),e.countPrinters?t(lC):e._e(),t(ae),t("input",{ref:"fileUploadAndStart",staticStyle:{display:"none"},attrs:{type:"file",accept:e.gcodeInputFileAccept.join(", ")},on:{change:e.uploadAndStart}}),e.showSaveConfigButton?t(g,{staticClass:"button-min-width-auto px-3 d-none d-sm-flex save-config-button",attrs:{tile:"",icon:e.$vuetify.breakpoint.smAndDown,text:e.$vuetify.breakpoint.mdAndUp,color:"primary",disabled:e.printerIsPrinting,loading:e.loadings.includes("topbarSaveConfig")},on:{click:e.saveConfig}},[t(_,{staticClass:"d-md-none"},[e._v(e._s(e.mdiContentSave))]),t("span",{staticClass:"d-none d-md-inline"},[e._v(e._s(e.$t("App.TopBar.SAVE_CONFIG")))])],1):e._e(),e.boolShowUploadAndPrint?t(g,{staticClass:"button-min-width-auto px-3 d-none d-sm-flex upload-and-start-button",attrs:{tile:"",icon:e.$vuetify.breakpoint.smAndDown,text:e.$vuetify.breakpoint.mdAndUp,color:"primary",loading:e.loadings.includes("btnUploadAndStart")},on:{click:e.btnUploadAndStart}},[t(_,{staticClass:"mr-md-2"},[e._v(e._s(e.mdiFileUpload))]),t("span",{staticClass:"d-none d-md-inline"},[e._v(e._s(e.$t("App.TopBar.UploadPrint")))])],1):e._e(),e.klippyIsConnected?t(g,{staticClass:"button-min-width-auto px-3 emergency-button",attrs:{tile:"",icon:e.$vuetify.breakpoint.smAndDown,text:e.$vuetify.breakpoint.mdAndUp,color:"error",loading:e.loadings.includes("topbarEmergencyStop")},on:{click:e.btnEmergencyStop}},[t(_,{staticClass:"mr-md-2"},[e._v(e._s(e.mdiAlertOctagonOutline))]),t("span",{staticClass:"d-none d-md-inline"},[e._v(e._s(e.$t("App.TopBar.EmergencyStop")))])],1):e._e(),t(V2),t(I2),t(_b)],1),t(xi,{attrs:{timeout:-1,fixed:"",right:"",bottom:""},scopedSlots:e._u([{key:"action",fn:function({attrs:r}){return[t(g,e._b({staticStyle:{"min-width":"auto"},attrs:{color:"red",text:""},on:{click:e.cancelUpload}},"v-btn",r,!1),[t(_,{staticClass:"0"},[e._v(e._s(e.mdiClose))])],1)]}}]),model:{value:e.uploadSnackbar.status,callback:function(r){e.$set(e.uploadSnackbar,"status",r)},expression:"uploadSnackbar.status"}},[t("strong",[e._v(e._s(e.$t("App.TopBar.Uploading"))+" "+e._s(e.uploadSnackbar.filename))]),t("br"),e._v(" "+e._s(Math.round(e.uploadSnackbar.percent))+" % @ "+e._s(e.formatFilesize(Math.round(e.uploadSnackbar.speed)))+"/s "),t("br"),t(Ss,{staticClass:"mt-2",attrs:{value:e.uploadSnackbar.percent}})],1),t(pb,{attrs:{"show-dialog":e.showEmergencyStopDialog},on:{close:function(r){e.showEmergencyStopDialog=!1}}})],1)},gX=[],_X=E(pp,fX,gX,!1,null,"40a2ce29");const cC=_X.exports;var vX=Object.defineProperty,bX=Object.getOwnPropertyDescriptor,uC=(s,e,t,r)=>{for(var i=r>1?void 0:r?bX(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&vX(e,t,i),i};let Zc=class extends k(L){get navigationStyle(){return this.$store.state.gui.uiSettings.navigationStyle}get icon(){return this.item.icon}get title(){return this.item.title}get to(){var s;return(s=this.item.to)!=null?s:void 0}get href(){var s;return(s=this.item.href)!=null?s:void 0}get target(){var s;return(s=this.item.target)!=null?s:void 0}get borderBottom(){return this.item.to==="/allPrinters"}};uC([w({type:Object,required:!0})],Zc.prototype,"item",2);Zc=uC([S],Zc);var yX=function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",[t(de,{attrs:{right:"","open-delay":500,disabled:e.navigationStyle!=="iconsOnly"},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(J,e._g(e._b({staticClass:"small-list-item",attrs:{router:"",to:e.to,href:e.href,target:e.target}},"v-list-item",i,!1),r),[t(Hs,{staticClass:"my-3 mr-3 menu-item-icon"},[t(_,[e._v(e._s(e.icon))])],1),t(_t,[t(Ze,{staticClass:"menu-item-title",attrs:{tile:""}},[e._v(" "+e._s(e.title)+" ")])],1)],1)]}}])},[t("span",[e._v(e._s(e.title))])]),e.borderBottom?t(I,{staticClass:"my-1"}):e._e()],1)},CX=[],$X=E(Zc,yX,CX,!1,null,"e1a7b3d5");const dC=$X.exports;var xX=Object.getOwnPropertyDescriptor,wX=(s,e,t,r)=>{for(var i=r>1?void 0:r?xX(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let fp=class extends k(L){constructor(){super(...arguments),this.mdiHelpCircleOutline=iv,this.mdiCloseThick=pe,this.mdiMoonWaningCrescent=oS}get mainsailVersion(){return this.$store.state.packageVersion}get klipperVersion(){var s,e;return(e=(s=this.$store.state.printer)==null?void 0:s.software_version)!=null?e:""}get moonrakerVersion(){var s,e;return(e=(s=this.$store.state.server)==null?void 0:s.moonraker_version)!=null?e:""}};fp=wX([S({})],fp);const SX="/img/logo.svg",PX="/img/klipper.svg";var DX=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(de,{attrs:{right:"",color:"panel"},scopedSlots:e._u([{key:"activator",fn:function({on:r,attrs:i}){return[t(_,e._g(e._b({},"v-icon",i,!1),r),[e._v(" "+e._s(e.mdiHelpCircleOutline)+" ")])]}}])},[t(Ee,{staticClass:"version-container pa-0"},[t("div",[t("img",{attrs:{height:"12",src:SX,alt:"mainsail-logo"}})]),t("div",[e._v("v"+e._s(e.mainsailVersion))]),t("div",[t(_,{staticClass:"moonraker-logo",attrs:{small:""}},[e._v(e._s(e.mdiMoonWaningCrescent))])],1),t("div",[e._v(e._s(e.moonrakerVersion))]),t("div",[t("img",{staticClass:"klipper-logo",attrs:{height:"12",src:PX,alt:"klipper-logo"}})]),t("div",[e._v(e._s(e.klipperVersion))])])],1)},TX=[],OX=E(fp,DX,TX,!1,null,"cc6926c6");const mC=OX.exports;var MX=Object.getOwnPropertyDescriptor,kX=(s,e,t,r)=>{for(var i=r>1?void 0:r?MX(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=a(i)||i);return i};let gp=class extends k(Xi,L,vt){constructor(){super(...arguments),this.navigationWidth=rw,this.topbarHeight=Vn}get naviDrawer(){return this.$store.state.naviDrawer}set naviDrawer(s){this.$store.dispatch("setNaviDrawer",s)}get navigationStyle(){return this.$store.state.gui.uiSettings.navigationStyle}get sidebarBackground(){var s;return(s=this.$store.getters["files/getCustomSidebarBackground"])!=null?s:this.sidebarBgImage}get currentPage(){return this.$route.fullPath}get boolNaviTemp(){return!this.isMobile&&this.$vuetify.breakpoint.mdAndDown}get sidebarCssVars(){return this.boolNaviTemp?{top:"".concat(Vn,"px !important"),"padding-bottom":"".concat(Vn,"px")}:{}}get sidebarLogo(){return this.$store.getters["files/getSidebarLogo"]}get logoColor(){return this.$store.state.gui.uiSettings.logo}get printerName(){return this.$store.state.gui.general.printername.length?this.$store.state.gui.general.printername:this.$store.state.printer.hostname}get logoCssVars(){return this.navigationStyle!=="iconsOnly"?{"margin-right":"16px"}:{}}get mobileLogoClass(){const s=["sidebar-logo","no-text-decoration","no-background","no-border"];return this.navigationStyle==="iconsOnly"&&(s.push("pa-0"),s.push("justify-center")),s}};gp=kX([S({components:{SidebarItem:dC,TheSelectPrinterDialog:Kp,AboutDialog:mC,MainsailLogo:mn}})],gp);var EX=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(F$,{key:e.navigationStyle,style:e.sidebarCssVars,attrs:{"mini-variant":e.navigationStyle==="iconsOnly",width:e.navigationWidth,temporary:e.boolNaviTemp,clipped:"",app:""},scopedSlots:e._u([{key:"img",fn:function(){return[t(nu,{attrs:{src:e.sidebarBackground,height:"100%"}})]},proxy:!0},{key:"append",fn:function(){return[t(J,{staticClass:"small-list-item mb-2"},[t(Hs,{staticClass:"menu-item-icon"},[t(mC)],1)],1)]},proxy:!0}]),model:{value:e.naviDrawer,callback:function(r){e.naviDrawer=r},expression:"naviDrawer"}},[t("overlay-scrollbars",{staticClass:"nav-scrollbar"},[t(Me,{staticClass:"pr-0 pt-0 ml-0"},[t(R$,{attrs:{"active-class":"active-nav-item"}},[e.isMobile?t(J,{class:e.mobileLogoClass,style:"height: "+e.topbarHeight+"px",attrs:{router:"",to:"/",ripple:!1}},[e.sidebarLogo?[t("img",{staticClass:"nav-logo",style:e.logoCssVars,attrs:{src:e.sidebarLogo,alt:"Logo"}})]:[t(mn,{staticClass:"nav-logo",style:e.logoCssVars,attrs:{color:e.logoColor,ripple:!1}})],e.navigationStyle!=="iconsOnly"?[t("span",{staticClass:"text-h6 font-weight-regular text-truncate"},[e._v(e._s(e.printerName))])]:e._e()],2):e._e(),e._l(e.visibleNaviPoints,function(r,i){return t(dC,{key:i,attrs:{item:r}})})],2)],1)],1)],1)},LX=[],AX=E(gp,EX,LX,!1,null,"3a20d60a");const hC=AX.exports;var FX=Object.defineProperty,RX=Object.getOwnPropertyDescriptor,rs=(s,e,t,r)=>{for(var i=r>1?void 0:r?RX(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(i=(r?a(e,t,i):a(i))||i);return r&&i&&FX(e,t,i),i};S.registerHooks(["metaInfo"]);let Rt=class extends k(L,vt){metaInfo(){let e=this.$store.getters.getTitle;return this.isPrinterPowerOff&&(e=this.$t("App.Titles.PrinterOff")),{title:e,titleTemplate:"%s"}}get title(){return this.$store.getters.getTitle}get naviDrawer(){return this.$store.state.naviDrawer}get navigationStyle(){return this.$store.state.gui.uiSettings.navigationStyle}get mainStyle(){let e={paddingLeft:"0"};return this.mainBgImage!==null&&(e.backgroundImage="url("+this.mainBgImage+")"),this.naviDrawer&&!this.$vuetify.breakpoint.mdAndDown&&(this.navigationStyle==="iconsAndText"&&(e.paddingLeft="220px"),this.navigationStyle==="iconsOnly"&&(e.paddingLeft="56px")),e}get customStylesheet(){return this.$store.getters["files/getCustomStylesheet"]}get customFavicons(){var e;return(e=this.$store.getters["files/getCustomFavicons"])!=null?e:null}get language(){return this.$store.state.gui.general.language}get current_file(){var e,t;return(t=(e=this.$store.state.printer.print_stats)==null?void 0:e.filename)!=null?t:""}get mode(){return this.$store.state.gui.uiSettings.mode}get logoColor(){return this.$store.state.gui.uiSettings.logo}get primaryColor(){return this.$store.state.gui.uiSettings.primary}get warningColor(){var e,t,r,i,n;return(n=(i=(r=(t=(e=this.$vuetify)==null?void 0:e.theme)==null?void 0:t.currentTheme)==null?void 0:r.warning)==null?void 0:i.toString())!=null?n:"#ff8300"}get primaryTextColor(){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(this.primaryColor);if(e){const t=parseInt(e[1],16)*.2126,r=parseInt(e[2],16)*.7152,i=parseInt(e[3],16)*.0722;return(t+r+i)/255>.7?"#222":"#fff"}return"#ffffff"}get cssVars(){return{"--v-btn-text-primary":this.primaryTextColor,"--color-logo":this.logoColor,"--color-primary":this.primaryColor,"--color-warning":this.warningColor,"--panel-toolbar-icon-btn-width":mm+"px","--panel-toolbar-text-btn-height":mm+"px","--topbar-icon-btn-width":Vn+"px","--sidebar-menu-item-height":iw+"px"}}get print_percent(){return Math.floor(this.$store.getters["printer/getPrintPercent"]*100)}get containerClasses(){var t,r;const e=(t=this.$router.options.routes)==null?void 0:t.find(i=>i.name===this.$route.name);return{"px-3":!0,"px-sm-6":!0,"py-sm-6":!0,"mx-auto":!0,fullscreen:(r=e==null?void 0:e.fullscreen)!=null?r:!1}}get progressAsFavicon(){return this.$store.state.gui.uiSettings.progressAsFavicon}async languageChanged(e){await xy(e)}customStylesheetChanged(e){const t=document.getElementById("customStylesheet");if(e!==null&&t===null){const r=document.createElement("link");r.id="customStylesheet",r.type="text/css",r.rel="stylesheet",r.href=e,document.head.appendChild(r)}else e!==null&&t?t.setAttribute("href",e):t&&t.remove()}current_fileChanged(e){e!==""&&this.$socket.emit("server.files.metadata",{filename:e},{action:"files/getMetadataCurrentFile"})}primaryColorChanged(e){this.$nextTick(()=>{this.$vuetify.theme.currentTheme.primary=e})}modeChanged(e){const t=e!=="light";this.$vuetify.theme.dark=t;const r=document.documentElement;r.className=t?"theme--dark":"theme--light"}async drawFavicon(e){var n,a,o;const t=document.querySelector("link[rel*='icon'][sizes='16x16']"),r=document.querySelector("link[rel*='icon'][sizes='32x32']");if(!t||!r)return;if(this.progressAsFavicon&&this.printerIsPrinting){let l=64,u=document.createElement("canvas");u.width=l,u.height=l;const c=u.getContext("2d"),d=u.width/2,m=u.height/2,h=32;if(!c)return;c.beginPath(),c.moveTo(d,m),c.arc(d,m,h,0,2*Math.PI,!1),c.closePath(),c.fillStyle="#ddd",c.fill(),c.strokeStyle="rgba(200, 208, 218, 0.66)",c.stroke();let f=1.5*Math.PI,p=0,v=(Math.PI-.5*Math.PI)/25;(e>=0&&e<=25||e>25&&e<=50||e>50&&e<=75||e>75&&e<=100)&&(p=f+e*v),c.beginPath(),c.moveTo(d,m),c.arc(d,m,h,f,p,!1),c.closePath(),c.fillStyle=this.logoColor,c.fill(),t.href=u.toDataURL("image/png"),r.href=u.toDataURL("image/png");return}if(this.customFavicons){const[l,u]=this.customFavicons;t.href=l,r.href=u;return}if((o=(a=(n=this.theme)==null?void 0:n.logo)==null?void 0:a.show)!=null&&o&&this.sidebarLogo.endsWith(".svg")){const l=await fetch(this.sidebarLogo);if(!l.ok)return;const c=(await l.text()).replace(/fill="var\(--color-logo, #[0-9a-fA-F]{6}\)"/g,'fill="'.concat(this.logoColor,'"')),d=new Blob([c],{type:"image/svg+xml"}),m=new FileReader;m.onloadend=()=>{const h=m.result;t.href=h,r.href=h},m.readAsDataURL(d);return}const i="data:image/svg+xml;base64,"+window.btoa('\n \n \n \n \n \n \n \n '));t.href=i,r.href=i}customFaviconsChanged(){this.drawFavicon(this.print_percent)}progressAsFaviconChanged(){this.drawFavicon(this.print_percent)}logoColorChanged(){this.drawFavicon(this.print_percent)}themeCssChanged(e){const t=document.getElementById("theme-css");t&&t.remove(),e!==null&&fetch(e).then(r=>r.text()).then(r=>{const i=document.createElement("style");i.id="theme-css",i.innerHTML=r,document.head.appendChild(i)})}print_percentChanged(e){this.drawFavicon(e),this.refreshSpoolman()}printerIsPrintingChanged(){this.drawFavicon(this.print_percent)}refreshSpoolman(){this.moonrakerComponents.includes("spoolman")&&this.$store.dispatch("server/spoolman/refreshActiveSpool",null,{root:!0})}appHeight(){this.$nextTick(()=>{document.documentElement.style.setProperty("--app-height",window.innerHeight+"px")})}mounted(){this.drawFavicon(this.print_percent),this.appHeight(),window.addEventListener("resize",this.appHeight),window.addEventListener("orientationchange",this.appHeight)}};rs([he("language")],Rt.prototype,"languageChanged",1);rs([he("customStylesheet")],Rt.prototype,"customStylesheetChanged",1);rs([he("current_file")],Rt.prototype,"current_fileChanged",1);rs([he("primaryColor")],Rt.prototype,"primaryColorChanged",1);rs([he("mode")],Rt.prototype,"modeChanged",1);rs([he("customFavicons")],Rt.prototype,"customFaviconsChanged",1);rs([he("progressAsFavicon")],Rt.prototype,"progressAsFaviconChanged",1);rs([he("logoColor")],Rt.prototype,"logoColorChanged",1);rs([he("themeCss")],Rt.prototype,"themeCssChanged",1);rs([he("print_percent")],Rt.prototype,"print_percentChanged",1);rs([he("printerIsPrinting")],Rt.prototype,"printerIsPrintingChanged",1);Rt=rs([S({components:{TheMacroPrompt:Iv,TheTimelapseRenderingSnackbar:Qv,TheEditor:ub,TheSelectPrinterDialog:Kp,TheConnectingDialog:Ev,TheUpdateDialog:mb,TheTopbar:cC,TheSidebar:hC,TheFullscreenUpload:Kv,TheUploadSnackbar:Jv,TheManualProbeDialog:Zv,TheBedScrewsDialog:Gv,TheScrewsTiltAdjustDialog:zv}})],Rt);var HX=function(){var e=this,t=e._self._c;return e._self._setupProxy,t(H$,{style:e.cssVars},[e.socketIsConnected&&e.guiIsReady?[t(hC),t(cC),t(j$,{style:e.mainStyle,attrs:{id:"content"}},[t(Ee,{class:e.containerClasses,attrs:{id:"page-container",fluid:""}},[t("router-view")],1)],1),t(S5),t(mb),t(ub),t(Qv),t(Kv),t(Jv),t(Zv),t(Gv),t(zv),t(Iv)]:e.instancesDB!=="moonraker"?t(Kp):t(Ev)],2)},jX=[],IX=E(Rt,HX,jX,!1,null,null);const NX=IX.exports;y.use(k_,{directives:{Touch:N$,Ripple:I$}});const pC=new k_({theme:{dark:!0,options:{customProperties:!0}},icons:{iconfont:"mdiSvg"},breakpoint:{mobileBreakpoint:768}});/*! + * vuex v3.6.2 + * (c) 2021 Evan You + * @license MIT + */function VX(s){var e=Number(s.version.split(".")[0]);if(e>=2)s.mixin({beforeCreate:r});else{var t=s.prototype._init;s.prototype._init=function(i){i===void 0&&(i={}),i.init=i.init?[r].concat(i.init):r,t.call(this,i)}}function r(){var i=this.$options;i.store?this.$store=typeof i.store=="function"?i.store():i.store:i.parent&&i.parent.$store&&(this.$store=i.parent.$store)}}var BX=typeof window<"u"?window:typeof global<"u"?global:{},hi=BX.__VUE_DEVTOOLS_GLOBAL_HOOK__;function UX(s){hi&&(s._devtoolHook=hi,hi.emit("vuex:init",s),hi.on("vuex:travel-to-state",function(e){s.replaceState(e)}),s.subscribe(function(e,t){hi.emit("vuex:mutation",e,t)},{prepend:!0}),s.subscribeAction(function(e,t){hi.emit("vuex:action",e,t)},{prepend:!0}))}function WX(s,e){return s.filter(e)[0]}function _p(s,e){if(e===void 0&&(e=[]),s===null||typeof s!="object")return s;var t=WX(e,function(i){return i.original===s});if(t)return t.copy;var r=Array.isArray(s)?[]:{};return e.push({original:s,copy:r}),Object.keys(s).forEach(function(i){r[i]=_p(s[i],e)}),r}function bn(s,e){Object.keys(s).forEach(function(t){return e(s[t],t)})}function fC(s){return s!==null&&typeof s=="object"}function zX(s){return s&&typeof s.then=="function"}function GX(s,e){return function(){return s(e)}}var vs=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var r=e.state;this.state=(typeof r=="function"?r():r)||{}},gC={namespaced:{configurable:!0}};gC.namespaced.get=function(){return!!this._rawModule.namespaced};vs.prototype.addChild=function(e,t){this._children[e]=t};vs.prototype.removeChild=function(e){delete this._children[e]};vs.prototype.getChild=function(e){return this._children[e]};vs.prototype.hasChild=function(e){return e in this._children};vs.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)};vs.prototype.forEachChild=function(e){bn(this._children,e)};vs.prototype.forEachGetter=function(e){this._rawModule.getters&&bn(this._rawModule.getters,e)};vs.prototype.forEachAction=function(e){this._rawModule.actions&&bn(this._rawModule.actions,e)};vs.prototype.forEachMutation=function(e){this._rawModule.mutations&&bn(this._rawModule.mutations,e)};Object.defineProperties(vs.prototype,gC);var ai=function(e){this.register([],e,!1)};ai.prototype.get=function(e){return e.reduce(function(t,r){return t.getChild(r)},this.root)};ai.prototype.getNamespace=function(e){var t=this.root;return e.reduce(function(r,i){return t=t.getChild(i),r+(t.namespaced?i+"/":"")},"")};ai.prototype.update=function(e){_C([],this.root,e)};ai.prototype.register=function(e,t,r){var i=this;r===void 0&&(r=!0);var n=new vs(t,r);if(e.length===0)this.root=n;else{var a=this.get(e.slice(0,-1));a.addChild(e[e.length-1],n)}t.modules&&bn(t.modules,function(o,l){i.register(e.concat(l),o,r)})};ai.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),r=e[e.length-1],i=t.getChild(r);i&&i.runtime&&t.removeChild(r)};ai.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),r=e[e.length-1];return t?t.hasChild(r):!1};function _C(s,e,t){if(e.update(t),t.modules)for(var r in t.modules){if(!e.getChild(r))return;_C(s.concat(r),e.getChild(r),t.modules[r])}}var kt,Gt=function(e){var t=this;e===void 0&&(e={}),!kt&&typeof window<"u"&&window.Vue&&yC(window.Vue);var r=e.plugins;r===void 0&&(r=[]);var i=e.strict;i===void 0&&(i=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new ai(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new kt,this._makeLocalGettersCache=Object.create(null);var n=this,a=this,o=a.dispatch,l=a.commit;this.dispatch=function(m,h){return o.call(n,m,h)},this.commit=function(m,h,f){return l.call(n,m,h,f)},this.strict=i;var u=this._modules.root.state;bd(this,u,[],this._modules.root),$g(this,u),r.forEach(function(d){return d(t)});var c=e.devtools!==void 0?e.devtools:kt.config.devtools;c&&UX(this)},Cg={state:{configurable:!0}};Cg.state.get=function(){return this._vm._data.$$state};Cg.state.set=function(s){};Gt.prototype.commit=function(e,t,r){var i=this,n=qc(e,t,r),a=n.type,o=n.payload,l={type:a,payload:o},u=this._mutations[a];u&&(this._withCommit(function(){u.forEach(function(d){d(o)})}),this._subscribers.slice().forEach(function(c){return c(l,i.state)}))};Gt.prototype.dispatch=function(e,t){var r=this,i=qc(e,t),n=i.type,a=i.payload,o={type:n,payload:a},l=this._actions[n];if(l){try{this._actionSubscribers.slice().filter(function(c){return c.before}).forEach(function(c){return c.before(o,r.state)})}catch{}var u=l.length>1?Promise.all(l.map(function(c){return c(a)})):l[0](a);return new Promise(function(c,d){u.then(function(m){try{r._actionSubscribers.filter(function(h){return h.after}).forEach(function(h){return h.after(o,r.state)})}catch{}c(m)},function(m){try{r._actionSubscribers.filter(function(h){return h.error}).forEach(function(h){return h.error(o,r.state,m)})}catch{}d(m)})})}};Gt.prototype.subscribe=function(e,t){return vC(e,this._subscribers,t)};Gt.prototype.subscribeAction=function(e,t){var r=typeof e=="function"?{before:e}:e;return vC(r,this._actionSubscribers,t)};Gt.prototype.watch=function(e,t,r){var i=this;return this._watcherVM.$watch(function(){return e(i.state,i.getters)},t,r)};Gt.prototype.replaceState=function(e){var t=this;this._withCommit(function(){t._vm._data.$$state=e})};Gt.prototype.registerModule=function(e,t,r){r===void 0&&(r={}),typeof e=="string"&&(e=[e]),this._modules.register(e,t),bd(this,this.state,e,this._modules.get(e),r.preserveState),$g(this,this.state)};Gt.prototype.unregisterModule=function(e){var t=this;typeof e=="string"&&(e=[e]),this._modules.unregister(e),this._withCommit(function(){var r=xg(t.state,e.slice(0,-1));kt.delete(r,e[e.length-1])}),bC(this)};Gt.prototype.hasModule=function(e){return typeof e=="string"&&(e=[e]),this._modules.isRegistered(e)};Gt.prototype.hotUpdate=function(e){this._modules.update(e),bC(this,!0)};Gt.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t};Object.defineProperties(Gt.prototype,Cg);function vC(s,e,t){return e.indexOf(s)<0&&(t&&t.prepend?e.unshift(s):e.push(s)),function(){var r=e.indexOf(s);r>-1&&e.splice(r,1)}}function bC(s,e){s._actions=Object.create(null),s._mutations=Object.create(null),s._wrappedGetters=Object.create(null),s._modulesNamespaceMap=Object.create(null);var t=s.state;bd(s,t,[],s._modules.root,!0),$g(s,t,e)}function $g(s,e,t){var r=s._vm;s.getters={},s._makeLocalGettersCache=Object.create(null);var i=s._wrappedGetters,n={};bn(i,function(o,l){n[l]=GX(o,s),Object.defineProperty(s.getters,l,{get:function(){return s._vm[l]},enumerable:!0})});var a=kt.config.silent;kt.config.silent=!0,s._vm=new kt({data:{$$state:e},computed:n}),kt.config.silent=a,s.strict&&KX(s),r&&(t&&s._withCommit(function(){r._data.$$state=null}),kt.nextTick(function(){return r.$destroy()}))}function bd(s,e,t,r,i){var n=!t.length,a=s._modules.getNamespace(t);if(r.namespaced&&(s._modulesNamespaceMap[a],s._modulesNamespaceMap[a]=r),!n&&!i){var o=xg(e,t.slice(0,-1)),l=t[t.length-1];s._withCommit(function(){kt.set(o,l,r.state)})}var u=r.context=ZX(s,a,t);r.forEachMutation(function(c,d){var m=a+d;XX(s,m,c,u)}),r.forEachAction(function(c,d){var m=c.root?d:a+d,h=c.handler||c;YX(s,m,h,u)}),r.forEachGetter(function(c,d){var m=a+d;JX(s,m,c,u)}),r.forEachChild(function(c,d){bd(s,e,t.concat(d),c,i)})}function ZX(s,e,t){var r=e==="",i={dispatch:r?s.dispatch:function(n,a,o){var l=qc(n,a,o),u=l.payload,c=l.options,d=l.type;return(!c||!c.root)&&(d=e+d),s.dispatch(d,u)},commit:r?s.commit:function(n,a,o){var l=qc(n,a,o),u=l.payload,c=l.options,d=l.type;(!c||!c.root)&&(d=e+d),s.commit(d,u,c)}};return Object.defineProperties(i,{getters:{get:r?function(){return s.getters}:function(){return qX(s,e)}},state:{get:function(){return xg(s.state,t)}}}),i}function qX(s,e){if(!s._makeLocalGettersCache[e]){var t={},r=e.length;Object.keys(s.getters).forEach(function(i){if(i.slice(0,r)===e){var n=i.slice(r);Object.defineProperty(t,n,{get:function(){return s.getters[i]},enumerable:!0})}}),s._makeLocalGettersCache[e]=t}return s._makeLocalGettersCache[e]}function XX(s,e,t,r){var i=s._mutations[e]||(s._mutations[e]=[]);i.push(function(a){t.call(s,r.state,a)})}function YX(s,e,t,r){var i=s._actions[e]||(s._actions[e]=[]);i.push(function(a){var o=t.call(s,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:s.getters,rootState:s.state},a);return zX(o)||(o=Promise.resolve(o)),s._devtoolHook?o.catch(function(l){throw s._devtoolHook.emit("vuex:error",l),l}):o})}function JX(s,e,t,r){s._wrappedGetters[e]||(s._wrappedGetters[e]=function(n){return t(r.state,r.getters,n.state,n.getters)})}function KX(s){s._vm.$watch(function(){return this._data.$$state},function(){},{deep:!0,sync:!0})}function xg(s,e){return e.reduce(function(t,r){return t[r]},s)}function qc(s,e,t){return fC(s)&&s.type&&(t=e,e=s,s=s.type),{type:s,payload:e,options:t}}function yC(s){kt&&s===kt||(kt=s,VX(kt))}var CC=Cd(function(s,e){var t={};return yd(e).forEach(function(r){var i=r.key,n=r.val;t[i]=function(){var o=this.$store.state,l=this.$store.getters;if(s){var u=$d(this.$store,"mapState",s);if(!u)return;o=u.context.state,l=u.context.getters}return typeof n=="function"?n.call(this,o,l):o[n]},t[i].vuex=!0}),t}),$C=Cd(function(s,e){var t={};return yd(e).forEach(function(r){var i=r.key,n=r.val;t[i]=function(){for(var o=[],l=arguments.length;l--;)o[l]=arguments[l];var u=this.$store.commit;if(s){var c=$d(this.$store,"mapMutations",s);if(!c)return;u=c.context.commit}return typeof n=="function"?n.apply(this,[u].concat(o)):u.apply(this.$store,[n].concat(o))}}),t}),xC=Cd(function(s,e){var t={};return yd(e).forEach(function(r){var i=r.key,n=r.val;n=s+n,t[i]=function(){if(!(s&&!$d(this.$store,"mapGetters",s)))return this.$store.getters[n]},t[i].vuex=!0}),t}),wC=Cd(function(s,e){var t={};return yd(e).forEach(function(r){var i=r.key,n=r.val;t[i]=function(){for(var o=[],l=arguments.length;l--;)o[l]=arguments[l];var u=this.$store.dispatch;if(s){var c=$d(this.$store,"mapActions",s);if(!c)return;u=c.context.dispatch}return typeof n=="function"?n.apply(this,[u].concat(o)):u.apply(this.$store,[n].concat(o))}}),t}),QX=function(s){return{mapState:CC.bind(null,s),mapGetters:xC.bind(null,s),mapMutations:$C.bind(null,s),mapActions:wC.bind(null,s)}};function yd(s){return eY(s)?Array.isArray(s)?s.map(function(e){return{key:e,val:e}}):Object.keys(s).map(function(e){return{key:e,val:s[e]}}):[]}function eY(s){return Array.isArray(s)||fC(s)}function Cd(s){return function(e,t){return typeof e!="string"?(t=e,e=""):e.charAt(e.length-1)!=="/"&&(e+="/"),s(e,t)}}function $d(s,e,t){var r=s._modulesNamespaceMap[t];return r}function tY(s){s===void 0&&(s={});var e=s.collapsed;e===void 0&&(e=!0);var t=s.filter;t===void 0&&(t=function(c,d,m){return!0});var r=s.transformer;r===void 0&&(r=function(c){return c});var i=s.mutationTransformer;i===void 0&&(i=function(c){return c});var n=s.actionFilter;n===void 0&&(n=function(c,d){return!0});var a=s.actionTransformer;a===void 0&&(a=function(c){return c});var o=s.logMutations;o===void 0&&(o=!0);var l=s.logActions;l===void 0&&(l=!0);var u=s.logger;return u===void 0&&(u=console),function(c){var d=_p(c.state);typeof u>"u"||(o&&c.subscribe(function(m,h){var f=_p(h);if(t(m,d,f)){var p=m_(),v=i(m),C="mutation "+m.type+p;u_(u,C,e),u.log("%c prev state","color: #9E9E9E; font-weight: bold",r(d)),u.log("%c mutation","color: #03A9F4; font-weight: bold",v),u.log("%c next state","color: #4CAF50; font-weight: bold",r(f)),d_(u)}d=f}),l&&c.subscribeAction(function(m,h){if(n(m,h)){var f=m_(),p=a(m),v="action "+m.type+f;u_(u,v,e),u.log("%c action","color: #03A9F4; font-weight: bold",p),d_(u)}}))}}function u_(s,e,t){var r=t?s.groupCollapsed:s.group;try{r.call(s,e)}catch{s.log(e)}}function d_(s){try{s.groupEnd()}catch{s.log("—— log end ——")}}function m_(){var s=new Date;return" @ "+Fo(s.getHours(),2)+":"+Fo(s.getMinutes(),2)+":"+Fo(s.getSeconds(),2)+"."+Fo(s.getMilliseconds(),3)}function sY(s,e){return new Array(e+1).join(s)}function Fo(s,e){return sY("0",e-s.toString().length)+s}var SC={Store:Gt,install:yC,version:"3.6.2",mapState:CC,mapMutations:$C,mapGetters:xC,mapActions:wC,createNamespacedHelpers:QX,createLogger:tY};const rY={switchToDashboard(){Ia.currentRoute.fullPath!=="/"&&Ia.push("/")},changePrinter({dispatch:s,getters:e},t){s("files/reset"),s("gui/reset"),s("printer/reset"),s("server/reset"),s("socket/reset");const r=e["farm/"+t.printer+"/getSocketData"];s("socket/setSocket",{hostname:r.hostname,port:r.port,path:r.path})},setNaviDrawer({commit:s},e){s("setNaviDrawer",e)},async importConfigJson({commit:s},e){var r;let t=(r=e.instancesDB)!=null?r:"moonraker";if(t!=="moonraker"){s("setInstancesDB",t),t==="json"&&"instances"in e&&Array.isArray(e.instances)&&e.instances.length&&s("setConfigInstances",e.instances);return}e.hostname&&s("socket/setData",{hostname:e.hostname}),e.port&&s("socket/setData",{port:parseInt(e.port.toString())}),e.path&&s("socket/setData",{route_prefix:e.path})}},iY={setNaviDrawer(s,e){y.set(s,"naviDrawer",e),localStorage.setItem("naviDrawer",e)},setInstancesDB(s,e){y.set(s,"instancesDB",e)},setConfigInstances(s,e){y.set(s,"configInstances",e)}},nY={getVersion:s=>s.packageVersion,getTitle:(s,e)=>{var r,i,n,a,o,l,u,c,d,m,h,f,p,v,C,P,M,F,O,$,D,V;if(!((r=s.socket)!=null&&r.isConnected))return"Mainsail";if(((i=s.server)==null?void 0:i.klippy_state)!=="ready")return ve.t("App.Titles.Error");let t=(o=(a=(n=s.printer)==null?void 0:n.print_stats)==null?void 0:a.state)!=null?o:"";if(s.printer&&((l=s.printer["gcode_macro TIMELAPSE_TAKE_FRAME"])!=null&&l.is_paused)&&t==="paused"&&(t="printing"),t==="paused")return ve.t("App.Titles.Pause");if(((c=(u=s.printer)==null?void 0:u.print_stats)==null?void 0:c.state)==="complete"){let N=ve.t("App.Titles.Complete",{filename:s.printer.print_stats.filename});return(d=s.gui)!=null&&d.general.printername&&(N+="- ".concat((m=s.gui)==null?void 0:m.general.printername)),N}if(t==="printing"){const N=e["printer/getEstimatedTimeETAFormat"],W=Math.floor(e["printer/getPrintPercent"]*100);if(N!=="--"){let te=ve.t("App.Titles.PrintingETA",{percent:W,filename:(f=(h=s.printer)==null?void 0:h.print_stats)==null?void 0:f.filename,eta:N});return(p=s.gui)!=null&&p.general.printername&&(te+="- ".concat((v=s.gui)==null?void 0:v.general.printername)),te}let G=ve.t("App.Titles.Printing",{percent:W,filename:(P=(C=s.printer)==null?void 0:C.print_stats)==null?void 0:P.filename});return(M=s.gui)!=null&&M.general.printername&&(G+="- ".concat((F=s.gui)==null?void 0:F.general.printername)),G}return(V=(D=(O=s.gui)==null?void 0:O.general.printername)!=null?D:($=s.printer)==null?void 0:$.hostname)!=null?V:"Mainsail"},getDependencies:s=>{var v,C,P,M,F,O,$,D,V,N,W,G;const e=[],t=(C=(v=s.printer)==null?void 0:v.software_version)!=null?C:"",r=t.split("-"),i=(P=r[0])!=null?P:"",n=parseInt((M=r[1])!=null?M:0),a=jg.split("-"),o=(F=a[0])!=null?F:"",l=parseInt((O=a[1])!=null?O:0);nt.valid(i)&&(nt.gt(o,i)||nt.eq(o,i)&&n0?"/".concat(r):"";await y.prototype.$socket.close(),await y.prototype.$socket.setUrl(e.protocol+"://"+t.hostname+":"+t.port+i+"/websocket"),await y.prototype.$socket.connect()}},onOpen({commit:s,dispatch:e,rootState:t}){var r,i;s("setConnected"),e("server/init",null,{root:!0}),(i=(r=t==null?void 0:t.server)==null?void 0:r.updateManager)!=null&&i.updateResponse.complete||s("server/updateManager/setStatus",{busy:!1},{root:!0})},onClose({commit:s}){s("setDisconnected")},onMessage({commit:s,dispatch:e},t){switch(t.method){case"notify_status_update":e("printer/getData",t.params[0],{root:!0});break;case"notify_gcode_response":e("server/addEvent",Object.assign({result:t.params[0]},{send:!1}),{root:!0});break;case"notify_klippy_ready":s("server/setKlippyConnected",null,{root:!0}),e("server/stopKlippyConnectedInterval",null,{root:!0}),e("server/stopKlippyStateInterval",null,{root:!0}),e("printer/init",null,{root:!0});break;case"notify_klippy_disconnected":e("server/setKlippyDisconnected",null,{root:!0});break;case"notify_klippy_shutdown":e("server/setKlippyShutdown",null,{root:!0});break;case"notify_proc_stat_update":e("server/updateProcStats",t.params[0],{root:!0});break;case"notify_cpu_throttled":s("server/setThrottledState",t.params[0],{root:!0});break;case"notify_filelist_changed":e("files/filelist_changed",t.params[0],{root:!0});break;case"notify_metadata_update":s("files/setMetadata",t.params[0],{root:!0});break;case"notify_power_changed":s("server/power/setStatus",t.params[0],{root:!0});break;case"notify_update_response":s("server/updateManager/addUpdateResponse",t.params[0],{root:!0});break;case"notify_update_refreshed":e("server/updateManager/onUpdateStatus",t.params[0],{root:!0});break;case"notify_history_changed":e("server/history/getChanged",t.params[0],{root:!0});break;case"notify_service_state_changed":e("server/serviceStateChanged",t.params[0],{root:!0});break;case"notify_timelapse_event":e("server/timelapse/getEvent",t.params[0],{root:!0});break;case"notify_job_queue_changed":e("server/jobQueue/getEvent",t.params[0],{root:!0});break;case"notify_announcement_update":e("server/announcements/getList",t.params[0],{root:!0});break;case"notify_announcement_dismissed":e("server/announcements/getDismissed",t.params[0],{root:!0});break;case"notify_announcement_wake":e("server/announcements/getWaked",t.params[0],{root:!0});break;case"notify_webcams_changed":e("gui/webcams/initStore",t.params[0],{root:!0});break;case"notify_active_spool_set":e("server/spoolman/getActiveSpoolId",t.params[0],{root:!0});break;case"notify_sensor_update":e("server/sensor/updateSensors",t.params[0],{root:!0});break;default:window.console.debug(t)}},addLoading({commit:s},e){s("addLoading",e)},removeLoading({commit:s},e){s("removeLoading",e)},clearLoadings({commit:s}){s("clearLoadings")},addInitModule({commit:s},e){s("addInitModule",e)},removeInitModule({commit:s},e){s("removeInitModule",e)},removeInitComponent({commit:s},e){s("removeInitComponent",e)},reportDebug(s,e){window.console.log(e)},setConnectionFailed({commit:s},e){s("setDisconnected",e)}},oY={reset(s){const e=PC();y.set(s,"initializationList",e.initializationList)},setConnected(s){y.set(s,"isConnected",!0),y.set(s,"isConnecting",!1),y.set(s,"connectingFailed",!1)},setDisconnected(s,e){y.set(s,"isConnected",!1),y.set(s,"isConnecting",!1),y.set(s,"connectingFailed",!0),y.set(s,"connection_id",null),e&&y.set(s,"connectionFailedMessage",e)},setData(s,e){"socket"in e&&(e=e.socket),Object.entries(e).forEach(([t,r])=>{y.set(s,t,r)})},addLoading(s,e){s.loadings.push(e.name)},removeLoading(s,e){const t=s.loadings.indexOf(e.name);t>-1&&s.loadings.splice(t,1)},clearLoadings(s){s.loadings.length&&y.set(s,"loadings",[])},addInitModule(s,e){const t=[...s.initializationList];t.indexOf(e)>-1||(t.push(e),y.set(s,"initializationList",t))},removeInitModule(s,e){const t=[...s.initializationList],r=t.indexOf(e);r!==-1&&(t.splice(r,1),y.set(s,"initializationList",t))},removeInitComponent(s,e){const t=[...s.initializationList],r=t.reduce((i,n,a)=>(n.startsWith(e)&&i.push(a),i),[]);r.length&&(r.forEach(i=>t.splice(i,1)),y.set(s,"initializationList",t))}},lY={getUrl:s=>{const e=s.port!==80?":"+s.port:"";let t="/"+s.path.replace(/^\/|\/$/g,"");return t.endsWith("/")&&(t=t.slice(0,-1)),"//".concat(s.hostname).concat(e).concat(t)},getHostUrl:s=>{const e=s.protocol==="wss"?"https":"http";return"".concat(e,"://").concat(s.hostname,"/")},getWebsocketUrl:(s,e)=>s.protocol+":"+e.getUrl+"/websocket"},PC=()=>{const s=window.location.hostname,e=window.location.port||(window.location.protocol==="https:"?443:80),t=Number(e);return{hostname:s,port:t,path:"",protocol:document.location.protocol==="https:"?"wss":"ws",reconnectInterval:2e3,isConnected:!1,isConnecting:!1,connectingFailed:!1,connectionFailedMessage:null,loadings:[],initializationList:["server"],connection_id:null}},cY=PC(),uY={namespaced:!0,state:cY,getters:lY,actions:aY,mutations:oY},dY={reset({commit:s,dispatch:e}){e("stopKlippyConnectedInterval"),e("stopKlippyStateInterval"),s("reset"),e("power/reset"),e("updateManager/reset")},async init({commit:s,dispatch:e,rootState:t}){window.console.debug("init Server");try{const r=await y.$socket.emitAndWait("server.connection.identify",{client_name:"mainsail",version:t.packageVersion,type:"web",url:"https://github.com/mainsail-crew/mainsail"});s("setConnectionId",r.connection_id)}catch(r){r.message==="Unauthorized"&&this.dispatch("socket/setConnectionFailed",r.message),window.console.error("Error while identifying client: "+r.message);return}e("socket/addInitModule","server/info",{root:!0}),e("socket/addInitModule","server/config",{root:!0}),e("socket/addInitModule","server/systemInfo",{root:!0}),e("socket/addInitModule","server/procStats",{root:!0}),e("socket/addInitModule","server/databaseList",{root:!0}),y.$socket.emit("server.info",{},{action:"server/initServerInfo"}),y.$socket.emit("server.config",{},{action:"server/initServerConfig"}),y.$socket.emit("machine.system_info",{},{action:"server/initSystemInfo"}),y.$socket.emit("machine.proc_stats",{},{action:"server/initProcStats"}),y.$socket.emit("server.database.list",{root:"config"},{action:"server/checkDatabases"}),await e("socket/removeInitModule","server",{root:!0})},checkDatabases({dispatch:s,commit:e},t){var r,i;(r=t.namespaces)!=null&&r.includes("mainsail")?(s("socket/addInitModule","gui/init",{root:!0}),s("gui/init",null,{root:!0})):s("gui/initDb",null,{root:!0}),(i=t.namespaces)!=null&&i.includes("maintenance")?(s("socket/addInitModule","gui/maintenance/init",{root:!0}),s("gui/maintenance/init",null,{root:!0})):s("gui/maintenance/initDb",null,{root:!0}),s("socket/addInitModule","gui/webcam/init",{root:!0}),s("gui/webcams/init",null,{root:!0}),e("saveDbNamespaces",t.namespaces),y.$socket.emit("server.info",{},{action:"server/checkKlippyConnected"}),s("socket/removeInitModule","server/databaseList",{root:!0})},initServerInfo({dispatch:s,commit:e},t){var r,i;if("plugins"in t&&delete t.plugins,"failed_plugins"in t&&delete t.failed_plugins,(r=t.components)!=null&&r.length)for(let n of t.components)n=T3(n),B_.includes(n)&&(window.console.debug("init server component: "+n),s("socket/addInitModule","server/"+n+"/init",{root:!0}),s("server/"+n+"/init",{},{root:!0}));(i=t.registered_directories)!=null&&i.length&&s("files/initRootDirs",t.registered_directories,{root:!0}),e("setData",t),s("socket/removeInitModule","server/info",{root:!0})},initServerConfig({commit:s,dispatch:e},t){s("setConfig",t),e("socket/removeInitModule","server/config",{root:!0})},initSystemInfo({commit:s,dispatch:e},t){s("setSystemInfo",t.system_info),e("socket/removeInitModule","server/systemInfo",{root:!0})},initProcStats({commit:s,dispatch:e},t){if(t.throttled_state!==null&&s("setThrottledState",t.throttled_state),t.system_uptime){const r=new Date(new Date().getTime()-t.system_uptime*1e3);s("setSystemBootAt",r)}e("socket/removeInitModule","server/procStats",{root:!0})},updateProcStats({commit:s},e){"cpu_temp"in e&&s("setCpuTemp",e.cpu_temp),"moonraker_stats"in e&&s("setMoonrakerStats",e.moonraker_stats),"network"in e&&s("setNetworkStats",e.network),"system_cpu_usage"in e&&s("setCpuStats",e.system_cpu_usage)},setKlippyReady({dispatch:s}){s("stopKlippyConnectedInterval"),s("stopKlippyStateInterval"),s("printer/reset",null,{root:!0}),s("printer/init",null,{root:!0})},setKlippyDisconnected({commit:s,dispatch:e}){s("setKlippyDisconnected",null),e("stopKlippyStateInterval"),e("startKlippyConnectedInterval")},setKlippyShutdown({commit:s,dispatch:e}){s("setKlippyShutdown",null),e("stopKlippyStateInterval"),e("startKlippyConnectedInterval")},startKlippyConnectedInterval({commit:s,state:e}){if(e.klippy_connected_timer)return;const t=setInterval(()=>{y.$socket.emit("server.info",{},{action:"server/checkKlippyConnected"})},2e3);s("setKlippyConnectedTimer",t)},stopKlippyConnectedInterval({commit:s,state:e}){e.klippy_connected_timer!==null&&(clearInterval(e.klippy_connected_timer),s("setKlippyConnectedTimer",null))},checkKlippyConnected({commit:s,dispatch:e},t){if(!t.klippy_connected){e("startKlippyConnectedInterval");return}e("stopKlippyConnectedInterval"),s("setKlippyConnected"),e("printer/initGcodes",null,{root:!0}),e("checkKlippyState",{state:t.klippy_state,state_message:null})},startKlippyStateInterval({commit:s,state:e}){if(e.klippy_state_timer)return;const t=setInterval(()=>{y.$socket.emit("printer.info",{},{action:"server/checkKlippyState"})},2e3);s("setKlippyStateTimer",t)},stopKlippyStateInterval({commit:s,state:e}){e.klippy_state_timer!==null&&(clearInterval(e.klippy_state_timer),s("setKlippyStateTimer",null))},checkKlippyState({commit:s,dispatch:e},t){if(s("setKlippyState",t.state),s("setKlippyMessage",t.state_message),t.state!=="ready"){e("startKlippyStateInterval");return}e("stopKlippyConnectedInterval"),e("stopKlippyStateInterval"),e("printer/init",null,{root:!0})},getData({commit:s},e){s("setData",e)},getGcodeStore({commit:s,dispatch:e,rootGetters:t},r){s("clearGcodeStore");let i=r.gcode_store;t["gui/console/getConsolefilterRules"].forEach(o=>{try{const l=new RegExp(o);i=i.filter(u=>!l.test(u.message))}catch{window.console.error("Custom console filter '"+o+"' doesn't work")}});const a=t["gui/console/getConsoleClearedSince"];i=i.filter(o=>a?o.time&&o.time*1e3{try{new RegExp(l).test(n)&&(o=!1)}catch{window.console.error("Custom console filter '"+l+"' doesn't work!")}return o}),o&&(t.type==="command"&&(n=''+n+""),s("addEvent",{date:new Date,message:r,formatMessage:n,type:i}),["error","response"].includes(i)&&!["/","/console"].includes(Ia.currentRoute.path)&&r.startsWith("!! ")&&y.$toast.error(n))},serviceStateChanged({commit:s},e){s("updateServiceState",e)},addFailedInitComponent({commit:s},e){s("removeComponent",e),s("addFailedInitComponent",e)}},mY={reset(s){Object.assign(s,FC())},setKlippyConnected(s){y.set(s,"klippy_connected",!0)},setKlippyState(s,e){y.set(s,"klippy_state",e)},setKlippyStateTimer(s,e){y.set(s,"klippy_state_timer",e)},setKlippyMessage(s,e){y.set(s,"klippy_message",e)},setKlippyDisconnected(s){y.set(s,"klippy_connected",!1),y.set(s,"klippy_state","disconnected"),y.set(s,"klippy_message","Disconnected...")},setKlippyShutdown(s){y.set(s,"klippy_state","shutdown"),y.set(s,"klippy_message","Shutdown...")},setCpuTemp(s,e){y.set(s,"cpu_temp",e)},setMoonrakerStats(s,e){y.set(s,"moonraker_stats",e)},setNetworkStats(s,e){y.set(s,"network_stats",e)},setCpuStats(s,e){y.set(s,"system_cpu_usage",e)},setKlippyConnectedTimer(s,e){y.set(s,"klippy_connected_timer",e)},setProcStats(s,e){y.set(s,"cpu_temp",e.cpu_temp),y.set(s,"moonraker_stats",e.moonraker_stats)},setConnectionId(s,e){y.set(s,"connection_id",e)},setData(s,e){"requestParams"in e&&delete e.requestParams,Object.entries(e).forEach(([t,r])=>{y.set(s,t,r)})},saveDbNamespaces(s,e){y.set(s,"dbNamespaces",e)},setConfig(s,e){y.set(s,"config",e)},setConsoleClearedThisSession(s){y.set(s,"console_cleared_this_session",!0)},clearGcodeStore(s){y.set(s,"events",[])},setGcodeStore(s,e){e.length>=yo&&(e=e.slice(e.length-yo)),e.forEach(t=>{const r=new Date(t.time*1e3);let i=sf(t.message),n=t.type;n==="command"&&(i=''+i+""),n==="response"&&(t.message.startsWith("// action:")?n="action":t.message.startsWith("// debug:")&&(n="debug")),s.events.push({date:r,message:t.message,formatMessage:i,type:n})})},addEvent(s,e){var t;["command","autocomplete"].includes(e.type)&&((t=s.events[s.events.length-1])==null?void 0:t.type)==="autocomplete"&&s.events.pop(),s.events.push({date:e.date,message:e.message,formatMessage:e.formatMessage,type:e.type}),s.events.length>=yo&&(s.events=s.events.slice(s.events.length-yo))},setSystemInfo(s,e){y.set(s,"system_info",e)},setThrottledState(s,e){e&&"bits"in e&&y.set(s.throttled_state,"bits",e.bits),e&&"flags"in e&&y.set(s.throttled_state,"flags",e.flags)},setSystemBootAt(s,e){y.set(s,"system_boot_at",e)},addRootDirectory(s,e){s.registered_directories.push(e.name)},updateServiceState(s,e){var r;const t=Object.keys(e)[0];(r=s.system_info)!=null&&r.service_state&&y.set(s.system_info.service_state,t,e[t])},addFailedInitComponent(s,e){const t=s.failed_init_components;t.includes(e)||t.push(e),y.set(s,"failed_init_components",t)},removeComponent(s,e){const t=s.components,r=t.indexOf(e);r!==-1&&(t.splice(r,1),y.set(s,"components",t))}},hY={getConsoleEvents:s=>(e=!0,t=500)=>{var i;const r=(i=[...s.events].slice(t*-1))!=null?i:[];if(r.length<20&&!s.console_cleared_this_session){const n=r.length?r[0].date:new Date;let a="";a+='- Type HELP to get a list of available commands.\n',a+='- Click on the "?" button to get a searchable list.\n',a+="- Commands in the console are clickable and will be placed into the input field.\n",a+="- Use the tab key to complete your inputs. If there are several options, a list is displayed.\n",a+="- Use the ⇵ arrow keys to navigate through the previous entries.\n",r.unshift({date:n,message:a,formatMessage:sf(a),type:"response"})}return e?r.reverse():r},getConfig:s=>(e,t)=>{var i,n;const r=(n=(i=s.config)==null?void 0:i.config)!=null?n:{};return e in r&&t in r[e]?r[e][t]:null},getHostStats:(s,e,t,r)=>{var n,a,o,l,u,c,d,m,h,f,p,v,C,P,M,F,O,$,D,V,N,W,G,te,X,q,z,K,Q,re,R,B,T,A,H,ee;let i=null;if("system_info"in s){let ie=null;(n=t.printer)!=null&&n.software_version&&(ie=(a=t.printer)==null?void 0:a.software_version.split("-").slice(0,4).join("-")),(o=t.printer)!=null&&o.app_name&&(ie=((l=t.printer)==null?void 0:l.app_name)+" "+ie);let ue=null;if((c=(u=s.system_info)==null?void 0:u.python)!=null&&c.version_string){const w$=(m=(d=s.system_info)==null?void 0:d.python)==null?void 0:m.version_string.indexOf(" ");ue=(f=(h=s.system_info)==null?void 0:h.python)==null?void 0:f.version_string.slice(0,w$+1)}const be=(C=(v=(p=s.system_info)==null?void 0:p.cpu_info)==null?void 0:v.cpu_count)!=null?C:1,Se=Math.round(((M=(P=t.printer.system_stats)==null?void 0:P.sysload)!=null?M:0)*100)/100,rt=Math.round(Se/be*100);let Pt="primary";rt>95?Pt="error":rt>80&&(Pt="warning");let jt=null,oi=null;const yn=((O=(F=t.printer.system_stats)==null?void 0:F.memavail)!=null?O:0)*1024,Ms=((V=(D=($=s.system_info)==null?void 0:$.cpu_info)==null?void 0:D.total_memory)!=null?V:0)*1024;yn>0&&Ms>0?(jt=Xe(Ms-yn)+" / "+Xe(Ms),oi=Math.round((Ms-yn)/Ms*100)):Ms&&(jt=Xe(Ms));let Dd="primary";oi&&oi>95?Dd="error":oi&&oi>80&&(Dd="warning");let Td=r["printer/getHostTempSensor"];Td===null&&s.cpu_temp!==null&&(Td={temperature:(N=s.cpu_temp)==null?void 0:N.toFixed(0),measured_min_temp:null,measured_max_temp:null}),i={cpuName:(te=(G=(W=s.system_info)==null?void 0:W.cpu_info)==null?void 0:G.processor)!=null?te:null,cpuDesc:(z=(q=(X=s.system_info)==null?void 0:X.cpu_info)==null?void 0:q.cpu_desc)!=null?z:null,bits:(re=(Q=(K=s.system_info)==null?void 0:K.cpu_info)==null?void 0:Q.bits)!=null?re:null,version:ie,pythonVersion:ue,os:(T=(B=(R=s.system_info)==null?void 0:R.distribution)==null?void 0:B.name)!=null?T:null,release_info:(ee=(H=(A=s.system_info)==null?void 0:A.distribution)==null?void 0:H.release_info)!=null?ee:null,load:Se,loadPercent:rt<100?rt:100,loadProgressColor:Pt,memoryFormat:jt,memUsed:Xe(Ms-yn),memAvail:Xe(yn),memTotal:Xe(Ms),memUsage:oi,memUsageColor:Dd,tempSensor:Td}}return i},getCpuUsage:s=>"cpu"in s.system_cpu_usage?Math.round(s.system_cpu_usage.cpu):null,getNetworkInterfaces:s=>{const e={};return Object.keys(s.network_stats).forEach(t=>{var r,i,n,a,o;t!=="lo"&&(t in((i=(r=s.system_info)==null?void 0:r.network)!=null?i:{})||t.startsWith("can"))&&(e[t]={...s.network_stats[t]},(n=s.system_info)!=null&&n.network&&t in((o=(a=s.system_info)==null?void 0:a.network)!=null?o:{})&&(e[t].details={...s.system_info.network[t]}))}),e},getThrottledStateFlags:s=>{let e=s.throttled_state.flags.filter(t=>t!=="?");return e=e.map(t=>(t=t.replace(/ /g,"").replace(/-/g,""),t.charAt(0).toUpperCase()+t.slice(1))),e}},pY={reset({commit:s}){s("reset")},init(){y.$socket.emit("machine.device_power.devices",{},{action:"server/power/getDevices"})},async getDevices({commit:s,dispatch:e},t){t.error||await s("setDevices",t.devices),await e("socket/removeInitModule","server/power/init",{root:!0})},getStatus({commit:s},e){e.error||s("setStatus",e)},responseToggle({commit:s},e){"requestParams"in e&&delete e.requestParams;for(const[t,r]of Object.entries(e))s("setStatus",{device:t,status:r})}},fY={reset(s){Object.assign(s,DC())},setDevices(s,e){y.set(s,"devices",e)},setStatus(s,e){const t=s.devices.findIndex(r=>r.device===e.device);t>=0&&y.set(s.devices[t],"status",e.status)}},gY={getDevices:s=>s.devices},DC=()=>({devices:[]}),_Y=DC(),vY={namespaced:!0,state:_Y,getters:gY,actions:pY,mutations:fY},bY={reset({commit:s}){s("reset")},init(){y.$socket.emit("machine.update.status",{},{action:"server/updateManager/onUpdateStatus"})},async onUpdateStatus({commit:s,dispatch:e},t){var r,i;await s("resetRepos");for(const n of Object.keys(t.version_info)){const a=(r=t.version_info[n])!=null?r:{},o=(i=a.configured_type)!=null?i:null;if(["git_repo","zip"].includes(o)){await s("storeGitRepo",{...a,name:n});continue}if(["web","web_beta","python"].includes(o)){await s("storeWebRepo",{...a,name:n});continue}n==="system"&&await s("updateSystem",{...a})}await e("socket/removeInitModule","server/updateManager/init",{root:!0})}},yY={reset(s){Object.assign(s,TC())},resetRepos(s){y.set(s,"git_repos",[]),y.set(s,"web_repos",[]),y.set(s,"system",{package_count:0,package_list:[]})},storeGitRepo(s,e){const t=[...s.git_repos];t.push({...e}),y.set(s,"git_repos",t)},storeWebRepo(s,e){const t=[...s.web_repos];t.push({...e}),y.set(s,"web_repos",t)},updateSystem(s,e){const t={...s.system};t.package_count=e.package_count,t.package_list=e.package_list,y.set(s,"system",t)},addUpdateResponse(s,e){s.updateResponse.application!==e.application&&y.set(s.updateResponse,"application",e.application),s.updateResponse.complete!==e.complete&&y.set(s.updateResponse,"complete",e.complete),"complete"in e&&e.complete&&y.$socket.emit("machine.update.status",{refresh:!1},{action:"server/updateManager/onUpdateStatus"}),s.updateResponse.messages.push({date:new Date,message:e.message})},resetUpdateResponse(s){y.set(s,"updateResponse",{application:"",complete:!0,messages:[]})}},CY={getUpdateManagerList(s){const e=[];return s.git_repos.forEach(t=>{e.push({name:t.name,type:"git",data:{...t}})}),s.web_repos.forEach(t=>{e.push({name:t.name,type:"web",data:{...t}})}),Ft(e,"name")}},TC=()=>({busy:!1,github_rate_limit:null,github_requests_remaining:null,github_limit_reset_time:null,git_repos:[],web_repos:[],system:{package_count:0,package_list:[]},updateResponse:{application:"",complete:!0,messages:[]}}),$Y=TC(),xY={namespaced:!0,state:$Y,getters:CY,actions:bY,mutations:yY},wY={reset({commit:s}){s("reset")},init(){y.$socket.emit("server.history.list",{start:0,limit:50,max:100},{action:"server/history/getHistory"}),y.$socket.emit("server.history.totals",{},{action:"server/history/getTotals"})},getTotals({commit:s},e){var r;s("setTotals",e.job_totals);const t=(r=e.auxiliary_totals)!=null?r:[];t.length&&s("setAuxiliaryTotals",t)},async getHistory({commit:s,dispatch:e,state:t},r){var o,l,u,c,d,m,h,f,p,v,C;"requestParams"in r&&((l=(o=r.requestParams)==null?void 0:o.start)!=null?l:0)===0&&s("resetJobs"),(u=r.jobs)==null||u.forEach(P=>{t.jobs.findIndex(M=>M.job_id===P.job_id)===-1&&s("addJob",P)});const i=(d=(c=r.requestParams)==null?void 0:c.start)!=null?d:0,n=(h=(m=r.requestParams)==null?void 0:m.limit)!=null?h:50,a=(p=(f=r.requestParams)==null?void 0:f.max)!=null?p:null;if(n>0&&(a===null||a>i+n)&&((v=r.jobs)==null?void 0:v.length)===n){y.$socket.emit("server.history.list",{start:i+n,limit:n,max:a},{action:"server/history/getHistory"});return}((C=r.jobs)==null?void 0:C.length){s("destroyJob",t)})},saveHistoryNote({commit:s},e){y.$socket.emit("server.database.post_item",{namespace:"history_notes",key:e.job_id,value:{text:e.note}}),s("setHistoryNotes",{job_id:e.job_id,text:e.note})}},SY={reset(s){Object.assign(s,OC())},resetJobs(s){y.set(s,"jobs",[])},setTotals(s,e){y.set(s,"job_totals",e)},setAuxiliaryTotals(s,e){y.set(s,"auxiliary_totals",e)},setHistoryNotes(s,e){const t=s.jobs.find(r=>r.job_id===e.job_id);t&&y.set(t,"note",e.text)},addJob(s,e){const t=[...s.jobs];t.push(e),y.set(s,"jobs",t)},updateJob(s,e){const t=s.jobs.findIndex(r=>r.job_id===e.job_id);t!==-1&&y.set(s.jobs,t,e)},destroyJob(s,e){const t=s.jobs.findIndex(r=>r.job_id===e);t!==-1&&s.jobs.splice(t,1)},setAllLoaded(s){y.set(s,"all_loaded",!0)}},PY={getTotalPrintTime(s){let e=0;return s.jobs.forEach(t=>{e+=t.print_duration}),e},getTotalCompletedPrintTime(s){let e=0;return s.jobs.forEach(t=>{t.status==="completed"&&(e+=t.print_duration)}),e},getLongestPrintTime(s){let e=0;return s.jobs.forEach(t=>{t.print_duration>e&&(e=t.print_duration)}),e},getTotalFilamentUsed(s){let e=0;return s.jobs.forEach(t=>{e+=t.filament_used}),e},getTotalJobsCount(s){return s.jobs.length},getTotalCompletedJobsCount(s){return s.jobs.filter(e=>e.status==="completed").length},getAvgPrintTime(s,e){const t=e.getTotalCompletedPrintTime,r=e.getTotalCompletedJobsCount;return t>0&&r>0?Math.round(t/r):0},getPrintStatus:s=>e=>{var t;if(s.jobs.length){const r=s.jobs.find(i=>i.job_id===e);return(t=r==null?void 0:r.status)!=null?t:""}return""},getPrintJobById:s=>e=>{if(s.jobs.length!==0)return s.jobs.find(t=>t.job_id===e)},getPrintJobsForGcodes:s=>(e,t,r,i,n)=>{if(s.jobs.length===0)return[];if(i)return s.jobs.filter(o=>{var l;return((l=o.metadata)==null?void 0:l.uuid)===i});const a=s.jobs.filter(o=>{var l,u,c;return((l=o.metadata)==null?void 0:l.size)===r&&Math.round(((c=(u=o.metadata)==null?void 0:u.modified)!=null?c:0)*1e3)===t});return a.length?a:n?a.filter(o=>o.job_id===n):[]},getPrintStatusByFilename:s=>(e,t)=>{var r;if(s.jobs.length){const i=s.jobs.find(n=>{var a,o;return n.filename===e&&Math.round(((o=(a=n.metadata)==null?void 0:a.modified)!=null?o:0)*1e3)===t});return(r=i==null?void 0:i.status)!=null?r:""}return""},getPrintStatusIconColor:()=>s=>{switch(s){case"in_progress":return"blue accent-3";case"completed":return"green";case"cancelled":return"red";default:return"orange"}},getPrintStatusTextColor:()=>s=>{switch(s){case"in_progress":return"blue--text";case"completed":return"green--text";case"cancelled":return"red--text";default:return"orange--text"}},getPrintStatusIcon:()=>s=>{switch(s){case"in_progress":return fS;case"completed":return xw;case"cancelled":return kw;default:return Jn}},getFilteredJobList:(s,e,t)=>{const r=t.gui.view.history.hidePrintStatus;return s.jobs.filter(i=>!r.includes(i.status))}},OC=()=>({jobs:[],job_totals:{total_jobs:0,total_time:0,total_print_time:0,total_filament_used:0,longest_job:0,longest_print:0},auxiliary_totals:[],all_loaded:!1}),DY=OC(),TY={namespaced:!0,state:DY,getters:PY,actions:wY,mutations:SY},OY={reset({commit:s}){s("reset")},init(){y.$socket.emit("machine.timelapse.get_settings",{},{action:"server/timelapse/initSettings"}),y.$socket.emit("machine.timelapse.lastframeinfo",{},{action:"server/timelapse/initLastFrameinfo"})},async initSettings({commit:s,dispatch:e},t){"requestParams"in t&&delete t.requestParams,await s("setSettings",t),await e("socket/removeInitModule","server/timelapse/init",{root:!0})},initLastFrameinfo({commit:s},e){s("setLastFrame",{count:e.framecount,file:e.lastframefile})},getEvent({commit:s},e){switch(e.action){case"newframe":s("setLastFrame",{count:parseInt(e.frame),file:e.framefile});break;case"render":e.status==="error"?(y.$toast.error(e.msg),s("resetSnackbar")):s("setRenderStatus",e);break;default:window.console.log("unknown timelapse event",e)}},saveSetting(s,e){y.$socket.emit("machine.timelapse.post_settings",e,{action:"server/timelapse/initSettings"})},updateCamSettings({dispatch:s,state:e},t){e.settings.camera===t.oldName&&s("saveSetting",{camera:t.newName})},resetSnackbar({commit:s}){s("resetSnackbar")}},MY={reset(s){Object.assign(s,MC())},setSettings(s,e){Object.keys(e).forEach(t=>{t in s.settings&&s.settings[t]!==e[t]&&y.set(s.settings,t,e[t])})},setLastFrame(s,e){y.set(s.lastFrame,"count",e.count),y.set(s.lastFrame,"file",e.file)},setRenderStatus(s,e){var t,r;y.set(s,"rendering",{status:e.status,progress:(t=e.progress)!=null?t:0,filename:(r=e.filename)!=null?r:""})},resetSnackbar(s){y.set(s,"rendering",{status:"",progress:0,filename:""})}},kY={},MC=()=>({settings:{enabled:!0,camera:"",mode:"layermacro",autorender:!0,autorenderOnce:!1,saveframes:!1,stream_delay_compensation:.05,gcode_verbose:!0,parkhead:!1,parkpos:"back_left",park_custom_pos_x:0,park_custom_pos_y:0,park_custom_pos_dz:0,park_travel_speed:100,park_retract_speed:15,park_retract_distance:1,park_extrude_speed:15,park_extrude_distance:1,park_time:.1,fw_retract:!1,hyperlapse_cycle:30,constant_rate_factor:23,output_framerate:30,pixelformat:"yuv420p",extraoutputparams:"",variable_fps:!1,targetlength:60,variable_fps_min:5,variable_fps_max:60,rotation:0,duplicatelastframe:0,previewimage:!0,time_format_code:"%Y%m%d_%H%M",blockedsettings:[]},lastFrame:{count:0,file:""},rendering:{status:"",progress:0,filename:""}}),EY=MC(),LY={namespaced:!0,state:EY,getters:kY,actions:OY,mutations:MY},AY={reset({commit:s}){s("reset")},init(){y.$socket.emit("server.job_queue.status",{},{action:"server/jobQueue/getStatus"})},getEvent({commit:s},e){"updated_queue"in e&&e.updated_queue!==null&&s("setQueuedJobs",e.updated_queue),"queue_state"in e&&s("setQueueState",e.queue_state)},async getStatus({commit:s,dispatch:e},t){"queued_jobs"in t&&s("setQueuedJobs",t.queued_jobs),"queue_state"in t&&s("setQueueState",t.queue_state),await e("socket/removeInitModule","server/jobQueue/init",{root:!0})},async addToQueue(s,e){y.$socket.emit("server.job_queue.post_job",{filenames:e})},changeCount({dispatch:s,getters:e},t){const r=e.getJobs,i=r.findIndex(n=>n.job_id===t.job_id);i!==-1&&(r[i].combinedIds=Array(t.count-1).fill(t.job_id),s("sendNewQueueList",{jobs:r}))},changePosition({dispatch:s,getters:e},t){const r=e.getJobs,i=r.splice(t.oldIndex,1)[0];r.splice(t.newIndex,0,i),s("sendNewQueueList",{jobs:r})},startByJobId({dispatch:s,getters:e},t){const r=e.getJobs,i=r.findIndex(a=>a.job_id===t);if(i===-1)return;const n=r.splice(i,1)[0];r.splice(0,0,n),s("sendNewQueueList",{jobs:r,printStart:!0})},sendNewQueueList(s,e){const t=e.jobs.map(i=>{var a,o;const n=((o=(a=i.combinedIds)==null?void 0:a.length)!=null?o:0)+1;return n===1?i.filename:Array(n).fill(i.filename)}).flat(),r={};e.printStart&&(r.action="server/jobQueue/start"),y.$socket.emit("server.job_queue.post_job",{filenames:t,reset:!0},r)},deleteFromQueue(s,e){y.$socket.emit("server.job_queue.delete_job",{job_ids:e})},clearQueue(){y.$socket.emit("server.job_queue.delete_job",{all:!0})},start(){y.$socket.emit("server.job_queue.start",{},{loading:"startJobqueue"})},pause(){y.$socket.emit("server.job_queue.pause",{},{loading:"pauseJobqueue"})}},FY={reset(s){Object.assign(s,kC())},setQueuedJobs(s,e){y.set(s,"queued_jobs",e)},setQueueState(s,e){y.set(s,"queue_state",e)}},RY={getJobs:(s,e,t,r)=>{const i=[];return s.queued_jobs.forEach(n=>{var l;const a={...n};if(i.length&&i[i.length-1].filename===a.filename){(l=i[i.length-1].combinedIds)==null||l.push(a.job_id);return}const o=r["files/getFile"]("gcodes/"+a.filename);o!=null&&o.metadataPulled||y.$socket.emit("server.files.metadata",{filename:a.filename},{action:"files/getMetadata"}),a.metadata=o,a.combinedIds=[],i.push(a)}),i},getJobsCount:s=>s.queued_jobs.length,getSmallThumbnail:(s,e,t,r)=>i=>{var n,a,o,l;if((a=(n=i==null?void 0:i.metadata)==null?void 0:n.thumbnails)!=null&&a.length){const u=(o=i==null?void 0:i.metadata)==null?void 0:o.thumbnails.find(d=>d.width>=Yt&&d.width<=Jt&&d.height>=Yt&&d.height<=Jt),c=i.filename.lastIndexOf("/")!==-1?"gcodes/"+i.filename.slice(0,i.filename.lastIndexOf("/")):"gcodes";if(u&&"relative_path"in u)return r["socket/getUrl"]+"/server/files/"+Ie(c)+"/"+Ie(u.relative_path)+"?timestamp="+((l=i.metadata)==null?void 0:l.modified.getTime())}return""},getBigThumbnail:(s,e,t,r)=>i=>{var n,a,o,l;if((a=(n=i==null?void 0:i.metadata)==null?void 0:n.thumbnails)!=null&&a.length){const u=(o=i==null?void 0:i.metadata)==null?void 0:o.thumbnails.find(d=>d.width>=Ls),c=i.filename.lastIndexOf("/")!==-1?"gcodes/"+i.filename.slice(0,i.filename.lastIndexOf("/")):"gcodes";if(u&&"relative_path"in u)return r["socket/getUrl"]+"/server/files/"+Ie(c)+"/"+Ie(u.relative_path)+"?timestamp="+((l=i.metadata)==null?void 0:l.modified.getTime())}return""}},kC=()=>({queued_jobs:[],queue_state:""}),HY=kC(),jY={namespaced:!0,state:HY,getters:RY,actions:AY,mutations:FY},IY={reset({commit:s}){s("reset")},init(){y.$socket.emit("server.announcements.list",{},{action:"server/announcements/getList"})},async getList({commit:s,dispatch:e},t){if("entries"in t){const r=t.entries.map(i=>{const n=new Date(i.date*1e3),a=t.date_dismissed?new Date(i.date_dismissed*1e3):null,o=t.dismiss_wake?new Date(i.dismiss_wake*1e3):null;return{...i,date:n,date_dismissed:a,dismiss_wake:o}});await s("setEntries",r)}"feeds"in t&&await s("setFeeds",t.feeds),await e("socket/removeInitModule","server/announcements/init",{root:!0})},getDismissed({commit:s},e){s("setDismissed",{entry_id:e.entry_id,status:!0})},getWaked({commit:s},e){s("setDismissed",{entry_id:e.entry_id,status:!1})},close(s,e){y.$socket.emit("server.announcements.dismiss",{entry_id:e.entry_id})},dismiss(s,e){y.$socket.emit("server.announcements.dismiss",{entry_id:e.entry_id,wake_time:e.time})}},NY={reset(s){Object.assign(s,EC())},setEntries(s,e){y.set(s,"entries",e)},setFeeds(s,e){y.set(s,"feeds",e)},setDismissed(s,e){const t=[...s.entries],r=t.findIndex(i=>i.entry_id===e.entry_id);r>-1&&(t[r].dismissed=e.status,e.status?t[r].date_dismissed=new Date:(t[r].date_dismissed=null,t[r].dismiss_wake=null)),y.set(s,"entries",t)}},VY={getAnnouncements:s=>s.entries.filter(e=>!e.dismissed)},EC=()=>({entries:[],feeds:[]}),BY=EC(),UY={namespaced:!0,state:BY,getters:VY,actions:IY,mutations:NY};function On(s){var e,t,r,i;return((t=(e=s.error)==null?void 0:e.message)!=null?t:null)!==null?(y.$toast.error((i=(r=s.error)==null?void 0:r.message)!=null?i:"unknown spoolman error"),null):"response"in s?s.response:s}const WY={reset({commit:s}){s("reset")},init({dispatch:s}){y.$socket.emit("server.spoolman.get_spool_id",{},{action:"server/spoolman/getActiveSpoolId"}),y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/info",use_v2_response:!0},{action:"server/spoolman/getInfo"}),y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/health",use_v2_response:!0},{action:"server/spoolman/getHealth"}),y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/vendor",use_v2_response:!0},{action:"server/spoolman/getVendors"}),s("socket/addInitModule","server/spoolman/getActiveSpoolId",{root:!0}),s("socket/addInitModule","server/spoolman/getHealth",{root:!0}),s("socket/addInitModule","server/spoolman/getInfo",{root:!0}),s("socket/addInitModule","server/spoolman/getVendors",{root:!0}),s("socket/removeInitModule","server/spoolman/init",{root:!0})},getActiveSpoolId({commit:s,dispatch:e},t){if(s("setActiveSpoolId",t.spool_id),e("socket/removeInitModule","server/spoolman/getActiveSpoolId",{root:!0}),[null,0].includes(t.spool_id)){s("setActiveSpool",null);return}y.$socket.emit("server.spoolman.proxy",{request_method:"GET",use_v2_response:!0,path:"/v1/spool/".concat(t.spool_id)},{action:"server/spoolman/getActiveSpool"})},getActiveSpool({commit:s},e){"requestParams"in e&&delete e.requestParams,e=On(e),e!==null&&s("setActiveSpool",e)},getHealth({commit:s,dispatch:e},t){delete t.requestParams,e("socket/removeInitModule","server/spoolman/getHealth",{root:!0}),t=On(t),t!==null&&s("setHealth",t.status)},getInfo({commit:s,dispatch:e},t){delete t.requestParams,e("socket/removeInitModule","server/spoolman/getInfo",{root:!0}),t=On(t),t!==null&&s("setInfo",t)},getVendors({commit:s,dispatch:e},t){delete t.requestParams,e("socket/removeInitModule","server/spoolman/getVendors",{root:!0}),t=On(t),t!==null&&s("setVendors",Object.entries(t).map(r=>r))},refreshSpools({dispatch:s}){y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/spool"},{action:"server/spoolman/getSpools"}),s("socket/addLoading","refreshSpools",{root:!0})},getSpools({commit:s,dispatch:e},t){if("requestParams"in t&&delete t.requestParams,e("socket/removeLoading","refreshSpools",{root:!0}),t=On(t),t===null)return;const r=Object.entries(t).map(i=>i[1]);s("setSpools",r)},setActiveSpool(s,e){const t={};e!==null&&(t.spool_id=e),y.$socket.emit("server.spoolman.post_spool_id",t)},refreshActiveSpool({state:s}){s.active_spool_id!==null&&y.$socket.emit("server.spoolman.proxy",{request_method:"GET",path:"/v1/spool/".concat(s.active_spool_id)},{action:"server/spoolman/getActiveSpool"})}},zY={reset(s){Object.assign(s,LC())},setActiveSpoolId(s,e){y.set(s,"active_spool_id",e)},setActiveSpool(s,e){y.set(s,"active_spool",e)},setHealth(s,e){y.set(s,"health",e)},setInfo(s,e){y.set(s,"info",e)},setVendors(s,e){y.set(s,"vendors",e)},setSpools(s,e){y.set(s,"spools",e)}},GY={},LC=()=>({health:"",info:{automatic_backups:!1,backups_dir:"",data_dir:"",debug_mode:!1,version:""},active_spool_id:null,active_spool:null,vendors:[],feeds:[]}),ZY=LC(),qY={namespaced:!0,state:ZY,getters:GY,actions:WY,mutations:zY},XY={reset({commit:s}){s("reset")},init(){y.$socket.emit("server.sensors.list",{},{action:"server/sensor/getSensors"})},getSensors({commit:s,dispatch:e},t){s("setSensors",t.sensors),e("socket/removeInitModule","server/sensor/init",{root:!0})},updateSensors({commit:s},e){Object.keys(e).forEach(t=>{s("updateSensor",{key:t,value:e[t]})})}},YY={reset(s){Object.assign(s,AC())},setSensors(s,e){y.set(s,"sensors",e)},updateSensor(s,e){e.key in s.sensors&&y.set(s.sensors[e.key],"values",e.value)}},JY={getSensors:s=>Object.keys(s.sensors)},AC=()=>({sensors:{}}),KY=AC(),QY={namespaced:!0,state:KY,getters:JY,actions:XY,mutations:YY},FC=()=>({klippy_connected:!1,klippy_connected_timer:null,klippy_state:"",klippy_state_timer:null,klippy_message:"",components:[],failed_components:[],failed_init_components:[],warnings:[],registered_directories:[],events:[],config:{},system_info:null,system_boot_at:null,cpu_temp:0,moonraker_stats:null,throttled_state:{bits:0,flags:[]},network_stats:{},system_cpu_usage:{},dbNamespaces:[],websocket_count:0,moonraker_version:""}),eJ=FC(),tJ={namespaced:!0,state:eJ,getters:hY,actions:dY,mutations:mY,modules:{power:vY,updateManager:xY,history:TY,timelapse:LY,jobQueue:jY,announcements:UY,spoolman:qY,sensor:QY}},sJ={reset({commit:s}){s("reset"),s("tempHistory/reset"),s("socket/clearLoadings",null,{root:!0})},init({dispatch:s}){window.console.debug("init printer"),s("reset"),s("socket/addInitModule","printer/info",{root:!0}),s("socket/addInitModule","printer/initSubscripts",{root:!0}),s("socket/addInitModule","printer/initTempHistory",{root:!0}),s("socket/addInitModule","server/gcode_store",{root:!0}),y.$socket.emit("printer.info",{},{action:"printer/getInfo"}),y.$socket.emit("server.gcode_store",{},{action:"server/getGcodeStore"}),s("initSubscripts")},getInfo({commit:s,dispatch:e},t){var r;s("server/setData",{klippy_state:t.state,klippy_message:t.state_message},{root:!0}),s("setData",{app_name:(r=t.app)!=null?r:null,hostname:t.hostname,software_version:t.software_version,cpu_info:t.cpu_info}),e("socket/removeInitModule","printer/info",{root:!0})},async initSubscripts({dispatch:s}){const e=await y.$socket.emitAndWait("printer.objects.list");let t={};const r=["menu"];if(e.objects.forEach(i=>{const n=i.split(" ");r.includes(n[0])||(t={...t,[i]:null})}),Object.keys(t).length>0){const i=await y.$socket.emitAndWait("printer.objects.subscribe",{objects:t},{});"screws_tilt_adjust"in i.status&&(i.status.screws_tilt_adjust.error=!1,i.status.screws_tilt_adjust.results={}),s("getData",i),setTimeout(()=>{s("initExtruderCanExtrude")},200)}y.$socket.emit("server.temperature_store",{include_monitors:!0},{action:"printer/tempHistory/init"}),s("socket/removeInitModule","printer/initSubscripts",{root:!0})},getData({commit:s,dispatch:e,state:t},r){var i,n,a,o,l,u,c,d,m,h;"status"in r&&(r=r.status),"requestParams"in r&&delete r.requestParams,"webhooks"in r&&(this.dispatch("server/getData",{klippy_state:r.webhooks.state,klippy_message:r.webhooks.state_message},{root:!0}),delete r.webhooks),"bed_mesh"in t&&"bed_mesh"in r&&"profiles"in r.bed_mesh&&(s("setBedMeshProfiles",r.bed_mesh.profiles),delete r.bed_mesh.profiles),(a=(n=(i=r.configfile)==null?void 0:i.settings)==null?void 0:n.printer)!=null&&a.kinematics&&e("gui/updateGcodeviewerCache",{kinematics:(u=(l=(o=r.configfile)==null?void 0:o.settings)==null?void 0:l.printer)==null?void 0:u.kinematics},{root:!0}),(c=r.toolhead)!=null&&c.axis_maximum&&e("gui/updateGcodeviewerCache",{axis_maximum:(d=r.toolhead)==null?void 0:d.axis_maximum},{root:!0}),(m=r.toolhead)!=null&&m.axis_minimum&&e("gui/updateGcodeviewerCache",{axis_minimum:(h=r.toolhead)==null?void 0:h.axis_minimum},{root:!0}),s("setData",r)},async initGcodes({commit:s}){const e=await y.$socket.emitAndWait("printer.objects.query",{objects:{gcode:["commands"]}},{});s("setData",e.status)},async initExtruderCanExtrude({dispatch:s,state:e}){const t=Object.keys(e).filter(n=>n.startsWith("extruder")),r={};t.forEach(n=>{r[n]=["can_extrude"]});const i=await y.$socket.emitAndWait("printer.objects.query",{objects:r},{});s("getData",i.status)},getEndstopStatus({commit:s},e){s("setEndstopStatus",e)},removeBedMeshProfile({commit:s},e){s("removeBedMeshProfile",e)},sendGcode({dispatch:s},e){if(s("server/addEvent",{message:e,type:"command"},{root:!0}),e.toLowerCase().trim()==="m112"){y.$socket.emit("printer.emergency_stop",{},{loading:"sendGcode"});return}y.$socket.emit("printer.gcode.script",{script:e},{loading:"sendGcode"})},clearScrewsTiltAdjust({commit:s}){s("clearScrewsTiltAdjust")}},rJ={reset(s){const e=HC();for(const t of Object.keys(s))!(t in e)&&t!=="tempHistory"&&delete s[t];for(const[t,r]of Object.entries(e))y.set(s,t,r)},setData(s,e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r!="object"||r===null||!(t in s)){y.set(s,t,r);return}typeof r=="object"&&Object.keys(r).forEach(i=>{y.set(s[t],i,r[i])})})},setBedMeshProfiles(s,e){"bed_mesh"in s&&y.set(s.bed_mesh,"profiles",e)},clearCurrentFile(s){y.set(s,"current_file",{})},setEndstopStatus(s,e){delete e.requestParams,y.set(s,"endstops",e)},removeBedMeshProfile(s,e){"bed_mesh "+e.name in s.configfile.config&&Object.assign(s.configfile.config["bed_mesh "+e.name],{deleted:!0})},clearScrewsTiltAdjust(s){y.set(s.screws_tilt_adjust,"error",!1),y.set(s.screws_tilt_adjust,"results",{})}},iJ={getPrintPercent:(s,e,t)=>{var i,n,a;switch((a=(n=(i=t==null?void 0:t.gui)==null?void 0:i.general)==null?void 0:n.calcPrintProgress)!=null?a:"file-relative"){case"file-relative":return e.getPrintPercentByFilepositionRelative;case"file-absolute":return e.getPrintPercentByFilepositionAbsolute;case"slicer":return e.getPrintPercentBySlicer;case"filament":return e.getPrintPercentByFilament;default:return e.getPrintPercentByFilepositionRelative}},getPrintPercentByFilepositionRelative:s=>{var e,t,r,i,n;if((e=s.current_file)!=null&&e.filename&&((t=s.current_file)!=null&&t.gcode_start_byte)&&((r=s.current_file)!=null&&r.gcode_end_byte)&&s.current_file.filename===s.print_stats.filename){if(s.virtual_sdcard.file_position<=s.current_file.gcode_start_byte)return 0;if(s.virtual_sdcard.file_position>=s.current_file.gcode_end_byte)return 1;const a=s.virtual_sdcard.file_position-s.current_file.gcode_start_byte,o=s.current_file.gcode_end_byte-s.current_file.gcode_start_byte;if(a>0&&o>0)return 1/o*a}return(n=(i=s.virtual_sdcard)==null?void 0:i.progress)!=null?n:0},getPrintPercentByFilepositionAbsolute:s=>{var e,t;return(t=(e=s.virtual_sdcard)==null?void 0:e.progress)!=null?t:0},getPrintPercentBySlicer:s=>{var e,t;return(t=(e=s.display_status)==null?void 0:e.progress)!=null?t:0},getPrintPercentByFilament:s=>{var r,i,n,a,o,l;const e=(i=(r=s.print_stats)==null?void 0:r.filament_used)!=null?i:null,t=(a=(n=s.current_file)==null?void 0:n.filament_total)!=null?a:null;if(e!==null&&t!==null){if(t==0)return 0;const u=e/t;return u>1?1:u}return(l=(o=s.virtual_sdcard)==null?void 0:o.progress)!=null?l:0},getPrintMaxLayers:s=>{var e,t,r,i,n,a,o;if(((r=(t=(e=s.print_stats)==null?void 0:e.info)==null?void 0:t.total_layer)!=null?r:null)!==null)return s.print_stats.info.total_layer;if((i=s.current_file)!=null&&i.layer_count)return s.current_file.layer_count;if(((n=s.current_file)==null?void 0:n.first_layer_height)!==void 0&&((a=s.current_file)==null?void 0:a.layer_height)!==void 0&&((o=s.current_file)==null?void 0:o.object_height)!==void 0){const l=Math.ceil((s.current_file.object_height-s.current_file.first_layer_height)/s.current_file.layer_height+1);return l>0?l:0}return 0},getPrintCurrentLayer:(s,e)=>{var t,r,i,n,a,o,l,u;if(((i=(r=(t=s.print_stats)==null?void 0:t.info)==null?void 0:r.current_layer)!=null?i:null)!==null)return s.print_stats.info.current_layer;if(((n=s.print_stats)==null?void 0:n.print_duration)>0&&((a=s.current_file)==null?void 0:a.first_layer_height)!==void 0&&((o=s.current_file)==null?void 0:o.layer_height)!==void 0){const c=(u=(l=s.gcode_move)==null?void 0:l.gcode_position[2])!=null?u:0,d=Math.ceil((c-s.current_file.first_layer_height)/s.current_file.layer_height+1);if(d>e.getPrintMaxLayers)return e.getPrintMaxLayers;if(d>0)return d}return 0},getPrinterObjects:s=>e=>{var r,i,n,a;const t=[];for(const[o,l]of Object.entries(s)){let u=o.substring(0,o.indexOf(" ")).trimEnd(),c=o.substring(o.indexOf(" ")+1).trimStart();o.indexOf(" ")===-1&&(u=c=o),e.includes(u)&&t.push({name:c,type:u,state:{...l},config:(i=(r=s.configfile)==null?void 0:r.config[o])!=null?i:{},settings:(a=(n=s.configfile)==null?void 0:n.settings[o.toLowerCase()])!=null?a:{}})}return t},getMacros:s=>{var a,o,l,u;const e=[],t=(o=(a=s.configfile)==null?void 0:a.settings)!=null?o:null,r=(u=(l=s.gcode)==null?void 0:l.commands)!=null?u:{},i="gcode_macro ",n=i.length;return Object.keys(s).filter(c=>c.toLowerCase().startsWith(i)).forEach(c=>{var v,C,P,M;const d=c.slice(n),m=(v=r[d.toUpperCase()])!=null?v:{};if(d.startsWith("_"))return;const h=c.toLowerCase(),f=(C=t[h])!=null?C:{};if("rename_existing"in f)return;const p=(P=s[c])!=null?P:{};e.push({name:d,description:(M=m==null?void 0:m.help)!=null?M:null,prop:f,params:k3(f),variables:p})}),Ft(e,"name")},getMacro:(s,e)=>t=>{const r=t.toLowerCase();return e.getMacros.find(i=>i.name.toLowerCase()===r)},getPartFanSpeed:s=>"fan"in s?s.fan.speed:0,getFans:(s,e)=>{const t=[],r=["temperature_fan","controller_fan","heater_fan","fan_generic","fan"],i=e.getPrinterObjects(r),n=["fan_generic","fan"];return i.foreach(a=>{var o;t.push({name:a.name,type:a.type,speed:(o=a.state.speed)!=null?o:0,controllable:n.includes(a.type)})}),t.sort((a,o)=>{if(a.controllableo.controllable)return-1;const l=a.name.toUpperCase(),u=o.name.toUpperCase();return lu?1:0})},getLights:(s,e)=>{const t=[],r=["dotstar","led","neopixel","pca9533","pca9632"];return e.getPrinterObjects(r).filter(n=>!n.name.startsWith("_")).forEach(n=>{var h,f,p,v,C,P,M,F,O,$,D;let a="RGB",o=null;const l=(h=n.state.color_data)!=null?h:[];"color_order"in n.settings&&(typeof n.settings.color_order=="string"?a=n.settings.color_order:Array.isArray(n.settings.color_order)&&n.settings.color_order.length>0&&(a=n.settings.color_order[0])),n.type==="led"&&(a="","red_pin"in n.config&&(a+="R"),"green_pin"in n.config&&(a+="G"),"blue_pin"in n.config&&(a+="B"),"white_pin"in n.config&&(a+="W"));let u=(f=n.settings.initial_red)!=null?f:null;"initial_red"in n.config||(u=null);let c=(p=n.settings.initial_green)!=null?p:null;"initial_green"in n.config||(c=null);let d=(v=n.settings.initial_blue)!=null?v:null;"initial_blue"in n.config||(d=null);let m=(C=n.settings.initial_white)!=null?C:null;if("initial_white"in n.config||(m=null),n.type==="led"&&a.length===1){const V=(P=l[0])!=null?P:[];switch(a){case"R":o=(M=V[0])!=null?M:0;break;case"G":o=(F=V[1])!=null?F:0;break;case"B":o=(O=V[2])!=null?O:0;break;case"W":o=($=V[3])!=null?$:0;break}}t.push({name:n.name,type:n.type,chainCount:(D=n.settings.chain_count)!=null?D:1,colorOrder:a,initialRed:u,initialGreen:c,initialBlue:d,initialWhite:m,colorData:l,singleChannelTarget:o})}),t.sort((n,a)=>{const o=n.name.toUpperCase(),l=a.name.toUpperCase();return ol?1:0})},getMiscellaneous:s=>{var i,n,a,o,l,u;const e=[],t=["controller_fan","heater_fan","fan_generic","fan","output_pin","pwm_tool","pwm_cycle_time"],r=["fan_generic","fan"];for(const[c,d]of Object.entries(s)){const m=c.split(" ");if(t.includes(m[0])){const h=m.length>1?m[1]:m[0];if(!h.startsWith("_")){let f=r.includes(m[0].toLowerCase());const p=(n=(i=s.configfile)==null?void 0:i.settings[c.toLowerCase()])!=null?n:{},v="speed"in d?d.speed:"value"in d?d.value:0,C="rpm"in d?d.rpm:null;let P=f,M=1;m[0].toLowerCase()==="fan"&&(M=255),["output_pin","pwm_tool","pwm_cycle_time"].includes(m[0])&&(f=!0,P=!1,"pwm"in p&&(P=(a=p==null?void 0:p.pwm)!=null?a:!1),["pwm_tool","pwm_cycle_time"].includes(m[0])&&(P=!0),"scale"in p&&(M=(o=p==null?void 0:p.scale)!=null?o:1));const F={name:h,type:m[0],power:v,controllable:f,pwm:P,rpm:C,scale:M,object:d,config:p,off_below:void 0,max_power:void 0};"configfile"in s&&"settings"in s.configfile&&c.toLowerCase()in s.configfile.settings&&("off_below"in p&&(F.off_below=(l=p==null?void 0:p.off_below)!=null?l:0),"max_power"in p&&(F.max_power=(u=p==null?void 0:p.max_power)!=null?u:1)),e.push(F)}}}return e.sort((c,d)=>{if(c.type==="fan")return-1;if(d.type==="fan"||c.pwmd.pwm)return-1;if(c.controllabled.controllable)return-1;const m=c.name.toUpperCase(),h=d.name.toUpperCase();return mh?1:0})},getMiscellaneousSensors:s=>{var r;const e=[],t=["load_cell"];for(const[i,n]of Object.entries(s)){const a=i.split(" ");if(!t.includes(a[0]))continue;const o=a.length>1?a[1]:a[0];if(o.startsWith("_"))continue;const l={name:o,type:a[0],value:"value"in n?n.value:null,unit:"unit"in n?n.unit:""};a[0]=="load_cell"?e.push({...l,value:(r=n.force_g)!=null?r:NaN,unit:"g"}):e.push(l)}return e.sort((i,n)=>{if(i.typen.type)return 1;if(i.unitn.unit)return 1;const a=i.name.toUpperCase(),o=n.name.toUpperCase();return ao?1:0}),e},getAvailableHeaters:s=>{var e,t;return(t=(e=s.heaters)==null?void 0:e.available_heaters)!=null?t:[]},getAvailableSensors:s=>{var e,t;return(t=(e=s.heaters)==null?void 0:e.available_sensors)!=null?t:[]},getAvailableMonitors:s=>{var e,t;return(t=(e=s.heaters)==null?void 0:e.available_monitors)!=null?t:[]},getFilamentSensors:s=>{var r;const e=["filament_switch_sensor","filament_motion_sensor","hall_filament_width_sensor"],t=[];for(const[i,n]of Object.entries(s)){const a=i.split(" ");e.includes(a[0])&&t.push({type:a[0],name:(r=a[1])!=null?r:a[0],enabled:n.enabled,filament_detected:n.filament_detected,filament_diameter:n.Diameter})}return Ft(t,"name")},getMcus:(s,e)=>{const t=[];return Object.keys(s).forEach(r=>{var i,n,a,o,l,u,c,d,m,h,f,p;if(r==="mcu"||r.startsWith("mcu ")){const v=s[r];let C=((i=v.mcu_version)!=null?i:"unknown").split("-").slice(0,4).join("-");"app"in v&&v.app!=="Klipper"&&(C=v.app+" "+C);let P=0;(n=v.last_stats)!=null&&n.mcu_task_avg&&((a=v.last_stats)!=null&&a.mcu_task_stddev)&&(P=v.last_stats.mcu_task_avg+3*((o=v.last_stats)==null?void 0:o.mcu_task_stddev)/.0025);let M="primary";P>.95?M="error":P>.8&&(M="warning"),t.push({name:r,mcu_constants:v.mcu_constants,last_stats:v.last_stats,version:C,chip:(u=(l=v.mcu_constants)==null?void 0:l.MCU)!=null?u:null,freq:(d=(c=v.last_stats)==null?void 0:c.freq)!=null?d:null,freqFormat:O3((h=(m=v.last_stats)==null?void 0:m.freq)!=null?h:0),awake:(((p=(f=v.last_stats)==null?void 0:f.mcu_awake)!=null?p:0)/5).toFixed(2),load:P.toFixed(2),loadPercent:P<1?Math.round(P*100):100,loadProgressColor:M,tempSensor:e.getMcuTempSensor(r)})}}),t},getPrinterObject:s=>e=>e in s?s[e]:null,getPrinterConfigObjects:s=>e=>{var r;const t={};return(r=s.configfile)!=null&&r.settings&&Object.keys(s.configfile.settings).forEach(i=>{const n=i.split(" ");e.includes(n[0])&&(t[i]=s.configfile.settings[i])}),t},getHostTempSensor:(s,e)=>{const t=["rpi_temperature","temperature_host"],r=["temperature_sensor","temperature_fan"];let i=null;const n=e.getPrinterConfigObjects(r);return Object.keys(n).forEach(a=>{var u,c,d;const o=n[a],l=Object.keys(s).find(m=>m.toLowerCase()===a.toLowerCase())||"";if("sensor_type"in o&&t.includes(o.sensor_type)&&l in s){const m=s[l];i={temperature:(u=m.temperature)==null?void 0:u.toFixed(0),measured_min_temp:(c=m.measured_min_temp)==null?void 0:c.toFixed(1),measured_max_temp:(d=m.measured_max_temp)==null?void 0:d.toFixed(1)}}}),i},getMcuTempSensors:(s,e)=>{const t=["temperature_sensor","temperature_fan"],r=[],i=e.getPrinterConfigObjects(t);return Object.keys(i).forEach(n=>{const a=i[n],o=Object.keys(s).find(l=>l.toLowerCase()===n.toLowerCase())||"";"sensor_type"in a&&a.sensor_type==="temperature_mcu"&&"sensor_mcu"in a&&r.push({key:o,settings:a,object:o in s?s[o]:{}})}),r},getMcuTempSensor:(s,e)=>t=>{let r=null;return e.getMcuTempSensors.forEach(n=>{var a,o,l,u,c,d;t.endsWith((a=n.settings)==null?void 0:a.sensor_mcu)&&((o=n.object)!=null&&o.temperature)&&(r={temperature:n.object.temperature.toFixed(0),measured_min_temp:(u=(l=n.object.measured_min_temp)==null?void 0:l.toFixed(1))!=null?u:null,measured_max_temp:(d=(c=n.object.measured_max_temp)==null?void 0:c.toFixed(1))!=null?d:null})}),r},getExtruders:s=>{var t,r;const e=[];return(t=s.configfile)!=null&&t.settings&&Object.keys((r=s.configfile)==null?void 0:r.settings).filter(i=>i.match(/^(extruder)\d?$/g)).sort().forEach(i=>{var a;const n=(a=s.configfile)==null?void 0:a.settings[i];e.push({key:i,name:"Extruder ".concat(i=="extruder"?"0":i.replace("extruder","")),filamentDiameter:n.filament_diameter,nozzleDiameter:n.nozzle_diameter,minExtrudeTemp:n.min_extrude_temp,maxExtrudeOnlyDistance:n.max_extrude_only_distance})}),e},getExtruderSteppers:s=>{var t,r;const e=[];return(t=s.configfile)!=null&&t.settings&&Object.keys((r=s.configfile)==null?void 0:r.settings).filter(i=>i.match(/^extruder_stepper/g)).sort().forEach(i=>{var a;const n=(a=s.configfile)==null?void 0:a.settings[i];e.push({key:i,name:i.replace("extruder_stepper ",""),extruder:n.extruder})}),e},getExtrudePossible:s=>{var t,r,i,n;const e=(r=(t=s.toolhead)==null?void 0:t.extruder)!=null?r:"extruder";return(n=(i=s[e])==null?void 0:i.can_extrude)!=null?n:!1},getBedMeshProfileName:s=>"bed_mesh"in s&&"profile_name"in s.bed_mesh?s.bed_mesh.profile_name:"",getMaxTemp:s=>{var t,r;let e=0;return(r=(t=s.heaters)==null?void 0:t.available_sensors)==null||r.forEach(i=>{var a;const n=(a=s.configfile)==null?void 0:a.settings[i];n&&"max_temp"in n&&Math.round(n.max_temp)>e&&Math.round(n.max_temp)<1e4&&(e=Math.round(n.max_temp))}),e>0?e+10:300},existPrinterConfig:s=>{var e;return(e=s.configfile)!=null&&e.config?Object.keys(s.configfile.config).length>0:!1},checkConfig:s=>e=>s.configfile.config?Object.keys(s.configfile.config).findIndex(r=>r.toLowerCase()===e.toLowerCase())!==-1:!1,checkNecessaryConfig:(s,e)=>{const t=[];return Qx.forEach(r=>{e.checkConfig(r)||t.push(r)}),!e.checkConfig("display")&&!e.checkConfig("display_status")&&t.push("display_status"),t},getEstimatedTimeFile:(s,e)=>"print_stats"in s&&"print_duration"in s.print_stats&&s.print_stats.print_duration>0&&e.getPrintPercent>0?(s.print_stats.print_duration/e.getPrintPercent-s.print_stats.print_duration).toFixed(0):0,getEstimatedTimeFilament:s=>"print_stats"in s&&"print_duration"in s.print_stats&&"filament_used"in s.print_stats&&"current_file"in s&&"filament_total"in s.current_file&&s.print_stats.print_duration>0&&s.current_file.filament_total>0&&s.current_file.filament_total>s.print_stats.filament_used?(s.print_stats.print_duration/(s.print_stats.filament_used/s.current_file.filament_total)-s.print_stats.print_duration).toFixed(0):0,getEstimatedTimeSlicer:s=>"print_stats"in s&&"print_duration"in s.print_stats&&"current_file"in s&&"estimated_time"in s.current_file&&s.print_stats.print_duration>0&&s.current_file.estimated_time>0?(s.current_file.estimated_time-s.print_stats.print_duration).toFixed(0):0,getEstimatedTimeAvg:(s,e,t)=>{var o,l,u,c,d,m,h,f;let r=0,i=0;const n=(c=(u=(l=(o=t.gui)==null?void 0:o.general)==null?void 0:l.calcEstimateTime)==null?void 0:u.includes("file"))!=null?c:!1,a=(f=(h=(m=(d=t.gui)==null?void 0:d.general)==null?void 0:m.calcEstimateTime)==null?void 0:h.includes("filament"))!=null?f:!1;return n&&e.getEstimatedTimeFile>0&&(r+=parseInt(e.getEstimatedTimeFile),i++),a&&e.getEstimatedTimeFilament>0&&(r+=parseInt(e.getEstimatedTimeFilament),i++),r&&i?r/i:0},getEstimatedTimeETA:(s,e,t)=>{var l,u,c,d,m,h,f,p,v,C,P,M;let r=0,i=0;const n=(d=(c=(u=(l=t.gui)==null?void 0:l.general)==null?void 0:u.calcEtaTime)==null?void 0:c.includes("file"))!=null?d:!1,a=(p=(f=(h=(m=t.gui)==null?void 0:m.general)==null?void 0:h.calcEtaTime)==null?void 0:f.includes("filament"))!=null?p:!1,o=(M=(P=(C=(v=t.gui)==null?void 0:v.general)==null?void 0:C.calcEtaTime)==null?void 0:P.includes("slicer"))!=null?M:!1;return n&&e.getEstimatedTimeFile>0&&(r+=parseInt(e.getEstimatedTimeFile),i++),a&&e.getEstimatedTimeFilament>0&&(r+=parseInt(e.getEstimatedTimeFilament),i++),o&&e.getEstimatedTimeSlicer>0&&(r+=parseInt(e.getEstimatedTimeSlicer),i++),r&&i?Math.round(Date.now()+r/i*1e3):0},getEstimatedTimeETAFormat:(s,e,t,r)=>{var m;const i=(m=r["gui/getHours12Format"])!=null?m:!1,n=e.getEstimatedTimeETA;if(n===0)return"--";const a=new Date(n);let o=!0,l=a.getHours();i&&l>11&&(o=!1),i&&l>12&&(l-=12),i&&l==0&&(l+=12),l<10&&(l="0"+l);const u=a.getMinutes()>=10?a.getMinutes():"0"+a.getMinutes(),c=n-new Date().getTime();let d=l+":"+u;return i&&(d+=" ".concat(o?"AM":"PM")),c>60*60*24*1e3&&(d+="+".concat(Math.trunc(c/(60*60*24*1e3)))),d},getKinematics:s=>{var e,t,r,i,n;return(t=(e=s.configfile)==null?void 0:e.settings)!=null&&t.printer?(n=(i=(r=s.configfile)==null?void 0:r.settings)==null?void 0:i.printer.kinematics)!=null?n:"none":!1},existsQGL:s=>{var e;return(e=s.configfile)!=null&&e.settings?"quad_gantry_level"in s.configfile.settings:!1},existsZtilt:s=>{var r,i,n,a;const e=(i=(r=s.gcode)==null?void 0:r.commands)!=null?i:null;if(e)return"Z_TILT_ADJUST"in e;const t=(a=(n=s.configfile)==null?void 0:n.settings)!=null?a:null;return t?"z_tilt"in t:!1},existsBedTilt:s=>{var e;return(e=s.configfile)!=null&&e.settings?"bed_tilt"in s.configfile.settings:!1},existsBedScrews:s=>{var e;return(e=s.configfile)!=null&&e.settings?"bed_screws"in s.configfile.settings:!1},existsDeltaCalibrate:s=>{var e;return(e=s.configfile)!=null&&e.settings?"delta_calibrate"in s.configfile.settings:!1},existsScrewsTilt:s=>{var e;return(e=s.configfile)!=null&&e.settings?"screws_tilt_adjust"in s.configfile.settings:!1},existsFirmwareRetraction:s=>{var e;return(e=s.configfile)!=null&&e.settings?"firmware_retraction"in s.configfile.settings:!1}},nJ={reset({commit:s,state:e}){e.updateSourceInterval!==null&&clearInterval(e.updateSourceInterval),s("reset")},init({commit:s,rootGetters:e,dispatch:t},r){var u,c,d;window.console.debug("init printer/tempHistory"),t("reset");const i=new Date,n=(u=e["printer/getAvailableHeaters"])!=null?u:[],a=(c=e["printer/getAvailableSensors"])!=null?c:[],o=(d=e["printer/getAvailableMonitors"])!=null?d:[],l=e["printer/tempHistory/getTemperatureStoreSize"];if(r!==void 0){"requestParams"in r&&delete r.requestParams;const m=Object.keys(r),h={};m.forEach(O=>{let $=O;if($.indexOf(" ")!==-1&&($=$.substring($.indexOf(" ")+1)),!(a.includes(O)||o.includes(O))||$.startsWith("_")){delete r[O];return}const D=r[O];Ln.forEach(V=>{if(V+"s"in D){const N=l-D[V+"s"].length;D[V+"s"]=[...Array.from({length:N},()=>null),...D[V+"s"]]}}),h[O]={...D}}),a.concat(o).forEach(O=>{if(O in r)return;let $=O,D=O;const V=O.indexOf(" ");if(V!==-1&&($=O.substring(V+1),D=O.substring(0,V)),$.startsWith("_"))return;const N={temperatures:Array(l).fill(null)};n.includes(O)?(N.targets=Array(l).fill(null),N.powers=Array(l).fill(null)):["temperature_fan"].includes(D)&&(N.targets=Array(l).fill(null),N.speeds=Array(l).fill(null)),h[O]={...N}});const p=[];for(let O=0;O{Ln.forEach(V=>{const N="".concat(V,"s");N in h[D]&&($["".concat(D,"-").concat(V)]=h[D][N][O])})}),p.push($)}s("setInitSource",p);const v=Object.keys(p[0]).filter(O=>O!=="date"),C=v.filter(O=>O.endsWith("-temperature")).map(O=>O.slice(0,O.length-12)).sort(),P=[];let M=0;C.forEach(O=>{let $=e["gui/getDatasetValue"]({name:O,type:"color"});$||(O==="heater_bed"&&($=Xx),O.endsWith(" chamber")&&($=Yx),$||($=qx[M],M++,$===void 0&&($="#"+Math.floor(16777215*Math.random()).toString(16))));const D={id:P.length+1,color:$,type:"line",name:"".concat(O,"-temperature"),encode:{x:"date",y:"".concat(O,"-temperature")},animation:!1,yAxisIndex:0,lineStyle:{color:$,width:2,opacity:.9},showSymbol:!1,emphasis:{lineStyle:{color:$,width:2,opacity:.9}}};P.push(D),Ln.forEach(V=>{if(V==="temperature")return;const N=O+"-"+V;if(!v.includes(N))return;const W=JSON.parse(JSON.stringify(D));W.id=P.length+1,W.name=N,W.encode.y=N,V==="target"&&(W.lineStyle.width=0,W.emphasis.lineStyle.width=0,W.areaStyle={color:$,opacity:.1},W.emphasis.areaStyle={color:$,opacity:.1}),Xn.includes(V)&&(W.yAxisIndex=1,W.lineStyle.width=1.5,W.lineStyle.opacity=.75,W.lineStyle.type="dotted",W.emphasis.lineStyle.width=1.5,W.emphasis.lineStyle.opacity=.75,W.emphasis.lineStyle.type="dotted"),P.push(W)})}),s("setInitSeries",P);const F=setInterval(()=>{t("updateSource")},Jx);s("setUpdateSourceInterval",F)}t("socket/removeInitModule","printer/initTempHistory",{root:!0})},async updateSource({commit:s,rootState:e,rootGetters:t,state:r}){var o,l;const i=(o=t["printer/getAvailableSensors"])!=null?o:[],n=(l=t["printer/getAvailableMonitors"])!=null?l:[],a=i.concat(n);if(a.length){const u=new Date;if(r.source.length){const d=r.source[r.source.length-1],m=d.date.getSeconds(),h=u.getSeconds(),f=u.getTime()-d.date.getTime();if(m===h&&f<1e3)return}const c={date:u};a.forEach(d=>{if(!(e.printer&&d in e.printer))return;const m={...e.printer[d]};Ln.forEach(h=>{if(!(h in m))return;let f=m[h];f!==null&&(f=Math.round(m[h]*10)/10),Xn.includes(h)&&(f=Math.round(m[h]*1e3)/1e3),c["".concat(d,"-").concat(h)]=f})}),s("addToSource",{data:c,maxHistory:t["printer/tempHistory/getTemperatureStoreSize"]})}},setColor({commit:s},e){s("setColor",e)}},aJ={reset(s){Object.assign(s,RC())},setInitSource(s,e){y.set(s,"source",e)},setInitSeries(s,e){y.set(s,"series",e)},addToSource(s,e){const t=[...s.source];for(t.push(e.data);t.length>e.maxHistory;)t.splice(0,1);y.set(s,"source",t)},saveLastDate(s,e){y.set(s,"timeLastUpdate",e)},setUpdateSourceInterval(s,e){y.set(s,"updateSourceInterval",e)},setColor(s,e){s.series.filter(t=>e.name===t.name||t.name.startsWith(e.name+"-")).forEach(t=>{var r;if(t.color=e.value,t.lineStyle.color=e.value,t.emphasis.lineStyle.color=e.value,t.name.endsWith("-target")){const i=t.areaStyle;i&&(i.color=e.value);const n=(r=t.emphasis)==null?void 0:r.areaStyle;n&&(n.color=e.value)}})}},oJ={getDatasetColor:(s,e)=>t=>{var i,n;const r=e.getSeries("".concat(t,"-temperature"));return(n=(i=r==null?void 0:r.lineStyle)==null?void 0:i.color)!=null?n:null},getSeries:s=>e=>s.series.find(t=>t.name===e),getSerieNames:s=>e=>{const t=[];return s.series.map(i=>i.name).filter(i=>i.startsWith("".concat(e,"-"))).forEach(i=>{t.push(i.slice(e.length+1))}),t},getBoolDisplayPwmAxis:(s,e)=>{const t=e.getSelectedLegends;return Object.keys(t).find(r=>t[r]===!0&&(r.endsWith("-power")||r.endsWith("-speed")))!==void 0},getAvg:s=>(e,t)=>{const r=t&&t!=="temperature"?e+"-"+t:e,i=new Date().getTime()-1e3*60;let n=0,a=0;return s.source.filter(o=>o.date>i).forEach(o=>{r in o&&(n+=o[r],a++)}),a&&Xn.includes(t)?n/a*100:a?n/a:0},getAvgPower:(s,e)=>t=>e.getAvg(t,"power"),getAvgSpeed:(s,e)=>t=>e.getAvg(t,"speed"),getHostMcuSensors:(s,e,t)=>{var a,o,l,u,c,d,m,h,f;const r=(l=(o=(a=t.printer)==null?void 0:a.configfile)==null?void 0:o.settings)!=null?l:{},i=(d=(c=(u=t.printer)==null?void 0:u.heaters)==null?void 0:c.available_heaters)!=null?d:[];return((f=(h=(m=t.printer)==null?void 0:m.heaters)==null?void 0:h.available_sensors)!=null?f:[]).filter(p=>{var P;if(i.includes(p)||p.startsWith("temperature_fan"))return!1;const v=r[p.toLowerCase()];if(!v)return!1;const C=(P=v.sensor_type)!=null?P:"";return["temperature_mcu","temperature_host"].includes(C)})},getSelectedLegends:(s,e,t)=>{var u,c,d,m,h,f,p,v,C,P,M,F,O,$,D,V,N,W,G,te,X,q;const r={},i=(d=(c=(u=t.printer)==null?void 0:u.heaters)==null?void 0:c.available_sensors)!=null?d:[],n=(f=(h=(m=t.printer)==null?void 0:m.heaters)==null?void 0:h.available_monitors)!=null?f:[],a=(P=(C=(v=(p=t.gui)==null?void 0:p.view)==null?void 0:v.tempchart)==null?void 0:C.datasetSettings)!=null?P:{};if(Object.keys(a).forEach(z=>{!i.includes(z)&&!n.includes(z)||Object.keys(a[z]).forEach(K=>{if(!Ln.includes(K))return;const Q="".concat(z,"-").concat(K);s.series.findIndex(re=>re.name===Q)!==-1&&(r[Q]=a[z][K])})}),s.series.forEach(z=>{if(Object.keys(r).includes(z.name))return;const K=z.name.slice(z.name.lastIndexOf("-")+1);r[z.name]=!Xn.includes(K)}),($=(O=(F=(M=t.gui)==null?void 0:M.view)==null?void 0:F.tempchart)==null?void 0:O.hideMcuHostSensors)!=null?$:!1){const z=(D=e.getHostMcuSensors)!=null?D:[];Object.keys(r).filter(K=>{const Q=K.slice(0,K.lastIndexOf("-"));return z.includes(Q)}).forEach(K=>{r[K]=!1})}if((G=(W=(N=(V=t.gui)==null?void 0:V.view)==null?void 0:N.tempchart)==null?void 0:W.hideMonitors)!=null?G:!1){const z=(q=(X=(te=t.printer)==null?void 0:te.heaters)==null?void 0:X.available_monitors)!=null?q:[];Object.keys(r).filter(K=>{const Q=K.slice(0,K.lastIndexOf("-"));return z.includes(Q)}).forEach(K=>{r[K]=!1})}return r},getTemperatureStoreSize:(s,e,t,r)=>{const i=r["server/getConfig"]("data_store","temperature_store_size");return i!=null?i:1200}},RC=()=>({source:[],series:[],timeLastUpdate:null,updateSourceInterval:null}),lJ=RC(),cJ={namespaced:!0,state:lJ,getters:oJ,actions:nJ,mutations:aJ},HC=()=>({}),uJ=HC(),dJ={namespaced:!0,state:uJ,getters:iJ,actions:sJ,mutations:rJ,modules:{tempHistory:cJ}},mJ={reset({commit:s}){s("reset")},initRootDirs({state:s,commit:e},t){t.forEach(r=>{s.filetree.findIndex(i=>i.filename===r)===-1&&(e("createRootDir",{name:r,permissions:"r"}),y.$socket.emit("server.files.get_directory",{path:r},{action:"files/getDirectory"}))})},getDirectory({state:s,commit:e,getters:t},r){var u,c,d,m,h,f;const i=r.requestParams.path.split("/"),n=i.length?i[0]:r.requestParams.path,a=r.requestParams.path.indexOf("/"),o=a>1?r.requestParams.path.slice(a+1):"",l=t.getDirectory(n+"/"+o);if((u=l==null?void 0:l.childrens)!=null&&u.length&&(l==null||l.childrens.forEach(p=>{var v,C;p!=null&&p.isDirectory&&((v=r.dirs)==null?void 0:v.findIndex(P=>P.dirname===p.filename))<0?e("setDeleteDir",{item:{path:o.length?o+"/"+p.filename:p.filename,root:n}}):!(p!=null&&p.isDirectory)&&((C=r.files)==null?void 0:C.findIndex(P=>P.filename===p.filename))<0&&e("setDeleteFile",{item:{path:o.length?o+"/"+p.filename:p.filename,root:n}})})),(c=r.dirs)!=null&&c.length&&r.dirs.filter(p=>!ow.includes(p.dirname)).forEach(p=>{var v;((v=l==null?void 0:l.childrens)==null?void 0:v.findIndex(C=>C.isDirectory&&C.filename===p.dirname))===-1&&(e("setCreateDir",{item:{path:o.length?o+"/"+p.dirname:p.dirname,root:n,permissions:p.permissions,modified:p.modified*1e3}}),y.$socket.emit("server.files.get_directory",{path:r.requestParams.path+"/"+p.dirname},{action:"files/getDirectory"}))}),(d=r.files)!=null&&d.length&&r.files.forEach(p=>{var C;const v=(C=l==null?void 0:l.childrens)==null?void 0:C.find(P=>!P.isDirectory&&P.filename===p.filename);v&&(v.size!==p.size||v.modified.getTime()!==new Date(p.modified*1e3).getTime())?e("setModifyFile",{item:{path:o.length?o+"/"+p.filename:p.filename,root:n,modified:p.modified,size:p.size}}):v||e("setCreateFile",{item:{path:o.length?o+"/"+p.filename:p.filename,root:n,permissions:p.permissions,modified:p.modified,size:p.size}})}),(m=r==null?void 0:r.root_info)!=null&&m.name){const p=s.filetree.find(v=>{var C;return v.filename===((C=r==null?void 0:r.root_info)==null?void 0:C.name)});p&&p.permissions!==((h=r.root_info)==null?void 0:h.permissions)&&e("setRootPermissions",r.root_info)}(f=r.requestParams)!=null&&f.path&&r.disk_usage&&e("setDiskUsage",{disk_usage:r.disk_usage,path:r.requestParams.path})},scanMetadata({commit:s},e){if(e.filename.slice(0,e.filename.indexOf("/"))==="gcodes"){const r=e.filename.slice(7);s("setMetadataRequested",{filename:r}),y.$socket.emit("server.files.metascan",{filename:r},{action:"files/getScanMetadata"})}},getScanMetadata({dispatch:s},e){if(e!==void 0&&e.filename!==""){s("getMetadata",e);const t=e.filename;y.$toast.success(ve.t("Files.ScanMetaSuccess",{filename:t}).toString())}},requestMetadata({commit:s},e){let t=[];for(const{filename:r}of e)if(t.length>=100&&(y.$socket.emitBatch(t),t=[]),r.slice(0,r.indexOf("/"))==="gcodes"){const n=r.slice(7);s("setMetadataRequested",{filename:n}),t.push({method:"server.files.metadata",params:{filename:n},emitOptions:{action:"files/getMetadata"}})}y.$socket.emitBatch(t)},getMetadata({commit:s,rootState:e},t){var r,i;t!==void 0&&t.filename!==""&&(t.filename===((i=(r=e==null?void 0:e.printer)==null?void 0:r.print_stats)==null?void 0:i.filename)&&(s("printer/clearCurrentFile",null,{root:!0}),s("printer/setData",{current_file:t},{root:!0})),s("setMetadata",t))},getMetadataCurrentFile({commit:s},e){s("printer/clearCurrentFile",null,{root:!0}),s("printer/setData",{current_file:e},{root:!0})},async filelist_changed({commit:s,dispatch:e},t){var r,i;switch(t.action){case"create_file":s("setCreateFile",t);break;case"move_file":if(((r=t.source_item)==null?void 0:r.path)==="printer_autosave.cfg"&&((i=t.source_item)==null?void 0:i.root)==="config"){s("setCreateFile",t);return}await s("setMoveFile",t),t.item.root==="gcodes"&&Pi.includes(t.item.path.slice(t.item.path.lastIndexOf(".")))&&await e("requestMetadata",[{filename:"gcodes/"+t.item.path}]);break;case"delete_file":s("setDeleteFile",t);break;case"modify_file":s("setModifyFile",t);break;case"create_dir":s("setCreateDir",t);break;case"move_dir":s("setMoveDir",t);break;case"delete_dir":s("setDeleteDir",t);break;case"root_update":e("server/addRootDirectory",t,{root:!0}),s("setRootUpdate",t);break;default:window.console.error("Unknown filelist_changed action: "+t.action);break}},getMove(s,e){if(e.error)y.$toast.error(e.error.message);else{const t=e.requestParams.dest.substr(e.requestParams.dest.lastIndexOf("/")).replace("/",""),r=e.requestParams.source.substr(0,e.requestParams.source.lastIndexOf("/")),i=e.requestParams.dest.substr(0,e.requestParams.dest.lastIndexOf("/"));r===i?y.$toast.success(ve.t("Files.SuccessfullyRenamed",{filename:t})):y.$toast.success(ve.t("Files.SuccessfullyMoved",{filename:t}))}},getCreateDir(s,e){if(e.error)y.$toast.error(e.error.message);else{const t=e.requestParams.path.substr(e.requestParams.path.lastIndexOf("/")+1);y.$toast.success(ve.t("Files.SuccessfullyCreated",{filename:t}))}},getDeleteDir(s,e){if(e.error)y.$toast.error(e.error.message);else{const t=e.requestParams.path.substr(e.requestParams.path.lastIndexOf("/")+1);y.$toast.success(ve.t("Files.SuccessfullyDeleted",{filename:t}))}},getDeleteFile(s,e){if(e.error)y.$toast.error(e.error.message);else{const t=e.item.path.substr(e.item.path.lastIndexOf("/")+1),r=e.item.path.substr(e.item.path.lastIndexOf(".")+1);e.item.root==="timelapse"&&r==="jpg"||y.$toast.success(ve.t("Files.SuccessfullyDeleted",{filename:t}))}},async uploadFile({commit:s,rootGetters:e},t){const r=e["socket/getUrl"],i=new FormData;i.append("file",t.file,t.file.name),i.append("root",t.root),i.append("path",t.path);const n=Le.CancelToken.source();return await s("uploadClearState"),await s("uploadSetCancelTokenSource",n),await s("uploadSetFilename",t.file.name),await s("uploadSetShow",!0),new Promise(a=>{Le.post(r+"/server/files/upload",i,{cancelToken:n.token,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:o=>{var c,d;const l=((c=o.progress)!=null?c:0)*100;s("uploadSetPercent",l);const u=(d=o.rate)!=null?d:0;s("uploadSetSpeed",u)}}).then(o=>{s("uploadSetShow",!1);const l=o.data.item.path.lastIndexOf("/"),u=o.data.item.path.slice(l+1);a(u)}).catch(()=>{s("uploadSetShow",!1),y.$toast.error(ve.t("FullscreenUpload.CannotUploadFile").toString()),a(!1)})})},uploadSetShow({commit:s},e){s("uploadSetShow",e)},uploadSetCurrentNumber({commit:s},e){s("uploadSetCurrentNumber",e)},uploadIncrementCurrentNumber({state:s,commit:e}){e("uploadSetCurrentNumber",s.upload.currentNumber+1)},uploadSetMaxNumber({commit:s},e){s("uploadSetMaxNumber",e)},downloadZip({rootGetters:s},e){const t=s["socket/getUrl"],r="".concat(t,"/server/files/").concat(e.destination.root,"/").concat(encodeURI(e.destination.path));window.open(r)},rolloverLog(s,e){e.rolled_over.forEach(t=>{y.$toast.success(ve.t("Machine.LogfilesPanel.RolloverToastSuccessful",{name:t}))}),Object.keys(e.failed).forEach(t=>{const r=e.failed[t];y.$toast.error(ve.t("Machine.LogfilesPanel.RolloverToastFailed",{name:t,message:r}))}),setTimeout(()=>{y.$socket.emit("server.files.get_directory",{path:"logs"},{action:"files/getDirectory"})},500)}},hJ={reset(s){Object.assign(s,jC())},createRootDir(s,e){s.filetree.push({isDirectory:!0,filename:e.name,modified:new Date,permissions:e.permissions,childrens:[],disk_usage:{free:0,total:0,used:0}})},setMetadataRequested(s,e){let t="gcodes/"+e.filename;const r=t.split("/");t=r[r.length-1];const i=Nt(s.filetree,r),n=i==null?void 0:i.findIndex(a=>a.filename===t);if(i&&n!==void 0&&n!==-1){const a={...i[n]};a.metadataRequested=!0,y.set(i,n,a)}else window.console.error("file not found in filetree: "+e.filename)},setMetadata(s,e){let t="gcodes/"+e.filename;const r=t.split("/");t=r[r.length-1];const i=Nt(s.filetree,r),n=i==null?void 0:i.findIndex(a=>a.filename===t);if(i&&n!==void 0&&n!==-1){const a={...i[n]};ew.forEach(o=>{o in e&&(a[o]=e[o])}),a.metadataRequested=!0,a.metadataPulled=!0,y.set(i,n,a)}else window.console.error("file not found in filetree: "+e.filename)},setCreateFile(s,e){let t=e.item.path;e.item.path.lastIndexOf("/")>=0&&(t=e.item.path.substr(e.item.path.lastIndexOf("/")).replace("/",""));const r=e.item.path.substr(0,e.item.path.lastIndexOf("/")),i=Nt(s.filetree,(e.item.root+"/"+r).split("/"));if(i){const n=i.findIndex(a=>!a.isDirectory&&a.filename===t);if(n===-1){const a=new Date(e.item.modified*1e3);i.push({isDirectory:!1,filename:t,modified:a,permissions:e.item.permissions,size:e.item.size,metadataRequested:!1,metadataPulled:!1})}else{i[n].modified=new Date(e.item.modified*1e3),i[n].size=e.item.size,i[n].metadataRequested=!1,i[n].metadataPulled=!1;const a=t.substring(t.lastIndexOf(".")+1);e.item.root==="gcodes"&&a==="gcode"&&y.$socket.emit("server.files.metadata",{filename:e.item.path},{action:"files/getMetadata"})}}},setMoveFile(s,e){let t=e.source_item.path,r=e.source_item.root;const i=e.source_item.path.lastIndexOf("/");i!==-1&&(t=e.source_item.path.substring(i+1),r=e.source_item.root+"/"+e.source_item.path.substring(0,i));let n=e.item.path,a=e.item.root;const o=e.item.path.lastIndexOf("/");o!==-1&&(n=e.item.path.substring(o+1),a=e.item.root+"/"+e.item.path.substring(0,o));const l=Nt(s.filetree,r.split("/")),u=l==null?void 0:l.findIndex(m=>m.filename===t);if(u===void 0||u===-1||l===null)return;const c=l.splice(u,1)[0];c.filename=n,r!==a&&"metadataPulled"in c&&c.metadataPulled&&"thumbnails"in c&&(c.metadataPulled=!1,delete c.thumbnails);const d=Nt(s.filetree,a.split("/"));d==null||d.push(c)},setModifyFile(s,e){let t=e.item.path,r=e.item.root;const i=e.item.path.lastIndexOf("/");i!==-1&&(t=e.item.path.substr(i+1),r=e.item.root+"/"+e.item.path.substr(0,i+1));const n=Nt(s.filetree,r.split("/")),a=n==null?void 0:n.findIndex(o=>o.filename===t);a!==void 0&&a>-1&&n&&n[a]&&("metadataPulled"in n[a]&&n[a].metadataPulled&&(n[a].metadataPulled=!1,"thumbnails"in n[a]&&delete n[a].thumbnails),n[a].modified=new Date(e.item.modified*1e3),n[a].size=e.item.size)},setMoveDir(s,e){let t=e.source_item.path,r=e.source_item.root;const i=e.source_item.path.lastIndexOf("/");i!==-1&&(t=e.source_item.path.substr(i+1),r=e.source_item.root+"/"+e.source_item.path.substr(0,i+1));let n=e.item.path,a=e.item.root;const o=e.item.path.lastIndexOf("/");o!==-1&&(n=e.item.path.substr(o+1),a=e.item.root+"/"+e.item.path.substr(0,o+1));const l=Nt(s.filetree,r.split("/")),u=l==null?void 0:l.findIndex(c=>c.filename===t);if(u!==void 0&&l&&l[u]){const c=l.splice(u,1)[0];c.filename=n;const d=Nt(s.filetree,a.split("/"));d==null||d.push(c)}},setDeleteFile(s,e){let t=e.item.path.substr(0,e.item.path.lastIndexOf("/"));const r=e.item.path.substr(e.item.path.lastIndexOf("/")+1);t=Nt(s.filetree,(e.item.root+"/"+t).split("/"));const i=t.findIndex(n=>n.filename===r);i>=0&&t[i]&&t.splice(i,1)},setCreateDir(s,e){var n;const t=e.item.path.substr(e.item.path.lastIndexOf("/")+1),r=e.item.path.substr(0,e.item.path.lastIndexOf("/")),i=Nt(s.filetree,(e.item.root+"/"+r).split("/"));i&&i.push({isDirectory:!0,filename:t,modified:(n=e.item.modified)!=null?n:new Date,permissions:e.item.permissions,childrens:[]})},setDeleteDir(s,e){let t=e.item.path.substr(0,e.item.path.lastIndexOf("/"));const r=e.item.path.substr(e.item.path.lastIndexOf("/")+1);t=Nt(s.filetree,(e.item.root+"/"+t).split("/"));const i=t.findIndex(n=>n.filename===r);i>=0&&t[i]&&t.splice(i,1)},setRootUpdate(s,e){var r,i,n;const t=s.filetree.findIndex(a=>a.filename===e.item.root);t!==-1&&((r=s.filetree[t].childrens)!=null&&r.length)&&((n=s.filetree[t].childrens)==null||n.splice(0,(i=s.filetree[t].childrens)==null?void 0:i.length))},setDiskUsage(s,e){const t=e.path.substr(0,e.path.lastIndexOf("/")),r=e.path.substr(e.path.lastIndexOf("/")+1),i=Nt(s.filetree,t.split("/")),n=i==null?void 0:i.find(a=>a.isDirectory&&a.filename===r);n&&y.set(n,"disk_usage",e.disk_usage)},setRootPermissions(s,e){const t=s.filetree.find(r=>r.filename===e.name);t&&y.set(t,"permissions",e.permissions)},uploadClearState(s){const e={...s.upload};e.show=!1,e.filename="",e.cancelTokenSource=null,e.speed=0,e.percent=0,y.set(s,"upload",e)},uploadSetShow(s,e){y.set(s.upload,"show",e)},uploadSetFilename(s,e){y.set(s.upload,"filename",e)},uploadSetCancelTokenSource(s,e){y.set(s.upload,"cancelTokenSource",e)},uploadSetCurrentNumber(s,e){y.set(s.upload,"currentNumber",e)},uploadSetMaxNumber(s,e){y.set(s.upload,"maxNumber",e)},uploadSetPercent(s,e){s.upload.percent!==e&&y.set(s.upload,"percent",e)},uploadSetSpeed(s,e){s.upload.speed!==e&&y.set(s.upload,"speed",e)}},pJ={getDirectory:s=>e=>{e.startsWith("/")&&(e=e.substr(1)),e.endsWith("/")&&(e=e.substr(0,e.length-1));const t=function(r,i){var n;if(i.length){const a=(n=r==null?void 0:r.childrens)==null?void 0:n.find(o=>o.isDirectory&&o.filename===i[0]);return a?(i.shift(),t(a,i)):null}return r};return t({childrens:s.filetree},e.split("/"))},getFile:(s,e)=>t=>{var a;const r=t.slice(0,t.lastIndexOf("/")),i=t.slice(t.lastIndexOf("/")+1),n=e.getDirectory(r);return(a=n==null?void 0:n.childrens)==null?void 0:a.find(o=>o.filename===i&&!o.isDirectory)},getGcodeFiles:(s,e,t,r)=>(i,n,a)=>{var d;const o=e.getDirectory("gcodes");if(o===null)return[];let l="".concat(r["socket/getUrl"],"/server/files/gcodes"),u=[];if(i!==null){l+=Ie(i);const m=e.getDirectory("gcodes"+i);u=(d=m==null?void 0:m.childrens)!=null?d:[]}else{const m=(h,f)=>{var p,v;h.isDirectory&&((p=h.childrens)!=null&&p.length)&&((v=h.childrens)==null||v.forEach(C=>{if(C.isDirectory)m(C,f+C.filename+"/");else{const P={...C};P.filename=f+C.filename,u.push(P)}}))};m(o,"")}u=u.filter(m=>{if(!n&&(m.filename==="thumbs"||m.filename.startsWith(".")))return!1;if(m.isDirectory)return!0;const h=m.filename.lastIndexOf("."),f=m.filename.slice(h);return Pi.includes(f)});const c=[];return u.forEach(m=>{var M,F;const h=typeof m.modified.getTime=="function"?m.modified.getTime():0,f={...m,preheat_gcode:null,small_thumbnail:null,big_thumbnail:null,big_thumbnail_width:null,count_printed:0,last_start_time:null,last_end_time:null,last_filament_used:null,last_status:null,last_print_duration:null,last_total_duration:null},p=[];if([{name:"first_layer_extr_temp",gcode:"M104"},{name:"first_layer_bed_temp",gcode:"M140"}].forEach(O=>{O.name in m&&m[O.name]>1&&p.push("".concat(O.gcode," S").concat(m[O.name]))}),p.length&&(f.preheat_gcode=p.join("\n")),(M=m.thumbnails)!=null&&M.length){let O="";if(i===null){const V=m.filename.lastIndexOf("/");V>0&&(O="/"+m.filename.slice(0,V))}const $=m.thumbnails.find(V=>V.width>=Yt&&V.width<=Jt&&V.height>=Yt&&V.height<=Jt);$&&"relative_path"in $&&(f.small_thumbnail="".concat(l).concat(Ie(O+"/"+$.relative_path),"?timestamp=").concat(h));const D=m.thumbnails.find(V=>V.width>=Ls);D&&"relative_path"in D&&(f.big_thumbnail="".concat(l).concat(Ie(O+"/"+D.relative_path),"?timestamp=").concat(h),f.big_thumbnail_width=D.width)}const C=i&&i.length?i+"/"+m.filename:m.filename;let P=r["server/history/getPrintJobsForGcodes"](C,h,m.size,(F=m.uuid)!=null?F:null,m.job_id);if(P&&P.length){P=P.sort((D,V)=>V.start_time-D.start_time);const O=P.filter(D=>D.status==="completed"),$=[...P].shift();if(f.last_status=$.status,f.count_printed=O.length,f.last_start_time=new Date($.start_time*1e3),f.count_printed>0){const D=O[0];f.last_start_time=new Date(D.start_time*1e3),f.last_end_time=new Date(D.end_time*1e3),f.last_filament_used=D.filament_used,f.last_print_duration=D.print_duration,f.last_total_duration=D.total_duration}}(a||f.count_printed===0)&&c.push(f)}),c},getAllGcodes:(s,e)=>e.getGcodeFiles(null,!1,!0),getThemeFileUrl:(s,e,t,r)=>(i,n)=>{var l;const a=e.getDirectory("config/"+Si),o=(l=a==null?void 0:a.childrens)==null?void 0:l.find(u=>{var c,d,m,h;return((d=u.filename)==null?void 0:d.slice(0,(c=u.filename)==null?void 0:c.lastIndexOf(".")))===i&&n.includes((h=u.filename)==null?void 0:h.slice(((m=u.filename)==null?void 0:m.lastIndexOf("."))+1))});return o?"".concat(r["socket/getUrl"],"/server/files/config/").concat(Si,"/").concat(o.filename,"?timestamp=").concat(o.modified.getTime()):null},getSidebarLogo:(s,e)=>{var i;const t="sidebar-logo",r=["svg","jpg","jpeg","png","gif"];return(i=e.getThemeFileUrl(t,r))!=null?i:""},getCustomSidebarBackground:(s,e)=>{var i;const t="sidebar-background",r=["jpg","jpeg","png","gif","svg"];return(i=e.getThemeFileUrl(t,r))!=null?i:null},getMainBackground:(s,e)=>{const t="main-background",r=["jpg","jpeg","png","gif","svg"];return e.getThemeFileUrl(t,r)},getCustomStylesheet:(s,e)=>{var i;const t="custom",r=["css"];return(i=e.getThemeFileUrl(t,r))!=null?i:null},getCustomNaviPoints:(s,e)=>{var i;const t="navi",r=["json"];return(i=e.getThemeFileUrl(t,r))!=null?i:null},getCustomFavicons:(s,e)=>{const t="favicon-32x32",r="favicon-32x32",i=["png","svg"],n=e.getThemeFileUrl(t,i),a=e.getThemeFileUrl(r,i);return n&&a?[n,a]:n?[n,n]:a?[a,a]:null},getDiskUsage:s=>e=>{e.indexOf("/")===0&&(e=e.substr(1)),e.indexOf("/")!==-1&&(e=e.substr(0,e.indexOf("/")));const t=s.filetree.find(r=>r.filename===e);return t&&"disk_usage"in t?t.disk_usage:null},checkConfigFile:(s,e)=>t=>{var i;const r=e.getDirectory("config");return((i=r==null?void 0:r.childrens)==null?void 0:i.findIndex(n=>n.filename!==void 0&&n.filename===t))!==-1},getSmallThumbnail:(s,e,t,r)=>(i,n)=>{var a;if("thumbnails"in i&&((a=i.thumbnails)!=null&&a.length)){const o=i.thumbnails.find(l=>l.width>=Yt&&l.width<=Jt&&l.height>=Yt&&l.height<=Jt);if(o&&"relative_path"in o)return"".concat(r["socket/getUrl"],"/server/files/").concat(Ie(n),"/").concat(Ie(o.relative_path),"?timestamp=").concat(i.modified.getTime())}return""},getBigThumbnail:(s,e,t,r)=>(i,n)=>{var a;if("thumbnails"in i&&((a=i.thumbnails)!=null&&a.length)){const o=i.thumbnails.find(l=>l.width>=Ls);if(o&&"relative_path"in o)return"".concat(r["socket/getUrl"],"/server/files/").concat(Ie(n),"/").concat(Ie(o.relative_path),"?timestamp=").concat(i.modified.getTime())}return""}},jC=()=>({filetree:[],upload:{show:!1,filename:"",currentNumber:0,maxNumber:0,cancelTokenSource:null,percent:0,speed:0}}),fJ=jC(),gJ={namespaced:!0,state:fJ,getters:pJ,actions:mJ,mutations:hJ},_J={reset({commit:s,dispatch:e}){s("reset"),e("console/reset"),e("gcodehistory/reset"),e("macros/reset"),e("presets/reset"),e("webcams/reset")},init(){window.console.debug("init gui"),y.$socket.emit("server.database.get_item",{namespace:"mainsail"},{action:"gui/initStore"})},async initStore({commit:s,dispatch:e,rootGetters:t,rootState:r},i){var o,l,u,c,d,m;const a=t["socket/getUrl"]+"/server/database/item"+"?namespace=mainsail";if("remoteprinters"in i.value&&(r.instancesDB==="moonraker"&&e("remoteprinters/initStore",i.value.remoteprinters.printers),delete i.value.remoteprinters),(u=(l=(o=i.value)==null?void 0:o.view)==null?void 0:l.gcodefiles)!=null&&u.currentPath&&(window.console.debug("remove currentPath from gui namespace"),await fetch(a+"&key=view.gcodefiles.currentPath",{method:"DELETE"})),(m=(d=(c=i.value)==null?void 0:c.view)==null?void 0:d.configfiles)!=null&&m.currentPath&&(window.console.debug("remove currentPath from gui namespace"),await fetch(a+"&key=view.configfiles.currentPath",{method:"DELETE"})),"cooldownGcode"in i.value&&(window.console.debug("update cooldownGcode to new namespace"),e("saveSetting",{name:"presets.cooldownGcode",value:i.value.cooldownGcode}),await fetch(a+"&key=cooldownGcode",{method:"DELETE"}),delete i.value.cooldownGcode),"presets"in i.value&&Array.isArray(i.value.presets)&&(window.console.debug("update presets to new namespace"),i.value.presets.forEach(h=>{e("presets/store",{values:h})}),delete i.value.presets),"dashboard"in i.value&&"nonExpandPanels"in i.value.dashboard&&Array.isArray(i.value.dashboard.nonExpandPanels)&&(await fetch(a+"&key=dashboard.nonExpandPanels",{method:"DELETE"}),e("saveSetting",{name:"dashboard.nonExpandPanels.widescreen",value:i.value.dashboard.nonExpandPanels}),delete i.value.dashboard.nonExpandPanels),"dashboard"in i.value){const h=i.value.dashboard;["mobileLayout","tabletLayout1","tabletLayout2","desktopLayout1","desktopLayout2","widescreenLayout1","widescreenLayout2","widescreenLayout3"].forEach(p=>{if(p in h){const v=h[p].findIndex(C=>C.name==="tools");v!==-1&&(h[p][v].name="temperature",e("saveSetting",{name:"dashboard."+p,value:h[p]}))}})}await s("setData",i.value),await e("socket/removeInitModule","gui/init",{root:!0})},async initDb({dispatch:s,rootGetters:e}){var a;const t=e["socket/getUrl"]+"/server/database/item",r=e["socket/getUrl"]+"/server/files/config/"+Si+"/default.json?time="+Date.now(),i=await fetch(r);let n={};i&&(n=await i.json(),((a=n.error)==null?void 0:a.code)===404&&(n={}));for(const o in n)if(["webcams","timelapse"].includes(o))for(const l of n[o])await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:o,key:l,value:n[o][l]})});else await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:"mainsail",key:o,value:n[o]})});await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:"mainsail",key:"initVersion",value:e.getVersion})}),s("init")},saveSetting({commit:s},e){s("saveSetting",e),y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:e.name,value:e.value})},saveSettingWithoutUpload({commit:s},e){s("saveSetting",e)},updateSettings(s,e){const t=e.keyName;let r=e.newVal;"value"in e&&t in e.value&&typeof e.value[t]!="string"&&!Array.isArray(e.value[t])&&(r=Object.assign(e.value[t],{...r})),y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:t,value:r})},setGcodefilesMetadata({commit:s,dispatch:e,state:t},r){s("setGcodefilesMetadata",r),e("updateSettings",{keyName:"view.gcodefiles.hideMetadataColumns",newVal:t.view.gcodefiles.hideMetadataColumns})},setGcodefilesShowHiddenFiles({commit:s,dispatch:e,state:t},r){s("setGcodefilesShowHiddenFiles",r),e("updateSettings",{keyName:"view.gcodefiles.showHiddenFiles",newVal:t.view.gcodefiles.showHiddenFiles})},setCurrentWebcam({commit:s,dispatch:e,state:t},r){s("setCurrentWebcam",r),e("updateSettings",{keyName:"view.webcam.currentCam",newVal:t.view.webcam.currentCam})},setTempchartDatasetAdditionalSensorSetting({commit:s,dispatch:e,state:t},r){s("setTempchartDatasetAdditionalSensorSetting",r),e("updateSettings",{keyName:"view.tempchart",newVal:t.view.tempchart})},async resetMoonrakerDB({rootGetters:s},e){var n,a;const t=s["socket/getUrl"]+"/server/database/item",r=s["socket/getUrl"]+"/server/files/config/"+Si+"/default.json?time="+Date.now();let i={};try{i=await fetch(r).then(o=>o.json())}catch(o){window.console.error("Error while fetching/parsing default.json",o),i={}}for(const o of e)if(["maintenance","timelapse","webcams"].includes(o)){const l=t+"?namespace="+o,c=await(await fetch(l)).json();if((n=c==null?void 0:c.result)!=null&&n.value)for(const d of Object.keys((a=c==null?void 0:c.result)==null?void 0:a.value))await fetch(l+"&key="+d,{method:"DELETE"});if(o in i)for(const d of i[o])await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:o,key:d,value:i[o][d]})})}else o==="history_jobs"?await fetch(s["socket/getUrl"]+"/server/history/job?all=true",{method:"DELETE"}):o==="history_totals"?await fetch(s["socket/getUrl"]+"/server/history/reset_totals",{method:"POST"}):(await fetch(s["socket/getUrl"]+"/server/database/item?namespace=mainsail&key="+o,{method:"DELETE"}),o in i&&await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:"mainsail",key:o,value:i[o]})}));window.location.reload()},async backupMoonrakerDB({rootGetters:s},e){var o,l,u,c;const t={},i=await(await fetch(s["socket/getUrl"]+"/server/database/item?namespace=mainsail")).json(),n=(l=(o=i==null?void 0:i.result)==null?void 0:o.value)!=null?l:{};for(const d of e)if(["timelapse","webcams"].includes(d)){const m=s["socket/getUrl"]+"/server/database/item?namespace="+d,f=await(await fetch(m)).json();(u=f==null?void 0:f.result)!=null&&u.value&&(t[d]={...(c=f==null?void 0:f.result)==null?void 0:c.value})}else d in n&&(t[d]={...n[d]});const a=document.createElement("a");a.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(JSON.stringify(t))),a.setAttribute("download","backup-mainsail.json"),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)},async restoreMoonrakerDB({rootGetters:s},e){var l,u,c,d,m,h;const t=s["socket/getUrl"]+"/server/database/item",r=t+"?namespace=mainsail",n=await(await fetch(s["socket/getUrl"]+"/server/database/list")).json(),a=(u=(l=n==null?void 0:n.result)==null?void 0:l.namespaces)!=null?u:[];let o=[];if(a.includes("mainsail")){const p=await(await fetch(r)).json();o=Object.keys((d=(c=p==null?void 0:p.result)==null?void 0:c.value)!=null?d:{})}for(const f of e.dbCheckboxes)if(["timelapse","webcams"].includes(f)){if(a.includes(f)){const p=t+"?namespace="+f,C=await(await fetch(p)).json();if((m=C==null?void 0:C.result)!=null&&m.value)for(const P of Object.keys((h=C==null?void 0:C.result)==null?void 0:h.value))await fetch(p+"&key="+P,{method:"DELETE"})}for(const p of Object.keys(e.restoreObjects[f])){const v=e.restoreObjects[f][p];await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:f,key:p,value:v})})}}else o.includes(f)&&await fetch(r+"&key="+f,{method:"DELETE"}),await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:"mainsail",key:f,value:e.restoreObjects[f]})});window.location.reload()},setHistoryColumns({commit:s,dispatch:e,state:t},r){s("setHistoryColumns",r),e("updateSettings",{keyName:"view.history",newVal:t.view.history})},toggleStatusInHistoryList({commit:s,dispatch:e,state:t},r){const i=[...t.view.history.hidePrintStatus],n=i.indexOf(r);n===-1?i.push(r):i.splice(n,1),s("setHistoryHidePrintStatus",i),e("updateSettings",{keyName:"view.history.hidePrintStatus",newVal:i})},saveExpandPanel({commit:s,dispatch:e,state:t},r){r.value?s("removeClosePanel",{name:r.name,viewport:r.viewport}):s("addClosePanel",{name:r.name,viewport:r.viewport}),e("updateSettings",{keyName:"dashboard.nonExpandPanels.".concat(r.viewport),newVal:t.dashboard.nonExpandPanels[r.viewport]})},resetLayout({dispatch:s},e){var i;const r=(i=xd().dashboard[e])!=null?i:[];s("saveSetting",{name:"dashboard."+e,value:r})},updateGcodeviewerCache({dispatch:s,state:e},t){var i;const r=(i=e.gcodeViewer.klipperCache)!=null?i:{};Object.keys(t).forEach(n=>{const a=t[n],o=n in r?r[n]:null;JSON.stringify(a)!==JSON.stringify(o)&&s("saveSetting",{name:"gcodeViewer.klipperCache.".concat(n),value:a})})},announcementDismissFlag(s,e){window.console.log(e)},setChartDatasetStatus({commit:s,dispatch:e,state:t},r){s("setChartDatasetStatus",r),e("updateSettings",{keyName:"view.tempchart.datasetSettings",newVal:t.view.tempchart.datasetSettings})},setDatasetAdditionalSensorStatus({commit:s,dispatch:e,state:t},r){s("setDatasetAdditionalSensorStatus",r),e("updateSettings",{keyName:"view.tempchart.datasetSettings",newVal:t.view.tempchart.datasetSettings})},setChartColor({commit:s,dispatch:e,state:t},r){s("setChartDatasetStatus",{objectName:r.objectName,dataset:"color",value:r.value}),e("updateSettings",{keyName:"view.tempchart.datasetSettings",newVal:t.view.tempchart.datasetSettings})}},vJ={reset(s){Object.assign(s,xd())},setData(s,e){tf(s,e)},saveSetting(s,e){const t=(r,i,n)=>i!==void 0&&typeof i=="string"?t(r,i.split("."),n):i.length==1&&n!==void 0?r[i[0]]=n:i.length==0?r:(i[0]in r||(r[i[0]]={}),t(r[i[0]],i.slice(1),n));t(s,e.name,e.value)},setHeaterChartVisibility(s,e){const t=s.view.tempchart.hiddenDataset.indexOf(e.name.toUpperCase());e.hidden&&t===-1?s.view.tempchart.hiddenDataset.push(e.name.toUpperCase()):e.hidden!==!0&&t>-1&&s.view.tempchart.hiddenDataset.splice(t,1)},setGcodefilesMetadata(s,e){const t=[...s.view.gcodefiles.hideMetadataColumns],r=t.findIndex(i=>i===e.name);e.value&&r!==-1?t.splice(r,1):!e.value&&r===-1&&t.push(e.name),y.set(s.view.gcodefiles,"hideMetadataColumns",t)},setGcodefilesShowHiddenFiles(s,e){y.set(s.view.gcodefiles,"showHiddenFiles",e)},setCurrentWebcam(s,e){y.set(s.view.webcam.currentCam,e.page,e.value)},setHistoryColumns(s,e){e.value&&s.view.history.hideColums.includes(e.name)?s.view.history.hideColums.splice(s.view.history.hideColums.indexOf(e.name),1):!e.value&&!s.view.history.hideColums.includes(e.name)&&s.view.history.hideColums.push(e.name)},setHistoryHidePrintStatus(s,e){y.set(s.view.history,"hidePrintStatus",e)},addClosePanel(s,e){const t=[...s.dashboard.nonExpandPanels[e.viewport]];t.includes(e.name)||(t.push(e.name),y.set(s.dashboard.nonExpandPanels,e.viewport,t))},removeClosePanel(s,e){const t=[...s.dashboard.nonExpandPanels[e.viewport]],r=t.indexOf(e.name);r>-1&&(t.splice(r,1),y.set(s.dashboard.nonExpandPanels,e.viewport,t))},deleteFromDashboardLayout(s,e){const t=[...s.dashboard[e.layoutname]];t.splice(e.index,1),y.set(s.dashboard,e.layoutname,t)},setChartDatasetStatus(s,e){if(!(e.objectName in s.view.tempchart.datasetSettings)){const t={};t[e.dataset]=e.value,y.set(s.view.tempchart.datasetSettings,e.objectName,t);return}y.set(s.view.tempchart.datasetSettings[e.objectName],e.dataset,e.value)},setDatasetAdditionalSensorStatus(s,e){if(!(e.objectName in s.view.tempchart.datasetSettings)){const t={additionalSensors:{}};t.additionalSensors[e.dataset]=e.value,y.set(s.view.tempchart.datasetSettings,e.objectName,t);return}if(!("additionalSensors"in s.view.tempchart.datasetSettings[e.objectName])){const t={};t[e.dataset]=e.value,y.set(s.view.tempchart.datasetSettings[e.objectName],"additionalSensors",t);return}y.set(s.view.tempchart.datasetSettings[e.objectName].additionalSensors,e.dataset,e.value)}},bJ={theme:s=>{const e=s.uiSettings.theme;return Ci.findIndex(t=>t.name===e)===-1?I_:e},getTheme:(s,e)=>{var t;return(t=Ci.find(r=>r.name===e.theme))!=null?t:Ci[0]},getDatasetValue:s=>e=>e.name in s.view.tempchart.datasetSettings&&e.type in s.view.tempchart.datasetSettings[e.name]?s.view.tempchart.datasetSettings[e.name][e.type]:["temperature","target"].includes(e.type),getDatasetAdditionalSensorValue:s=>e=>e.name in s.view.tempchart.datasetSettings&&"additionalSensors"in s.view.tempchart.datasetSettings[e.name]&&e.sensor in s.view.tempchart.datasetSettings[e.name].additionalSensors?s.view.tempchart.datasetSettings[e.name].additionalSensors[e.sensor]:!0,getPanelExpand:s=>(e,t)=>"dashboard"in s&&t in s.dashboard.nonExpandPanels?!s.dashboard.nonExpandPanels[t].includes(e):!0,getAllPossiblePanels:(s,e,t,r)=>{var u,c,d,m;let i=[...sw];return((u=s.macros)==null?void 0:u.mode)==="expert"&&(e["macros/getAllMacrogroups"].forEach(f=>{i.push("macrogroup_"+f.id)}),i=i.filter(f=>f!=="macros")),r["printer/getKinematics"]==="none"&&(i=i.filter(h=>!["toolhead-control","machine-settings"].includes(h))),r["printer/getExtruders"].length<1&&(i=i.filter(h=>h!=="extruder-control")),((m=(d=(c=t.printer)==null?void 0:c.heaters)==null?void 0:d.available_sensors)!=null?m:[]).length<1&&(i=i.filter(h=>h!=="temperature")),e["webcams/getWebcams"].length===0&&(i=i.filter(h=>h!=="webcam")),t.server.components.includes("spoolman")||(i=i.filter(h=>h!=="spoolman")),i},getPanels:(s,e,t)=>(r,i,n=!1)=>{var u,c;const a=i?"".concat(r,"Layout").concat(i):"".concat(r,"Layout");let o=(c=(u=s.dashboard[a])==null?void 0:u.filter(d=>d!==null))!=null?c:[];const l=e.getAllPossiblePanels;if(i<2){const d=e.getAllPanelsFromViewport(r),m=[];l.forEach(h=>{d.find(f=>f.name===h)||m.push({name:h,visible:!0})}),o=o.concat(m)}if(n&&(o=o.filter(d=>d.visible)),t.gui.macros.mode==="simple")o=o.filter(d=>!d.name.startsWith("macrogroup_"));else{o=o.filter(m=>m.name!=="macros");const d=e["macros/getAllMacrogroups"];d.length&&(o=o.filter(m=>{if(!m.name.startsWith("macrogroup_"))return!0;const h=m.name.slice(11);return d.findIndex(f=>f.id===h)!==-1}))}return o.filter(d=>l.includes(d.name))},getAllPanelsFromViewport:s=>e=>{let t=[];"".concat(e,"Layout")in s.dashboard&&(t=t.concat(s.dashboard["".concat(e,"Layout")]));let r=1;for(;"".concat(e,"Layout").concat(r)in s.dashboard;)t=t.concat(s.dashboard["".concat(e,"Layout").concat(r)]),r++;return t},getDefaultControlActionButton:(s,e,t,r)=>r["printer/existsQGL"]?"qgl":r["printer/existsZtilt"]?"ztilt":"m84",getHours12Format:s=>{const e=s.general.timeFormat;return e==="12hours"?!0:e===null?Intl.DateTimeFormat(navigator.language,{hour:"numeric"}).resolvedOptions().hour12:!1}},yJ={reset({commit:s}){s("reset")},clear({commit:s}){const e=new Date().valueOf();y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"console.cleared_since",value:e}),s("clear",{cleared_since:e}),s("server/clearGcodeStore",{},{root:!0}),s("server/setConsoleClearedThisSession",{},{root:!0})},saveSetting({dispatch:s},e){s("gui/saveSetting",{name:"console."+e.name,value:e.value},{root:!0})},filterUpload(s,e){y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"console.consolefilters."+e.id,value:e.value})},filterStore({commit:s,dispatch:e,state:t},r){const i=ds();s("filterStore",{id:i,values:r.values}),e("filterUpload",{id:i,value:t.consolefilters[i]})},filterUpdate({commit:s,dispatch:e,state:t},r){s("filterUpdate",r),e("filterUpload",{id:r.id,value:t.consolefilters[r.id]})},filterDelete({commit:s},e){s("filterDelete",e),y.$socket.emit("server.database.delete_item",{namespace:"mainsail",key:"console.consolefilters."+e})}},CJ={reset(s){Object.assign(s,IC())},clear(s,e){y.set(s,"cleared_since",e.cleared_since)},filterStore(s,e){y.set(s.consolefilters,e.id,e.values)},filterUpdate(s,e){if(!(e.id in s.consolefilters))return;const t={...s.consolefilters[e.id]};Object.assign(t,e.values),y.set(s.consolefilters,e.id,t)},filterDelete(s,e){e in s.consolefilters&&y.delete(s.consolefilters,e)}},$J={getConsolefilters:s=>{const e=[];return Object.keys(s.consolefilters).forEach(t=>{e.push({...s.consolefilters[t],id:t})}),Ft(e,"name")},getConsolefilterRules:(s,e,t)=>{const r=[];return t.gui.console.hideWaitTemperatures&&r.push("^(?:ok\\s+)?(B|C|T\\d*):"),t.gui.console.hideTlCommands&&nw.forEach(i=>{r.push(i)}),Object.keys(s.consolefilters).forEach(i=>{const n=s.consolefilters[i];n.bool&&n.regex.split("\n").forEach(a=>{a!==""&&r.push(a)})}),r},getConsoleClearedSince:s=>s.cleared_since},IC=()=>({hideWaitTemperatures:!0,hideTlCommands:!0,direction:"table",entryStyle:"default",height:300,autoscroll:!0,consolefilters:{},rawOutput:!1}),xJ=IC(),wJ={namespaced:!0,state:xJ,getters:$J,actions:yJ,mutations:CJ},SJ={reset({commit:s}){s("reset")},upload({state:s}){y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"gcodehistory.entries",value:s.entries})},async addToHistory({commit:s,dispatch:e,state:t},r){const i=[...t.entries];for(i.push(r);i.length>tw;)i.splice(0,1);await s("updateHistory",i),await e("upload")}},PJ={reset(s){Object.assign(s,NC())},updateHistory(s,e){y.set(s,"entries",e)}},DJ={},NC=()=>({entries:[]}),TJ=NC(),OJ={namespaced:!0,state:TJ,getters:DJ,actions:SJ,mutations:PJ},MJ={reset({commit:s}){s("reset")},saveSetting({dispatch:s},e){s("gui/saveSetting",{name:"macros."+e.name,value:e.value},{root:!0})},groupUpload({state:s},e){y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"macros.macrogroups."+e,value:s.macrogroups[e]})},async groupStore({commit:s,dispatch:e},t){const r=ds();return await s("groupStore",{id:r,values:t.values}),await e("groupUpload",r),r},groupUpdate({commit:s,dispatch:e},t){s("groupUpdate",t),e("groupUpload",t.id)},addMacroToMacrogroup({commit:s,dispatch:e},t){s("addMacroToMacrogroup",t),e("groupUpload",t.id)},updateMacroFromMacrogroup({commit:s,dispatch:e},t){s("updateMacroFromMacrogroup",t),e("groupUpload",t.id)},removeMacroFromMacrogroup({commit:s,dispatch:e},t){s("removeMacroFromMacrogroup",t),e("groupUpload",t.id)},groupDelete({commit:s,dispatch:e,rootState:t},r){s("groupDelete",r),y.$socket.emit("server.database.delete_item",{namespace:"mainsail",key:"macros.macrogroups."+r}),["mobileLayout","tabletLayout1","tabletLayout2","desktopLayout1","desktopLayout2","widescreenLayout1","widescreenLayout2","widescreenLayout3"].forEach(n=>{var l;const o=(t.gui?[...t.gui.dashboard[n]]:[]).findIndex(u=>u.name==="macrogroup_"+r);o!==-1&&(s("gui/deleteFromDashboardLayout",{layoutname:n,index:o},{root:!0}),e("gui/updateSettings",{keyName:"dashboard."+n,newVal:(l=t.gui)==null?void 0:l.dashboard[n]},{root:!0}))})}},kJ={reset(s){Object.assign(s,VC())},groupStore(s,e){y.set(s.macrogroups,e.id,e.values)},groupUpdate(s,e){if(e.id in s.macrogroups){const t={...s.macrogroups[e.id]};Object.assign(t,e.values),y.set(s.macrogroups,e.id,t)}},addMacroToMacrogroup(s,e){var i,n;const t=[...(n=(i=s.macrogroups[e.id])==null?void 0:i.macros)!=null?n:[]],r={pos:1,name:e.macro,color:"group",showInStandby:!0,showInPrinting:!0,showInPause:!0};t.length&&(r.pos=Math.max(...t.map(a=>a.pos))+1),t.push(r),y.set(s.macrogroups[e.id],"macros",t)},updateMacroFromMacrogroup(s,e){var i,n;const t=[...(n=(i=s.macrogroups[e.id])==null?void 0:i.macros)!=null?n:[]],r=t.findIndex(a=>a.name===e.macro);if(r!==-1){const a=t[r];a[e.option]=e.value,y.set(s.macrogroups[e.id],"macros",t)}},removeMacroFromMacrogroup(s,e){var i,n;const t=[...(n=(i=s.macrogroups[e.id])==null?void 0:i.macros)!=null?n:[]],r=t.findIndex(a=>a.name===e.macro);if(r!==-1){const a=t[r].pos;t.splice(r,1),t.filter(o=>o.pos>a).forEach(o=>{o.pos=o.pos-1})}y.set(s.macrogroups[e.id],"macros",t)},groupDelete(s,e){e in s.macrogroups&&y.delete(s.macrogroups,e)}},EJ={getAllMacrogroups:s=>{const e=[];return Object.keys(s.macrogroups).forEach(t=>{e.push({...s.macrogroups[t],id:t})}),Ft(e,"name")},getMacrogroup:s=>e=>s.macrogroups[e]},VC=()=>({mode:"simple",hiddenMacros:[],macrogroups:{}}),LJ=VC(),AJ={namespaced:!0,state:LJ,getters:EJ,actions:MJ,mutations:kJ},FJ={reset({commit:s}){s("reset")},upload({state:s},e){y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"miscellaneous.entries."+e,value:s.entries[e]})},async store({commit:s,dispatch:e},t){const r=ds();return await s("store",{id:r,values:t}),await e("upload",r),r},async storeLightgroup({commit:s,dispatch:e,getters:t},r){let i=t.getId(r.entry);i===null&&(i=await e("store",r.entry));const n=ds();return await s("updateLightgroup",{entryId:i,lightgroupId:n,values:r.lightgroup}),await e("upload",i),n},async updateLightgroup({commit:s,dispatch:e,getters:t},r){const i=t.getId(r.entry);if(i!==null)return await s("updateLightgroup",{entryId:i,lightgroupId:r.lightgroup.id,values:r.lightgroup}),await e("upload",i),r.lightgroup.id},async deleteLightgroup({commit:s,dispatch:e,getters:t},r){const i=t.getId(r.entry);i!==null&&(await s("destroyLightgroup",{entryId:i,lightgroupId:r.lightgroupId}),await e("upload",i))},async storePreset({commit:s,dispatch:e,getters:t},r){let i=t.getId(r.entry);i===null&&(i=await e("store",r.entry));const n=ds();return await s("updatePreset",{entryId:i,presetId:n,values:r.preset}),await e("upload",i),n},async updatePreset({commit:s,dispatch:e,getters:t},r){const i=t.getId(r.entry);if(i!==null)return await s("updatePreset",{entryId:i,presetId:r.preset.id,values:r.preset}),await e("upload",i),r.preset.id},async deletePreset({commit:s,dispatch:e,getters:t},r){const i=t.getId(r.entry);i!==null&&(await s("destroyPreset",{entryId:i,presetId:r.presetId}),await e("upload",i))}},RJ={reset(s){Object.assign(s,BC())},store(s,e){const t={name:e.values.name,type:e.values.type,lightgroups:{},presets:{}};y.set(s.entries,e.id,t)},updateLightgroup(s,e){const t={name:e.values.name,start:parseInt(e.values.start.toString()),end:parseInt(e.values.end.toString())};y.set(s.entries[e.entryId].lightgroups,e.lightgroupId,t)},destroyLightgroup(s,e){const t={...s.entries};delete t[e.entryId].lightgroups[e.lightgroupId],y.set(s,"entries",t)},updatePreset(s,e){const t={name:e.values.name,red:e.values.red,green:e.values.green,blue:e.values.blue,white:e.values.white};y.set(s.entries[e.entryId].presets,e.presetId,t)},destroyPreset(s,e){const t={...s.entries};delete t[e.entryId].presets[e.presetId],y.set(s,"entries",t)}},HJ={getEntries:s=>{const e=[];return Object.entries(s.entries).forEach(([t,r])=>{e.push({id:t,name:r.name,type:r.type,lightgroups:{...r.lightgroups},presets:{...r.presets}})}),e},getEntry:(s,e)=>t=>e.getEntries.find(r=>r.name===t.name&&r.type===t.type),getId:(s,e)=>t=>{var r,i;return(i=(r=e.getEntry(t))==null?void 0:r.id)!=null?i:null},getEntryLightgroups:(s,e)=>t=>{const r=e.getEntry(t);if(!r)return[];const i=[];return Object.entries(r.lightgroups).forEach(([n,a])=>{i.push({name:a.name,start:a.start,end:a.end,id:n})}),Ft(i,"name")},getEntryPresets:(s,e)=>t=>{const r=e.getEntry(t);if(!r)return[];const i=[];return Object.entries(r.presets).forEach(([n,a])=>{i.push({name:a.name,red:a.red,green:a.green,blue:a.blue,white:a.white,id:n})}),Ft(i,"name")}},BC=()=>({entries:{}}),jJ=BC(),IJ={namespaced:!0,state:jJ,getters:HJ,actions:FJ,mutations:RJ},NJ={reset({commit:s}){s("reset")},upload({state:s}){y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"navigation.entries",value:s.entries})},updatePos({commit:s},e){s("updatePos",e)},changeVisibility({commit:s,dispatch:e},t){s("changeVisibility",t),e("upload")}},VJ={reset(s){Object.assign(s,UC())},updatePos(s,e){const t=s.entries.findIndex(n=>n.type===e.type&&n.title===e.title);if(t!==-1){s.entries[t].position=e.position;return}const r={type:e.type,title:e.title,visible:e.visible,position:e.position},i=[...s.entries];i.push(r),y.set(s,"entries",i)},changeVisibility(s,e){var a;const t=(a=e.orgTitle)!=null?a:e.title,r=s.entries.findIndex(o=>o.type===e.type&&o.title===t);if(r!==-1){s.entries[r].visible=!e.visible;return}const i={type:e.type,title:t,visible:!e.visible,position:e.position},n=[...s.entries];n.push(i),y.set(s,"entries",n)}},BJ={},UC=()=>({entries:[]}),UJ=UC(),WJ={namespaced:!0,state:UJ,getters:BJ,actions:NJ,mutations:VJ},zJ={reset({commit:s}){s("reset")},upload({state:s}){y.$socket.emit("server.database.post_item",{namespace:"mainsail",key:"notifications.dismiss",value:s.dismiss})},close({dispatch:s},e){const t=e.id.indexOf("/");if(t===-1)return;const r=e.id.slice(0,t),i=e.id.slice(t+1);if(r==="announcement"){s("server/announcements/close",{entry_id:i},{root:!0});return}s("storeDismiss",{entry_id:i,category:r,type:"ever",time:null})},dismiss({dispatch:s},e){const t=e.id.indexOf("/");if(t===-1)return;const r=e.id.slice(0,t),i=e.id.slice(t+1);if(r==="announcement"){s("server/announcements/dismiss",{entry_id:i,time:e.time},{root:!0});return}s("storeDismiss",{entry_id:i,category:r,type:e.type,time:e.time})},async storeDismiss({commit:s,dispatch:e,state:t},r){var a;let i=new Date().getTime();r.type==="time"&&(i=new Date().getTime()+((a=r.time)!=null?a:0)*1e3);const n={id:r.entry_id,category:r.category,type:r.type,date:i};t.dismiss.filter(o=>o.id===n.id&&o.category===n.category&&o.type===n.type).length&&await s("removeDismiss",n),await s("addDismiss",n),await e("upload")}},GJ={reset(s){Object.assign(s,zC())},addDismiss(s,e){const t=[...s.dismiss];t.push(e),y.set(s,"dismiss",t)},removeDismiss(s,e){const t=[...s.dismiss],r=t.findIndex(i=>i.id===e.id&&i.category===e.category&&i.type===e.type);r!==-1&&t.splice(r),y.set(s,"dismiss",t)}};var WC={exports:{}};const ZJ={},qJ=Object.freeze(Object.defineProperty({__proto__:null,default:ZJ},Symbol.toStringTag,{value:"Module"})),h_=E_(qJ);/** + * [js-sha256]{@link https://github.com/emn178/js-sha256} + * + * @version 0.10.1 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2023 + * @license MIT + */(function(s){(function(){var e="input is invalid type",t=typeof window=="object",r=t?window:{};r.JS_SHA256_NO_WINDOW&&(t=!1);var i=!t&&typeof self=="object",n=!r.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;n?r=Tr:i&&(r=self);var a=!r.JS_SHA256_NO_COMMON_JS&&!0&&s.exports,o=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),u=[-2147483648,8388608,32768,128],c=[24,16,8,0],d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],m=["hex","array","digest","arrayBuffer"],h=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function($){return Object.prototype.toString.call($)==="[object Array]"}),o&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function($){return typeof $=="object"&&$.buffer&&$.buffer.constructor===ArrayBuffer});var f=function($,D){return function(V){return new M(D,!0).update(V)[$]()}},p=function($){var D=f("hex",$);n&&(D=v(D,$)),D.create=function(){return new M($)},D.update=function(W){return D.create().update(W)};for(var V=0;V>2]|=$[W]<>2]|=N<>2]|=(192|N>>6)<>2]|=(128|N&63)<=57344?(X[G>>2]|=(224|N>>12)<>2]|=(128|N>>6&63)<>2]|=(128|N&63)<>2]|=(240|N>>18)<>2]|=(128|N>>12&63)<>2]|=(128|N>>6&63)<>2]|=(128|N&63)<=64?(this.block=X[16],this.start=G-64,this.hash(),this.hashed=!0):this.start=G}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},M.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var $=this.blocks,D=this.lastByteIndex;$[16]=this.block,$[D>>2]|=u[D&3],this.block=$[16],D>=56&&(this.hashed||this.hash(),$[0]=this.block,$[16]=$[1]=$[2]=$[3]=$[4]=$[5]=$[6]=$[7]=$[8]=$[9]=$[10]=$[11]=$[12]=$[13]=$[14]=$[15]=0),$[14]=this.hBytes<<3|this.bytes>>>29,$[15]=this.bytes<<3,this.hash()}},M.prototype.hash=function(){var $=this.h0,D=this.h1,V=this.h2,N=this.h3,W=this.h4,G=this.h5,te=this.h6,X=this.h7,q=this.blocks,z,K,Q,re,R,B,T,A,H,ee,ie;for(z=16;z<64;++z)R=q[z-15],K=(R>>>7|R<<25)^(R>>>18|R<<14)^R>>>3,R=q[z-2],Q=(R>>>17|R<<15)^(R>>>19|R<<13)^R>>>10,q[z]=q[z-16]+K+q[z-7]+Q<<0;for(ie=D&V,z=0;z<64;z+=4)this.first?(this.is224?(A=300032,R=q[0]-1413257819,X=R-150054599<<0,N=R+24177077<<0):(A=704751109,R=q[0]-210244248,X=R-1521486534<<0,N=R+143694565<<0),this.first=!1):(K=($>>>2|$<<30)^($>>>13|$<<19)^($>>>22|$<<10),Q=(W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7),A=$&D,re=A^$&V^ie,T=W&G^~W&te,R=X+Q+T+d[z]+q[z],B=K+re,X=N+R<<0,N=R+B<<0),K=(N>>>2|N<<30)^(N>>>13|N<<19)^(N>>>22|N<<10),Q=(X>>>6|X<<26)^(X>>>11|X<<21)^(X>>>25|X<<7),H=N&$,re=H^N&D^A,T=X&W^~X&G,R=te+Q+T+d[z+1]+q[z+1],B=K+re,te=V+R<<0,V=R+B<<0,K=(V>>>2|V<<30)^(V>>>13|V<<19)^(V>>>22|V<<10),Q=(te>>>6|te<<26)^(te>>>11|te<<21)^(te>>>25|te<<7),ee=V&N,re=ee^V&$^H,T=te&X^~te&W,R=G+Q+T+d[z+2]+q[z+2],B=K+re,G=D+R<<0,D=R+B<<0,K=(D>>>2|D<<30)^(D>>>13|D<<19)^(D>>>22|D<<10),Q=(G>>>6|G<<26)^(G>>>11|G<<21)^(G>>>25|G<<7),ie=D&V,re=ie^D&N^ee,T=G&te^~G&X,R=W+Q+T+d[z+3]+q[z+3],B=K+re,W=$+R<<0,$=R+B<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+$<<0,this.h1=this.h1+D<<0,this.h2=this.h2+V<<0,this.h3=this.h3+N<<0,this.h4=this.h4+W<<0,this.h5=this.h5+G<<0,this.h6=this.h6+te<<0,this.h7=this.h7+X<<0},M.prototype.hex=function(){this.finalize();var $=this.h0,D=this.h1,V=this.h2,N=this.h3,W=this.h4,G=this.h5,te=this.h6,X=this.h7,q=l[$>>28&15]+l[$>>24&15]+l[$>>20&15]+l[$>>16&15]+l[$>>12&15]+l[$>>8&15]+l[$>>4&15]+l[$&15]+l[D>>28&15]+l[D>>24&15]+l[D>>20&15]+l[D>>16&15]+l[D>>12&15]+l[D>>8&15]+l[D>>4&15]+l[D&15]+l[V>>28&15]+l[V>>24&15]+l[V>>20&15]+l[V>>16&15]+l[V>>12&15]+l[V>>8&15]+l[V>>4&15]+l[V&15]+l[N>>28&15]+l[N>>24&15]+l[N>>20&15]+l[N>>16&15]+l[N>>12&15]+l[N>>8&15]+l[N>>4&15]+l[N&15]+l[W>>28&15]+l[W>>24&15]+l[W>>20&15]+l[W>>16&15]+l[W>>12&15]+l[W>>8&15]+l[W>>4&15]+l[W&15]+l[G>>28&15]+l[G>>24&15]+l[G>>20&15]+l[G>>16&15]+l[G>>12&15]+l[G>>8&15]+l[G>>4&15]+l[G&15]+l[te>>28&15]+l[te>>24&15]+l[te>>20&15]+l[te>>16&15]+l[te>>12&15]+l[te>>8&15]+l[te>>4&15]+l[te&15];return this.is224||(q+=l[X>>28&15]+l[X>>24&15]+l[X>>20&15]+l[X>>16&15]+l[X>>12&15]+l[X>>8&15]+l[X>>4&15]+l[X&15]),q},M.prototype.toString=M.prototype.hex,M.prototype.digest=function(){this.finalize();var $=this.h0,D=this.h1,V=this.h2,N=this.h3,W=this.h4,G=this.h5,te=this.h6,X=this.h7,q=[$>>24&255,$>>16&255,$>>8&255,$&255,D>>24&255,D>>16&255,D>>8&255,D&255,V>>24&255,V>>16&255,V>>8&255,V&255,N>>24&255,N>>16&255,N>>8&255,N&255,W>>24&255,W>>16&255,W>>8&255,W&255,G>>24&255,G>>16&255,G>>8&255,G&255,te>>24&255,te>>16&255,te>>8&255,te&255];return this.is224||q.push(X>>24&255,X>>16&255,X>>8&255,X&255),q},M.prototype.array=M.prototype.digest,M.prototype.arrayBuffer=function(){this.finalize();var $=new ArrayBuffer(this.is224?28:32),D=new DataView($);return D.setUint32(0,this.h0),D.setUint32(4,this.h1),D.setUint32(8,this.h2),D.setUint32(12,this.h3),D.setUint32(16,this.h4),D.setUint32(20,this.h5),D.setUint32(24,this.h6),this.is224||D.setUint32(28,this.h7),$};function F($,D,V){var N,W=typeof $;if(W==="string"){var G=[],te=$.length,X=0,q;for(N=0;N>6,G[X++]=128|q&63):q<55296||q>=57344?(G[X++]=224|q>>12,G[X++]=128|q>>6&63,G[X++]=128|q&63):(q=65536+((q&1023)<<10|$.charCodeAt(++N)&1023),G[X++]=240|q>>18,G[X++]=128|q>>12&63,G[X++]=128|q>>6&63,G[X++]=128|q&63);$=G}else if(W==="object"){if($===null)throw new Error(e);if(o&&$.constructor===ArrayBuffer)$=new Uint8Array($);else if(!Array.isArray($)&&(!o||!ArrayBuffer.isView($)))throw new Error(e)}else throw new Error(e);$.length>64&&($=new M(D,!0).update($).array());var z=[],K=[];for(N=0;N<64;++N){var Q=$[N]||0;z[N]=92^Q,K[N]=54^Q}M.call(this,D,V),this.update(K),this.oKeyPad=z,this.inner=!0,this.sharedMemory=V}F.prototype=new M,F.prototype.finalize=function(){if(M.prototype.finalize.call(this),this.inner){this.inner=!1;var $=this.array();M.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update($),M.prototype.finalize.call(this)}};var O=p();O.sha256=O,O.sha224=p(!0),O.sha256.hmac=P(),O.sha224.hmac=P(!0),a?s.exports=O:(r.sha256=O.sha256,r.sha224=O.sha224)})()})(WC);var tr=WC.exports,p_=function(s,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,n;r"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new QJ:typeof navigator<"u"?nK(navigator.userAgent):oK()}function iK(s){return s!==""&&sK.reduce(function(e,t){var r=t[0],i=t[1];if(e)return e;var n=i.exec(s);return!!n&&[r,n]},!1)}function nK(s){var e=iK(s);if(!e)return null;var t=e[0],r=e[1];if(t==="searchbot")return new KJ;var i=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);i?i.length{let t=[];t=t.concat(e.getNotificationsAnnouncements),t=t.concat(e.getNotificationsFlags),t=t.concat(e.getNotificationsDependencies),t=t.concat(e.getNotificationsMoonrakerWarnings),t=t.concat(e.getNotificationsMoonrakerFailedComponents),t=t.concat(e.getNotificationsMoonrakerFailedInitComponents),t=t.concat(e.getNotificationsKlipperWarnings),t=t.concat(e.getNotificationsOverdueMaintenance),t=t.concat(e.getNotificationsBrowserWarnings),t=t.concat(e.getNotificationsOverheatDrivers);const r={normal:2,high:1,critical:0};return t.sort((i,n)=>r[i.priority]r[n.priority]?1:n.date.getTime()-i.date.getTime())},getNotificationsAnnouncements:(s,e,t,r)=>{const i=[],n=r["server/announcements/getAnnouncements"];return n.length&&n.forEach(a=>{i.push({id:"announcement/"+a.entry_id,priority:a.priority,title:a.title,description:a.description,date:a.date,dismissed:a.dismissed,url:a.url})}),i},getNotificationsFlags:(s,e,t,r)=>{var a;const i=[];let n=r["server/getThrottledStateFlags"];if(n.length){const o=(a=t.server.system_boot_at)!=null?a:new Date,l=r["gui/notifications/getDismissByCategory"]("flag").map(u=>u.id);n=n.filter(u=>!l.includes(u)),n.forEach(u=>{i.push({id:"flag/"+u,priority:u.startsWith("Previously")?"high":"critical",title:ve.t("App.ThrottledStates.Title".concat(u)),description:ve.t("App.ThrottledStates.Description".concat(u)),date:o,dismissed:!1})})}return i},getNotificationsDependencies:(s,e,t,r)=>{var a;const i=[];let n=r.getDependencies;if(n.length){const o=(a=t.server.system_boot_at)!=null?a:new Date,l=r["gui/notifications/getDismissByCategory"]("dependency").map(u=>u.id);n=n.filter(u=>!l.includes("".concat(u.serviceName,"/").concat(u.neededVersion))),n.forEach(u=>{i.push({id:"dependency/".concat(u.serviceName,"/").concat(u.neededVersion),priority:"high",title:ve.t("App.Notifications.DependencyName",{name:u.serviceName}).toString(),description:ve.t("App.Notifications.DependencyDescription",{name:u.serviceName,installedVersion:u.installedVersion,neededVersion:u.neededVersion}).toString(),date:o,dismissed:!1})})}return i},getNotificationsMoonrakerWarnings:(s,e,t,r)=>{var a,o;const i=[];let n=(a=t.server.warnings)!=null?a:[];if(n.length){const l=(o=t.server.system_boot_at)!=null?o:new Date,u=r["gui/notifications/getDismissByCategory"]("moonrakerWarning").map(c=>c.id);n=n.filter(c=>!u.includes(tr.sha256(c))),n.forEach(c=>{var m,h,f,p;let d=c;if(c.startsWith("Unparsed config option")){const C=(h=(m=RegExp(/'(?